/* ============================================================
   XcodeFix HRMS — Option 1 "Aurora"
   Modern SaaS · light · friendly (Linear/Deel/Notion polish)
   ============================================================ */

:root {
  /* Color tokens */
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-soft: #EEF2FF;
  --grad-aurora: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
  --success: #16A34A;
  --success-soft: #ECFDF5;
  --warning: #D97706;
  --warning-soft: #FFFBEB;
  --danger: #DC2626;
  --danger-soft: #FEF2F2;
  --info: #0284C7;
  --info-soft: #EFF8FF;
  --text: #0F172A;
  --text-2: #475569;
  --text-3: #94A3B8;
  --border: #E2E8F0;
  --bg: #F7F8FB;
  --surface: #FFFFFF;

  /* Elevation */
  --shadow-1: 0 1px 2px rgb(15 23 42 / .04);
  --shadow-2: 0 8px 24px rgb(15 23 42 / .08);
  --shadow-3: 0 24px 48px -12px rgb(15 23 42 / .18);

  /* Shape */
  --r-card: 16px;
  --r-btn: 10px;
  --r-chip: 999px;

  /* Layout */
  --sidebar-w: 264px;
  --content-max: 1320px;

  /* Type scale */
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-15: 15px;
  --fs-18: 18px;
  --fs-22: 22px;
  --fs-28: 28px;

  --focus-ring: 0 0 0 3px rgb(79 70 229 / .2);
  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--fs-15);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.25; color: var(--text); }
h1 { font-size: var(--fs-28); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: var(--fs-22); letter-spacing: -.01em; }
h3 { font-size: var(--fs-18); }
h4 { font-size: var(--fs-15); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 8px;
}
a:focus-visible, button:focus-visible { border-radius: var(--r-btn); }

::placeholder { color: var(--text-3); }

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 200;
  background: var(--primary); color: #fff; padding: 10px 16px;
  border-radius: var(--r-btn); font-weight: 600; transition: top .15s var(--ease);
}
.skip-link:focus-visible { top: 16px; color: #fff; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap;
}

.num, td.num, .metric-value { font-variant-numeric: tabular-nums; }

/* ---------- App frame ---------- */
.app { min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 60;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: transform .25s var(--ease);
}
.content {
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column; min-height: 100vh;
}
.main {
  width: 100%; max-width: var(--content-max);
  margin: 0 auto;
  padding: 28px 32px 40px;
  flex: 1;
}

/* ---------- Sidebar ---------- */
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 16px;
}
.brand-mark {
  width: 38px; height: 38px; flex: none;
  border-radius: 11px;
  background: var(--grad-aurora);
  display: grid; place-items: center;
  color: #fff;
  box-shadow: 0 4px 12px rgb(99 102 241 / .35);
}
.brand-name { font-size: var(--fs-15); font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.brand-tenant { font-size: var(--fs-12); font-weight: 500; color: var(--text-3); }

.nav {
  flex: 1; overflow-y: auto;
  padding: 8px 12px 16px;
  display: flex; flex-direction: column; gap: 2px;
}
.nav-link, .nav-toggle {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px; font-weight: 600;
  color: var(--text-2);
  transition: background .15s var(--ease), color .15s var(--ease);
  cursor: pointer;
}
.nav-link:hover, .nav-toggle:hover { background: var(--bg); color: var(--text); }
.nav-link svg, .nav-toggle svg { flex: none; }
.nav-link .nav-label, .nav-toggle .nav-label { flex: 1; text-align: left; }

.nav-link[aria-current="page"], .nav-link.is-active {
  background: var(--grad-aurora);
  color: #fff;
  box-shadow: 0 6px 16px rgb(99 102 241 / .35);
}
.nav-link[aria-current="page"]:hover, .nav-link.is-active:hover { color: #fff; }

.nav-badge {
  min-width: 22px; height: 22px; padding: 0 7px;
  display: inline-grid; place-items: center;
  border-radius: var(--r-chip);
  background: var(--primary-soft); color: var(--primary);
  font-size: var(--fs-12); font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.nav-link[aria-current="page"] .nav-badge, .nav-link.is-active .nav-badge { background: rgb(255 255 255 / .22); color: #fff; }

.nav-caret { transition: transform .2s var(--ease); color: var(--text-3); }
.nav-toggle[aria-expanded="true"] .nav-caret { transform: rotate(180deg); }
.nav-toggle.is-parent-active { color: var(--primary); }

.nav-sub {
  overflow: hidden;
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .25s var(--ease);
}
.nav-sub > ul { min-height: 0; }
.nav-group[data-open="true"] > .nav-sub { grid-template-rows: 1fr; }
.nav-sub a {
  display: flex; align-items: center; gap: 10px;
  min-height: 40px;
  margin: 1px 0 1px 20px;
  padding: 8px 12px 8px 22px;
  border-left: 2px solid var(--border);
  font-size: 13.5px; font-weight: 500;
  color: var(--text-2);
  border-radius: 0 10px 10px 0;
  transition: color .15s var(--ease), background .15s var(--ease), border-color .15s var(--ease);
}
.nav-sub a:hover { color: var(--text); background: var(--bg); }
.nav-sub a[aria-current="page"] {
  color: var(--primary); font-weight: 700;
  border-left-color: var(--primary);
  background: var(--primary-soft);
}
.nav-section-label {
  padding: 16px 12px 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3);
}

.sidebar-user {
  margin: 12px; padding: 12px;
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
}
.sidebar-user .avatar { flex: none; }
.sidebar-user-name { font-size: 13.5px; font-weight: 700; line-height: 1.3; }
.sidebar-user-role { font-size: var(--fs-12); color: var(--text-3); line-height: 1.3; }

/* Avatar */
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--grad-aurora); color: #fff;
  font-size: 14px; font-weight: 700; letter-spacing: .02em;
  flex: none;
}
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 72px; height: 72px; font-size: 24px; border-radius: 22px; }
.avatar.t-rose { background: linear-gradient(135deg, #F43F5E, #FB7185); }
.avatar.t-amber { background: linear-gradient(135deg, #D97706, #F59E0B); }
.avatar.t-teal { background: linear-gradient(135deg, #0D9488, #14B8A6); }
.avatar.t-sky { background: linear-gradient(135deg, #0284C7, #38BDF8); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 32px;
  background: rgb(247 248 251 / .85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { width: 100%; max-width: var(--content-max); margin: 0 auto; display: flex; align-items: center; gap: 16px; }

.hamburger {
  display: none;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  border-radius: var(--r-btn);
  color: var(--text-2);
  border: 1px solid var(--border);
  background: var(--surface);
}
.hamburger:hover { background: var(--bg); }

.search-pill {
  flex: 1; max-width: 440px;
  display: flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-chip);
  color: var(--text-3);
  font-size: 14px;
  cursor: pointer;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.search-pill:hover { border-color: #CBD5E1; box-shadow: var(--shadow-1); }
.search-pill:focus-visible { border-radius: var(--r-chip); }
.search-pill .kbd {
  margin-left: auto;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  font-size: var(--fs-12); font-weight: 600; color: var(--text-3);
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  position: relative;
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-btn);
  color: var(--text-2);
  background: transparent;
  transition: background .15s var(--ease), color .15s var(--ease);
  cursor: pointer;
}
.icon-btn:hover { background: var(--primary-soft); color: var(--primary); }
.icon-btn.is-bordered { border: 1px solid var(--border); background: var(--surface); }
.icon-btn.is-bordered:hover { background: var(--primary-soft); color: var(--primary); }

.bell-dot::after {
  content: ""; position: absolute; top: 9px; right: 10px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 2px var(--surface);
}
.quick-links {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 14px;
  border-radius: var(--r-btn);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.quick-links:hover { background: var(--primary-soft); color: var(--primary); }
.avatar-menu-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 4px; padding-right: 10px;
  border-radius: var(--r-chip);
  transition: background .15s var(--ease);
}
.avatar-menu-btn:hover { background: var(--primary-soft); }
.avatar-menu-meta { text-align: left; line-height: 1.2; }
.avatar-menu-meta .name { font-size: 13px; font-weight: 700; }
.avatar-menu-meta .role { font-size: 11.5px; color: var(--text-3); }

/* ---------- Footer ---------- */
.footer {
  padding: 20px 32px 28px;
  text-align: center;
  font-size: var(--fs-13);
  color: var(--text-3);
}
.footer a { color: var(--text-3); }
.footer a:hover { color: var(--primary); }

/* ---------- Page header ---------- */
.page-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  margin-bottom: 24px;
}
.page-head .grow { flex: 1; min-width: 220px; }
.page-title { font-size: var(--fs-28); font-weight: 800; letter-spacing: -.02em; }
.page-sub { margin-top: 4px; color: var(--text-2); font-size: 14px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-1);
  padding: 24px;
  transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}
.card.is-hoverable:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.card-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.card-head .grow { flex: 1; }
.card-title { font-size: var(--fs-15); font-weight: 700; }
.card-kicker { font-size: var(--fs-12); font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.card-link { font-size: 13.5px; font-weight: 600; }
.card-icon {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--primary-soft); color: var(--primary);
}
.card-icon.t-success { background: var(--success-soft); color: var(--success); }
.card-icon.t-warning { background: var(--warning-soft); color: var(--warning); }
.card-icon.t-danger { background: var(--danger-soft); color: var(--danger); }
.card-icon.t-info { background: var(--info-soft); color: var(--info); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border-radius: var(--r-btn);
  font-size: 14px; font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgb(79 70 229 / .28); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text-2); border-color: var(--border); }
.btn-secondary:hover { border-color: #CBD5E1; color: var(--text); background: var(--bg); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: #E0E7FF; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803D; }
.btn-danger-outline { background: var(--surface); color: var(--danger); border-color: #FECACA; }
.btn-danger-outline:hover { background: var(--danger-soft); border-color: #FCA5A5; }
.btn-danger-subtle { background: var(--danger-soft); color: var(--danger); }
.btn-danger-subtle:hover { background: #FEE2E2; }
.btn-ghost { color: var(--primary); }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; border-radius: 9px; }

/* ---------- Chips & badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 11px;
  border-radius: var(--r-chip);
  font-size: var(--fs-12); font-weight: 700;
  white-space: nowrap;
}
.chip-primary { background: var(--primary-soft); color: var(--primary); }
.chip-success { background: var(--success-soft); color: #15803D; }
.chip-warning { background: var(--warning-soft); color: #B45309; }
.chip-danger { background: var(--danger-soft); color: var(--danger); }
.chip-info { background: var(--info-soft); color: var(--info); }
.chip-neutral { background: #F1F5F9; color: var(--text-2); }
.chip-violet { background: #F5F3FF; color: #7C3AED; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.person-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 3px 12px 3px 4px;
  border-radius: var(--r-chip);
  background: var(--primary-soft);
  font-size: 13px; font-weight: 600; color: var(--text);
}
.person-chip .avatar { width: 28px; height: 28px; font-size: 11px; }
.chip-add {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border-radius: var(--r-chip);
  border: 1.5px dashed var(--border);
  color: var(--text-2); font-size: 13px; font-weight: 600;
  transition: border-color .15s var(--ease), color .15s var(--ease), background .15s var(--ease);
}
.chip-add:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 13.5px; font-weight: 700; color: var(--text); }
.field-label .req { color: var(--danger); }
.field-help { font-size: var(--fs-12); color: var(--text-3); }
.input, .select, .textarea {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  font-size: 14px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.textarea { height: auto; min-height: 104px; padding: 12px 14px; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: #CBD5E1; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
  border-radius: var(--r-btn);
}
.select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}
.input-icon-wrap { position: relative; }
.input-icon-wrap > svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none;
}
.input-icon-wrap .input { padding-left: 42px; }

.file-drop {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text-2); font-size: 13.5px;
  cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.file-drop:hover { border-color: var(--primary); background: var(--primary-soft); }
.file-drop strong { color: var(--primary); }

/* ---------- Tabs ---------- */
.tabs {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px;
  background: #EEF1F6;
  border-radius: 12px;
}
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 38px; padding: 0 16px;
  border-radius: 9px;
  font-size: 13.5px; font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] {
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-1);
  font-weight: 700;
}
.tab .count {
  min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-grid; place-items: center;
  border-radius: var(--r-chip);
  background: rgb(15 23 42 / .06);
  font-size: 11.5px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tab[aria-selected="true"] .count { background: var(--primary-soft); color: var(--primary); }

/* Underline tabs (section sub-nav) */
.tabs-line { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab-line {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  font-size: 14px; font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.tab-line:hover { color: var(--text); }
.tab-line[aria-current="page"], .tab-line[aria-selected="true"] {
  color: var(--primary); border-bottom-color: var(--primary); font-weight: 700;
}

/* Segmented control */
.segmented {
  display: inline-flex; padding: 4px; gap: 2px;
  background: #EEF1F6; border-radius: 12px;
}
.segmented .seg {
  min-height: 36px; padding: 0 16px;
  border-radius: 9px;
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.segmented .seg[aria-pressed="true"], .segmented .seg[aria-selected="true"] {
  background: var(--surface); color: var(--primary); font-weight: 700;
  box-shadow: var(--shadow-1);
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.table th, .table td { padding: 13px 16px; text-align: left; font-size: 13.5px; border-bottom: 1px solid var(--border); }
.table thead th {
  font-size: var(--fs-12); font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-3); background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s var(--ease); }
.table tbody tr:hover { background: #FAFBFE; }
.table td { color: var(--text-2); }
.table td.strong, .table td strong { color: var(--text); font-weight: 600; }

/* ---------- Notes / alerts ---------- */
.note {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 13.5px;
}
.note svg { flex: none; margin-top: 1px; }
.note-info { background: var(--info-soft); color: #075985; }
.note-warning { background: var(--warning-soft); color: #92400E; }
.note .note-close { margin-left: auto; color: inherit; opacity: .6; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; flex: none; }
.note .note-close:hover { opacity: 1; background: rgb(255 255 255 / .5); }

/* ---------- Dashboard ---------- */
.greeting {
  position: relative; overflow: hidden;
  border-radius: 20px;
  border: 1px solid #E0E7FF;
  padding: 32px;
  margin-bottom: 24px;
  background:
    radial-gradient(560px 260px at 8% -20%, rgb(99 102 241 / .16), transparent 62%),
    radial-gradient(480px 260px at 55% -30%, rgb(139 92 246 / .14), transparent 60%),
    radial-gradient(520px 300px at 98% 130%, rgb(56 189 248 / .12), transparent 62%),
    linear-gradient(135deg, #FDFDFF 0%, #F4F4FF 100%);
}
.greeting-date {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--fs-13); font-weight: 600; color: var(--primary);
  background: rgb(255 255 255 / .7);
  border: 1px solid #E0E7FF;
  padding: 6px 14px; border-radius: var(--r-chip);
  margin-bottom: 14px;
}
.greeting h1 { font-size: var(--fs-28); margin-bottom: 8px; }
.greeting-quote { color: var(--text-2); font-size: 14.5px; max-width: 560px; }
.greeting-quote cite { color: var(--text-3); font-style: normal; font-weight: 600; }

.bento {
  display: grid; gap: 24px;
  grid-template-columns: repeat(12, 1fr);
}
.bento > * { grid-column: span 4; }
.bento .span-8 { grid-column: span 8; }
.bento .span-6 { grid-column: span 6; }
.bento .span-12 { grid-column: span 12; }

/* Attendance / swipe card */
.clock-display {
  font-size: 40px; font-weight: 800; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  background: var(--grad-aurora);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.swipe-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13.5px; color: var(--text-2); margin-top: 10px; }
.swipe-meta strong { color: var(--text); font-weight: 700; }

/* Review list */
.review-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
}
.review-item + .review-item { border-top: 1px solid var(--border); }
.review-item .grow { flex: 1; min-width: 0; }
.review-item .who { font-size: 13.5px; font-weight: 700; }
.review-item .what { font-size: var(--fs-12); color: var(--text-3); }

/* Progress ring */
.ring-wrap { display: flex; align-items: center; gap: 20px; }
.ring { position: relative; width: 96px; height: 96px; flex: none; }
.ring svg { width: 96px; height: 96px; transform: rotate(-90deg); }
.ring .ring-value {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 20px; font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Counters */
.counter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.counter {
  padding: 16px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.counter .counter-num { font-size: var(--fs-28); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; }
.counter .counter-label { font-size: var(--fs-12); font-weight: 600; color: var(--text-3); margin-top: 2px; }

/* Holiday list */
.holiday-item { display: flex; align-items: center; gap: 14px; padding: 9px 0; }
.holiday-item + .holiday-item { border-top: 1px solid var(--border); }
.date-badge {
  width: 46px; height: 46px; flex: none;
  border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary);
  line-height: 1.05;
}
.date-badge .d { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.date-badge .m { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.holiday-item .name { font-size: 13.5px; font-weight: 700; }
.holiday-item .day { font-size: var(--fs-12); color: var(--text-3); }

/* Quick links list */
.quick-list a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; margin: 0 -12px;
  border-radius: 12px;
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.quick-list a:hover { background: var(--primary-soft); color: var(--primary); }
.quick-list a .go { margin-left: auto; color: var(--text-3); }
.quick-list a:hover .go { color: var(--primary); }

/* Leave snapshot */
.balance-pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.balance-pill {
  text-align: center; padding: 14px 8px;
  border-radius: 14px; background: var(--bg); border: 1px solid var(--border);
}
.balance-pill .v { font-size: var(--fs-22); font-weight: 800; font-variant-numeric: tabular-nums; }
.balance-pill .l { font-size: 11.5px; font-weight: 600; color: var(--text-3); }

/* ---------- KPI cards ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 24px; }
.kpi .kpi-label { font-size: var(--fs-13); font-weight: 600; color: var(--text-2); }
.kpi .kpi-value { font-size: var(--fs-28); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; margin-top: 6px; }
.kpi .kpi-delta { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-size: var(--fs-12); font-weight: 700; }
.kpi .kpi-delta.down { color: var(--danger); }
.kpi .kpi-delta.up { color: var(--success); }
.kpi .kpi-delta.flat { color: var(--text-3); }

/* ---------- Calendar ---------- */
.cal-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-title { font-size: var(--fs-18); font-weight: 800; min-width: 150px; }
.cal-scroll { overflow-x: auto; }
.cal { min-width: 640px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow {
  text-align: center; padding: 8px 0 10px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-3);
}
.cal-day {
  position: relative;
  min-height: 76px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: box-shadow .15s var(--ease), border-color .15s var(--ease);
}
.cal-day:hover { border-color: #CBD5E1; box-shadow: var(--shadow-1); }
.cal-day .dnum { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-day .shift { font-size: 10.5px; font-weight: 600; color: var(--text-3); margin-top: 2px; }
.cal-day.is-empty { border-color: transparent; background: transparent; box-shadow: none; }
.cal-day.is-off { background: #F8FAFC; }
.cal-day.is-off .dnum { color: var(--text-3); }
.cal-day.is-holiday { background: #F5F3FF; border-color: #DDD6FE; }
.cal-day.is-muted .dnum { color: var(--text-3); font-weight: 600; }
.cal-day.is-today { border: 2px solid var(--primary); box-shadow: 0 0 0 4px rgb(79 70 229 / .12); }
.cal-day.is-today .dnum { color: var(--primary); }
.day-chip {
  position: absolute; right: 8px; bottom: 8px;
  min-width: 22px; height: 22px; padding: 0 6px;
  display: inline-grid; place-items: center;
  border-radius: 7px;
  font-size: 11px; font-weight: 800;
}
.day-chip.p { background: var(--success-soft); color: #15803D; }
.day-chip.o { background: #F1F5F9; color: var(--text-3); }
.day-chip.h { background: #EDE9FE; color: #7C3AED; }
.day-chip.badge-count { background: var(--primary); color: #fff; border-radius: 50%; }
.cal-dot { position: absolute; left: 10px; bottom: 12px; width: 8px; height: 8px; border-radius: 50%; }
.cal-dot.violet { background: #8B5CF6; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; font-size: var(--fs-13); color: var(--text-2); }
.legend .legend-item { display: inline-flex; align-items: center; gap: 8px; }
.legend .swatch { width: 12px; height: 12px; border-radius: 4px; }

/* Day detail panel */
.metrics-table { width: 100%; }
.metrics-table th, .metrics-table td { padding: 9px 0; font-size: 13.5px; border-bottom: 1px solid var(--border); }
.metrics-table th { text-align: left; font-weight: 500; color: var(--text-2); }
.metrics-table td { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.metrics-table tr:last-child th, .metrics-table tr:last-child td { border-bottom: 0; }

.session {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg); border: 1px solid var(--border);
}
.session + .session { margin-top: 10px; }
.session .s-name { font-size: var(--fs-12); font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.session .s-time { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.session .s-in { margin-left: auto; }

/* ---------- Balance cards (leave) ---------- */
.balance-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.progress {
  height: 8px; border-radius: 999px;
  background: #EEF1F6;
  overflow: hidden;
}
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--grad-aurora); }
.progress.t-success > span { background: linear-gradient(90deg, #16A34A, #4ADE80); }
.balance-big { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1; }
.balance-big .unit { font-size: var(--fs-13); font-weight: 600; color: var(--text-3); letter-spacing: 0; }

/* ---------- Month cards (holiday calendar) ---------- */
.months-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.month-card .month-name { font-size: var(--fs-15); font-weight: 800; }
.holiday-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.holiday-row + .holiday-row { border-top: 1px dashed var(--border); }
.holiday-row .h-name { flex: 1; font-size: 13.5px; font-weight: 600; }
.no-holidays {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 0 4px;
  color: var(--text-3); font-size: var(--fs-13);
}

/* ---------- Tickets ---------- */
.ticket {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 20px 24px;
}
.ticket + .ticket { border-top: 1px solid var(--border); }
.ticket .grow { flex: 1; min-width: 0; }
.ticket-id { font-size: var(--fs-12); font-weight: 700; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ticket-subject { font-size: 15px; font-weight: 700; margin: 2px 0 8px; }
.ticket-meta { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.ticket-meta .sep { color: var(--border); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgb(15 23 42 / .45);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 24px;
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.modal-overlay.is-open { opacity: 1; }
.modal {
  width: 100%; max-width: 560px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-3);
  padding: 28px;
  transform: translateY(12px) scale(.98);
  transition: transform .2s var(--ease);
}
.modal-overlay.is-open .modal { transform: none; }
.modal-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.modal-head .grow { flex: 1; }
.modal-title { font-size: var(--fs-18); font-weight: 800; }
.modal-sub { font-size: 13.5px; color: var(--text-2); margin-top: 2px; }
.modal-close {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-btn);
  color: var(--text-3);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
body.modal-open { overflow: hidden; }

/* ---------- Feed (Engage) ---------- */
.engage-layout { display: grid; grid-template-columns: 264px 1fr; gap: 24px; align-items: start; }
.filter-rail .rail-group + .rail-group { margin-top: 4px; border-top: 1px solid var(--border); padding-top: 4px; }
.rail-toggle {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 11px 4px;
  font-size: 13.5px; font-weight: 700; color: var(--text);
}
.rail-toggle .nav-caret { margin-left: auto; }
.rail-list a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 4px 8px 12px;
  font-size: 13.5px; font-weight: 500; color: var(--text-2);
  border-radius: 8px;
}
.rail-list a:hover { color: var(--primary); background: var(--primary-soft); }
.rail-list a.is-active { color: var(--primary); font-weight: 700; }

.post .post-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.post .post-who { font-size: 14px; font-weight: 700; }
.post .post-meta { font-size: var(--fs-12); color: var(--text-3); }
.post-body { font-size: 14.5px; color: var(--text-2); }
.post-actions { display: flex; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.post-action {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 38px; padding: 0 14px;
  border-radius: var(--r-btn);
  font-size: 13px; font-weight: 600; color: var(--text-2);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.post-action:hover { background: var(--primary-soft); color: var(--primary); }
.banner-art {
  border-radius: 14px;
  padding: 24px;
  margin: 14px 0 4px;
}
.banner-birthday { background: linear-gradient(135deg, #FDF2F8, #F5F3FF); border: 1px solid #FBCFE8; }
.banner-kudos { background: linear-gradient(135deg, #FFFBEB, #FEF3C7); border: 1px solid #FDE68A; }
.link-chip {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 12px;
  padding: 9px 14px;
  border-radius: var(--r-btn);
  background: var(--primary-soft); color: var(--primary);
  font-size: 13px; font-weight: 700;
}
.link-chip:hover { background: #E0E7FF; }

/* ---------- To-do secondary nav ---------- */
.side-nav-group + .side-nav-group { margin-top: 18px; }
.side-nav-label {
  font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-3); padding: 0 12px 6px;
}
.side-nav a {
  display: flex; align-items: center; gap: 10px;
  min-height: 40px; padding: 8px 12px;
  border-radius: 10px;
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.side-nav a:hover { background: var(--bg); color: var(--text); }
.side-nav a.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.side-nav .count { margin-left: auto; }

/* ---------- Empty state ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 40px 24px;
}
.empty h4 { margin-top: 18px; font-size: 15px; }
.empty p { margin-top: 6px; font-size: 13.5px; color: var(--text-3); max-width: 320px; }

/* ---------- Documents ---------- */
.doc-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 32px;
  border-radius: 20px;
  border: 1px solid #E0E7FF;
  padding: 36px;
  margin-bottom: 28px;
  background:
    radial-gradient(500px 240px at 90% -30%, rgb(139 92 246 / .16), transparent 60%),
    radial-gradient(420px 240px at 10% 130%, rgb(56 189 248 / .12), transparent 60%),
    linear-gradient(135deg, #FDFDFF, #F4F4FF);
}
.doc-hero .grow { flex: 1; }
.doc-hero-art { flex: none; }

.section-title {
  font-size: var(--fs-13); font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); margin: 28px 0 16px;
}
.doc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
.doc-card .count-line { font-size: var(--fs-13); color: var(--text-3); font-weight: 600; }

/* ---------- Info grid (my-info) ---------- */
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 24px; }
.info-item .info-label { font-size: var(--fs-12); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.info-item .info-value { font-size: 14.5px; font-weight: 600; margin-top: 4px; }

.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); border-radius: 2px; }
.timeline-item { position: relative; padding: 2px 0 4px; }
.timeline-item::before {
  content: ""; position: absolute; left: -24px; top: 8px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--primary-soft); border: 4px solid var(--primary);
}

/* Profile header */
.profile-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.profile-head .grow { flex: 1; min-width: 240px; }
.profile-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* Jump links */
.jump-links { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-3); flex-wrap: wrap; }
.jump-links a { font-weight: 600; }

/* ---------- Layout helpers ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.split-side { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.split-nav { display: grid; grid-template-columns: 264px 1fr; gap: 24px; align-items: start; }
.stack-8 > * + * { margin-top: 8px; }
.stack-16 > * + * { margin-top: 16px; }
.stack-24 > * + * { margin-top: 24px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.text-2 { color: var(--text-2); } .text-3 { color: var(--text-3); }
.fs-12 { font-size: var(--fs-12); } .fs-13 { font-size: var(--fs-13); }
.w-600 { font-weight: 600; } .w-700 { font-weight: 700; } .w-800 { font-weight: 800; }
.card-flush { padding: 0; }
.card-flush .card-head { padding: 20px 24px 0; margin-bottom: 16px; }
.divider { height: 1px; background: var(--border); border: 0; margin: 16px 0; }

/* ---------- Sidebar drawer scrim ---------- */
.sidebar-scrim {
  position: fixed; inset: 0; z-index: 55;
  background: rgb(15 23 42 / .4);
  opacity: 0; transition: opacity .25s var(--ease);
}
.sidebar-scrim.is-open { opacity: 1; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1200px) {
  .bento > * { grid-column: span 6; }
  .bento .span-8, .bento .span-12 { grid-column: span 12; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .split-side { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); box-shadow: none; }
  .sidebar.is-open { transform: none; box-shadow: var(--shadow-3); }
  .content { margin-left: 0; }
  .hamburger { display: inline-flex; }
  .topbar { padding: 12px 20px; }
  .main { padding: 24px 20px 36px; }
  .engage-layout { grid-template-columns: 1fr; }
  .split-nav { grid-template-columns: 1fr; }
  .avatar-menu-meta { display: none; }
}

@media (max-width: 767px) {
  .quick-links .ql-label { display: none; }
  .quick-links { padding: 0 12px; }
  .grid-2 { grid-template-columns: 1fr; }
  .doc-hero { padding: 24px; }
  .doc-hero-art { display: none; }
  .greeting { padding: 24px; }
  .page-title { font-size: var(--fs-22); }
  .counter-row { grid-template-columns: 1fr 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .search-pill .kbd { display: none; }
}

@media (max-width: 479px) {
  .bento > *, .bento .span-6, .bento .span-8 { grid-column: span 12; }
  .main { padding: 20px 16px 32px; }
  .topbar { padding: 10px 16px; gap: 10px; }
  .search-pill .pill-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .balance-pills { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .page-actions { width: 100%; }
  .modal { padding: 20px; }
}

/* ============================================================
   Motion preferences
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Print-friendly-ish subtle scrollbars */
.nav::-webkit-scrollbar, .cal-scroll::-webkit-scrollbar, .table-wrap::-webkit-scrollbar { height: 8px; width: 8px; }
.nav::-webkit-scrollbar-thumb, .cal-scroll::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb { background: #E2E8F0; border-radius: 8px; }
