:root {
  --bg: #0E0D24;
  --sidebar: #131230;
  --surface: #1C1A3D;
  --surface2: #211F47;
  --border: #312E5C;
  --orange: #F2811C;
  --orange-dark: #D9700F;
  --green: #22C55E;
  --red: #F87171;
  --text: #F5F4FB;
  --muted: #918DB5;
  --muted-dark: #68638F;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }
::selection { background: var(--orange); color: #fff; }
a { color: inherit; }

/* ---------- layout ---------- */
.app-shell { height: 100vh; width: 100%; display: flex; overflow: hidden; }
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--sidebar);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
}
.sidebar-header { padding: 20px 20px; border-bottom: 1px solid var(--border); }
.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.sidebar-section-label {
  padding: 0 12px; margin-bottom: 6px; font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.06em; color: var(--muted-dark); text-transform: uppercase;
}
.sidebar-link {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 8px; font-size: 13.5px; font-weight: 500; margin-bottom: 2px;
  border: 1px solid transparent; background: transparent; color: var(--muted); text-align: left;
  transition: background 0.12s, color 0.12s;
}
.sidebar-link:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.sidebar-link.active {
  background: rgba(242,129,28,0.15); color: var(--orange); border-color: rgba(242,129,28,0.3);
}
.sidebar-footer {
  padding: 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px;
}
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 64px; border-bottom: 1px solid var(--border); display: flex; align-items: center;
  justify-content: space-between; padding: 0 24px; flex-shrink: 0;
}
.topbar-title { font-weight: 700; font-size: 15px; }
.topbar-subtitle { color: var(--muted); font-size: 13.5px; margin-left: 8px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-chip {
  font-size: 12.5px; color: var(--muted); background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px;
}
.bell-btn {
  width: 36px; height: 36px; border-radius: 8px; background: var(--surface2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--muted); position: relative;
}
.bell-dot { position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
.content { flex: 1; overflow-y: auto; padding: 24px; }

/* ---------- logo ---------- */
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark-img { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; display: block; box-shadow: 0 0 0 1px rgba(242,129,28,0.25); }
.logo-text-title { font-weight: 700; font-size: 14px; color: var(--text); line-height: 1.15; }
.logo-text-sub { font-size: 10.5px; color: var(--muted); letter-spacing: 0.04em; font-weight: 500; }

/* ---------- cards / stats ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 1px 2px rgba(0,0,0,0.18); }
.card-row {
  display: flex; align-items: center; justify-content: space-between; padding: 14px 18px;
  flex-wrap: wrap; gap: 8px; transition: background 0.12s;
}
.card-row:hover { background: rgba(255,255,255,0.02); }
.card-row + .card-row { border-top: 1px solid var(--border); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.stat-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 17px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18); transition: border-color 0.15s, transform 0.15s;
}
.stat-card:hover { border-color: var(--muted-dark); transform: translateY(-1px); }
.stat-icon {
  width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px; font-size: 17px;
}
.stat-badge {
  float: right; font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: var(--surface2); color: var(--muted); border: 1px solid var(--border);
}
.stat-value { font-size: 26px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 13px; font-weight: 600; margin-top: 8px; }
.stat-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---------- badges / pills ---------- */
.badge {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 1px solid;
  display: inline-flex; align-items: center; gap: 5px;
}
.badge-green { background: rgba(34,197,94,0.15); color: var(--green); border-color: rgba(34,197,94,0.3); }
.badge-red { background: rgba(248,113,113,0.15); color: var(--red); border-color: rgba(248,113,113,0.3); }
.badge-orange { background: rgba(242,129,28,0.15); color: var(--orange); border-color: rgba(242,129,28,0.3); }
.badge-neutral { background: var(--surface2); color: var(--muted); border-color: var(--border); }

.pill {
  padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid var(--border);
  background: var(--surface2); color: var(--muted); display: inline-flex; align-items: center; gap: 8px;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.pill:hover:not(.active) { color: var(--text); border-color: var(--muted-dark); }
.pill.active { background: var(--orange); color: #fff; border-color: var(--orange); }
.pill-count { font-size: 11px; padding: 1px 6px; border-radius: 999px; background: var(--border); }
.pill.active .pill-count { background: rgba(255,255,255,0.25); }

/* ---------- buttons / inputs ---------- */
.btn {
  padding: 10px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 600; border: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.12s, transform 0.08s;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--orange-dark); }
.btn-ghost { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--muted-dark); }
.btn-danger { background: rgba(248,113,113,0.15); color: var(--red); border: 1px solid rgba(248,113,113,0.3); }
.btn-danger:hover:not(:disabled) { background: rgba(248,113,113,0.25); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover:not(:disabled) { background: #16a34a; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px; font-size: 15px; }

.field-label { font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 5px; display: block; }
.input, select.input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 10px 12px; font-size: 13.5px; outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input::placeholder { color: var(--muted-dark); }
.input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(242,129,28,0.15); }
.input-icon-wrap { position: relative; }
.input-icon-wrap .input { padding-left: 34px; }
.input-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted-dark); }

.icon-btn {
  width: 32px; height: 32px; border-radius: 8px; background: var(--surface2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--muted);
  transition: color 0.12s, border-color 0.12s;
}
.icon-btn:hover { color: var(--text); border-color: var(--muted-dark); }
.icon-btn.danger:hover { color: var(--red); border-color: rgba(248,113,113,0.4); }

/* ---------- avatars ---------- */
.avatar {
  border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0;
}

/* ---------- empty state ---------- */
.empty-state {
  text-align: center; padding: 56px 24px; background: var(--surface); border: 1px dashed var(--border);
  border-radius: 14px;
}
.empty-state .icon { color: var(--muted-dark); margin-bottom: 12px; font-size: 26px; }
.empty-state .title { font-weight: 600; font-size: 14.5px; margin-bottom: 4px; }
.empty-state .subtitle { font-size: 13px; color: var(--muted); max-width: 340px; margin: 0 auto; }

/* ---------- login page ---------- */
.login-wrap {
  min-height: 100vh; width: 100%; display: flex; align-items: center; justify-content: center;
  padding: 16px; position: relative; overflow: hidden;
}
.login-glow {
  position: absolute; inset: 0; opacity: 0.5; pointer-events: none;
  background:
    radial-gradient(circle at 20% 20%, rgba(242,129,28,0.12), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(109,140,242,0.10), transparent 40%);
}
.login-box { position: relative; width: 100%; max-width: 380px; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px; box-shadow: 0 8px 24px rgba(0,0,0,0.28); }
.login-title { font-size: 19px; font-weight: 800; }
.login-subtitle { font-size: 13px; color: var(--muted); margin-top: 4px; }
.login-error {
  display: flex; align-items: center; gap: 8px; background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.3); color: var(--red); font-size: 13px;
  border-radius: 8px; padding: 10px 12px; margin: 16px 0;
}
.login-footer { text-align: center; font-size: 11.5px; color: var(--muted-dark); margin-top: 20px; }

/* ---------- punch card ---------- */
.punch-card { padding: 26px; position: relative; overflow: hidden; margin-bottom: 24px; box-shadow: 0 8px 24px rgba(0,0,0,0.22); }
.punch-perf {
  position: absolute; top: 0; bottom: 0; width: 14px;
  background-image: radial-gradient(circle, var(--bg) 4px, transparent 4.5px);
  background-size: 14px 16px; background-position: center;
}
.punch-time { font-size: 28px; font-weight: 800; font-family: 'JetBrains Mono', monospace; letter-spacing: -0.01em; }

/* ---------- misc utility ---------- */
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.muted { color: var(--muted); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 20px; }
.text-right { text-align: right; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.max-w-3 { max-width: 760px; margin: 0 auto; }
.section-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
