/* Employee Portal — styles */
:root {
  --ink: #1d2527;
  --ink-2: #4a5558;
  --muted: #7b8689;
  --line: #e6e2db;
  --bg: #f5f3ef;
  --card: #ffffff;
  --brand: #1f4e5f;
  --brand-2: #2c6a7f;
  --brand-soft: #e3eef1;
  --accent: #d9822b;
  --ok: #2e7d4f;   --ok-bg: #e5f3ea;
  --warn: #9a6a12; --warn-bg: #fbf0d9;
  --bad: #b23b3b;  --bad-bg: #f8e3e1;
  --info: #2c5d8f; --info-bg: #e3edf8;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(29,37,39,.04), 0 4px 16px rgba(29,37,39,.04);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #f0ede7; padding: 1px 6px; border-radius: 4px; font-size: .9em; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex: none; background: var(--brand); color: #dce9ed;
  display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
.brand img { height: 34px; max-width: 120px; object-fit: contain; background: #fff; border-radius: 6px; padding: 3px; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.brand-name { font-weight: 600; color: #fff; font-size: 15px; line-height: 1.2; }
.sidebar nav { flex: 1; overflow-y: auto; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8fb3bf; padding: 16px 10px 6px; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: #dce9ed; font-weight: 500; font-size: 14px; }
.sidebar a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.sidebar a.active { background: rgba(255,255,255,.14); color: #fff; }
.sidebar .count { margin-left: auto; background: var(--accent); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 8px; font-weight: 600; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.12); padding-top: 10px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 18px 32px; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-size: 20px; font-weight: 600; flex: 1; }
.menu-btn { display: none; background: none; border: 0; padding: 6px; color: var(--ink); cursor: pointer; }
.menu-btn svg { width: 22px; height: 22px; }
.who { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.content { padding: 28px 32px 48px; max-width: 1180px; width: 100%; }

.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 600; font-size: 13px; display: inline-grid; place-items: center; flex: none; }
.avatar-sm { width: 30px; height: 30px; font-size: 12px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }

/* ---------- Cards & layout ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card.narrow { max-width: 480px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3 { font-size: 16px; font-weight: 600; }
.card-head a { font-size: 13px; font-weight: 500; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 { margin-bottom: 20px; }
.grid-2 > * { min-width: 0; }
html, body { overflow-x: hidden; }
.grid-wide-left { grid-template-columns: 1.6fr 1fr; align-items: start; }
.muted, .sub { color: var(--muted); }
.sub { font-size: 13px; margin-top: 2px; }
.sub.note { color: var(--ink-2); }
.hint { font-size: 13px; color: var(--muted); font-weight: 400; }
.empty { color: var(--muted); padding: 14px 0; margin: 0; }
.right { text-align: right; }
.back { margin: 0 0 14px; font-size: 14px; }
.grow { flex: 1; }

.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.hero h2 { font-size: 28px; font-weight: 700; }
.hero p { margin: 4px 0 0; }
.eyebrow { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 4px !important; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat strong { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.stat strong small { font-size: 16px; color: var(--muted); font-weight: 500; }
.stat-sub { font-size: 13px; color: var(--muted); }
a.stat-sub { color: var(--brand-2); font-weight: 500; }
.stat-alert { border-color: #edc98d; background: #fffaf0; }

/* Balances */
.balances { display: flex; flex-direction: column; gap: 16px; }
.bal-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; margin-bottom: 6px; }
.bal-top small { color: var(--muted); font-weight: 400; }
.bar { height: 7px; border-radius: 99px; background: #edeae4; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--brand-2); border-radius: 99px; }

/* Slips */
.slip-feature, .slip-list li { display: flex; align-items: center; gap: 14px; }
.slip-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.slip-icon svg { width: 22px; height: 22px; }
.slip-meta { flex: 1; display: flex; flex-direction: column; }
.slip-meta span { font-size: 13px; }
.slip-list { list-style: none; margin: 0; padding: 0; }
.slip-list li { padding: 12px 0; border-top: 1px solid var(--line); }
.slip-list li:first-child { border-top: 0; padding-top: 0; }
.slip-actions { display: flex; gap: 8px; }

.simple-list { list-style: none; margin: 0; padding: 0; }
.simple-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.simple-list li:first-child { border-top: 0; }

/* Profile */
.profile-head { display: flex; align-items: center; gap: 18px; }
.profile-head h2 { font-size: 22px; }
.profile-head p { margin: 2px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px !important; }
.chip { font-size: 12px; background: #f0ede7; color: var(--ink-2); padding: 3px 10px; border-radius: 99px; }
.fields { margin: 0; display: grid; gap: 0; }
.fields-2 { grid-template-columns: 1fr 1fr; column-gap: 28px; }
.field { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.fields .field:first-child, .fields-2 .field:nth-child(2) { border-top: 0; }
.field dt { color: var(--muted); }
.field dd { margin: 0; text-align: right; font-weight: 500; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table input { padding: 7px 10px; }
.w-sm { width: 100px; }
.person { display: flex; align-items: center; gap: 10px; }
.inline-actions { display: inline-flex; gap: 6px; }

/* ---------- Badges ---------- */
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: #efede9; color: var(--muted); }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.span-2 { grid-column: span 2; }
.section-title { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin-top: 8px; }
.section-title:first-of-type { margin-top: 0; }
input, select, textarea {
  font: inherit; font-size: 15px; color: var(--ink); background: #fff;
  border: 1px solid #d8d3cb; border-radius: 8px; padding: 10px 12px; width: 100%;
}
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--brand); }
input[type=file] { padding: 10px; background: #faf9f6; border-style: dashed; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(44,106,127,.15); }
.form label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: 14px; padding: 10px 18px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
.btn-ghost { background: #fff; color: var(--ink); border-color: #d8d3cb; }
.btn-ghost:hover { background: #f6f4f0; }
.btn-danger { background: #fff; color: var(--bad); border-color: #e6c3bf; }
.btn-danger:hover { background: var(--bad-bg); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

.alert { padding: 11px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; border: 1px solid transparent; }
.alert-success { background: var(--ok-bg); color: var(--ok); border-color: #c6e4d1; }
.alert-error { background: var(--bad-bg); color: var(--bad); border-color: #efc9c5; }
.alert-info { background: var(--info-bg); color: var(--info); border-color: #c8daef; }

/* Toolbar */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .search { flex: 1; min-width: 220px; }
.seg { display: inline-flex; background: #ebe7e0; border-radius: 9px; padding: 3px; }
.seg a { padding: 6px 14px; border-radius: 7px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.seg a.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg a:hover { text-decoration: none; }
.month-pick label { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; }
.month-pick input { width: auto; }

/* Leave requests (admin) */
.request { display: flex; gap: 20px; justify-content: space-between; align-items: flex-start; }
.request-main { flex: 1; min-width: 0; }
.request-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 14px 0 6px; font-size: 14px; }
.request-facts span { display: flex; flex-direction: column; }
.request-facts small { color: var(--muted); font-size: 12px; }
.reason { background: #faf9f6; border-radius: 8px; padding: 10px 12px; margin: 10px 0 0; font-size: 14px; color: var(--ink-2); }
.request-actions { display: flex; flex-direction: column; gap: 8px; width: 240px; flex: none; }
.request-actions input { font-size: 14px; padding: 8px 10px; }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 10% -10%, #dbe8ec 0, transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 32px; box-shadow: 0 10px 40px rgba(29,37,39,.08); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.auth-brand img { height: 40px; max-width: 140px; object-fit: contain; }
.auth-brand div { display: flex; flex-direction: column; line-height: 1.25; }
.auth-brand span { font-size: 13px; color: var(--muted); }
.auth-title { font-size: 22px; margin-bottom: 14px; }
.auth-foot { text-align: center; font-size: 14px; margin: 18px 0 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-2, .grid-wide-left { grid-template-columns: 1fr; }
  .request { flex-direction: column; }
  .request-actions { width: 100%; }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 20; transform: translateX(-100%); transition: transform .2s ease; visibility: hidden; }
  .sidebar.open { transform: none; visibility: visible; box-shadow: 8px 0 24px rgba(0,0,0,.15); }
  .menu-btn { display: block; }
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 18px; }
  .who-name { display: none; }
  .content { padding: 18px 16px 40px; }
  .card { padding: 18px; }
  .hero { flex-direction: column; align-items: flex-start; }
  .hero h2 { font-size: 24px; }
  .form-grid, .fields-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .fields-2 .field:nth-child(2) { border-top: 1px solid var(--line); }
  .slip-list li { flex-wrap: wrap; }
  .slip-actions { width: 100%; padding-left: 58px; }
  .profile-head { flex-wrap: wrap; }
  .stat-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat strong { font-size: 24px; }
  .table { min-width: 520px; }
  .request-facts { gap: 8px 18px; }
  .toolbar .seg { overflow-x: auto; max-width: 100%; }
}
.auth-brand .brand-mark { color: #fff; font-size: 14px; }
