/* ============================================================
   Zoxi Media — Internal Office Dashboard
   Design concept: "The Ledger" — the whole system is, at heart,
   a company ledger (money, people, hours, leave). Sidebar reads
   like a ledger book's spine with tabbed pages; every stat card
   carries a credit/debit rule exactly like a bookkeeper's entry.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #F3F5EF;
  --bg-alt: #EAEEE3;
  --card: #FFFFFF;
  --ink: #1B211D;
  --ink-soft: #55604F;
  --ink-faint: #8A9285;
  --line: #DCE1D4;
  --spine: #1F4A38;
  --spine-soft: #2C6249;
  --spine-tab: #16382A;
  --brass: #B4832F;
  --credit: #2E7D5B;
  --credit-bg: #E7F2EA;
  --debit: #B25234;
  --debit-bg: #F7EAE3;
  --warn: #B4832F;
  --warn-bg: #F5EEDF;

  --font-display: 'Source Serif 4', Georgia, serif;
  --font-body: 'IBM Plex Sans', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', monospace;

  --radius: 3px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.app {
  display: grid;
  grid-template-columns: 236px 1fr;
  min-height: 100vh;
}

/* ---------------- Sidebar / "Ledger spine" ---------------- */

.spine {
  background: var(--spine);
  color: #EFEFE6;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.spine__brand {
  padding: 26px 22px 20px;
  border-bottom: 1px solid rgba(239,239,230,0.12);
}

.spine__brand-mark {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #FFFFFF;
}

.spine__brand-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(239,239,230,0.55);
  margin-top: 4px;
}

.spine__nav {
  flex: 1;
  padding: 14px 0;
  overflow-y: auto;
}

.spine__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 22px;
  text-decoration: none;
  color: rgba(239,239,230,0.72);
  border-left: 3px solid transparent;
  transition: background .15s ease, color .15s ease;
  cursor: pointer;
}

.spine__item:hover {
  background: rgba(239,239,230,0.06);
  color: #FFFFFF;
}

.spine__item.is-active {
  background: var(--spine-tab);
  border-left-color: var(--brass);
  color: #FFFFFF;
}

.spine__tab {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--brass);
  min-width: 20px;
}

.spine__label {
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.spine__foot {
  padding: 16px 22px 22px;
  border-top: 1px solid rgba(239,239,230,0.12);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: rgba(239,239,230,0.42);
  line-height: 1.6;
}

/* ---------------- Main column ---------------- */

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 34px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.topbar__greeting-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.topbar__greeting {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  margin-top: 2px;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.clockcard {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 14px;
}

.clockcard__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--credit);
  box-shadow: 0 0 0 3px var(--credit-bg);
}

.clockcard__text { font-size: 12.5px; color: var(--ink-soft); }
.clockcard__text b { color: var(--ink); font-family: var(--font-mono); }

.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--spine);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
}

.content { padding: 28px 34px 48px; }

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 12px;
}

/* ---------------- Stat cards (ledger entries) ---------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 30px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.stat--credit { border-left-color: var(--credit); }
.stat--debit  { border-left-color: var(--debit); }
.stat--neutral{ border-left-color: var(--spine-soft); }
.stat--brass  { border-left-color: var(--brass); }

.stat__label {
  font-size: 12px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat__tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 1px 6px;
  border-radius: 2px;
}

.stat--credit .stat__tag { color: var(--credit); background: var(--credit-bg); }
.stat--debit .stat__tag  { color: var(--debit); background: var(--debit-bg); }
.stat--neutral .stat__tag{ color: var(--spine-soft); background: var(--bg-alt); }
.stat--brass .stat__tag  { color: var(--brass); background: var(--warn-bg); }

.stat__value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 500;
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
}

.stat__sub {
  font-size: 11.5px;
  color: var(--ink-faint);
  margin-top: 6px;
}

/* ---------------- Panels ---------------- */

.grid-2 {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 16px 20px 0;
}

.panel__title {
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 600;
}

.panel__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
}

.panel__body { padding: 14px 20px 20px; }

/* attendance rows */
.att-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13.5px;
}
.att-row:last-child { border-bottom: none; }

.att-name { display: flex; align-items: center; gap: 10px; }

.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot--on-time { background: var(--credit); }
.dot--late { background: var(--brass); }
.dot--absent { background: var(--debit); }
.dot--leave { background: var(--ink-faint); }

.att-time { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-soft); }

.status-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.status-pill--on-time { color: var(--credit); background: var(--credit-bg); }
.status-pill--late { color: var(--brass); background: var(--warn-bg); }
.status-pill--absent { color: var(--debit); background: var(--debit-bg); }
.status-pill--leave { color: var(--ink-soft); background: var(--bg-alt); }

/* leave requests table */
.leave-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}
.leave-row:last-child { border-bottom: none; }

.leave-emp { font-size: 13.5px; font-weight: 500; }
.leave-detail { font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; }
.leave-dates { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); text-align: right; }

.btn-row { display: flex; gap: 6px; }
.btn-mini {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 2px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  color: var(--ink-soft);
}
.btn-mini--approve { border-color: var(--credit); color: var(--credit); }
.btn-mini--approve:hover { background: var(--credit-bg); }
.btn-mini--reject { border-color: var(--debit); color: var(--debit); }
.btn-mini--reject:hover { background: var(--debit-bg); }

/* full ledger table (Revenue & Expense) */
.ledger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ledger-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
}
.ledger-table td {
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
  vertical-align: middle;
}
.ledger-table tr:last-child td { border-bottom: none; }
.ledger-table .amt {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.amt--credit { color: var(--credit); }
.amt--debit { color: var(--debit); }

.chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-alt);
  color: var(--ink-soft);
}

.chart-wrap { padding: 6px 4px 0; }

/* ---------------- Responsive ---------------- */

@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .spine { position: relative; height: auto; }
  .content { padding: 20px; }
  .stats { grid-template-columns: 1fr; }
}
