/* ============================================================================
   SANVIT HRMS — Design System "Aurora" (2026 refresh)
   Type: Plus Jakarta Sans · Primary: Indigo · Sidebar: deep-space gradient
   ========================================================================== */

:root {
  --font-sans:
    "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto,
    sans-serif;

  --bg: #f4f5fa;
  --bg-tint: radial-gradient(
    1100px 420px at 18% -8%,
    rgba(99, 102, 241, 0.07),
    transparent 60%
  );
  --surface: #ffffff;
  --border: #e4e7f2;
  --border-soft: #eff1f8;
  --line: #e4e7f2;

  --text: #131730;
  --text-dim: #5c667c;
  --text-faint: #9aa3ba;
  --ink-soft: #5c667c;

  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --accent: #4f46e5;
  --accent-soft: #eef0fe;
  --grad: linear-gradient(135deg, #6d6df8 0%, #4f46e5 55%, #4338ca 100%);
  --grad-soft: linear-gradient(
    135deg,
    rgba(109, 109, 248, 0.14),
    rgba(79, 70, 229, 0.1)
  );

  --sidebar-bg: linear-gradient(180deg, #0d1227 0%, #141a3a 55%, #182046 100%);
  --sidebar-glow: radial-gradient(
    420px 210px at 30% -40px,
    rgba(99, 102, 241, 0.35),
    transparent 70%
  );

  --ok: #059669;
  --ok-bg: #ecfdf5;
  --ok-line: #a7f3d0;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --warn-line: #fde68a;
  --bad: #dc2626;
  --bad-bg: #fef2f2;
  --bad-line: #fecaca;
  --rose: #e11d48;
  --rose-soft: #ffe4e9;
  --neutral-bg: #f1f2f8;
  --violet: #7c3aed;
  --violet-bg: #f1ebff;
  --teal: #0d9488;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow:
    0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 32px -16px rgba(16, 24, 40, 0.16);
  --shadow-lg:
    0 2px 4px rgba(16, 24, 40, 0.05), 0 24px 56px -24px rgba(16, 24, 40, 0.28);
  --glow: 0 8px 22px -8px rgba(79, 70, 229, 0.55);

  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  background-image: var(--bg-tint);
  background-repeat: no-repeat;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection {
  background: rgba(79, 70, 229, 0.18);
}
a {
  color: var(--accent);
}
a:hover {
  color: var(--brand-dark);
}

/* Thin modern scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: #c7cbe0 transparent;
}
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #c9cde2;
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: #aab1d0;
  background-clip: content-box;
  border: 2px solid transparent;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 60px;
}
.muted {
  color: var(--text-faint);
  font-size: 12.5px;
}

/* ============================================================================
   SHELL — sidebar + main
   ========================================================================== */
.shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

.side {
  background: var(--sidebar-bg);
  background-image: var(--sidebar-glow), var(--sidebar-bg);
  color: #aab4d6;
  padding: 22px 14px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
}
.side .brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  font-weight: 800;
  font-size: 15.5px;
  letter-spacing: 0.2px;
  padding: 4px 10px 24px;
}
.side .brand .mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--grad);
  box-shadow:
    var(--glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  flex: none;
}
.side a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 10px;
  color: #9fa9cc;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}
.side a .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
  flex: none;
}
.side a .ic {
  width: 17px;
  height: 17px;
  flex: none;
  opacity: 0.85;
}
.side a:hover:not(.active) {
  background: rgba(255, 255, 255, 0.06);
  color: #e9edfb;
}
.side a:hover:not(.active) .ic {
  opacity: 1;
}
.side a.active {
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  box-shadow: var(--glow);
}
.side a.active .ic {
  opacity: 1;
}
.side a.signout:hover {
  background: rgba(244, 63, 94, 0.14);
  color: #fda4af;
}
.side .grp {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5b6690;
  margin: 18px 11px 7px;
}
.side form {
  margin: 0;
  padding: 0;
}
.side-spacer {
  flex: 1 1 auto;
  min-height: 16px;
}

.main {
  padding: 26px 34px 56px;
  max-width: 1380px;
  margin: 0 auto;
  width: 100%;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.tenant-context-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid #f0c36d;
  border-radius: 6px;
  background: #fff8e7;
  color: #6f4b00;
  font-size: 13px;
}
.tenant-context-banner form { margin: 0; }
.topbar h1 {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
}
.topbar .sub {
  color: var(--text-dim);
  font-size: 12.5px;
  margin-top: 4px;
  font-weight: 500;
}
.who {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--grad);
  color: #fff;
  box-shadow: var(--glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
}
.role-chip {
  padding: 5px 12px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 700;
}
.date-pill {
  padding: 6px 13px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ============================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font: 700 13px var(--font-sans);
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(79, 70, 229, 0.6);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease;
}
.btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: var(--glow);
  color: #fff;
}
.btn:active {
  transform: translateY(0);
}
.btn:focus-visible,
.btn-primary:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.28);
  outline-offset: 1px;
}
.btn-sm {
  min-height: 34px;
  padding: 8px 13px;
  font-size: 12px;
  border-radius: 9px;
}
.btn-small {
  padding: 7px 11px;
  font-size: 11.5px;
  border-radius: 8px;
  box-shadow: none;
}
.btn.ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.btn.ghost:hover {
  background: var(--bg);
  border-color: #cdd2e6;
  color: var(--brand);
  box-shadow: none;
}
.btn.link {
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  box-shadow: none;
}
.btn.link:hover {
  background: var(--neutral-bg);
  box-shadow: none;
  transform: none;
}
.btn-danger {
  background: linear-gradient(135deg, #f87171, #dc2626);
  box-shadow: 0 6px 16px -8px rgba(220, 38, 38, 0.55);
}

.btn-primary,
.btn-outline,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 10px;
  padding: 10px 16px;
  font: 700 12.5px var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease,
    background 0.15s ease;
}
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(79, 70, 229, 0.6);
}
.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: var(--glow);
  color: #fff;
}
.btn-outline {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.btn-outline:hover {
  background: var(--bg);
  border-color: #cdd2e6;
  color: var(--brand);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--neutral-bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.btn-secondary:hover {
  background: #e8eaf4;
  color: var(--text);
}
.btn-block {
  width: 100%;
}

/* ============================================================================
   PAGE STRUCTURE
   ========================================================================== */
.page-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin: 2px 0 20px;
}
.section-title {
  font-size: 23px;
  line-height: 1.2;
  margin: 5px 0 0;
  letter-spacing: -0.025em;
  font-weight: 800;
}
.eyebrow {
  display: block;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}
.section-heading h3 {
  margin: 3px 0 0;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.action-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  border: 1px solid;
  border-radius: var(--radius);
  padding: 13px 16px;
  margin-bottom: 16px;
  font-size: 12.5px;
}
.notice strong,
.notice span {
  display: block;
}
.notice strong {
  font-size: 12.5px;
  margin-bottom: 2px;
}
.notice-ok {
  background: var(--ok-bg);
  border-color: var(--ok-line);
  color: #047857;
}
.notice-warn {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: #92400e;
}
.notice-icon {
  display: grid !important;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-weight: 800;
  background: currentColor;
  color: #fff !important;
  flex: none;
  font-size: 11px;
}

/* ============================================================================
   STAT CARDS
   ========================================================================== */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}
.stat {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 17px 18px 15px;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease;
}
.stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.stat::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad);
  opacity: 0;
}
.stat.ok::after {
  background: linear-gradient(135deg, #34d399, #059669);
  opacity: 1;
}
.stat.warn::after {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  opacity: 1;
}
.stat.bad::after {
  background: linear-gradient(135deg, #f87171, #dc2626);
  opacity: 1;
}
.stat.info::after {
  background: var(--grad);
  opacity: 1;
}
.stat.violet::after {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  opacity: 1;
}
.stat .lbl {
  font-size: 10.5px;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 9px;
}
.stat .val {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat .delta {
  font-size: 11.5px;
  margin-top: 6px;
  color: var(--text-faint);
  font-weight: 600;
}
.stat .delta.up {
  color: var(--ok);
}
.stat .delta.warn {
  color: var(--warn);
}
.stat .delta.bad {
  color: var(--bad);
}
.stat.ok .val {
  color: var(--ok);
}
.stat.warn .val {
  color: var(--warn);
}
.stat.bad .val {
  color: var(--bad);
}
.stat.info .val {
  color: var(--accent);
}
.stat.violet .val {
  color: var(--violet);
}

/* ============================================================================
   PANELS & GRIDS
   ========================================================================== */
.panels,
.grid2 {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.grid3,
.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.panel h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.panel .phead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  gap: 10px;
}
.panel .phead h3 {
  margin: 0;
}
.panel .phead .note {
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 600;
}
.chart-box {
  position: relative;
  height: 230px;
}
.chart-box.sm {
  height: 180px;
}
.chart-panel {
  min-height: 285px;
}
.chart-panel .phead h3 {
  margin-top: 4px;
}
.chart-empty {
  height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
  padding: 24px;
}
.sq {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--grad-soft);
  margin: 0 auto 10px;
}

.payroll-mini-chart {
  height: 220px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 20px 4px 0;
  border-bottom: 1px solid var(--border);
}
.payroll-mini-column {
  height: 100%;
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.payroll-mini-value {
  font-size: 9px;
  color: var(--text-dim);
  white-space: nowrap;
  transform: rotate(-42deg);
  transform-origin: center bottom;
  margin-bottom: 3px;
}
.payroll-mini-track {
  height: 150px;
  width: 100%;
  max-width: 32px;
  display: flex;
  align-items: flex-end;
  background: var(--border-soft);
  border-radius: 8px 8px 0 0;
  overflow: hidden;
}
.payroll-mini-track i {
  display: block;
  width: 100%;
  min-height: 3px;
  background: var(--grad);
  border-radius: 8px 8px 0 0;
}
.payroll-mini-column small {
  font-size: 10px;
  color: var(--text-faint);
  white-space: nowrap;
}

/* ============================================================================
   APPRAISALS / MATRIX
   ========================================================================== */
.performance-tabs {
  margin-bottom: 16px;
}
.appraisal-stats {
  grid-template-columns: repeat(5, 1fr);
}
.appraisal-initiate-card h3 {
  font-size: 15px !important;
  line-height: 1.3;
}
.appraisal-initiate-card p,
.appraisal-initiate-card label {
  font-size: 12px !important;
  line-height: 1.5;
}
.appraisal-initiate-card select,
.appraisal-initiate-card input {
  font-size: 12px !important;
  font-weight: 500 !important;
  padding: 8px 10px !important;
}
.appraisal-initiate-card button {
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 9px 16px !important;
}
.appraisal-all-table {
  font-size: 12px !important;
}
.appraisal-all-table th {
  font-size: 10px !important;
  padding: 9px 10px !important;
}
.appraisal-all-table td {
  font-size: 12px !important;
  padding: 9px 10px !important;
}
.appraisal-all-table td[style*="font-size"] {
  font-size: 11px !important;
}
.appraisal-all-table .btn {
  font-size: 11px !important;
  padding: 7px 10px !important;
}
.appraisal-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.appraisal-row-actions form {
  margin: 0;
}
.appraisal-delete-button {
  color: var(--bad);
  border-color: var(--bad-line);
  background: var(--bad-bg);
}
.appraisal-delete-button:hover {
  color: #fff;
  background: var(--bad);
  border-color: var(--bad);
}
.appraisal-chart-panel {
  margin-bottom: 16px;
}
.appraisal-chart-panel .chart-box {
  height: 300px;
}

.matrix-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 18px;
}
.matrix-intro h1 {
  font-size: 22px;
  line-height: 1.2;
  margin: 5px 0 0;
  letter-spacing: -0.025em;
}
.matrix-intro p {
  font-size: 12.5px;
  color: var(--text-dim);
  margin: 7px 0 0;
}
.matrix-shell {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
}
.matrix-y-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.matrix-content {
  min-width: 0;
}
.matrix-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.matrix-cell {
  min-height: 150px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.matrix-cell-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 7px;
}
.matrix-cell-head span {
  color: var(--text-faint);
  font-size: 11px;
}
.matrix-cell a,
.matrix-unassessed a {
  display: block;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  padding: 4px 0;
}
.matrix-cell small {
  color: var(--text-faint);
  font-size: 11px;
}
.matrix-high-high,
.matrix-low-low {
  background: #f0fdf7;
  border-color: #a7f3d0;
}
.matrix-high-medium,
.matrix-medium-high {
  background: #f0f5ff;
  border-color: #bfdbfe;
}
.matrix-high-low,
.matrix-medium-medium {
  background: #fffbeb;
  border-color: #fde68a;
}
.matrix-medium-low {
  background: #f8fafc;
  border-color: #e2e8f0;
}
.matrix-low-high {
  background: #f5f3ff;
  border-color: #ddd6fe;
}
.matrix-low-medium {
  background: #fef2f2;
  border-color: #fecaca;
}
.matrix-x-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 2px 0;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.matrix-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 180px));
  gap: 12px;
  margin-top: 16px;
}
.matrix-summary .card {
  margin: 0;
  padding: 14px;
}
.matrix-summary strong,
.matrix-summary span {
  display: block;
}
.matrix-summary strong {
  font-size: 20px;
}
.matrix-summary span {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
}
.matrix-unassessed {
  margin-top: 16px;
  font-size: 12.5px;
}

/* ============================================================================
   RECRUITMENT
   ========================================================================== */
.recruitment-metric-stats {
  grid-template-columns: repeat(5, 1fr);
}
.recruitment-subpage {
  font-size: 12px;
}
.recruitment-tabs {
  margin-bottom: 16px;
}
.recruitment-subpage h3 {
  font-size: 15px;
  line-height: 1.3;
}
.recruitment-subpage h4 {
  font-size: 13px;
}
.recruitment-subpage p,
.recruitment-subpage label {
  font-size: 12px !important;
  line-height: 1.5;
}
.recruitment-subpage .list {
  font-size: 12px;
}
.recruitment-subpage .list th {
  font-size: 10px;
  padding: 9px 10px;
}
.recruitment-subpage .list td {
  font-size: 12px;
  padding: 9px 10px;
}
.recruitment-subpage .btn {
  font-size: 12px;
}
.recruitment-mix-row {
  display: grid;
  grid-template-columns: 110px 1fr 28px;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12px;
}
.recruitment-meter {
  height: 9px;
  background: var(--border-soft);
  border-radius: 99px;
  overflow: hidden;
}
.recruitment-meter i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--grad);
}
.recruitment-cost-split,
.budget-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.recruitment-cost-split div,
.budget-summary div {
  padding: 13px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
}
.recruitment-cost-split small,
.recruitment-cost-split strong,
.budget-summary small,
.budget-summary strong {
  display: block;
}
.recruitment-cost-split small,
.budget-summary small {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.recruitment-cost-split strong,
.budget-summary strong {
  font-size: 18px;
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}

/* ============================================================================
   ANALYTICS
   ========================================================================== */
.analytics-page {
  font-size: 12px;
}
.analytics-tabs {
  margin-bottom: 16px;
}
.analytics-controls {
  padding: 15px 18px;
  margin-bottom: 16px;
}
.inline-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.analytics-kpis .stat-card {
  margin: 0;
}
.analytics-kpis .stat-card .num {
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.analytics-kpis .stat-card .lbl {
  font-size: 10px;
}
.analytics-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.analytics-chart-card {
  margin: 0;
}
.analytics-chart-card h3 {
  font-size: 14px;
  margin: 0 0 10px;
}
.analytics-chart {
  height: 260px;
  position: relative;
}
.analytics-narrative {
  margin-bottom: 16px;
}
.analytics-narrative-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.analytics-narrative-grid h4 {
  font-size: 13px;
  margin: 0 0 8px;
}
.analytics-narrative-grid ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.55;
}

/* ============================================================================
   CULTURE / COMMUNITY
   ========================================================================== */
.section-icon,
.hero-mark,
.resource-hero-mark,
.quote-mark {
  font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", sans-serif;
  font-size: 18px;
  line-height: 1;
  color: var(--accent);
  font-style: normal;
}
.hero-mark,
.resource-hero-mark {
  font-size: 28px;
}
.quote-mark {
  font-size: 22px;
  color: var(--accent);
}
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-faint);
  font: 600 15px/1 sans-serif;
  cursor: pointer;
  transition: 0.15s ease;
}
.icon-button:hover {
  background: var(--bad-bg);
  border-color: var(--bad-line);
  color: var(--bad);
}

.community-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background:
    linear-gradient(
      120deg,
      rgba(99, 102, 241, 0.1),
      rgba(124, 58, 237, 0.06) 55%,
      transparent
    ),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.community-hero h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 6px 0;
}
.community-hero p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13.5px;
  max-width: 520px;
}
.community-layout {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 16px;
  align-items: start;
}
.community-feed {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.recognition-form {
  margin-top: 4px;
}
.admin-date-card {
  border-top: 3px solid var(--accent);
}
.date-item {
  gap: 12px;
}
.date-tile {
  width: 46px;
  height: 50px;
  border-radius: 12px;
  flex: none;
  background: var(--grad);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow);
}
.date-tile b {
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}
.date-tile span {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 3px;
  opacity: 0.9;
}
.culture-list {
  display: grid;
  gap: 2px;
}
.avatar-blue {
  background: linear-gradient(135deg, #60a5fa, #2563eb) !important;
  color: #fff !important;
}
.overview-grid {
  margin-bottom: 14px;
}

.overview-culture-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.overview-culture-grid .culture-card {
  min-width: 0;
  margin: 0;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.overview-culture-grid .culture-card:nth-child(1) {
  border-top: 3px solid #4f46e5;
  background: linear-gradient(180deg, #f7f8ff 0%, var(--surface) 45%);
}
.overview-culture-grid .culture-card:nth-child(2) {
  border-top: 3px solid #0d9488;
  background: linear-gradient(180deg, #f3fcfb 0%, var(--surface) 45%);
}
.overview-culture-grid .culture-card:nth-child(3) {
  border-top: 3px solid #7c3aed;
  background: linear-gradient(180deg, #faf8ff 0%, var(--surface) 45%);
}
.overview-culture-grid .section-heading {
  margin-bottom: 10px;
}
.overview-culture-grid .section-heading h3 {
  font-size: 13.5px;
  margin: 4px 0 0;
}
.overview-culture-grid .eyebrow {
  font-size: 9px;
}
.overview-culture-grid .section-icon {
  font-size: 16px;
}
.overview-culture-grid .culture-card:nth-child(1) .section-icon {
  color: #4f46e5;
}
.overview-culture-grid .culture-card:nth-child(2) .section-icon {
  color: #0d9488;
}
.overview-culture-grid .culture-card:nth-child(3) .section-icon {
  color: #7c3aed;
}
.culture-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12px;
}
.culture-item:last-child {
  border-bottom: 0;
}
.culture-item strong,
.culture-item span {
  display: block;
}
.culture-item span,
.recognition-quote small {
  color: var(--text-dim);
  font-size: 10.5px;
  margin-top: 2px;
}
.recognition-feed {
  display: grid;
  gap: 6px;
}
.recognition-quote {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}
.recognition-quote:last-child {
  border-bottom: 0;
}
.recognition-quote p {
  font-size: 11.5px;
  line-height: 1.4;
  margin: 0;
  color: var(--text);
}
.culture-action {
  margin-top: 8px;
  font-size: 11px !important;
  padding: 6px 10px !important;
}

.timeline-update-card {
  font-size: 11px;
  padding: 10px 14px !important;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.timeline-update-card .eyebrow {
  font-size: 9px;
  margin-right: 2px;
}
.timeline-update-card strong {
  font-size: 11px;
}
.timeline-update-card > span:last-child {
  font-size: 10.5px;
  color: var(--text-dim);
}

.leave-holiday-card {
  max-width: 520px;
  margin-top: 16px;
}
.holiday-legend {
  font-size: 11px;
  color: var(--warn);
  font-weight: 600;
}
.holiday-calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
  font-size: 12px;
  font-weight: 600;
}
.holiday-weekdays,
.holiday-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  text-align: center;
}
.holiday-weekdays {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 800;
  margin-bottom: 5px;
}
.holiday-days span {
  display: grid;
  place-items: center;
  min-height: 32px;
  border-radius: 9px;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
}
.holiday-days .holiday-day {
  background: var(--warn-bg);
  border: 1px solid #fcd34d;
  color: var(--warn);
  font-weight: 800;
  cursor: help;
}
.holiday-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
  font-size: 11px;
  color: var(--text-dim);
}
.holiday-list span {
  padding: 4px 8px;
  background: var(--warn-bg);
  border-radius: 7px;
}
.holiday-list strong {
  color: var(--warn);
  margin-right: 3px;
}
.holiday-list small {
  color: var(--text-faint);
}

/* ============================================================================
   BADGES
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3.5px 11px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.badge .d {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.badge.ok {
  background: var(--ok-bg);
  color: #047857;
}
.badge.warn {
  background: var(--warn-bg);
  color: #92400e;
}
.badge.bad {
  background: var(--bad-bg);
  color: #b91c1c;
}
.badge.neutral {
  background: var(--neutral-bg);
  color: var(--text-dim);
}
.badge.info {
  background: var(--accent-soft);
  color: #4338ca;
}
.badge.violet {
  background: var(--violet-bg);
  color: #6d28d9;
}
.badge.role-admin,
.badge-tenant_admin {
  background: var(--violet-bg);
  color: #6d28d9;
}
.badge.role-manager {
  background: var(--accent-soft);
  color: #4338ca;
}
.badge.role-employee {
  background: var(--neutral-bg);
  color: var(--text-dim);
}
.badge-complete {
  background: var(--ok-bg);
  color: #047857;
}
.badge-pending {
  background: var(--warn-bg);
  color: #92400e;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: #4338ca;
  font-size: 11px;
  font-weight: 700;
}

/* ============================================================================
   LIST PIECES
   ========================================================================== */
.legend-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12.5px;
}
.legend-row:last-child {
  border-bottom: none;
}
.legend-row .lk {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.legend-row .sw {
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

.comp-item,
.row-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
}
.comp-item:last-child,
.row-item:last-child {
  border-bottom: none;
}
.row-item .who2 {
  display: flex;
  align-items: center;
  gap: 11px;
}
.row-item .initials {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}
.row-item .meta {
  color: var(--text-dim);
  font-size: 12px;
}

/* ============================================================================
   TOOLBARS / TABS
   ========================================================================== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 14px 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.people-toolbar {
  justify-content: space-between;
}
.toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}
.toolbar-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 118px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--grad);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  text-align: center;
  box-shadow: 0 6px 16px -8px rgba(79, 70, 229, 0.6);
}
.toolbar-actions .btn:hover {
  filter: brightness(1.08);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}
.search {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9.5px 13px;
  font: 600 13px var(--font-sans);
  color: var(--text);
  background: var(--bg);
  width: 260px;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
  background: #fff;
}
.search-wrap {
  position: relative;
}
.search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.45;
}
.search-wrap .search {
  padding-left: 36px;
}
.status_filter {
  width: auto;
}
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 7px 14px;
  border-radius: 99px;
  font: 700 12px var(--font-sans);
  color: var(--text-dim);
  cursor: pointer;
  transition: 0.15s ease;
}
.chip:hover {
  border-color: #cdd2e6;
  color: var(--text);
}
.chip.active {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--glow);
}
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-dim);
  margin-left: auto;
  font-weight: 600;
}
.toggle {
  width: 36px;
  height: 20px;
  background: #cdd2e6;
  border-radius: 99px;
  position: relative;
  cursor: pointer;
  transition: 0.15s ease;
}
.toggle .knob {
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: 0.15s ease;
}
.count-note {
  font-size: 12px;
  color: var(--text-faint);
  padding: 0 16px;
  font-weight: 600;
}

.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 8px 10px;
  box-shadow: var(--shadow-sm);
}
.tab {
  padding: 8px 15px;
  border-radius: 9px;
  font: 700 12.5px var(--font-sans);
  color: var(--text-dim);
  cursor: pointer;
  transition: 0.15s ease;
}
.tabs .tab {
  background: var(--grad);
  color: #fff;
  font: 700 12px var(--font-sans);
  text-decoration: none;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 12px -6px rgba(79, 70, 229, 0.55);
}
.tabs .tab:hover {
  filter: brightness(1.1);
  color: #fff;
  text-decoration: none;
}
.tabs .tab.active {
  background: linear-gradient(135deg, #4338ca, #3730a3);
  color: #fff;
}
.attendance-tabs,
.leave-tabs,
.resource-tabs {
  margin-bottom: 16px;
}
.tab .count {
  opacity: 0.75;
  margin-left: 4px;
}

/* ============================================================================
   TABLES
   ========================================================================== */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}
.toolbar + .table-wrap,
.tabs + .table-wrap {
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
}
.table-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.table-head h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 750px;
}
thead th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  font-weight: 800;
  padding: 11px 16px;
  background: #f8f9fd;
  border-bottom: 1px solid var(--border);
}
thead th.num,
td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
tbody td {
  padding: 12.5px 16px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
tbody tr:last-child td {
  border-bottom: none;
}
tbody tr {
  transition: background 0.12s ease;
}
tbody tr:hover {
  background: #f7f8ff;
}
.namecell {
  display: flex;
  align-items: center;
  gap: 11px;
}
.namecell .initials {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: var(--grad-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 800;
  flex: none;
}
.namecell .name {
  font-weight: 700;
}
.namecell .sub {
  font-size: 11.5px;
  color: var(--text-dim);
}
.code,
.mono {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 11.5px;
  color: var(--text-dim);
}
.actions,
.row-actions,
.reg-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}
.link-btn {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
}
.link-btn:hover {
  color: var(--brand-dark);
}
.link-btn.muted {
  color: var(--text-dim);
}
.type-pill {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  background: var(--neutral-bg);
  color: var(--text-dim);
}
.dates {
  font-size: 12.5px;
}
.dates .n {
  color: var(--text-dim);
  font-size: 11px;
}
.reason {
  font-size: 12px;
  color: var(--text-dim);
  max-width: 180px;
}
.row-actions button,
.reg-actions button {
  padding: 7px 13px;
  border-radius: 9px;
  font: 700 11.5px var(--font-sans);
  cursor: pointer;
  border: none;
  transition: 0.15s ease;
}
.row-actions .approve,
.reg-actions .approve {
  background: var(--ok-bg);
  color: #047857;
}
.row-actions .approve:hover,
.reg-actions .approve:hover {
  background: var(--ok);
  color: #fff;
}
.row-actions .reject,
.reg-actions .reject {
  background: var(--bad-bg);
  color: #b91c1c;
}
.row-actions .reject:hover,
.reg-actions .reject:hover {
  background: var(--bad);
  color: #fff;
}
.balance-note {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 2px;
}
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 16px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-dim);
  font-weight: 600;
}

/* ============================================================================
   PAYROLL
   ========================================================================== */
.payroll-stats {
  grid-template-columns: repeat(5, 1fr);
}
.payroll-chart-grid {
  grid-template-columns: 1.35fr 1fr;
}
.payroll-table {
  margin-bottom: 16px;
}
.payroll-table .table-head {
  align-items: center;
}
.payroll-table .table-head h3 {
  margin-top: 4px;
}
.table-scroll {
  overflow-x: auto;
}
.strong {
  font-weight: 700;
}
.empty-state {
  text-align: center;
  color: var(--text-faint);
  padding: 38px !important;
  font-weight: 600;
}
.payroll-quick-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 4px;
}
.quick-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: 0.16s ease;
}
.quick-link:hover {
  border-color: #c7cbe4;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  color: var(--text);
}
.quick-link-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--grad-soft);
  color: var(--accent);
  font-weight: 800;
  flex: none;
  font-size: 15px;
}
.quick-link strong,
.quick-link small {
  display: block;
}
.quick-link strong {
  font-size: 12.5px;
}
.quick-link small {
  color: var(--text-dim);
  font-size: 11px;
  margin-top: 3px;
}
.quick-arrow {
  margin-left: auto;
  color: var(--accent);
  font-size: 18px;
  transition: transform 0.15s ease;
}
.quick-link:hover .quick-arrow {
  transform: translateX(3px);
}
.kpi-link {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  transition: 0.15s ease;
}
.kpi-link:hover {
  background: var(--accent-soft);
  color: var(--brand-dark);
}

.reg-item {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.reg-item:last-child {
  border-bottom: none;
}
.reg-item .rtop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 3px;
}
.reg-item .rmeta {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.datepick {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font: 700 13px var(--font-sans);
  box-shadow: var(--shadow-sm);
}
.datepick svg {
  opacity: 0.5;
}

/* ============================================================================
   FORMS
   ========================================================================== */
.field {
  margin-bottom: 17px;
}
.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 7px;
  color: var(--text);
  letter-spacing: 0.01em;
}
.form-control {
  width: 100%;
}
input,
select,
textarea {
  width: 100%;
  padding: 10.5px 13px;
  border: 1px solid #d9dcea;
  border-radius: 10px;
  font: 600 13.5px var(--font-sans);
  background: #fbfbfe;
  color: var(--text);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}
input::placeholder,
textarea::placeholder {
  color: var(--text-faint);
  font-weight: 500;
}
input[type="checkbox"] {
  width: auto;
  padding: 0;
  accent-color: var(--accent);
}
input[type="radio"] {
  width: auto;
  accent-color: var(--accent);
}
input[type="file"] {
  padding: 9px 11px;
  font-size: 12px;
  background: var(--surface);
}
input[type="date"] {
  font-weight: 600;
}
input:hover,
select:hover,
textarea:hover {
  border-color: #c4c9e0;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px rgba(79, 70, 229, 0.14);
  background: #fff;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235c667c' stroke-width='2.5' 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 12px center;
  padding-right: 34px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 13px;
}
.child-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  margin-bottom: 10px;
}
.locked-field input,
.locked-field select {
  background: var(--neutral-bg);
  color: var(--text-dim);
}
.remove-child {
  white-space: nowrap;
}
.emp-checkbox {
  width: 16px;
  height: 16px;
}
.admin-form-card {
  max-width: 900px;
  margin-bottom: 20px;
}
.admin-form-card-secondary {
  margin-top: 24px;
}
.help-banner {
  max-width: 900px;
  margin-bottom: 16px;
  padding: 13px 16px;
  border: 1px solid #dbe0ff;
  border-radius: var(--radius);
  background: linear-gradient(120deg, #eef0fe, #f6f7ff);
  color: #3d4470;
  font-size: 12.5px;
  line-height: 1.6;
}
.help-banner a {
  color: var(--brand);
  font-weight: 700;
}
.hint {
  margin-top: 6px;
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.45;
}
.field > label {
  min-height: 16px;
}
.admin-form-card form > .btn,
.admin-form-card form > a.btn {
  margin-right: 8px;
  margin-top: 4px;
}

.salary-components-page {
  font-size: 12.5px;
}
.salary-components-page h3 {
  font-size: 15px;
}
.salary-components-page h4 {
  font-size: 13px;
  line-height: 1.35;
  margin: 18px 0 10px;
}
.salary-components-page label,
.salary-components-page strong {
  font-size: 12px;
}
.salary-components-page .card-sub {
  font-size: 12px;
}
.salary-components-page .list {
  font-size: 12px;
}
.salary-components-page .list th {
  font-size: 10px;
  padding: 9px 10px;
}
.salary-components-page .list td {
  font-size: 12px;
  padding: 9px 10px;
}
.salary-components-page input,
.salary-components-page select {
  font-size: 12px;
  padding: 8px 10px;
}
.salary-components-page .btn {
  font-size: 12px;
  padding: 8px 12px;
}

/* ============================================================================
   CARDS
   ========================================================================== */
.card,
.form-card,
.profile-card,
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.card h3,
.form-card h3,
.profile-card h3 {
  font-size: 15px;
  line-height: 1.3;
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.card-sub {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0 0 14px;
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}
.stat-card {
  margin: 0;
  padding: 17px 18px;
}
.stat-card .num {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.stat-card .lbl {
  font-size: 10.5px;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 8px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.dashboard-grid .card {
  margin: 0;
}
.dashboard-card {
  margin-bottom: 16px;
}
.dashboard-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  background:
    radial-gradient(
      560px 220px at 88% -30%,
      rgba(124, 58, 237, 0.16),
      transparent 65%
    ),
    radial-gradient(
      420px 200px at -5% 130%,
      rgba(79, 70, 229, 0.12),
      transparent 60%
    ),
    linear-gradient(120deg, #161c3d, #232a5c 60%, #2b3170);
  border-radius: 18px;
  color: #fff;
  padding: 30px 32px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.dashboard-hero h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 6px 0 8px;
  color: #fff;
}
.dashboard-hero p {
  margin: 0;
  color: #c6cdf2;
  font-size: 13.5px;
}
.dashboard-hero .eyebrow {
  color: #a5acf5;
}
.dashboard-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.dashboard-actions .btn-primary {
  background: #fff;
  color: #2a2f6b;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.4);
}
.dashboard-actions .btn-primary:hover {
  background: #f0f1ff;
  color: var(--brand-dark);
}
.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.overview-page {
  font-size: 13.5px;
}

.list {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.list th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  font-weight: 800;
  padding: 10px 12px;
  background: #f8f9fd;
  border-bottom: 1px solid var(--border);
}
.list td {
  padding: 11.5px 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.list tr:last-child td {
  border-bottom: none;
}
.list tr:hover td {
  background: #f7f8ff;
}

.resource-tabs {
  display: flex;
  gap: 4px;
  align-items: center;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.resource-tabs a {
  flex: none;
  padding: 8px 14px;
  border-radius: 9px;
  color: var(--text-dim);
  font: 700 12px var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  transition: 0.15s ease;
}
.resource-tabs a:hover {
  background: var(--neutral-bg);
  color: var(--text);
}
.resource-tabs a.active {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 12px -6px rgba(79, 70, 229, 0.55);
}
.reset-password-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.generate-reset-password {
  max-width: 190px;
}

/* ============================================================================
   FLASH MESSAGES
   ========================================================================== */
.flash {
  padding: 13px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-left-width: 4px;
}
.flash-success {
  background: var(--ok-bg);
  color: #047857;
  border-color: var(--ok-line);
  border-left-color: var(--ok);
}
.flash-danger {
  background: var(--bad-bg);
  color: #b91c1c;
  border-color: var(--bad-line);
  border-left-color: var(--bad);
}
.flash-warning {
  background: var(--warn-bg);
  color: #92400e;
  border-color: var(--warn-line);
  border-left-color: var(--warn);
}
.flash-info {
  background: var(--accent-soft);
  color: #4338ca;
  border-color: #d9defc;
  border-left-color: var(--accent);
}

/* ============================================================================
   PROFILE
   ========================================================================== */
.profile-header {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.avatar-circle {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  flex: none;
  background: var(--grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  box-shadow: var(--glow);
}
.profile-photo {
  object-fit: cover;
  border: 1px solid var(--border);
}
.pname {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.pmeta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--text-dim);
  font-size: 12.5px;
  margin-top: 5px;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 22px;
}
.pi-label {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}
.pi-value {
  font-size: 13.5px;
  font-weight: 600;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

/* ============================================================================
   HR RESOURCES / LETTERS / MEETINGS / MEMORIES
   ========================================================================== */
.resource-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background:
    linear-gradient(
      120deg,
      rgba(13, 148, 136, 0.1),
      rgba(79, 70, 229, 0.08) 60%,
      transparent
    ),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.resource-hero h1 {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 6px 0;
}
.resource-hero p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
}
.resource-search-card {
  margin-bottom: 16px;
}
.search-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.resource-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.resource-list {
  display: grid;
  gap: 10px;
}
.resource-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: 0.15s ease;
}
.resource-row:hover {
  border-color: #c7cbe4;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.resource-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  flex: none;
  background: var(--grad-soft);
  color: var(--accent);
  font-size: 16px;
  font-weight: 800;
}
.admin-resource-card {
  border-top: 3px solid var(--teal);
}
.letter-list {
  display: grid;
  gap: 10px;
}
.letter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}
.letter-ref {
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 700;
}
.letter-recipient {
  font-size: 12.5px;
  font-weight: 600;
}
.letter-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.letter-body {
  white-space: pre-wrap;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text);
}
.official-letter {
  max-width: 820px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 46px;
  box-shadow: var(--shadow);
}
.policy-answer-box {
  background: var(--accent-soft);
  border: 1px solid #d9defc;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 12.5px;
  color: #3d4470;
  margin-top: 12px;
}
.template-editor {
  min-height: 220px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px;
  font-weight: 500;
}
.meeting-list {
  display: grid;
  gap: 10px;
}
.meeting-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}
.meeting-date {
  width: 52px;
  height: 54px;
  border-radius: 13px;
  flex: none;
  background: var(--grad);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow);
}
.meeting-date b {
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
}
.meeting-date span {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 3px;
  opacity: 0.9;
}
.memory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.memory-card {
  margin: 0;
  overflow: hidden;
  padding: 0;
}
.memory-copy {
  padding: 14px 16px;
}
.memory-placeholder {
  height: 150px;
  border-radius: 12px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #eceef8, #f6f7fc);
  display: grid;
  place-items: center;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 600;
}
.memory-upload {
  margin-top: 10px;
}
.calculator-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.calculator-card {
  margin: 0;
}
.calculator-result {
  margin-top: 12px;
  padding: 13px 15px;
  border-radius: 12px;
  background: var(--ok-bg);
  border: 1px solid var(--ok-line);
  color: #047857;
  font-weight: 800;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* ============================================================================
   LOGIN SCREEN
   ========================================================================== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--bg);
  background-image: var(--bg-tint);
}
.login-wrap {
  width: 100%;
  max-width: 980px;
  min-height: 620px;
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.login-art {
  flex: 1;
  position: relative;
  color: #fff;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(
      120% 90% at 85% -10%,
      rgba(109, 109, 248, 0.65),
      transparent 55%
    ),
    radial-gradient(
      90% 75% at -10% 105%,
      rgba(13, 148, 136, 0.45),
      transparent 55%
    ),
    radial-gradient(
      70% 60% at 110% 80%,
      rgba(124, 58, 237, 0.4),
      transparent 60%
    ),
    linear-gradient(160deg, #0d1227 0%, #1a1f44 100%);
}
.login-art::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.14) 1px,
    transparent 1px
  );
  background-size: 26px 26px;
  opacity: 0.35;
}
.login-art > * {
  position: relative;
}
.login-art .mark2 {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
}
.art-mid {
  margin: auto 0;
}
.login-art h2 {
  font-size: 27px;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: -0.02em;
  max-width: 340px;
  margin: 0 0 24px;
}
.login-art h2 em {
  font-style: normal;
  background: linear-gradient(90deg, #a5b4fc, #67e8f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.art-points {
  display: grid;
  gap: 10px;
}
.art-point {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: #d3d9f6;
}
.art-point i {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  flex: none;
  font-style: normal;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
}
.login-art .foot {
  font-size: 12px;
  opacity: 0.75;
  font-weight: 600;
}
.login-form {
  width: 440px;
  padding: 56px 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-form h1 {
  font-size: 24px;
  margin: 0 0 6px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.login-form p.sub {
  color: var(--text-dim);
  font-size: 13px;
  margin: 0 0 28px;
}
.lfield {
  margin-bottom: 18px;
}
.lfield label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 7px;
  color: var(--text);
  letter-spacing: 0.01em;
}
.lfield input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d9dcea;
  border-radius: 11px;
  font: 600 13.5px var(--font-sans);
  background: #fbfbfe;
}
.lfield input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px rgba(79, 70, 229, 0.14);
  background: #fff;
}
.login-btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 11px;
  background: var(--grad);
  color: #fff;
  font: 800 13.5px var(--font-sans);
  letter-spacing: 0.02em;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: var(--glow);
  transition:
    filter 0.15s ease,
    transform 0.15s ease;
}
.login-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.login-note {
  font-size: 11.5px;
  color: var(--text-faint);
  text-align: center;
  margin-top: 20px;
  font-weight: 500;
}

/* ============================================================================
   AUTH (change password / error) — standalone pages
   ========================================================================== */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  background-image: var(--bg-tint);
}
.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 38px 40px;
  box-shadow: var(--shadow-lg);
}
.auth-mark {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 20px;
}
.brand-blue-dot {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  flex: none;
  background: var(--grad);
  box-shadow: var(--glow);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}
.brand-blue-dot::after {
  content: "S";
}
.auth-mark .word {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.01em;
  display: block;
}
.auth-mark-sub {
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.auth-sub {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 22px;
}
.auth-card h1 {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
  margin: 14px 0 6px;
  line-height: 1;
}

/* ============================================================================
   PRINT / MISC
   ========================================================================== */
.no-print {
  display: revert;
}
@media print {
  .no-print {
    display: none !important;
  }
  .side,
  .topbar,
  .flash {
    display: none !important;
  }
  .shell {
    grid-template-columns: 1fr;
  }
  body {
    background: #fff;
  }
}

@media (max-width: 1080px) {
  .shell {
    grid-template-columns: 206px 1fr;
  }
  .main {
    padding: 22px 22px 48px;
  }
}
@media (max-width: 760px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .side {
    display: none;
  }
  .stats,
  .payroll-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .grid2,
  .panels,
  .grid3,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .community-layout,
  .resource-columns,
  .memory-grid,
  .calculator-grid {
    grid-template-columns: 1fr;
  }
  .page-actions {
    align-items: flex-start;
    flex-direction: column;
  }
  .people-toolbar {
    align-items: stretch;
  }
  .people-toolbar .search-wrap,
  .people-toolbar .search {
    width: 100%;
  }
  .toolbar-actions {
    width: 100%;
    justify-content: stretch;
  }
  .toolbar-actions .btn {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }
  .payroll-quick-links {
    grid-template-columns: 1fr;
  }
  .appraisal-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .recruitment-metric-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .analytics-kpis,
  .analytics-chart-grid,
  .analytics-narrative-grid {
    grid-template-columns: 1fr;
  }
  .overview-culture-grid {
    grid-template-columns: 1fr;
  }
  .matrix-intro {
    align-items: flex-start;
    flex-direction: column;
  }
  .matrix-grid {
    grid-template-columns: 1fr;
  }
  .matrix-x-label {
    display: none;
  }
  .profile-grid {
    grid-template-columns: 1fr 1fr;
  }
  .login-form {
    width: 100%;
    padding: 40px 28px;
  }
}
@media (max-width: 620px) {
  .login-art {
    display: none;
  }
  .login-form {
    width: 100%;
  }
  .auth-card {
    padding: 28px 22px;
  }
}

/* ---- Mobile menu (phones) ---- */
.menu-toggle {
  display: none;
}
.side-backdrop {
  display: none;
}
@media (max-width: 760px) {
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 12px;
    flex: none;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 10px;
    background: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #0f172a;
  }
  .side {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    max-width: 82vw;
    overflow-y: auto;
    z-index: 1001;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
  }
  body.nav-open .side {
    transform: translateX(0);
  }
  body.nav-open .side-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1000;
  }
  body.nav-open {
    overflow: hidden;
  }
}

/* Reusable modal */
.modal-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(13, 18, 39, 0.55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay[hidden] { display: none; }
body.modal-open { overflow: hidden; }
.modal-dialog { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 760px; max-height: 90vh; display: flex; flex-direction: column; outline: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-title { margin: 0; font-size: 16px; color: var(--text); }
.modal-close { border: none; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; color: var(--text-dim); padding: 0 6px; border-radius: 6px; }
.modal-close:hover { color: var(--text); background: var(--neutral-bg); }
.modal-close:focus-visible { outline: 2px solid var(--brand); }
.modal-body { padding: 16px 18px; overflow: auto; }
.modal-loading, .modal-error { color: var(--text-dim); }
.modal-error { color: var(--bad); }
tr[data-modal-url] { cursor: pointer; }
@media (max-width: 640px) {
  .modal-overlay { padding: 0; align-items: stretch; }
  .modal-dialog { max-width: none; max-height: none; height: 100%; border-radius: 0; }
}

/* Stop touchpad swipes from navigating back; contain horizontal scroll inside tables. */
html, body { overscroll-behavior-x: none; }
.table-wrap, .table-scroll, .resource-tabs, [style*="overflow-x"] { overscroll-behavior-x: contain; }
