/* ==========================================================================
   ASC Pest Control Hub — Dashboard CSS
   Design tokens from ASC_Dashboards_Mockup.html, adapted for production.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=Hanken+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --orange:      #FC4C01;
  --orange-soft: #FFE9DE;
  --navy:        #101920;
  --navy2:       #19242F;
  --navy3:       #22303c;
  --bg:          #F5F6F8;
  --card:        #FFFFFF;
  --line:        #E7E9EE;
  --text:        #16202B;
  --muted:       #6B7480;
  --green:       #1F9D6B;
  --green-soft:  #E1F5EC;
  --amber:       #C98415;
  --amber-soft:  #FBEFD9;
  --red:         #DB4B36;
  --red-soft:    #FBE3DE;
  --blue:        #2D74C4;
  --blue-soft:   #E2EDF8;
  --radius:      14px;
  --shadow:      0 1px 2px rgba(16,25,32,.04), 0 6px 20px rgba(16,25,32,.06);
  --sidebar-w:   240px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  height: 100%;
}
h1,h2,h3,h4,.num { font-family: 'Sora', sans-serif; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ── Auth overlay ── */
#auth-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: radial-gradient(1200px 600px at 70% -10%, var(--navy3), #0c1318 60%);
  display: grid; place-items: center; padding: 24px; overflow: auto;
}
#auth-overlay::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.05) 1px, transparent 0);
  background-size: 22px 22px; pointer-events: none;
}

.auth-card {
  width: 420px; max-width: 100%;
  background: #fff; border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,.4);
  padding: 34px 32px; position: relative;
  animation: fade-up .4s ease both;
}
.auth-logo {
  display: flex; align-items: center; gap: 11px; justify-content: center;
  margin-bottom: 20px;
}
.auth-logo img { width: 40px; height: 40px; border-radius: 10px; }
.auth-logo span { font-family: 'Sora'; font-weight: 700; font-size: 16px; color: var(--navy); }
.auth-title { font-family: 'Sora'; font-weight: 700; font-size: 21px; text-align: center; margin-bottom: 6px; }
.auth-sub   { color: var(--muted); font-size: 13.5px; text-align: center; margin-bottom: 22px; line-height: 1.5; }
.auth-error {
  background: var(--red-soft); color: var(--red); border-radius: 9px;
  padding: 9px 12px; font-size: 13px; font-weight: 600; margin-bottom: 14px; display: none;
}
.auth-step { display: none; }
.auth-step.on { display: block; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; font-family: 'Sora'; }
.field input, .field select {
  width: 100%; border: 1.5px solid var(--line); border-radius: 11px;
  padding: 12px 13px; font-family: inherit; font-size: 14px; outline: none; transition: .15s;
}
.field input:focus, .field select:focus {
  border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft);
}

.otp-boxes { display: flex; gap: 9px; justify-content: center; margin: 4px 0 20px; }
.otp-box {
  width: 46px; height: 56px; text-align: center;
  font-family: 'Sora'; font-weight: 700; font-size: 22px; color: var(--navy);
  border: 1.5px solid var(--line); border-radius: 12px; outline: none;
}
.otp-box:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }

.auth-btn {
  width: 100%; background: var(--orange); color: #fff; border: none;
  border-radius: 11px; padding: 13px; font-family: 'Sora'; font-weight: 600;
  font-size: 14.5px; transition: .15s; margin-top: 4px;
}
.auth-btn:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.auth-btn:disabled { opacity: .6; }
.auth-btn.dark { background: var(--navy); }
.auth-btn-ghost { background: #fff; color: var(--text); border: 1.5px solid var(--line); }
.auth-btn-ghost:hover:not(:disabled) { border-color: var(--navy); filter: none; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin: 14px 0 6px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-alt { text-align: center; font-size: 13px; color: var(--muted); margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.auth-alt a { color: var(--orange); font-weight: 600; cursor: pointer; }
.auth-consent { display: flex; gap: 9px; font-size: 12px; color: var(--muted); margin: 2px 0 12px; align-items: flex-start; line-height: 1.45; }
.auth-consent input { margin-top: 2px; accent-color: var(--orange); }

/* ── App shell ── */
.screen { display: none; height: calc(100vh - 52px); }
.screen.active { display: grid; grid-template-columns: var(--sidebar-w) 1fr; }

/* ── Top bar ── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy); color: #fff;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px; height: 52px;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-family: 'Sora'; font-weight: 700; font-size: 15px; }
.topbar .brand img { width: 28px; height: 28px; border-radius: 7px; }
.topbar .tag {
  font-size: 11px; color: #9aa6b2; border: 1px solid #33414e;
  padding: 3px 9px; border-radius: 999px; font-weight: 600;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.signout-btn {
  background: none; border: 1px solid #33414e; color: #cdd5dd;
  font-family: 'Sora'; font-weight: 600; font-size: 12px;
  padding: 7px 13px; border-radius: 999px; transition: .15s;
}
.signout-btn:hover { border-color: #5a6c7a; color: #fff; }

/* ── Sidebar ── */
.sidebar {
  background: var(--navy); color: #cdd5dd;
  padding: 18px 12px; display: flex; flex-direction: column; gap: 3px;
  overflow-y: auto;
}
.sidebar-user {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px 18px; border-bottom: 1px solid #283642; margin-bottom: 12px;
}
.sidebar-user .av {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--orange); color: #fff;
  display: grid; place-items: center;
  font-family: 'Sora'; font-weight: 700; font-size: 15px; flex: none;
}
.sidebar-user .nm { font-family: 'Sora'; font-weight: 600; color: #fff; font-size: 13.5px; line-height: 1.2; }
.sidebar-user .rl { font-size: 11.5px; color: #8a96a2; text-transform: capitalize; }
.nav-label {
  font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase;
  color: #5f6c78; font-weight: 700; padding: 14px 12px 6px;
}
.nav-item {
  font-size: 13.5px; font-weight: 500; color: #aeb8c2;
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer; transition: .15s;
}
.nav-item:hover { background: var(--navy2); color: #fff; }
.nav-item.on    { background: var(--navy2); color: #fff; }
.nav-item svg   { flex: none; opacity: .85; }
.nav-item.on svg { opacity: 1; }
.sidebar-foot {
  margin-top: auto; font-size: 11px; color: #6b7783;
  padding: 12px 10px 0; border-top: 1px solid #283642;
}

/* ── Main content ── */
.main { padding: 24px 28px 60px; overflow-y: auto; }

/* ── Top section ── */
.page-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 22px; gap: 14px; flex-wrap: wrap;
}
.page-top h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.page-top .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.page-top-actions { display: flex; align-items: center; gap: 10px; }

/* ── Buttons ── */
.btn {
  font-family: 'Sora'; font-weight: 600; font-size: 13px;
  border: none; border-radius: 10px; padding: 10px 16px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: .15s;
}
.btn.primary   { background: var(--orange); color: #fff; }
.btn.primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn.ghost     { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: #c9ced8; }
.bell-btn {
  width: 38px; height: 38px; border-radius: 10px; background: #fff;
  border: 1px solid var(--line); display: grid; place-items: center;
  position: relative; cursor: pointer;
}
.bell-btn::after {
  content: ""; position: absolute; top: 9px; right: 10px;
  width: 8px; height: 8px; background: var(--orange); border-radius: 50%; border: 2px solid #fff;
}

/* ── Grid layouts ── */
.grid  { display: grid; gap: 16px; }
.g-4   { grid-template-columns: repeat(4, 1fr); }
.g-3   { grid-template-columns: repeat(3, 1fr); }
.g-2   { grid-template-columns: 1.6fr 1fr; }
.g-2s  { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) {
  .g-4 { grid-template-columns: repeat(2, 1fr); }
  .g-3, .g-2, .g-2s { grid-template-columns: 1fr; }
  .screen.active { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* ── Stat cards ── */
.stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  animation: fade-up .45s ease both;
}
.stat .lab { font-size: 12.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.stat .lab .dot { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; }
.stat .v { font-family: 'Sora'; font-weight: 700; font-size: 26px; margin-top: 10px; letter-spacing: -.02em; }
.stat .d { font-size: 12px; margin-top: 5px; font-weight: 600; }
.up   { color: var(--green); }
.down { color: var(--red);   }
.flat { color: var(--muted); }

/* ── Cards ── */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  animation: fade-up .45s ease both;
}
.card .hd {
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.card .hd h3 { font-size: 14px; font-weight: 600; }
.card .hd a  { font-size: 12.5px; color: var(--orange); font-weight: 600; font-family: 'Sora'; cursor: pointer; }
.card .bd    { padding: 14px 16px; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); font-weight: 700;
  padding: 9px 14px; border-bottom: 1px solid var(--line);
}
td { padding: 11px 14px; border-bottom: 1px solid #f0f1f4; }
tr:last-child td { border-bottom: none; }
tbody tr:hover  { background: #fafbfc; }
.t-strong { font-weight: 600; font-family: 'Sora'; font-size: 13px; }
.t-sub    { color: var(--muted); font-size: 12px; }

/* ── Badges ── */
.badge {
  font-size: 11.5px; font-weight: 600; font-family: 'Sora';
  padding: 4px 10px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.b-green  { background: var(--green-soft);  color: var(--green); }
.b-amber  { background: var(--amber-soft);  color: var(--amber); }
.b-red    { background: var(--red-soft);    color: var(--red);   }
.b-blue   { background: var(--blue-soft);   color: var(--blue);  }
.b-grey   { background: #EEF0F3; color: #5d6772; }
.b-orange { background: var(--orange-soft); color: var(--orange); }

/* ── Job cards (tech) ── */
.jobcard {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 13px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  box-shadow: 0 1px 2px rgba(16,25,32,.04);
}
.jobcard.cur { border-color: var(--orange); box-shadow: 0 4px 16px rgba(252,76,1,.15); }
.jobcard .tm { font-family: 'Sora'; font-weight: 700; font-size: 13px; color: var(--navy); width: 44px; flex: none; }
.jobcard .jb { flex: 1; min-width: 0; }
.jobcard .jn { font-family: 'Sora'; font-weight: 600; font-size: 13.5px; }
.jobcard .js { color: var(--muted); font-size: 12px; margin-top: 2px; }
.job-empty   { color: var(--muted); font-size: 13px; padding: 16px; text-align: center; }

/* ── Progress bars ── */
.progress { height: 7px; background: #eef0f3; border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 99px; }

/* ── Kanban ── */
.kan { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
@media (max-width: 1100px) { .kan { grid-template-columns: repeat(2,1fr); } }
.kcol { background: #fafbfc; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.kcol .kh { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; color: var(--muted); padding: 4px 6px 10px; display: flex; justify-content: space-between; }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(16,25,32,.04); }
.kcard .knm { font-family: 'Sora'; font-weight: 600; font-size: 13px; }
.kcard .ksub { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.kcard .ktag { margin-top: 9px; }

/* ── List rows ── */
.list { display: flex; flex-direction: column; }
.row  { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0f1f4; }
.row:last-child { border-bottom: none; }
.row .av { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-family: 'Sora'; font-weight: 700; font-size: 13px; flex: none; }
.row .gr { flex: 1; min-width: 0; }
.row .ti { font-weight: 600; font-size: 13.5px; font-family: 'Sora'; }
.row .mt { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* ── Animations ── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ── Empty / loading states ── */
.empty-state { color: var(--muted); font-size: 13px; padding: 24px; text-align: center; }
.loading-row { animation: pulse 1.2s ease infinite; background: #f0f1f4; height: 16px; border-radius: 6px; }
@keyframes pulse { 0%,100%{opacity:.5} 50%{opacity:1} }

/* ── Responsive mobile sidebar ── */
@media (max-width: 720px) {
  .main { padding: 14px 14px 60px; }
  .page-top h1 { font-size: 18px; }
  .stat .v { font-size: 20px; }
  .kan { grid-template-columns: 1fr; }
}
