@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

/* ── TOKENS ──────────────────────────────────────────────────── */
:root {
  /* Sidebar */
  --sidebar-bg:   #1a0533;
  --sidebar-w:    228px;

  /* Page */
  --page-bg:      #f0f2f8;
  --surface:      #ffffff;
  --surface2:     #f7f8fc;

  /* Borders */
  --border:       #e4e8f0;
  --border2:      #d0d6e8;

  /* Text */
  --text:         #0f1629;
  --text2:        #4a5270;
  --text3:        #94a0bc;

  /* Accent palette */
  --indigo:       #4f35e8;
  --indigo-light: #ede9ff;
  --indigo-mid:   rgba(79,53,232,.12);

  --emerald:      #00b37d;
  --emerald-light:#e0f7f0;

  --coral:        #f04e37;
  --coral-light:  #feeae8;

  --amber:        #f59e0b;
  --amber-light:  #fef3c7;

  --sky:          #0ea5e9;
  --sky-light:    #e0f2fe;

  --violet:       #7c3aed;
  --violet-light: #ede9fe;

  /* UI */
  --radius:       10px;
  --radius-lg:    14px;
  --radius-xl:    20px;

  --shadow-sm:    0 1px 3px rgba(15,22,41,.06), 0 1px 2px rgba(15,22,41,.04);
  --shadow:       0 4px 12px rgba(15,22,41,.08), 0 1px 3px rgba(15,22,41,.05);
  --shadow-md:    0 8px 24px rgba(15,22,41,.10), 0 2px 6px rgba(15,22,41,.06);
  --shadow-lg:    0 16px 40px rgba(15,22,41,.12), 0 4px 12px rgba(15,22,41,.07);

  --font:         'DM Sans', sans-serif;
  --font-head:    'Outfit', sans-serif;
  --font-mono:    'DM Mono', monospace;

  --transition:   all .18s cubic-bezier(.4,0,.2,1);
}

/* ── RESET ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  background: var(--page-bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
}
a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: var(--font); cursor: pointer; }
input, select { font-family: var(--font); }

/* ── SIDEBAR ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  padding: 22px 20px 18px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-logo img {
  width: 36px; height: 36px;
  border-radius: 10px;
  object-fit: contain;
  background: rgba(255,255,255,.1);
}
.logo-placeholder {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--indigo), #7c5cfc);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-size: 16px; font-weight: 800;
  color: #fff; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79,53,232,.4);
}
.logo-text strong {
  display: block;
  font-family: var(--font-head);
  font-size: 14px; font-weight: 700;
  color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.2;
}
.logo-text span {
  font-size: 10px;
  color: rgba(255,255,255,.35);
  text-transform: uppercase;
  letter-spacing: .8px;
}

.nav-section { padding: 16px 0 8px; }
.nav-section-label {
  padding: 0 20px 6px;
  font-size: 9.5px; font-weight: 700;
  color: rgba(255,255,255,.25);
  text-transform: uppercase; letter-spacing: 1px;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px;
  font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,.5);
  transition: var(--transition);
  border-left: 2px solid transparent;
  margin: 1px 0;
  border-radius: 0;
}
.nav-link:hover {
  color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.06);
  text-decoration: none;
}
.nav-link.active {
  color: #fff;
  background: rgba(79,53,232,.25);
  border-left-color: var(--indigo);
  font-weight: 600;
}
.nav-icon {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; opacity: .7; flex-shrink: 0;
}
.nav-link.active .nav-icon { opacity: 1; }

.sidebar-footer {
  margin-top: auto;
  padding: 14px 18px 20px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.sync-chip {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; color: rgba(255,255,255,.3);
  margin-bottom: 10px;
}
.sync-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #00b37d;
  box-shadow: 0 0 8px rgba(0,179,125,.6);
  flex-shrink: 0;
  animation: pulse 2s ease infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 8px rgba(0,179,125,.6); }
  50%      { box-shadow: 0 0 14px rgba(0,179,125,.9); }
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.user-orb {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo), #7c5cfc);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-size: 13px; font-weight: 700;
  color: #fff; flex-shrink: 0;
}
.user-info strong { display: block; font-size: 12px; color: #fff; font-weight: 600; }
.user-info span   { font-size: 10px; color: rgba(255,255,255,.35); }
.btn-logout {
  width: 100%; padding: 8px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  color: rgba(255,255,255,.5);
  font-size: 12px; font-family: var(--font);
  transition: var(--transition);
}
.btn-logout:hover {
  background: rgba(240,78,55,.15);
  border-color: rgba(240,78,55,.3);
  color: #ff6b58;
}

/* ── OVERLAY ─────────────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,22,41,.5);
  backdrop-filter: blur(2px);
  z-index: 99;
}
.sidebar-overlay.show { display: block; }

/* ── MAIN ────────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1; display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOPBAR ──────────────────────────────────────────────────── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
.topbar-title {
  font-family: var(--font-head);
  font-size: 17px; font-weight: 700;
  color: var(--text);
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-date {
  font-size: 12px; color: var(--text3);
  font-family: var(--font-mono);
  background: var(--surface2);
  padding: 4px 10px; border-radius: 20px;
  border: 1px solid var(--border);
}

.topbar-breadcrumb {
  display: flex; align-items: center; gap: 7px;
  overflow: hidden; flex: 1; min-width: 0;
}
.topbar-breadcrumb a {
  font-size: 13px; color: var(--text3);
  white-space: nowrap;
}
.topbar-breadcrumb a:hover { color: var(--indigo); text-decoration: none; }
.topbar-breadcrumb .sep { color: var(--border2); font-size: 16px; }
.topbar-breadcrumb .cur {
  font-family: var(--font-head);
  font-size: 15px; font-weight: 700;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── PAGE ────────────────────────────────────────────────────── */
.page { padding: 24px; flex: 1; }

/* ── MOBILE MENU ─────────────────────────────────────────────── */
.mobile-menu-btn {
  display: none;
  align-items: center; justify-content: center;
  background: none; border: none;
  color: var(--text2); font-size: 20px;
  cursor: pointer; padding: 4px;
  border-radius: 8px; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.mobile-menu-btn:hover { background: var(--surface2); }

/* ── FILTER BAR ──────────────────────────────────────────────── */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 22px;
  display: flex; flex-wrap: wrap;
  align-items: flex-end; gap: 12px;
  box-shadow: var(--shadow-sm);
}
.presets { display: flex; gap: 5px; flex-wrap: wrap; }
.preset {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px; font-weight: 500;
  color: var(--text2);
  background: var(--surface2);
  border: 1.5px solid var(--border);
  cursor: pointer; text-decoration: none;
  transition: var(--transition);
}
.preset:hover { border-color: var(--indigo); color: var(--indigo); text-decoration: none; }
.preset.active {
  background: var(--indigo); color: #fff;
  border-color: var(--indigo);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(79,53,232,.3);
}

.filter-group { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-left: auto; }
.filter-group label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 10px; font-weight: 700;
  color: var(--text3);
  text-transform: uppercase; letter-spacing: .6px;
}
.filter-group input[type=date],
.filter-group select {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 11px;
  color: var(--text); font-size: 12.5px; font-family: var(--font);
  min-width: 130px; outline: none;
  transition: var(--transition);
}
.filter-group input:focus,
.filter-group select:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(79,53,232,.1);
}
.filter-group select option { background: #fff; }

.btn-apply {
  background: var(--indigo); color: #fff; border: none;
  padding: 8px 18px; border-radius: var(--radius);
  font-size: 12.5px; font-weight: 700; font-family: var(--font);
  letter-spacing: .2px;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(79,53,232,.25);
}
.btn-apply:hover { background: #3d27c7; box-shadow: 0 4px 14px rgba(79,53,232,.35); }

.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text2);
  padding: 8px 14px; border-radius: var(--radius);
  font-size: 12.5px; font-family: var(--font);
  text-decoration: none; display: inline-block;
  transition: var(--transition);
}
.btn-ghost:hover { border-color: var(--indigo); color: var(--indigo); text-decoration: none; }

/* ── KPI GRID ────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.kpi {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.kpi:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kpi::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.kpi.indigo::before  { background: linear-gradient(90deg, var(--indigo), #7c5cfc); }
.kpi.emerald::before { background: linear-gradient(90deg, var(--emerald), #00d6a0); }
.kpi.coral::before   { background: linear-gradient(90deg, var(--coral), #ff7a66); }
.kpi.amber::before   { background: linear-gradient(90deg, var(--amber), #fbbf24); }
.kpi.sky::before     { background: linear-gradient(90deg, var(--sky), #38bdf8); }
.kpi.violet::before  { background: linear-gradient(90deg, var(--violet), #9f6eff); }

.kpi-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; margin-bottom: 12px;
}
.kpi.indigo  .kpi-icon { background: var(--indigo-light);  }
.kpi.emerald .kpi-icon { background: var(--emerald-light); }
.kpi.coral   .kpi-icon { background: var(--coral-light);   }
.kpi.amber   .kpi-icon { background: var(--amber-light);   }
.kpi.sky     .kpi-icon { background: var(--sky-light);     }
.kpi.violet  .kpi-icon { background: var(--violet-light);  }

.kpi-label {
  font-size: 10.5px; font-weight: 700;
  color: var(--text3);
  text-transform: uppercase; letter-spacing: .6px;
  margin-bottom: 5px;
}
.kpi-value {
  font-family: var(--font-head);
  font-size: 26px; font-weight: 800;
  color: var(--text); line-height: 1.1; margin-bottom: 4px;
}
.kpi-value.indigo  { color: var(--indigo); }
.kpi-value.emerald { color: var(--emerald); }
.kpi-value.coral   { color: var(--coral); }
.kpi-value.amber   { color: var(--amber); }
.kpi-sub { font-size: 11px; color: var(--text3); }
.kpi-trend { font-size: 11px; font-weight: 700; margin-top: 6px; display: flex; align-items: center; gap: 3px; }
.trend-up   { color: var(--emerald); }
.trend-down { color: var(--coral); }

/* ── SECTION LABELS ──────────────────────────────────────────── */
.section-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; margin-top: 6px;
}
.section-bar {
  width: 4px; height: 22px;
  border-radius: 2px; flex-shrink: 0;
}
.section-head h2 {
  font-family: var(--font-head);
  font-size: 15px; font-weight: 800;
}
.section-head .section-sub {
  font-size: 11px; color: var(--text3); margin-left: 4px;
}

/* ── CARDS ───────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 18px;
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow); }

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border);
}
.card-head h3 {
  font-family: var(--font-head);
  font-size: 14px; font-weight: 700; color: var(--text);
}
.card-head .meta { font-size: 11px; color: var(--text3); }
.card-head .action {
  font-size: 11.5px; font-weight: 600;
  color: var(--indigo); padding: 3px 10px;
  background: var(--indigo-light); border-radius: 20px;
  transition: var(--transition);
}
.card-head .action:hover {
  background: var(--indigo); color: #fff;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(79,53,232,.25);
}
.card-body { padding: 18px; }

/* ── GRIDS ───────────────────────────────────────────────────── */
.grid-2   { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.grid-3   { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 18px; margin-bottom: 18px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin-bottom: 18px; }

/* ── TABLES ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: var(--surface2);
  text-align: left; padding: 10px 14px;
  font-size: 10.5px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1.5px solid var(--border); white-space: nowrap;
}
tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafbff; }
.empty td {
  text-align: center; color: var(--text3);
  padding: 32px; font-size: 12px; font-style: italic;
}
tbody tr.totals-row td {
  background: var(--surface2); font-weight: 700;
  color: var(--text); border-top: 2px solid var(--border2);
}

/* cell helpers */
.bold  { font-weight: 700; color: var(--text); }
.mono  { font-family: var(--font-mono); font-size: 12px; }
.muted { color: var(--text3); }
.c-indigo  { color: var(--indigo); }
.c-emerald { color: var(--emerald); }
.c-coral   { color: var(--coral); }
.c-amber   { color: var(--amber); }

/* clickable rows */
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td { background: var(--indigo-light) !important; }

/* ── BADGES ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 20px;
  font-size: 10.5px; font-weight: 700; white-space: nowrap;
  letter-spacing: .2px;
}
.badge-indigo  { background: var(--indigo-light);  color: var(--indigo); }
.badge-emerald { background: var(--emerald-light); color: #006b4b; }
.badge-coral   { background: var(--coral-light);   color: #b32a16; }
.badge-amber   { background: var(--amber-light);   color: #92400e; }
.badge-sky     { background: var(--sky-light);     color: #0369a1; }
.badge-gray    { background: var(--surface2); border: 1px solid var(--border); color: var(--text3); }

/* ── PROGRESS BARS ───────────────────────────────────────────── */
.prog-list { display: flex; flex-direction: column; gap: 13px; }
.prog-row {}
.prog-meta { display: flex; justify-content: space-between; margin-bottom: 5px; }
.prog-name { font-size: 12.5px; color: var(--text); font-weight: 500; max-width: 62%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prog-val  { font-size: 12px; font-family: var(--font-mono); color: var(--indigo); font-weight: 500; }
.prog-track { height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; border: 1px solid var(--border); }
.prog-fill  { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--indigo), #7c5cfc); transition: width .6s ease; }
.prog-fill.emerald { background: linear-gradient(90deg, var(--emerald), #00d6a0); }
.prog-fill.amber   { background: linear-gradient(90deg, var(--amber), #fbbf24); }

/* ── STAT ROWS ───────────────────────────────────────────────── */
.stat-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.stat-row:last-child { border-bottom: none; }
.stat-label { font-size: 12.5px; color: var(--text2); }
.stat-value { font-size: 13px; font-family: var(--font-mono); color: var(--text); font-weight: 600; }

/* ── WORK PERIOD CARDS ───────────────────────────────────────── */
.period-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.period-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  display: block;
  border-top: 3px solid var(--border);
}
.period-card:hover {
  border-top-color: var(--indigo);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}
.period-card.open { border-top-color: var(--emerald); }
.period-name {
  font-family: var(--font-head);
  font-size: 14px; font-weight: 800;
  color: var(--text); margin-bottom: 4px;
}
.period-dates { font-size: 11px; color: var(--text3); font-family: var(--font-mono); margin-bottom: 14px; }
.period-stats { display: flex; gap: 20px; flex-wrap: wrap; }
.pstat .pval  { font-family: var(--font-head); font-size: 16px; font-weight: 800; color: var(--indigo); }
.pstat .plbl  { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .3px; }

/* ── DETAIL HEADER ───────────────────────────────────────────── */
.detail-header {
  background: linear-gradient(135deg, #1a0533 0%, #2d1060 50%, #1a0533 100%);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  margin-bottom: 22px;
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 20px;
  box-shadow: var(--shadow-md);
  position: relative; overflow: hidden;
}
.detail-header::before {
  content: '';
  position: absolute; top: -60px; right: -60px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(79,53,232,.2);
}
.detail-title {
  font-family: var(--font-head);
  font-size: 22px; font-weight: 900;
  color: #fff; margin-bottom: 4px;
  position: relative;
}
.detail-meta { font-size: 11px; color: rgba(255,255,255,.45); font-family: var(--font-mono); position: relative; }
.detail-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.dkpi {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  padding: 12px 16px;
  position: relative;
}
.dkpi .dval {
  font-family: var(--font-head);
  font-size: 20px; font-weight: 800;
  color: #f0b429;
}
.dkpi .dlbl { font-size: 10px; color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: .5px; margin-top: 1px; }

/* ── CHART WRAPPERS ──────────────────────────────────────────── */
.chart-wrap canvas { max-height: 260px; }

/* ── LOGIN PAGE ──────────────────────────────────────────────── */
body.login {
  background: linear-gradient(135deg, #0d0120 0%, #1a0533 40%, #0d0120 100%);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
}
body.login .main { margin-left: 0; }
.login-wrap { width: 100%; max-width: 440px; }

.login-logo-area { text-align: center; margin-bottom: 28px; }
.login-logo-area img { max-height: 60px; max-width: 200px; object-fit: contain; filter: brightness(1.3); }
.login-logo-fallback { display: inline-flex; align-items: center; gap: 14px; }
.login-logo-fallback .orb {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--indigo), #7c5cfc);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 22px; font-weight: 900; color: #fff;
  box-shadow: 0 8px 24px rgba(79,53,232,.5);
}
.login-logo-fallback .lname { font-family: var(--font-head); font-size: 22px; font-weight: 800; color: #fff; }
.login-logo-fallback .lsub  { font-size: 11px; color: rgba(255,255,255,.35); text-transform: uppercase; letter-spacing: .8px; }

.login-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
  border: 1px solid rgba(255,255,255,.06);
}
.login-card-head {
  padding: 26px 26px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.login-card-head h2 { font-family: var(--font-head); font-size: 17px; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.login-card-head p  { font-size: 12px; color: var(--text3); }

.login-users { padding: 20px 26px; }
.login-step-label { font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 12px; }
.ulist { display: flex; flex-direction: column; gap: 6px; }
.urow {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
  transition: var(--transition);
}
.urow:hover  { border-color: var(--indigo); background: var(--indigo-light); }
.urow.active { border-color: var(--indigo); background: var(--indigo-light); }
.urow-orb {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo), #7c5cfc);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 14px; font-weight: 800; flex-shrink: 0;
}
.urow-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.urow-role { font-size: 10px; color: var(--text3); }
.urow-arrow { color: var(--text3); font-size: 16px; margin-left: auto; }
.urow:hover .urow-arrow { color: var(--indigo); }

/* PIN pad */
.pin-pad { padding: 20px 26px 28px; border-top: 1px solid var(--border); display: none; }
.pin-pad.show { display: block; }
.pin-who { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.pin-who-left { display: flex; align-items: center; gap: 10px; }
.pin-who-orb {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo), #7c5cfc);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 13px; font-weight: 700;
}
.pin-who-name { font-size: 13px; font-weight: 700; color: var(--text); }
.pin-who-role { font-size: 10px; color: var(--text3); }
.pin-back {
  background: none; border: 1.5px solid var(--border);
  border-radius: 8px; padding: 5px 12px;
  font-size: 11px; color: var(--text2); font-family: var(--font);
  transition: var(--transition);
}
.pin-back:hover { border-color: var(--indigo); color: var(--indigo); }

.pin-dots { display: flex; gap: 11px; justify-content: center; margin-bottom: 20px; }
.pd {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--border2); background: transparent;
  transition: var(--transition);
}
.pd.on  { background: var(--indigo); border-color: var(--indigo); transform: scale(1.25); box-shadow: 0 2px 8px rgba(79,53,232,.4); }
.pd.err { background: var(--coral); border-color: var(--coral); }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%,75%{transform:translateX(-6px)} 50%{transform:translateX(6px)} }
.shake { animation: shake .35s ease; }

.numpad { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.nkey {
  height: 56px; border: none; border-radius: var(--radius);
  background: var(--surface2); border: 1.5px solid var(--border);
  color: var(--text); font-family: var(--font-head);
  font-size: 20px; font-weight: 700;
  transition: var(--transition); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nkey:hover  { background: var(--indigo-light); border-color: var(--indigo); color: var(--indigo); }
.nkey:active { transform: scale(.93); }
.nkey.k0     { grid-column: 2; }
.nkey.kdel   { background: var(--coral-light); border-color: rgba(240,78,55,.2); color: var(--coral); font-size: 17px; }
.nkey.kdel:hover { background: var(--coral); color: #fff; border-color: var(--coral); }
.nkey.kenter {
  grid-column: 1/-1; height: 50px;
  background: linear-gradient(135deg, var(--indigo), #7c5cfc);
  color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .3px;
  border: none; border-radius: var(--radius); margin-top: 2px;
  box-shadow: 0 4px 16px rgba(79,53,232,.35);
}
.nkey.kenter:hover { box-shadow: 0 6px 20px rgba(79,53,232,.5); transform: translateY(-1px); }
.nkey.kenter:active { transform: scale(.97); }
.nkey.kenter:disabled { background: var(--surface2); border: 1.5px solid var(--border); color: var(--text3); box-shadow: none; cursor: not-allowed; transform: none; }
.pin-err { background: var(--coral-light); color: var(--coral); border-radius: var(--radius); padding: 9px 14px; font-size: 12px; font-weight: 600; text-align: center; margin-bottom: 14px; border: 1px solid rgba(240,78,55,.2); }

/* ── RESPONSIVE ──────────────────────────────────────────────── */

/* ≥1280px */
@media (min-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ≤960px — tablet */
@media (max-width: 960px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    transform: translateX(-228px);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    width: 228px; z-index: 200;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .mobile-menu-btn { display: flex; }
  .grid-3   { grid-template-columns: 1fr 1fr; }
  .grid-1-2 { grid-template-columns: 1fr; }
  .grid-2-1 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .page { padding: 18px; }
}

/* ≤768px — large phone */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .page { padding: 14px; }
  .topbar { padding: 0 14px; }
  .card-head { padding: 12px 14px; }
  .card-body { padding: 14px; }
  .filter-bar { padding: 12px 14px; flex-direction: column; align-items: stretch; }
  .filter-group { margin-left: 0; }
  thead th { padding: 8px 10px; }
  tbody td  { padding: 10px 10px; }
  .detail-header { padding: 20px; }
}

/* ≤480px — phone */
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi { padding: 14px 14px 12px; }
  .kpi-value { font-size: 22px; }
  .kpi-icon { width: 30px; height: 30px; font-size: 14px; }
  .page { padding: 10px; }
  .topbar { height: 50px; }
  .topbar-title { font-size: 15px; }
  .presets { display: grid; grid-template-columns: 1fr 1fr 1fr; width: 100%; }
  .preset { text-align: center; padding: 6px 8px; }
  .nkey { height: 58px; }
  .period-grid { grid-template-columns: 1fr; }
  .detail-kpis { grid-template-columns: 1fr 1fr; }
  .dkpi .dval { font-size: 17px; }
  .card-head h3 { font-size: 13px; }
  thead th { font-size: 9.5px; padding: 7px 8px; }
  tbody td  { padding: 9px 8px; font-size: 12px; }
}

/* ≥640px — work period detail desktop layout */
@media (min-width: 640px) {
  .detail-header { flex-direction: row; align-items: center; }
  .detail-kpis   { display: flex; gap: 20px; width: auto; }
  .dkpi          { min-width: 110px; }
}