/* AttendPro online portal — mirrors the desktop app's design tokens
   (frontend/tailwind.config.js + frontend/src/index.css) without a build step. */

:root {
  --brand-50:#eef2ff; --brand-100:#e0e7ff; --brand-200:#c7d2fe; --brand-300:#a5b4fc;
  --brand-400:#818cf8; --brand-500:#6366f1; --brand-600:#4f46e5; --brand-700:#4338ca;
  --brand-800:#3730a3; --brand-900:#312e81;
  --slate-50:#f8fafc; --slate-100:#f1f5f9; --slate-200:#e2e8f0; --slate-300:#cbd5e1;
  --slate-400:#94a3b8; --slate-500:#64748b; --slate-600:#475569; --slate-700:#334155;
  --slate-800:#1e293b; --slate-900:#0f172a;
  --emerald-50:#ecfdf5; --emerald-600:#059669; --rose-50:#fff1f2; --rose-600:#e11d48;
  --amber-50:#fffbeb; --amber-600:#d97706; --violet-50:#f5f3ff; --violet-600:#7c3aed;
  --sidebar-w:248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, "Segoe UI", sans-serif;
  background: var(--slate-50);
  color: var(--slate-800);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: linear-gradient(180deg,#101526 0%,#0a0e1a 100%);
  padding: 20px 12px; display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; margin-bottom: 22px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg,#6366f1 0%,#4f46e5 55%,#4338ca 100%);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: 0 4px 14px -2px rgba(79,70,229,.55);
}
.brand-name { color: #fff; font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brand-sub { color: var(--slate-500); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

.nav-group-label { color: rgba(148,163,184,.8); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 0 12px; margin: 14px 0 6px; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; color: var(--slate-400);
  font-size: 13.5px; font-weight: 500; margin-bottom: 2px; transition: all .15s;
}
.nav-link:hover { background: rgba(255,255,255,.05); color: #f1f5f9; }
.nav-link.active { background: rgba(255,255,255,.08); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.nav-link.active::before { content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%); width: 3px; height: 16px; border-radius: 0 4px 4px 0; background: var(--brand-400); }
.nav-icon { width: 16px; text-align: center; opacity: .9; }

.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.06); padding-top: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 999px; background: linear-gradient(135deg,#6366f1,#4338ca); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.user-name { color: #f1f5f9; font-size: 13px; font-weight: 600; }
.user-role { color: var(--slate-500); font-size: 11px; text-transform: capitalize; }
.signout { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border: none; background: transparent; color: var(--slate-500); font: inherit; font-size: 13px; font-weight: 500; border-radius: 8px; cursor: pointer; text-align: left; }
.signout:hover { background: rgba(244,63,94,.1); color: #fb7185; }

/* ---------- main ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(226,232,240,.8); background: rgba(255,255,255,.85); padding: 16px 24px; position: sticky; top: 0; z-index: 5; }
.page-title { font-size: 22px; font-weight: 800; letter-spacing: -.01em; color: var(--slate-900); }
.page-subtitle { font-size: 13px; color: var(--slate-500); margin-top: 2px; }
.content { padding: 24px; flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--slate-200); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--slate-500); }

/* ---------- components ---------- */
.card { background: #fff; border-radius: 16px; border: 1px solid rgba(226,232,240,.7); box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06); padding: 20px; margin-bottom: 20px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .sidebar { display: none; } }

.stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--slate-400); }
.stat-value { font-size: 26px; font-weight: 800; color: var(--slate-900); margin-top: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; padding: 9px 16px; font-size: 13.5px; font-weight: 600; border: none; cursor: pointer; font-family: inherit; transition: all .15s; }
.btn-primary { background: linear-gradient(135deg,#6366f1 0%,#4f46e5 55%,#4338ca 100%); color: #fff; box-shadow: 0 4px 12px -2px rgba(79,70,229,.45); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: #fff; color: var(--slate-700); border: 1px solid var(--slate-200); }
.btn-ghost:hover { background: var(--slate-50); }
.btn-approve { background: var(--emerald-50); color: var(--emerald-600); }
.btn-reject { background: var(--rose-50); color: var(--rose-600); }
.btn-sm { padding: 6px 10px; font-size: 12px; }

.label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--slate-500); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--slate-200); border-radius: 10px; padding: 9px 12px;
  font-size: 13.5px; font-family: inherit; color: var(--slate-800); background: #fff; outline: none;
}
.input:focus { border-color: var(--brand-400); box-shadow: 0 0 0 4px var(--brand-100); }
.field { margin-bottom: 14px; }

.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 10px; font-size: 11.5px; font-weight: 700; }
.badge-present, .badge-approved, .badge-active { background: var(--emerald-50); color: var(--emerald-600); }
.badge-absent, .badge-rejected { background: var(--rose-50); color: var(--rose-600); }
.badge-half_day, .badge-pending { background: var(--amber-50); color: var(--amber-600); }
.badge-leave { background: var(--violet-50); color: var(--violet-600); }
.badge-holiday, .badge-weekly_off, .badge-cancelled, .badge-inactive { background: var(--slate-100); color: var(--slate-500); }

table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.table th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--slate-400); background: rgba(248,250,252,.8); padding: 10px 14px; }
table.table td { padding: 11px 14px; border-top: 1px solid var(--slate-100); }
table.table tr:hover td { background: rgba(248,250,252,.6); }
.table-wrap { overflow-x: auto; }

.error-box { background: var(--rose-50); color: var(--rose-600); border-radius: 10px; padding: 10px 14px; font-size: 13.5px; font-weight: 500; margin-bottom: 16px; }
.success-box { background: var(--emerald-50); color: var(--emerald-600); border-radius: 10px; padding: 10px 14px; font-size: 13.5px; font-weight: 500; margin-bottom: 16px; }
.empty { text-align: center; color: var(--slate-400); padding: 28px; font-size: 13.5px; }
.muted { color: var(--slate-400); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }

/* ---------- reports ---------- */
.tabs { display: inline-flex; background: var(--slate-100); border-radius: 10px; padding: 4px; gap: 2px; margin-bottom: 16px; }
.tab { padding: 7px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--slate-500); }
.tab.active { background: #fff; color: var(--brand-700); box-shadow: 0 1px 2px rgba(16,24,40,.08); }
table.muster th, table.muster td { padding: 6px 8px; text-align: center; font-size: 11.5px; white-space: nowrap; }
table.muster td:first-child, table.muster th:first-child { text-align: left; }
table.muster td:nth-child(2), table.muster th:nth-child(2) { text-align: left; min-width: 140px; }
.code-P { color: var(--emerald-600); font-weight: 800; }
.code-A { color: var(--rose-600); font-weight: 800; }
.code-H { color: var(--amber-600); font-weight: 800; }
.code-L { color: var(--violet-600); font-weight: 800; }
.code-HO { color: #0284c7; font-weight: 800; }
.code-WO { color: var(--slate-400); font-weight: 800; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--slate-500); margin-top: 10px; }

/* ---------- login ---------- */
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .login-shell { grid-template-columns: 1fr 1fr; } }
.login-brand { display: none; position: relative; overflow: hidden; background: linear-gradient(180deg,#101526 0%,#0a0e1a 100%); color: #fff; padding: 48px; flex-direction: column; justify-content: space-between; }
@media (min-width: 1024px) { .login-brand { display: flex; } }
.login-glow-1 { position: absolute; width: 380px; height: 380px; border-radius: 999px; background: rgba(99,102,241,.25); filter: blur(80px); right: -80px; top: -80px; }
.login-glow-2 { position: absolute; width: 380px; height: 380px; border-radius: 999px; background: rgba(67,56,202,.3); filter: blur(80px); left: -40px; bottom: -80px; }
.login-heading { font-size: 34px; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; position: relative; }
.login-copy { color: var(--slate-400); max-width: 360px; margin-top: 14px; position: relative; }
.login-form-wrap { display: grid; place-items: center; padding: 24px; background: var(--slate-50); }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 16px; border: 1px solid rgba(226,232,240,.7); box-shadow: 0 10px 30px -12px rgba(16,24,40,.18); padding: 32px; }
