/* WAAKO HR — phones & tablets. Loaded after app.css */

#app { width: 100%; min-height: 100dvh; min-height: 100svh; }
.dock { display: none; }

@media (max-width: 1024px) {
  html, body, #app {
    width: 100% !important;
    max-width: 100%;
    overflow-x: hidden;
  }

  .auth-wrap {
    display: flex !important;
    flex-direction: column;
    width: 100% !important;
    max-width: 100vw;
    min-height: 100dvh;
    min-height: 100svh;
    grid-template-columns: none !important;
  }
  .auth-brand {
    width: 100% !important;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    text-align: center;
    min-height: 34vh;
    padding: calc(36px + env(safe-area-inset-top)) 24px 28px;
    background:
      radial-gradient(circle at 88% -10%, rgba(0, 174, 239, 0.38), transparent 42%),
      linear-gradient(165deg, #1565C0 0%, var(--brand) 46%, var(--brand-dark) 100%);
  }
  .auth-brand img {
    width: min(320px, 86vw) !important;
    height: auto !important;
    max-height: none;
    object-fit: contain !important;
    border-radius: 12px !important;
    margin: 0 auto 0 !important;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.28));
  }
  .auth-brand h1,
  .auth-brand .tag,
  .auth-brand p { display: none !important; }
  .auth-panel {
    width: 100% !important;
    flex: 1;
    display: block;
    padding: 12px 16px calc(28px + env(safe-area-inset-bottom));
    background: var(--bg);
  }
  .auth-card {
    width: 100% !important;
    max-width: none !important;
    margin: 8px 0 0 !important;
    padding: 28px 20px 24px;
    border-radius: 22px;
    box-shadow: 0 20px 50px rgba(16, 24, 40, 0.14);
  }
  .auth-card h2 { font-size: 24px; letter-spacing: -0.03em; }
  .auth-card .sub { font-size: 14px; }
  .auth-card input {
    min-height: 48px;
    border-radius: 12px;
    font-size: 16px;
  }
  .auth-card .pw-toggle {
    width: 44px;
    height: 44px;
  }
  .auth-card .btn-primary {
    min-height: 52px;
    border-radius: 14px;
    font-size: 16px;
    letter-spacing: 0.02em;
  }
  .auth-meta { font-size: 14px; }
  .auth-meta a { color: var(--brand); font-weight: 600; }

  .shell { width: 100%; }
  .main {
    width: 100% !important;
    margin-left: 0 !important;
    min-height: 100dvh;
  }
}

@media (max-width: 860px) {
  :root { --dock: 64px; }

  .topbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  .menu-btn {
    background: var(--brand-soft);
    border-color: transparent;
    color: var(--brand);
    border-radius: 12px;
  }

  .content {
    padding: 14px 14px calc(var(--dock) + 20px + env(safe-area-inset-bottom)) !important;
  }

  .page-head {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
  }
  .page-head h1 {
    font-size: 22px;
    letter-spacing: -0.03em;
  }
  .page-head > div:last-child:has(.btn),
  .page-head > .btn,
  .page-head > button {
    width: 100%;
  }
  .page-head .btn,
  .page-head button.btn {
    border-radius: 12px;
  }

  .grid { gap: 12px; }
  .g-5, .g-4, .g-3, .g-2, .g-main { grid-template-columns: 1fr !important; }
  .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px; }

  .card {
    border-radius: 18px;
    overflow: hidden;
  }
  .stat {
    padding: 16px 18px;
    background: linear-gradient(180deg, #fff 0%, #f7f8fc 100%);
  }
  .stat .lbl { font-size: 11px; }
  .stat .num { font-size: 28px; letter-spacing: -0.04em; }

  .filters {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
  }

  .tabs {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px;
    gap: 4px;
    border-bottom: 1px solid var(--border);
  }
  .tab {
    border-bottom: 0 !important;
    border-radius: 999px !important;
    padding: 8px 14px;
    font-size: 13px;
  }
  .tab.on {
    background: var(--brand);
    color: #fff;
    box-shadow: none;
  }

  .clock-card {
    border: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    background: linear-gradient(165deg, #1565C0 0%, var(--brand) 48%, var(--brand-dark) 100%);
    color: #fff;
    border-radius: 24px;
    box-shadow: 0 16px 40px rgba(13, 22, 84, 0.32);
  }
  .clock-card .card-b.clock-status {
    padding: 22px 16px 18px;
    overflow: hidden;
  }
  .clock-card .muted,
  .clock-card p,
  .clock-card .card-b { color: rgba(255, 255, 255, 0.88); }
  .clock-card .big { color: #fff; font-size: 28px; line-height: 1.15; }
  .clock-card p,
  .clock-card .clock-note {
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
  }
  .clock-card .btn-clock {
    background: var(--accent);
    color: var(--brand-dark);
    border: 0;
    width: 100%;
    max-width: 100%;
    min-height: 56px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.03em;
    box-shadow: 0 10px 24px rgba(0, 174, 239, 0.35);
    margin-top: 4px;
  }
  .clock-card .btn-clock.out { background: #34d399; color: #064e3b; box-shadow: 0 10px 24px rgba(52, 211, 153, 0.3); }
  .clock-card .badge.b-info {
    color: #0c4a6e !important;
    background: #e0f2fe !important;
    border: 0;
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .clock-card .clock-err {
    color: #7f1d1d !important;
    background: #fff1f2 !important;
    border: 1px solid #fecdd3;
    display: block;
    white-space: normal;
    text-align: left;
    line-height: 1.4;
    font-weight: 600;
    font-size: 13px;
    padding: 12px 14px;
    margin: 12px 0 14px;
    border-radius: 16px;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .clock-card a { color: #7eefff; }
  .clock-card .map { border: 0; max-width: 100%; }

  .dock {
    display: flex;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 40;
    background: var(--brand-dark);
    color: #fff;
    border-radius: 22px;
    padding: 8px 6px;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 12px 40px rgba(13, 22, 84, 0.45);
    border: 1px solid rgba(0, 174, 239, 0.22);
  }
  .dock-i {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: none;
    border: 0;
    padding: 6px 4px;
    min-height: 48px;
    cursor: pointer;
    text-decoration: none;
  }
  .dock-i span { font-size: 18px; line-height: 1; }
  .dock-i.router-link-active { color: rgba(255, 255, 255, 0.62); }
  .dock-i.router-link-exact-active,
  .dock-i.on {
    color: var(--accent);
  }

  .toast-wrap {
    bottom: calc(var(--dock) + 18px + env(safe-area-inset-bottom));
  }

  .modal-bg { background: rgba(8, 12, 28, 0.55); }
}

@media (min-width: 700px) and (max-width: 1024px) {
  .g-5, .g-4, .g-3 { grid-template-columns: 1fr 1fr !important; }
  .dash-stats { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .auth-card { max-width: 480px !important; margin-left: auto !important; margin-right: auto !important; }
  .auth-panel { display: flex; justify-content: center; }
  .content { max-width: 920px; margin: 0 auto; }
}

@media (max-width: 560px) {
  .userchip .btn-ghost { display: inline-flex; }
  .search-global { display: none !important; }
  .date-nav-text { max-width: 48vw !important; }
}
