﻿:root {
  --ink: #0f172a;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.08);
  --bg: #f1f5f9;
  --card: #ffffff;
  --ok: #059669;
  --ok-bg: #ecfdf5;
  --warn: #d97706;
  --warn-bg: #fffbeb;
  --bad: #dc2626;
  --bad-bg: #fef2f2;
  --info: #2563eb;
  --info-bg: #eff6ff;
  --accent: #0f766e;
  --accent-2: #115e59;
  --accent-3: #14b8a6;
  --accent-soft: #f0fdfa;
  --accent-soft-2: #ccfbf1;
  --navy: #0f172a;
  --navy-2: #1e293b;
  --navy-3: #334155;
  --sidebar-bg: #071a1f;
  --sidebar-bg-2: #0b2a2e;
  --sidebar-bg-3: #0f3d3a;
  --sidebar-text: #e2e8f0;
  --sidebar-muted: #94a3b8;
  --sidebar-glow: rgba(45, 212, 191, 0.18);
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.05);
  --shadow-lg: 0 20px 40px rgba(15,23,42,.10);
  --radius: 16px;
  --sidebar: 268px;
  --font-display: "Sora", sans-serif;
  --font-body: "DM Sans", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: #f1f5f9;
  background-attachment: fixed;
  overflow-x: hidden;
}

button, input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.hidden { display: none !important; }

/* ========== LOGIN (form left · text right) ========== */
html:has(body.login-body),
body.login-body {
  background: #f1f5f9;
  background-attachment: scroll;
  overflow-x: hidden;
}
.login-body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
}
.auth-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.05fr minmax(340px, 0.95fr);
  background: #fff;
}
.auth-form-side {
  position: relative;
  display: grid;
  place-items: center;
  padding: 48px 40px;
  background: #fff;
  border-left: 1px solid #e8edf3;
  order: 2;
}
.auth-copy-side {
  position: relative;
  display: grid;
  place-items: center;
  padding: 56px 48px;
  overflow: hidden;
  color: #fff;
  order: 1;
}
.auth-back {
  position: absolute;
  top: 22px;
  left: 28px;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  text-decoration: none;
}
.auth-back:hover { color: #0f172a; }
.auth-form-inner {
  width: min(400px, 100%);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.auth-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}
.auth-logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  object-fit: contain;
  background: #f8fafc;
}
.auth-brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 15px;
  color: #0f172a;
  letter-spacing: -.02em;
}
.auth-brand small {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}
.auth-form-inner h1 {
  font-family: var(--font-display);
  font-size: 34px;
  letter-spacing: -.04em;
  color: #0f172a;
  line-height: 1.1;
}
.auth-sub {
  margin: 8px 0 22px;
  color: #64748b;
  font-size: 14.5px;
  line-height: 1.55;
}
.auth-form-inner .field { margin-bottom: 14px; }
.auth-form-inner .field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
}
.auth-form-inner .field input {
  width: 100%;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
}
.auth-form-inner .field input:focus {
  background: #fff;
  border-color: #94a3b8;
  box-shadow: 0 0 0 4px rgba(15,23,42,.06);
}
.auth-btn {
  margin-top: 8px;
  border: 0;
  border-radius: 12px;
  padding: 13px 16px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
}
.auth-alt {
  margin-top: 18px;
  text-align: center;
  font-size: 12.5px;
  color: #64748b;
}
.auth-alt a {
  font-weight: 700;
  text-decoration: none;
}
.auth-alt a:hover { text-decoration: underline; }

.auth-copy-side::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  right: -120px;
  bottom: -140px;
  background: rgba(255,255,255,.08);
  pointer-events: none;
}
.auth-copy-side::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(120deg, transparent 10%, #000 70%);
  opacity: .35;
  pointer-events: none;
}
.auth-copy-inner {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
}
.auth-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 14px;
  opacity: .95;
}
.auth-copy-inner h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.12;
  letter-spacing: -.035em;
  margin-bottom: 14px;
  color: #fff;
}
.auth-copy-inner > p {
  font-size: 15.5px;
  line-height: 1.7;
  color: rgba(255,255,255,.78);
  margin-bottom: 26px;
}
.auth-list {
  list-style: none;
  display: grid;
  gap: 12px;
  margin: 0 0 28px;
}
.auth-list li {
  position: relative;
  padding-left: 22px;
  font-size: 14.5px;
  font-weight: 600;
  color: rgba(255,255,255,.92);
}
.auth-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.auth-quote {
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(8px);
}
.auth-quote strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}
.auth-quote span {
  font-size: 12px;
  color: rgba(255,255,255,.7);
  font-weight: 600;
}

/* Role themes */
.login-super .auth-mark { background: #0f766e; color: #f0fdfa; }
.login-super .auth-btn { background: #0f766e; }
.login-super .auth-btn:hover { background: #0d9488; }
.login-super .auth-copy-side {
  background: linear-gradient(155deg, #042f2e 0%, #0f766e 48%, #14b8a6 120%);
}
.login-super .auth-eyebrow { color: #99f6e4; }
.login-super .auth-list li { color: #f0fdfa; }
.login-super .auth-form-inner .field input:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 4px rgba(15,118,110,.14);
}

.login-branch .auth-mark { background: #0e7490; color: #ecfeff; }
.login-branch .auth-btn { background: #0e7490; }
.login-branch .auth-btn:hover { background: #0891b2; }
.login-branch .auth-copy-side {
  background: linear-gradient(155deg, #083344 0%, #0e7490 48%, #22d3ee 120%);
}
.login-branch .auth-eyebrow { color: #a5f3fc; }
.login-branch .auth-form-inner .field input:focus {
  border-color: #22d3ee;
  box-shadow: 0 0 0 4px rgba(14,116,144,.14);
}

.login-employee .auth-mark { background: #115e59; color: #f0fdfa; }
.login-employee .auth-btn { background: #115e59; }
.login-employee .auth-btn:hover { background: #0f766e; }
.login-employee .auth-copy-side {
  background: linear-gradient(155deg, #022c22 0%, #115e59 45%, #2dd4bf 125%);
}
.login-employee .auth-eyebrow { color: #5eead4; }
.login-employee .auth-form-inner .field input:focus {
  border-color: #2dd4bf;
  box-shadow: 0 0 0 4px rgba(17,94,89,.14);
}

.login-error {
  background: #fef3f2;
  border: 1px solid #fecdca;
  color: #d92d20;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.03em;
  font-size: 18px;
  z-index: 1;
}
.brand-mark span {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-3);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: #042f2e;
  box-shadow: 0 8px 20px rgba(15,118,110,.25);
  flex-shrink: 0;
}
.brand-logo-img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: contain;
  background: #fff;
  flex-shrink: 0;
}
@media (max-width: 920px) {
  .auth-wrap { grid-template-columns: 1fr; min-height: 100vh; min-height: 100dvh; }
  .auth-copy-side { display: none !important; }
  .auth-form-side {
    order: 1;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 72px 18px 36px;
    border-left: 0;
    border-top: 0;
  }
  .auth-form-inner {
    width: min(420px, 100%);
    padding: 24px 20px;
  }
  .auth-form-inner h1 { font-size: 28px; }
  .auth-back { top: 16px; left: 16px; }
}

.role-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #eef2f6;
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 20px;
  gap: 2px;
}
.role-switch button {
  border: 0;
  background: transparent;
  padding: 10px 6px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: .2s ease;
}
.role-switch button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(16,24,40,.08);
}
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #344054;
}
.field input, .field select, .field textarea, .search input, .toolbar select, .toolbar input {
  width: 100%;
  border: 1px solid #d0d5dd;
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
  color: var(--ink);
  transition: .18s ease;
}
.field input:focus, .field select:focus, .field textarea:focus, .search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(15,118,110,.14);
}
.btn {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: .18s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(15,118,110,.22);
}
.btn-primary:hover { background: var(--accent-2); filter: none; }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-2); }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { background: #f8fafc; }
.btn-danger { background: var(--bad-bg); color: var(--bad); }
.btn-warn { background: var(--warn-bg); color: var(--warn); }
.btn-ok { background: var(--ok-bg); color: var(--ok); }
.btn-full { width: 100%; }
.hint {
  margin-top: 16px;
  background: #f8fafc;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

/* ========== APP SHELL ========== */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar);
  background:
    radial-gradient(120% 70% at 0% 0%, var(--sidebar-glow), transparent 55%),
    radial-gradient(90% 50% at 100% 100%, rgba(14,116,144,.22), transparent 50%),
    linear-gradient(175deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 48%, var(--sidebar-bg-3) 100%);
  color: var(--sidebar-text);
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(94, 234, 212, 0.12);
  box-shadow: 8px 0 32px rgba(7, 26, 31, 0.18);
  z-index: 30;
}
.theme-admin .sidebar {
  background:
    radial-gradient(120% 70% at 10% 0%, rgba(56,189,248,.16), transparent 55%),
    radial-gradient(90% 50% at 100% 100%, rgba(15,118,110,.25), transparent 50%),
    linear-gradient(175deg, #071820 0%, #0b2730 50%, #0e3a3a 100%);
}
.theme-super .sidebar {
  background:
    radial-gradient(120% 70% at 0% 0%, var(--sidebar-glow), transparent 55%),
    radial-gradient(90% 50% at 100% 100%, rgba(14,116,144,.22), transparent 50%),
    linear-gradient(175deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 48%, var(--sidebar-bg-3) 100%);
}
.theme-employee .sidebar {
  background:
    radial-gradient(120% 70% at 0% 0%, rgba(45,212,191,.14), transparent 55%),
    linear-gradient(175deg, #071a1f 0%, #0c2428 55%, #123a36 100%);
}
.sidebar .brand-mark {
  color: #fff;
  margin: 6px 8px 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}
.sidebar .brand-mark span {
  background: linear-gradient(145deg, #5eead4 0%, #14b8a6 55%, #0f766e 100%);
  color: #042f2e;
  box-shadow: 0 8px 22px rgba(20, 184, 166, 0.35);
}
.nav-scroll { overflow: auto; flex: 1; padding-bottom: 10px; }
.nav-scroll::-webkit-scrollbar { width: 0; }
.nav-label {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #7dd3c7;
  opacity: .85;
  padding: 16px 12px 8px;
  font-weight: 700;
}
.nav-btn {
  width: 100%;
  border: 0;
  background: transparent;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  text-align: left;
  transition: .18s ease;
  margin-bottom: 3px;
  text-decoration: none;
}
.nav-btn .nav-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.12);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  transition: .18s ease;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
.nav-btn .nav-ico .nav-svg {
  width: 18px;
  height: 18px;
  display: block;
}
.nav-btn:hover {
  background: rgba(255,255,255,.1);
  color: #ffffff;
}
.nav-btn:hover .nav-ico {
  background: rgba(45, 212, 191, 0.28);
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.35);
}
.nav-btn.active {
  background: linear-gradient(90deg, rgba(20,184,166,.32) 0%, rgba(20,184,166,.14) 100%);
  color: #ffffff;
  box-shadow: inset 3px 0 0 #2dd4bf, 0 8px 20px rgba(0,0,0,.12);
}
.nav-btn.active .nav-ico {
  background: rgba(45, 212, 191, 0.4);
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.45);
}
.sidebar-foot {
  margin-top: auto;
  padding: 12px 2px 2px;
  position: relative;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  display: grid;
  gap: 8px;
}
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 14px;
  text-decoration: none;
  color: #f8fafc;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  transition: .18s ease;
}
.sidebar-profile:hover {
  background: rgba(20, 184, 166, .16);
  border-color: rgba(94, 234, 212, .35);
}
.sidebar-profile-ava {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  color: #042f2e;
  background: #99f6e4;
  flex-shrink: 0;
}
.sidebar-profile-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.sidebar-profile-text strong {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-profile-text small {
  color: #94a3b8;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-logout {
  width: 100%;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: #f1f5f9;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: .18s ease;
}
.sidebar-logout:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fecaca;
}
.user-row { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  color: #042f2e;
  background: #99f6e4;
  flex-shrink: 0;
}
.user-row strong { display: block; color: #fff; font-size: 13px; }
.user-row small { color: #94a3b8; font-size: 11px; }
.logout { margin-top: 12px; width: 100%; background: rgba(255,255,255,.04); color: #e2e8f0; border-color: rgba(255,255,255,.08); }

.profile-menu { position: relative; }
.profile-trigger {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  color: inherit;
}
.profile-trigger:hover { background: rgba(255,255,255,.06); }
.profile-meta { flex: 1; min-width: 0; }
.profile-meta strong { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-meta small { color: #94a3b8; font-size: 11px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-caret { color: #94a3b8; font-size: 12px; }
.profile-dropdown {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  background: #102536;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  z-index: 40;
}
.profile-menu.open .profile-dropdown { display: block; }
.profile-dropdown a,
.profile-dropdown button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #e2e8f0;
  text-align: left;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.profile-dropdown a:hover,
.profile-dropdown button:hover { background: rgba(14,159,143,.18); color: #fff; }

.quick-actions {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.qa-card {
  background: #fff;
  border: 1px solid rgba(16,24,40,.06);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: .18s ease;
}
.qa-card:hover { transform: translateY(-2px); border-color: rgba(14,159,143,.35); }
.qa-card span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  margin-bottom: 10px;
}
.qa-card strong { display: block; font-size: 13px; }
.qa-card small { color: var(--muted); font-size: 11px; }

.toast-banner {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
}
.toast-banner.ok { background: #ecfdf3; color: #039855; border: 1px solid #abefc6; }
.toast-banner.bad { background: #fef3f2; color: #d92d20; border: 1px solid #fecdca; }
.toast-banner.info { background: #eff8ff; color: #175cd3; border: 1px solid #b2ddff; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100% !important; border-collapse: collapse; }
.data-table thead th {
  background: #f8fafc !important;
  border-bottom: 1px solid #e4e7ec !important;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #667085;
  white-space: nowrap;
}
.data-table tbody td {
  vertical-align: middle;
  border-bottom: 1px solid #f2f4f7;
}
.dataTables_wrapper { padding: 0 0 8px; }
.dataTables_wrapper .dt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid #eef2f6;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}
.dataTables_wrapper .dt-length,
.dataTables_wrapper .dt-search {
  display: flex;
  align-items: center;
}
.dataTables_wrapper .dt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: #fafbfc;
  border-top: 1px solid #eef2f6;
}
.dataTables_filter label,
.dataTables_length label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.dataTables_filter input,
.dataTables_length select {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 9px 12px;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
  transition: .15s ease;
  outline: none;
}
.dataTables_wrapper .dataTables_filter input {
  min-width: 240px;
  width: 260px;
  max-width: 100%;
  height: 40px;
  box-sizing: border-box;
  margin: 0 !important;
  padding: 9px 14px 9px 42px !important;
  background-color: #fff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath d='M10 10l2.5 2.5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: 14px center !important;
  background-size: 14px 14px !important;
}
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_length select:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20,184,166,.16);
}
.dataTables_wrapper .dataTables_filter input::placeholder {
  color: #94a3b8;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  opacity: 1;
}
.dataTables_length select {
  min-width: 72px;
  cursor: pointer;
  appearance: none;
  background:
    #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5L6 7.5 9 4.5'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  padding-right: 28px;
}
.dataTables_info {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  padding: 0 !important;
}
.dataTables_paginate { padding: 0 !important; }
.dataTables_paginate .paginate_button {
  border-radius: 8px !important;
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
  color: #334155 !important;
  padding: 5px 11px !important;
  margin: 0 2px !important;
  font-weight: 600 !important;
}
.dataTables_paginate .paginate_button.current {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}
.dataTables_paginate .paginate_button:hover {
  background: #f0fdfa !important;
  color: #0f766e !important;
  border-color: #99f6e4 !important;
}
.dataTables_paginate .paginate_button.current:hover {
  background: var(--accent-2) !important;
  color: #fff !important;
}
.btn-sm {
  padding: 7px 10px;
  font-size: 12px;
  border-radius: 10px;
}

.main { flex: 1; min-width: 0; background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 160px, #f1f5f9 100%); }
.topbar {
  min-height: 64px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 28px;
  background: #ffffff;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 1px 0 rgba(255,255,255,.8), 0 6px 18px rgba(15, 23, 42, 0.04);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.topbar-title-block { min-width: 0; }
.topbar-eyebrow { display: none; }
.topbar h1 {
  font-family: var(--font-display);
  font-size: clamp(18px, 1.8vw, 22px);
  letter-spacing: -.03em;
  color: #0f172a;
  line-height: 1.15;
}
.topbar p {
  color: #64748b;
  font-size: 12.5px;
  margin-top: 2px;
  line-height: 1.35;
  max-width: 720px;
}
.top-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

.header-profile { position: relative; }
.header-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 14px;
  padding: 6px 12px 6px 6px;
  cursor: pointer;
  font-family: inherit;
  transition: .18s ease;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.header-profile-btn:hover,
.header-profile.open .header-profile-btn {
  border-color: #99f6e4;
  box-shadow: 0 8px 20px rgba(15,118,110,.12);
  background: #fff;
}
.header-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #042f2e;
  background: linear-gradient(145deg, #5eead4, #14b8a6);
  box-shadow: inset 0 0 0 1px rgba(4,47,46,.08);
}
.header-user-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  min-width: 0;
  max-width: 180px;
}
.header-user-text strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.header-user-text small {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.header-caret { color: #94a3b8; font-size: 12px; margin-left: 2px; }
.header-profile-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 240px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15,23,42,.14);
  overflow: hidden;
  z-index: 40;
}
.header-profile-meta {
  padding: 14px 16px;
  border-bottom: 1px solid #eef2f6;
  background: linear-gradient(180deg, #f0fdfa 0%, #fff 100%);
}
.header-profile-meta strong {
  display: block;
  font-size: 14px;
  color: #0f172a;
}
.header-profile-meta small {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: #64748b;
}
.header-profile-menu a,
.header-profile-menu button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.header-profile-menu a:hover,
.header-profile-menu button:hover {
  background: #f0fdfa;
  color: #0f766e;
}
.header-profile-menu form { margin: 0; }
.header-profile-menu form button {
  border-top: 1px solid #eef2f6;
  color: #dc2626;
}
.header-profile-menu form button:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.search { position: relative; width: 280px; }
.search input { padding-left: 40px; background: #fff; }
.search::before {
  content: "âŒ•";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #98a2b3;
  font-size: 16px;
  z-index: 1;
}

.content { padding: 24px 28px 44px; }
.page { display: none; animation: pageIn .35s ease; }
.page.active { display: block; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.hero-strip {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 16px;
  margin-bottom: 18px;
  padding: 22px 24px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(125deg, #0f172a 0%, #1e293b 48%, #0f766e 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.theme-admin .hero-strip {
  background: linear-gradient(125deg, #0f172a 0%, #134e4a 55%, #0f766e 100%);
}
.theme-employee .hero-strip {
  background: linear-gradient(125deg, #0f172a 0%, #0f3d3a 55%, #0f766e 100%);
}
.hero-strip::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -40px;
  top: -60px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
}
.hero-strip h2 {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: -.03em;
  position: relative;
  z-index: 1;
}
.hero-strip p {
  color: #c5d4df;
  margin-top: 6px;
  max-width: 520px;
  position: relative;
  z-index: 1;
}
.hero-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}
.hero-meta .page-actions {
  width: 100%;
  justify-content: flex-end;
}
.hero-meta .page-actions .btn-ghost {
  background: rgba(255,255,255,.12);
  color: #fff;
  border-color: rgba(255,255,255,.18);
}
.hero-meta .page-actions .btn-ghost:hover {
  background: rgba(255,255,255,.2);
}
.hero-meta .page-actions .btn-primary {
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
}
.hero-chip {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.12);
  padding: 10px 14px;
  border-radius: 14px;
  backdrop-filter: blur(8px);
  min-width: 110px;
}
.hero-chip span { display: block; font-size: 11px; color: #b7c5d4; }
.hero-chip strong { font-size: 18px; font-family: var(--font-display); }

.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.kpi {
  background: var(--card);
  border: 1px solid rgba(16,24,40,.05);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: .2s ease;
}
.kpi:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(16,24,40,.08); }
.kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
}
.kpi .kpi-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}
.kpi .dot {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 15px;
}
.kpi h3 {
  font-family: var(--font-display);
  font-size: 30px;
  margin-top: 10px;
  letter-spacing: -.04em;
}
.kpi small { color: var(--muted); font-weight: 600; display: block; margin-top: 4px; }
.up { color: var(--ok); }

/* Branch admin dashboard polish */
.admin-dash .kpis { margin-bottom: 0; }
.admin-dash .hero-strip { margin-bottom: 0; }
.admin-hero {
  align-items: flex-end;
  gap: 20px;
}
.admin-hero-copy {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
}
.admin-hero-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #99f6e4;
  margin-bottom: 8px;
}
.admin-hero-actions {
  margin-top: 16px;
  justify-content: flex-start;
}
.admin-hero-actions .btn-ghost {
  background: rgba(255,255,255,.12);
  color: #fff;
  border-color: rgba(255,255,255,.18);
}
.admin-hero-actions .btn-ghost:hover {
  background: rgba(255,255,255,.22);
}
.admin-hero-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
  justify-content: flex-end;
}
.admin-hero-stats .hero-chip.is-warn {
  background: rgba(251, 191, 36, .16);
  border-color: rgba(251, 191, 36, .35);
}
.admin-hero-stats .hero-chip.is-warn strong { color: #fde68a; }

.admin-kpis .kpi-sep {
  color: #94a3b8;
  font-weight: 500;
  margin: 0 2px;
}
.admin-kpis .kpi-tone-leads::before { background: #0f766e; }
.admin-kpis .kpi-tone-assign::before { background: #0284c7; }
.admin-kpis .kpi-tone-money::before { background: #059669; }
.admin-kpis .kpi-tone-pipe::before { background: #d97706; }

.admin-quick .qa-card {
  display: flex;
  flex-direction: column;
  min-height: 108px;
}
.admin-quick .qa-card span {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #0f766e;
}
.admin-quick .qa-card .nav-svg {
  width: 18px;
  height: 18px;
}
.admin-quick .qa-card.qa-hot {
  border-color: rgba(217, 119, 6, .35);
  background: linear-gradient(180deg, #fffbeb 0%, #fff 70%);
}
.admin-quick .qa-card.qa-hot span {
  background: #ffedd5;
  color: #c2410c;
}

.admin-rank-item .person { gap: 10px; }
.admin-rank {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #0f766e;
  background: #ccfbf1;
  flex-shrink: 0;
}
.admin-rank-meter {
  width: 110px;
  flex-shrink: 0;
}
.admin-rank-meter small {
  display: block;
  margin-top: 4px;
  text-align: right;
  color: var(--muted);
  font-weight: 700;
}

.admin-attention {
  display: grid;
  gap: 10px;
}
.admin-attn-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid #eef2f6;
  background: #f8fafc;
  text-decoration: none;
  color: inherit;
  transition: .18s ease;
}
.admin-attn-item:hover {
  border-color: rgba(15, 118, 110, .28);
  background: #f0fdfa;
  transform: translateY(-1px);
}
.admin-attn-ico {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #ccfbf1;
  color: #0f766e;
  flex-shrink: 0;
}
.admin-attn-ico .nav-svg {
  width: 17px;
  height: 17px;
}
.admin-attn-item strong {
  display: block;
  font-size: 13px;
}
.admin-attn-item small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}
.admin-attn-item em {
  margin-left: auto;
  font-style: normal;
  font-weight: 800;
  font-family: var(--font-display);
  font-size: 18px;
  color: #0f766e;
  min-width: 28px;
  text-align: right;
}

.branch-perf-row {
  align-items: flex-start;
}
.branch-perf-meta {
  display: block;
  margin-top: 4px;
  color: #0f766e !important;
  font-weight: 700;
}
.branch-perf-meter {
  width: 140px;
  flex-shrink: 0;
  text-align: right;
}
.branch-perf-meter small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
}

.emp-profile-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.emp-profile-head {
  display: grid;
  gap: 18px;
}
.emp-profile-person .emp-profile-ava {
  width: 56px;
  height: 56px;
  font-size: 18px;
}
.emp-profile-person h2 {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -.03em;
  margin: 0;
}
.emp-profile-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.emp-profile-facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.emp-profile-facts > div {
  background: #f8fafc;
  border: 1px solid #eef2f6;
  border-radius: 14px;
  padding: 12px 14px;
}
.emp-profile-facts span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
}
.emp-profile-facts strong {
  font-size: 14px;
}
.emp-profile-facts small {
  color: #64748b;
  font-weight: 600;
}
@media (max-width: 900px) {
  .emp-profile-facts { grid-template-columns: 1fr 1fr; }
}
.down { color: var(--bad); }

.grid-2 { display: grid; grid-template-columns: 1.35fr .85fr; gap: 16px; }
.grid-2.grid-equal { grid-template-columns: 1fr 1fr; }
.site-upload-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
}
.site-upload-preview img {
  max-height: 48px;
  max-width: 160px;
  object-fit: contain;
}
.site-upload-preview img.favicon-preview { max-height: 32px; max-width: 32px; }
.site-upload-preview img.banner-preview { max-height: 72px; max-width: 220px; }
.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #667085;
  cursor: pointer;
}
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid #f1f5f9;
  gap: 10px;
}
.card-h h3 {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: -.02em;
}
.card-h-actions,
.page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 14px;
}
.card-b { padding: 18px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }

table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  vertical-align: middle;
}
th {
  color: #667085;
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: #fafbfc;
  font-weight: 700;
}
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #f8fafc; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
}
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-bad { background: var(--bad-bg); color: var(--bad); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-teal { background: var(--accent-soft); color: var(--accent-2); }
.b-violet { background: #fff7ed; color: #c2410c; }
.b-mute { background: #f2f4f7; color: #475467; }

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: center;
}
.toolbar .grow { flex: 1; min-width: 220px; }

/* Sales desk â€” professional layout */
.sales-desk { display: grid; gap: 16px; }
.sales-filter-card .card-b { padding-top: 8px; }
.sales-filter-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr 1fr;
  gap: 12px 14px;
  align-items: end;
}
.sales-filter-grid .field { margin-bottom: 0; }
.sales-filter-grid .field label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #667085;
  margin-bottom: 6px;
}
.sales-filter-grid .field input,
.sales-filter-grid .field select {
  padding: 10px 12px;
  font-size: 13px;
  border-radius: 10px;
  background: #f9fafb;
}
.sales-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-bottom: 2px;
  grid-column: 3 / -1;
  justify-content: flex-end;
}
.sales-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.sales-kpi {
  background: #fff;
  border: 1px solid #eef2f6;
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
  border-left: 4px solid #12b76a;
}
.sales-kpi.warn { border-left-color: #f79009; }
.sales-kpi.info { border-left-color: #1570ef; }
.sales-kpi.ok { border-left-color: var(--accent); }
.sales-kpi span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #667085;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.sales-kpi strong {
  display: block;
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: -.03em;
  color: #101828;
}
.sales-kpi small {
  display: block;
  margin-top: 4px;
  color: #98a2b3;
  font-size: 12px;
}
.sales-charts {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.1fr;
  gap: 14px;
}
.sales-chart-wrap {
  height: 240px;
  position: relative;
}
.sales-chart-wrap.tall { height: 260px; }
.sales-emp-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}
.sales-emp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #eef2f6;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  background: #fbfcfd;
  transition: .15s ease;
}
.sales-emp-row:hover,
.sales-emp-row.active {
  border-color: #99f6e4;
  background: #f0fdfa;
}
.sales-emp-row strong { display: block; font-size: 13px; }
.sales-emp-row small { color: #667085; font-size: 11px; }
.sales-emp-meta { text-align: right; }
.sales-emp-meta b { display: block; font-size: 13px; color: #0f766e; }
.sales-process-card .card-h { align-items: flex-start; }
.sales-process-sub {
  margin-top: 4px;
  color: #667085;
  font-size: 13px;
}
.sales-process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.sales-process-grid div {
  background: #f8fafc;
  border: 1px solid #eef2f6;
  border-radius: 12px;
  padding: 12px 14px;
}
.sales-process-grid span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #667085;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.sales-process-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  font-family: var(--font-display);
}
.sales-link {
  color: #0e7490;
  font-weight: 700;
  text-decoration: none;
}
.sales-link:hover { text-decoration: underline; }
.sales-dash { color: #98a2b3; }
.sales-empty,
.sales-empty-cell {
  color: #667085;
  padding: 18px;
  margin: 0;
}
.target-inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 200px;
}
.target-inline-form input {
  width: 120px;
  padding: 8px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  font-size: 13px;
}

/* Targets desk */
.targets-desk { display: grid; gap: 16px; }
.panel-desk { display: grid; gap: 16px; }
.panel-filter-card .card-b { padding-top: 8px; }
.panel-filter-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: 12px 14px;
  align-items: end;
}
.panel-filter-grid.cols-2 { grid-template-columns: minmax(220px, 1.2fr) 1fr auto; }
.panel-filter-grid.cols-3 { grid-template-columns: 1.3fr 1fr 1fr auto; }
.panel-filter-grid .field { margin-bottom: 0; }
.panel-filter-grid .field label,
.target-filter-grid .field label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
  margin-bottom: 6px;
}
.panel-filter-grid .field input,
.panel-filter-grid .field select {
  padding: 10px 12px;
  font-size: 13px;
  border-radius: 10px;
  background: #f8fafc;
}
.panel-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-bottom: 2px;
  flex-wrap: wrap;
}
.panel-empty {
  text-align: center;
  padding: 28px;
  color: #94a3b8;
}
@media (max-width: 900px) {
  .panel-filter-grid,
  .panel-filter-grid.cols-2,
  .panel-filter-grid.cols-3 { grid-template-columns: 1fr; }
  .panel-filter-actions { grid-column: 1 / -1; }
}

.target-set-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1.1fr auto;
  gap: 14px 16px;
  align-items: end;
}
.target-set-grid .field { margin-bottom: 0; }
.target-set-grid .field label,
.target-filter-grid .field label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
  margin-bottom: 6px;
}
.target-set-grid .field input,
.target-set-grid .field select,
.target-filter-grid .field select {
  padding: 10px 12px;
  font-size: 13px;
  border-radius: 10px;
  background: #f8fafc;
}
.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #64748b;
}
.target-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.preset-chip {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: .15s ease;
}
.preset-chip:hover,
.preset-chip.active {
  border-color: var(--accent);
  color: var(--accent-2);
  background: var(--accent-soft);
}
.target-set-actions {
  display: flex;
  align-items: center;
  padding-bottom: 2px;
}
.target-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px) auto;
  gap: 14px;
  align-items: end;
}
.target-filter-grid .field { margin-bottom: 0; }
.target-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-bottom: 2px;
}
@media (max-width: 1100px) {
  .target-set-grid { grid-template-columns: 1fr 1fr; }
  .target-set-actions { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .target-set-grid,
  .target-filter-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1280px) {
  .sales-filter-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .sales-filter-actions { grid-column: 1 / -1; }
  .sales-charts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .sales-filter-grid,
  .sales-kpi-row,
  .sales-charts,
  .sales-process-grid {
    grid-template-columns: 1fr;
  }
  .sales-chart-wrap,
  .sales-chart-wrap.tall { height: 220px; }
}
.emp-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.emp-filters select {
  min-width: 160px;
  max-width: 220px;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 10px;
}
.card-h .emp-filters {
  flex: 1;
  margin-left: 12px;
}
.leads-card-h {
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
}
.lead-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
}
.lead-filters select {
  min-width: 140px;
  max-width: 200px;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 10px;
  border: 1px solid #d0d5dd;
  background: #fff;
}
.view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.view-tab {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #e4e7ec;
  background: #fff;
  color: #344054;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.view-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.wait-pill {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c4320a;
  font-size: 11px;
  font-weight: 700;
}
.upload-preview {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #ecfdf3;
  border: 1px solid #abefc6;
  color: #067647;
  font-size: 13px;
}
.upload-hero .card-b { padding: 22px 24px; }
.upload-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.upload-form-grid .span-2 { grid-column: 1 / -1; }
.batch-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ecfdf3, #f0fdfa);
  border: 1px solid #abefc6;
}
.batch-banner strong { display: block; font-size: 16px; color: #067647; margin-bottom: 4px; }
.batch-banner p { margin: 0; color: #344054; font-size: 13px; }
.batch-banner b { color: #101828; }
@media (max-width: 720px) {
  .upload-form-grid { grid-template-columns: 1fr; }
}

.progress {
  height: 8px;
  background: #e4e7ec;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}
.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  border-radius: inherit;
}
.ring-wrap { display: grid; place-items: center; position: relative; }
.ring-label { position: absolute; text-align: center; }
.ring-label strong {
  display: block;
  font-size: 32px;
  letter-spacing: -.04em;
  font-family: var(--font-display);
}
.ring-label small { color: var(--muted); font-weight: 700; }

.list { display: grid; gap: 10px; }
.list-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #eef2f6;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #fbfcfd);
  align-items: center;
  text-decoration: none;
  color: inherit;
}
a.list-item:hover { border-color: #99f6e4; background: #f0fdfa; }
.list-item strong { display: block; font-size: 14px; }
.list-item small { color: var(--muted); display: block; margin-top: 2px; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  color: var(--muted);
  transition: .18s ease;
  text-decoration: none;
}
.tab:hover { border-color: rgba(15,118,110,.35); color: #0f766e; }
.tab.active {
  background: #0f766e;
  color: #fff;
  border-color: #0f766e;
}
.reports-tabs-wrap { padding-top: 14px; padding-bottom: 14px; }
.reports-tabs {
  gap: 8px;
}
.reports-desk .panel-filter-actions {
  flex-wrap: wrap;
}

.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 36, .52);
  display: none;
  place-items: center;
  z-index: 50;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-bg.open { display: grid; }
.modal {
  width: min(640px, 100%);
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: riseIn .25s ease;
}
.modal-h, .modal-f {
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-h {
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
}
.modal-f { border-top: 1px solid var(--line); gap: 10px; justify-content: flex-end; }
.modal-b { padding: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.span-2 { grid-column: span 2; }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--navy);
  color: #fff;
  padding: 13px 16px;
  border-radius: 14px;
  display: none;
  z-index: 70;
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  font-size: 13px;
}
.toast.show { display: block; animation: riseIn .25s ease; }

.chart-box { height: 280px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.switch {
  width: 44px;
  height: 24px;
  background: #d0d5dd;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}
.switch.on { background: var(--accent); }
.switch i {
  position: absolute;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: .18s ease;
}
.switch.on i { left: 23px; }

.mini-stat {
  padding: 14px;
  border: 1px solid #eef2f6;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #f8fafc);
}
.mini-stat span { color: var(--muted); font-size: 12px; font-weight: 700; }
.mini-stat b {
  display: block;
  font-size: 22px;
  margin-top: 4px;
  font-family: var(--font-display);
  letter-spacing: -.03em;
}

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.icon-btn:hover { background: #f1f5f9; }

.person {
  display: flex;
  align-items: center;
  gap: 10px;
}
.person .ava {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #0b3b3a;
  background: var(--accent-soft-2);
  flex-shrink: 0;
}
.person small { color: var(--muted); display: block; margin-top: 2px; }

.flow-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.flow-step {
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  text-decoration: none;
  color: inherit;
  transition: .18s ease;
}
.flow-step:hover {
  border-color: #99f6e4;
  box-shadow: 0 8px 20px rgba(16,24,40,.06);
}
.flow-step span {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  background: #ccfbf1;
  color: #0b3b3a;
  margin-bottom: 4px;
}
.flow-step strong { font-size: 14px; color: #101828; }
.flow-step small { color: #667085; font-size: 12px; }

.branch-admin-map {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bam-card {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) 40px minmax(280px, 1.4fr);
  gap: 12px;
  align-items: center;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.bam-card.bam-empty {
  border-style: dashed;
  background: #fcfcfd;
}
.bam-branch {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.bam-branch strong {
  display: block;
  font-size: 15px;
  color: #101828;
}
.bam-branch small {
  display: block;
  color: #667085;
  margin-top: 2px;
  font-size: 12px;
}
.bam-code {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .04em;
  color: #0b3b3a;
  background: linear-gradient(135deg, #ccfbf1, #e0f2fe);
  flex-shrink: 0;
}
.bam-arrow {
  text-align: center;
  color: #98a2b3;
  font-size: 20px;
  font-weight: 700;
}
.bam-admin {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  justify-content: space-between;
  min-width: 0;
}
.bam-meta { display: flex; align-items: center; gap: 8px; }
.bam-unassigned {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.bam-unassigned strong { color: #b54708; font-size: 14px; }
.bam-unassigned small { color: #98a2b3; margin-bottom: 6px; }

@media (max-width: 900px) {
  .bam-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .bam-arrow { display: none; }
}

.report-tile {
  padding: 18px;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.report-tile h3 {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: -.02em;
}
.report-tile p { color: var(--muted); margin: 8px 0 16px; line-height: 1.55; flex: 1; }
.report-tile .ico {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  margin-bottom: 12px;
  font-size: 18px;
}

.mobile-toggle { display: none; }
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 35;
}
.overlay.show { display: block; }
.sidebar-close {
  display: none;
  margin-left: auto;
  border: 0;
  background: rgba(255,255,255,.1);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

/* ========== RESPONSIVE: TABLET ========== */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .quick-actions { grid-template-columns: repeat(3, 1fr); }
  .sales-charts { grid-template-columns: 1fr 1fr; }
  .sales-filter-grid { grid-template-columns: 1fr 1fr 1fr; }
  .sales-filter-actions { grid-column: 1 / -1; }
  .grid-2 { grid-template-columns: 1fr; }
  .hero-strip { flex-direction: column; align-items: flex-start; }
  .admin-hero { align-items: stretch; }
  .admin-hero-stats { width: 100%; justify-content: flex-start; }
  .admin-hero-actions { width: 100%; }
}

@media (max-width: 1100px) {
  .grid-3, .settings-grid, .modal-b { grid-template-columns: 1fr 1fr; }
  .target-set-grid { grid-template-columns: 1fr 1fr; }
  .target-set-actions { grid-column: 1 / -1; }
  .panel-filter-grid,
  .panel-filter-grid.cols-2,
  .panel-filter-grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .panel-filter-actions { grid-column: 1 / -1; }
}

/* ========== RESPONSIVE: MOBILE / SMALL TABLET ========== */
@media (max-width: 900px) {
  .role-switch { grid-template-columns: 1fr; }

  .app { display: block; min-height: 100vh; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(288px, 86vw);
    height: 100vh;
    height: 100dvh;
    transform: translateX(-105%);
    transition: transform .24s ease;
    z-index: 40;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 16px 0 40px rgba(0,0,0,.28);
  }
  .sidebar .brand-mark {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .sidebar-close { display: inline-grid; place-items: center; }

  .mobile-toggle { display: inline-flex !important; }
  .main { width: 100%; }

  .topbar {
    padding: 10px 14px;
    min-height: 58px;
    gap: 10px;
    flex-wrap: nowrap;
  }
  .topbar-left { gap: 8px; min-width: 0; flex: 1; }
  .topbar h1 {
    font-size: 17px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 52vw;
  }
  .topbar p {
    display: none;
  }
  .top-actions {
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 48%;
  }
  .top-actions .btn {
    padding: 8px 10px;
    font-size: 12px;
  }
  .header-user-text { display: none; }
  .header-profile-btn { border-radius: 12px; padding: 4px; }

  .content {
    padding: 14px 12px 36px;
  }

  .kpis,
  .grid-2,
  .grid-2.grid-equal,
  .grid-3,
  .settings-grid,
  .modal-b,
  .hero-meta,
  .flow-strip,
  .sales-kpi-row,
  .sales-filter-grid,
  .sales-charts,
  .sales-process-grid,
  .target-set-grid,
  .target-filter-grid,
  .panel-filter-grid,
  .panel-filter-grid.cols-2,
  .panel-filter-grid.cols-3,
  .quick-actions {
    grid-template-columns: 1fr !important;
  }

  .quick-actions { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .kpis { gap: 10px; }
  .kpi h3 { font-size: 22px; }
  .hero-strip {
    padding: 16px;
    border-radius: 14px;
  }
  .hero-strip h2 { font-size: 20px; }
  .hero-meta { width: 100%; }
  .hero-chip { flex: 1; min-width: 0; }

  .card-h {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px;
  }
  .card-b { padding: 14px; }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0;
  }
  .data-table,
  .card table {
    min-width: 640px;
  }
  .dataTables_wrapper .dt-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .dataTables_wrapper .dataTables_filter input {
    min-width: 0;
    width: 100%;
  }
  .dataTables_wrapper .dt-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar .grow,
  .toolbar select,
  .toolbar input { width: 100%; min-width: 0; }

  .row-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .row-actions .btn,
  .row-actions form { width: 100%; }
  .target-inline-form {
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
  }
  .target-inline-form input { width: 100%; }

  .modal-bg { padding: 12px; align-items: end; }
  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 18px 18px 12px 12px;
    overflow: auto;
  }
  .modal-b {
    grid-template-columns: 1fr !important;
  }
  .modal-b .span-2 { grid-column: 1; }

  .bam-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .bam-arrow { display: none; }

  .search { width: 100%; }
  .chart-box { max-height: 220px; }
  .sales-chart-wrap,
  .sales-chart-wrap.tall { height: 210px; }
}

/* ========== RESPONSIVE: SMALL PHONES ========== */
@media (max-width: 480px) {
  .quick-actions { grid-template-columns: 1fr !important; }
  .admin-bottom { grid-template-columns: 1fr; }
  .top-actions .btn-ghost { display: none; }
  .topbar h1 { max-width: 42vw; font-size: 16px; }
  .content { padding: 12px 10px 28px; }
  .hero-chip strong { font-size: 15px; }
  .btn { white-space: normal; }
  .data-table,
  .card table { min-width: 560px; }
}

/* ========== RESPONSIVE: LARGE DESKTOP ========== */
@media (min-width: 1400px) {
  .content { padding-left: 32px; padding-right: 32px; }
}



