/* Broadwing HR — design tokens, layout and components. Light and dark themes. */

:root {
  /* Broadwing blue */
  --brand: #1f72a6;
  --brand-600: #175f8c;
  --brand-ink: #ffffff;
  --brand-soft: #e5f0f8;
  --brand-softer: #f2f8fc;
  --bw-bar: linear-gradient(90deg, #17669a 0%, #2479ad 45%, #5f9fc4 100%);

  --bg: #f6f7fb;
  --panel: #ffffff;
  --panel-2: #f9fafc;
  --line: #e6e8ef;
  --line-2: #eef0f5;
  --text: #111827;
  --text-2: #374151;
  --muted: #6b7280;
  --faint: #9ca3af;

  --side-bg: linear-gradient(180deg, #125a8a 0%, #0e4c76 55%, #0b3f63 100%);
  --side-text: #d7e8f4;
  --side-muted: #8fb6d3;
  --side-active: rgba(255, 255, 255, .14);
  --side-accent: #9fd3f2;

  --ok: #15803d;      --ok-soft: #dcfce7;
  --warn: #b45309;    --warn-soft: #fef3c7;
  --bad: #b91c1c;     --bad-soft: #fee2e2;
  --info: #1d4ed8;    --info-soft: #dbeafe;
  --violet: #6d28d9;  --violet-soft: #ede9fe;
  --grey-soft: #f1f5f9;

  --focus: 0 0 0 3px rgba(31, 114, 166, .28);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 4px 12px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .16), 0 2px 6px rgba(16, 24, 40, .08);
  --radius: 12px;
  --radius-sm: 8px;
  --side-w: 248px;
  --top-h: 60px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #63addb; --brand-600: #3f93c6; --brand-ink: #06121c; --brand-soft: #0f2c40; --brand-softer: #0c2232;
    --bg: #0b1020; --panel: #121a2e; --panel-2: #0f1628; --line: #24304a; --line-2: #1b2540;
    --text: #e5e7eb; --text-2: #cbd5e1; --muted: #94a3b8; --faint: #64748b;
    --side-bg: linear-gradient(180deg, #0c3b5c 0%, #082b45 100%); --side-active: rgba(255, 255, 255, .1); --bw-bar: linear-gradient(90deg, #0f4f7a 0%, #17669a 50%, #3f84ad 100%); --bw-start: #0f4f7a;
    --ok: #4ade80; --ok-soft: #052e16; --warn: #fbbf24; --warn-soft: #3b2405; --bad: #f87171; --bad-soft: #3f0d0d;
    --info: #60a5fa; --info-soft: #0c2346; --violet: #c4b5fd; --violet-soft: #2a1c55; --grey-soft: #1b2540;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 4px 12px rgba(0, 0, 0, .3); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #63addb; --brand-600: #3f93c6; --brand-ink: #06121c; --brand-soft: #0f2c40; --brand-softer: #0c2232;
  --bg: #0b1020; --panel: #121a2e; --panel-2: #0f1628; --line: #24304a; --line-2: #1b2540;
  --text: #e5e7eb; --text-2: #cbd5e1; --muted: #94a3b8; --faint: #64748b;
  --side-bg: linear-gradient(180deg, #0c3b5c 0%, #082b45 100%); --side-active: rgba(255, 255, 255, .1); --bw-bar: linear-gradient(90deg, #0f4f7a 0%, #17669a 50%, #3f84ad 100%); --bw-start: #0f4f7a;
  --ok: #4ade80; --ok-soft: #052e16; --warn: #fbbf24; --warn-soft: #3b2405; --bad: #f87171; --bad-soft: #3f0d0d;
  --info: #60a5fa; --info-soft: #0c2346; --violet: #c4b5fd; --violet-soft: #2a1c55; --grey-soft: #1b2540;
  --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 4px 12px rgba(0, 0, 0, .3); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 8px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side {
  background: var(--side-bg); color: var(--side-text); position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; overflow: hidden; z-index: 30;
}
.side-head { padding: 0 0 12px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.brand {
  height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 18px; color: #fff;
  background: var(--bw-start, #17669a); box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .08);
}
.brand-mark { width: 34px; height: 24px; flex: none; display: block; }
.brand-name { font-weight: 300; font-size: 16px; letter-spacing: .08em; text-transform: uppercase; line-height: 1; white-space: nowrap; }
.brand-name b { font-weight: 600; letter-spacing: .04em; margin-left: 6px; padding: 2px 6px; border-radius: 5px; background: rgba(255, 255, 255, .16); font-size: 11px; vertical-align: 2px; }
.org-switch {
  margin: 12px 12px 0; width: calc(100% - 24px); display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); border-radius: 10px; padding: 8px 10px; color: #e2e8f0;
}
.org-switch:hover { background: rgba(255, 255, 255, .09); }
.org-logo { width: 26px; height: 26px; border-radius: 7px; background: rgba(255, 255, 255, .18); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; overflow: hidden; }
.org-logo img { width: 100%; height: 100%; object-fit: cover; }
.side-nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent; }
.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 2px; }
.nav-label { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--side-muted); padding: 0 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--side-text);
  font-weight: 500; text-decoration: none !important; position: relative; margin-bottom: 1px;
}
.nav-item svg { opacity: .8; flex: none; }
.nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-item.active { background: var(--side-active); color: #fff; }
.nav-item.active::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--side-accent); }
.nav-item.active svg { opacity: 1; color: var(--side-accent); }
.nav-count { margin-left: auto; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 0 7px; line-height: 18px; }
.side-foot { padding: 10px; border-top: 1px solid rgba(255, 255, 255, .06); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 24px; position: sticky; top: 0; z-index: 20;
  background: var(--bw-bar); color: #fff; box-shadow: 0 1px 3px rgba(11, 63, 99, .25);
}
.topbar .icon-btn, .topbar .user-chip { color: #fff; }
.topbar .icon-btn:hover, .topbar .user-chip:hover { background: rgba(255, 255, 255, .16); border-color: transparent; }
.topbar .icon-btn .dot { border-color: #2479ad; }
.topbar .user-chip .avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
.topbar-brand { display: none; align-items: center; gap: 8px; color: #fff; }
.topbar-brand img { width: 30px; height: 21px; }
.topbar .menu-btn { display: none; }
.search {
  display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 0 10px; height: 36px; width: min(380px, 40vw); color: var(--muted); position: relative;
}
.search-wrap { position: relative; }
.search.search-pop { position: absolute; right: 0; top: 44px; width: min(380px, calc(100vw - 32px)); z-index: 60; box-shadow: var(--shadow-lg); }
.search.search-pop.hidden { display: none; }
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; color: var(--text); }
.search-results {
  position: absolute; top: 40px; left: 0; right: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: 6px; max-height: 360px; overflow: auto; z-index: 50;
}
.search-results a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; color: var(--text); text-decoration: none; }
.search-results a:hover, .search-results a.sel { background: var(--brand-soft); }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 1px solid transparent; background: transparent;
  color: var(--text-2); cursor: pointer; position: relative; flex: none;
}
.icon-btn:hover { background: var(--panel); border-color: var(--line); }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; border-radius: 99px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--bg); }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 3px 8px 3px 3px; border-radius: 99px; cursor: pointer; border: 1px solid transparent; background: none; }
.user-chip:hover { background: var(--panel); border-color: var(--line); }

.content { padding: 24px; max-width: 1440px; width: 100%; margin: 0 auto; flex: 1; }
.content.wide { max-width: none; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .titles { flex: 1; min-width: 220px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.crumbs a { color: var(--muted); }

.bottom-nav { display: none; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text); font-weight: 550; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-sm); text-decoration: none !important; transition: background .12s, border-color .12s, transform .05s;
}
.btn:hover { background: var(--panel-2); border-color: #d5d9e3; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ok.solid { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--grey-soft); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 7px; gap: 4px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn-group { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--panel); }
.btn-group button { border: 0; background: none; padding: 0 12px; height: 32px; cursor: pointer; color: var(--muted); font-weight: 550; }
.btn-group button.on { background: var(--brand-soft); color: var(--brand); }
.btn-group button + button { border-left: 1px solid var(--line); }

/* ---------------------------------------------------------------- cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); min-height: 52px; }
.card-head h2, .card-head h3 { flex: 1; }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }
.card + .card { margin-top: 16px; }
.grid > .card + .card, .col > .card + .card, .row > .card + .card { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 1fr) 340px; }
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 550; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .hint { font-size: 12px; color: var(--muted); }
.stat .stat-icon { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line-2); }
.list > li:last-child { border-bottom: 0; }
.list > li.click { cursor: pointer; }
.list > li.click:hover { background: var(--panel-2); }
.kv { margin: 0; display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- badges & avatars */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 600;
  background: var(--grey-soft); color: var(--text-2); white-space: nowrap;
}
.badge.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; overflow: hidden;
  font-size: 12.5px; font-weight: 700; color: #fff; background: var(--brand); letter-spacing: .02em; user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.avatar.xl { width: 84px; height: 84px; font-size: 28px; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .who { min-width: 0; }
.person .who .name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .who .meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; border: 1px solid var(--line); font-size: 12.5px; background: var(--panel); }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }

/* ---------------------------------------------------------------- forms */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form.one { grid-template-columns: 1fr; }
.form .full { grid-column: 1 / -1; }
.form-section { grid-column: 1 / -1; font-weight: 650; font-size: 13px; color: var(--text-2); padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--line-2); display: flex; align-items: center; gap: 8px; }
.form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field > label .req { color: var(--bad); }
.field .help { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--bad); }
.input, select.input, textarea.input {
  width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel);
  color: var(--text); transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; min-height: 80px; padding: 9px 11px; resize: vertical; }
.input:hover { border-color: #cfd4df; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.input.invalid { border-color: var(--bad); }
.input.sm { height: 32px; font-size: 13px; }
select.input { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; padding: 4px 0; }
.check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.check .sub { font-size: 12px; color: var(--muted); }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 9px 0 0 9px; }
.input-group .addon { border: 1px solid var(--line); border-left: 0; border-radius: 0 9px 9px 0; padding: 0 10px; display: grid; place-items: center; color: var(--muted); background: var(--panel-2); font-size: 13px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { width: auto; }
.seg { display: inline-flex; gap: 4px; padding: 3px; background: var(--grey-soft); border-radius: 10px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); }
.days-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.days-picker label { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; height: 34px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); user-select: none; }
.days-picker input { display: none; }
.days-picker input:checked + span { color: var(--brand); }
.days-picker label:has(input:checked) { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover td { background: var(--brand-softer); }
.table .num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tfoot td { font-weight: 700; background: var(--panel-2); border-top: 1px solid var(--line); }
.table.compact td { padding: 7px 12px; }
.table-foot { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button {
  padding: 10px 14px; border: 0; background: none; color: var(--muted); font-weight: 600; cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none !important; display: inline-flex; align-items: center; gap: 7px;
}
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs .on { color: var(--brand); border-bottom-color: var(--brand); }
.tabs .count { background: var(--grey-soft); color: var(--text-2); border-radius: 99px; font-size: 11px; padding: 0 7px; line-height: 18px; }
.tabs .on .count { background: var(--brand-soft); color: var(--brand); }

/* ---------------------------------------------------------------- modal, toast, menus */
.overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: grid; place-items: center; padding: 20px; z-index: 100; animation: fade .12s ease-out; }
.modal { background: var(--panel); border-radius: 16px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop .14s ease-out; }
.modal.lg { width: min(820px, 100%); }
.modal.xl { width: min(1100px, 100%); }
.modal.sm { width: min(420px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 12px; }
.modal-head h2 { flex: 1; }
.modal-body { padding: 4px 20px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-2); background: var(--panel-2); border-radius: 0 0 16px 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 11px; background: #0f172a; color: #fff;
  box-shadow: var(--shadow-lg); min-width: 260px; max-width: 420px; animation: pop .15s ease-out; font-weight: 500;
}
.toast.bad { background: #991b1b; }
.toast.ok svg { color: #4ade80; }
.toast.pending { background: #92400e; }
.toast.pending svg { color: #fde68a; }
.menu { position: fixed; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 220px; z-index: 150; animation: pop .1s ease-out; }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--text); text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--grey-soft); }
.menu .sep { height: 1px; background: var(--line-2); margin: 5px 0; }
.menu .head { padding: 8px 10px; font-size: 12px; color: var(--muted); }
.menu .danger { color: var(--bad); }

/* ---------------------------------------------------------------- states */
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .empty-icon { width: 52px; height: 52px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 14px; }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
.loading { display: grid; place-items: center; padding: 60px; }
@keyframes spin { to { transform: rotate(360deg); } }
.alert { display: flex; gap: 10px; padding: 11px 14px; border-radius: 10px; background: var(--info-soft); color: var(--info); font-weight: 500; align-items: flex-start; }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert svg { flex: none; margin-top: 2px; }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }

/* ---------------------------------------------------------------- sign-in */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art {
  background: radial-gradient(900px 600px at 110% 110%, rgba(134, 185, 214, .55) 0%, transparent 60%), linear-gradient(135deg, #0b4a75 0%, #17669a 50%, #3f8bb8 100%);
  color: #e2e8f0; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth-art h1 { font-size: 38px; line-height: 1.12; color: #fff; max-width: 520px; letter-spacing: -.02em; }
.auth-art p { font-size: 16px; color: #d7e8f4; max-width: 480px; margin-top: 14px; }
.auth-feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 560px; }
.auth-feat { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; font-weight: 500; }
.auth-feat svg { color: #b9def3; flex: none; }
.auth-art .brand { background: none; box-shadow: none; padding: 0; height: auto; }
.auth-art .brand-mark { width: 46px; height: 32px; }
.auth-art .brand-name { font-size: 20px; }
.auth-form { display: grid; place-items: center; padding: 32px; }
.auth-box { width: min(400px, 100%); }
.auth-box h2 { font-size: 24px; margin-bottom: 6px; }

/* ---------------------------------------------------------------- employee profile */
.profile-hero { display: flex; gap: 18px; align-items: center; padding: 20px; }
.profile-hero .facts { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 6px; }
.profile-hero .facts span { display: inline-flex; gap: 6px; align-items: center; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 18px 14px; }
.timeline li::before { content: ''; position: absolute; left: -25px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--panel); border: 3px solid var(--brand); }
.timeline .when { font-size: 12px; color: var(--muted); }
.progress { height: 8px; border-radius: 99px; background: var(--grey-soft); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--brand); }

/* ---------------------------------------------------------------- organogram */
.org-page { display: grid; grid-template-columns: 290px 1fr; height: calc(100vh - var(--top-h) - 140px); min-height: 520px; gap: 0; }
.org-page.no-side { grid-template-columns: 1fr; }
.org-tray { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-radius: var(--radius) 0 0 var(--radius); }
.org-tray-head { padding: 12px; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 8px; }
.org-tray-list { overflow-y: auto; padding: 8px; flex: 1; }
.tray-item { user-select: none; -webkit-user-select: none; display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 9px; cursor: grab; border: 1px solid transparent; }
.tray-item:hover { background: var(--panel-2); border-color: var(--line); }
.tray-item .top-tag { font-size: 10.5px; font-weight: 700; color: var(--brand); background: var(--brand-soft); border-radius: 99px; padding: 0 7px; }
.org-canvas {
  user-select: none; -webkit-user-select: none;
  position: relative; overflow: hidden; background-color: var(--panel-2); cursor: grab; touch-action: none;
  background-image: radial-gradient(circle, color-mix(in srgb, var(--faint) 45%, transparent) 1px, transparent 1px); background-size: 22px 22px;
  border-radius: 0 var(--radius) var(--radius) 0; border: 1px solid var(--line); border-left: 0;
}
.org-page.no-side .org-canvas { border-left: 1px solid var(--line); border-radius: var(--radius); }
.org-canvas.panning { cursor: grabbing; }
.org-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.org-lines { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.org-lines path { fill: none; stroke: color-mix(in srgb, var(--faint) 80%, transparent); stroke-width: 1.6; }
.org-node {
  position: absolute; width: 220px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  padding: 12px 12px 10px; cursor: grab; user-select: none; transition: box-shadow .15s, border-color .15s, transform .15s;
}
.org-node:hover { box-shadow: var(--shadow-lg); }
.org-node .bar { position: absolute; left: 0; top: 0; right: 0; height: 4px; border-radius: 14px 14px 0 0; }
.org-node .nm { font-weight: 650; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-node .ds { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-node .ft { display: flex; align-items: center; gap: 6px; margin-top: 9px; font-size: 11.5px; color: var(--muted); }
.org-node .toggle { margin-left: auto; border: 1px solid var(--line); background: var(--panel-2); border-radius: 99px; padding: 0 8px; height: 20px; font-size: 11px; font-weight: 700; cursor: pointer; color: var(--text-2); display: inline-flex; align-items: center; gap: 3px; }
.org-node.drop-target { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 25%, transparent), var(--shadow-lg); transform: scale(1.03); }
.org-node.dragging { opacity: .35; }
.org-node.self { border-color: var(--brand); }
.org-node.highlight { animation: glow 1.6s ease-out 2; }
.org-node.section { background: color-mix(in srgb, var(--panel-2) 60%, var(--panel)); border-style: dashed; }
.org-node .kind-tag { margin-left: auto; font-size: 10.5px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 0 7px; }
.org-stage.dragging-section .org-node.section, .org-stage.dragging-dept .org-node.section { opacity: .4 !important; }
.strength { display: inline-flex; align-items: center; gap: 5px; font-weight: 650; color: var(--text-2); }
.strength .note { font-size: 10.5px; font-weight: 700; border-radius: 99px; padding: 0 6px; }
.strength.under .note { color: var(--warn); background: var(--warn-soft); }
.strength.over .note { color: var(--bad); background: var(--bad-soft); }
.strength.full .note { color: var(--ok); background: var(--ok-soft); }
.avatar.xs { width: 22px; height: 22px; font-size: 9.5px; flex: none; }
.avatar.sec { background: var(--panel) !important; border: 1.5px dashed; border-radius: 8px; }
.tray-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 8px 4px; }
.tray-group:first-child { padding-top: 2px; }
.choice { text-align: left; width: 100%; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 10px 12px; cursor: pointer; color: var(--text); font: inherit; }
.choice:hover { border-color: var(--brand); background: var(--brand-soft); }
@keyframes glow { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 60%, transparent); } 100% { box-shadow: 0 0 0 16px transparent; } }
.org-ghost { position: fixed; pointer-events: none; z-index: 300; width: 220px; opacity: .92; transform: rotate(-2deg); box-shadow: var(--shadow-lg); }
.org-controls { position: absolute; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.org-controls button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center; color: var(--text-2); }
.org-controls button:hover { color: var(--brand); }
.org-root-drop {
  position: absolute; left: 14px; top: 14px; z-index: 5; padding: 10px 14px; border: 2px dashed var(--line); border-radius: 12px; background: var(--panel);
  color: var(--muted); font-weight: 600; font-size: 12.5px; display: none; align-items: center; gap: 8px;
}
.org-root-drop.show { display: flex; }
.org-root-drop.over { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.org-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; font-size: 12.5px; color: var(--muted); box-shadow: var(--shadow); z-index: 4; white-space: nowrap; }
.org-detail { position: absolute; right: 14px; top: 14px; width: 300px; z-index: 6; }

/* ---------------------------------------------------------------- attendance */
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.sheet { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.sheet th, .sheet td { border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); padding: 0; text-align: center; }
.sheet th { position: sticky; top: 0; background: var(--panel-2); z-index: 2; font-weight: 600; color: var(--muted); padding: 6px 0; min-width: 30px; }
.sheet th.we { color: var(--faint); }
.sheet .name-col { position: sticky; left: 0; background: var(--panel); z-index: 3; text-align: left; padding: 6px 12px; min-width: 200px; max-width: 220px; border-right: 1px solid var(--line); }
.sheet th.name-col { z-index: 4; background: var(--panel-2); }
.sheet .cell { width: 30px; height: 32px; display: grid; place-items: center; font-weight: 700; font-size: 11px; cursor: pointer; }
.sheet .cell:hover { outline: 2px solid var(--brand); outline-offset: -2px; }
.sheet .sum { padding: 0 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-present { background: color-mix(in srgb, #22c55e 18%, transparent); color: #15803d; }
.st-late { background: color-mix(in srgb, #f59e0b 22%, transparent); color: #b45309; }
.st-absent { background: color-mix(in srgb, #ef4444 18%, transparent); color: #b91c1c; }
.st-half_day, .st-half_leave { background: color-mix(in srgb, #f97316 18%, transparent); color: #c2410c; }
.st-leave { background: color-mix(in srgb, #3b82f6 18%, transparent); color: #1d4ed8; }
.st-holiday { background: color-mix(in srgb, #8b5cf6 16%, transparent); color: #6d28d9; }
.st-weekend, .st-off { background: var(--grey-soft); color: var(--faint); }
.st-missing { background: color-mix(in srgb, #eab308 25%, transparent); color: #854d0e; }
.st-not_employed, .st-none { background: transparent; color: var(--faint); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 10px; }

/* ---------------------------------------------------------------- check-in (phone) */
.clock-card { text-align: center; padding: 28px 20px; background: linear-gradient(160deg, var(--brand-soft), var(--panel) 70%); }
.clock-time { font-size: 46px; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.clock-date { color: var(--muted); font-weight: 500; }
.punch-btn {
  width: 168px; height: 168px; border-radius: 50%; border: 0; margin: 22px auto 10px; display: grid; place-items: center; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #86b9d6, var(--brand) 60%, #0b4a75); color: #fff; font-size: 17px; font-weight: 700;
  box-shadow: 0 14px 30px rgba(31, 114, 166, .35), inset 0 -6px 14px rgba(0, 0, 0, .18); position: relative;
}
.punch-btn.out { background: radial-gradient(circle at 35% 30%, #fb7185, #e11d48 60%, #9f1239); box-shadow: 0 14px 30px rgba(225, 29, 72, .35), inset 0 -6px 14px rgba(0, 0, 0, .18); }
.punch-btn:disabled { filter: grayscale(.6); opacity: .7; cursor: not-allowed; }
.punch-btn::after { content: ''; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--brand) 30%, transparent); }
.punch-btn span { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.geo-status { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 99px; font-weight: 600; font-size: 13px; }
.map { height: 260px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); z-index: 0; }
.map.tall { height: 360px; }

/* ---------------------------------------------------------------- calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 104px; padding: 6px; background: var(--panel); min-width: 0; }
.cal .dow { min-height: 0; padding: 8px; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--panel-2); }
.cal .other { background: var(--panel-2); color: var(--faint); }
.cal .today .d { background: var(--brand); color: #fff; border-radius: 99px; padding: 0 7px; }
.cal .d { font-weight: 650; font-size: 12.5px; display: inline-block; margin-bottom: 4px; }
.cal .ev { font-size: 11.5px; border-radius: 6px; padding: 2px 6px; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.cal .ev.pending { opacity: .65; border: 1px dashed currentColor; }
.cal .hol { background: var(--violet-soft); color: var(--violet); }

/* ---------------------------------------------------------------- payslip */
.payslip { max-width: 820px; margin: 0 auto; background: #fff; color: #111827; border-radius: 14px; border: 1px solid #e5e7eb; padding: 32px; box-shadow: var(--shadow); }
.payslip h1 { font-size: 20px; }
.payslip .ps-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; border-bottom: 2px solid #111827; padding-bottom: 16px; margin-bottom: 16px; }
.payslip .ps-logo { max-height: 48px; max-width: 160px; margin-bottom: 8px; }
.payslip .ps-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 24px; font-size: 13px; margin-bottom: 16px; }
.payslip .ps-grid div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dotted #e5e7eb; padding: 3px 0; }
.payslip .ps-grid span:first-child { color: #6b7280; }
.payslip table { width: 100%; border-collapse: collapse; font-size: 13px; }
.payslip th { text-align: left; background: #f3f4f6; padding: 7px 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #374151; }
.payslip td { padding: 7px 10px; border-bottom: 1px solid #f3f4f6; }
.payslip td.amt, .payslip th.amt { text-align: right; font-variant-numeric: tabular-nums; }
.payslip .ps-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.payslip .ps-net { margin-top: 18px; display: flex; justify-content: space-between; align-items: center; background: #eef2ff; border-radius: 10px; padding: 14px 18px; font-size: 18px; font-weight: 750; color: #3730a3; }
.payslip .ps-foot { margin-top: 22px; font-size: 11.5px; color: #6b7280; display: flex; justify-content: space-between; }

/* ---------------------------------------------------------------- misc */
.kbd { font: 11px ui-monospace, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; color: var(--muted); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.code-box { background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; font-family: ui-monospace, monospace; font-size: 12.5px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps div { flex: 1; height: 5px; border-radius: 99px; background: var(--grey-soft); }
.steps div.on { background: var(--brand); }
.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 36px; gap: 10px; align-items: center; font-size: 13px; }
.bar-track { height: 10px; background: var(--grey-soft); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chain .step { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); font-size: 12px; font-weight: 600; }
.chain .step.done { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chain .step.now { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chain .step.rejected { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chain .step.skipped { opacity: .5; text-decoration: line-through; }
.drop-zone { border: 2px dashed var(--line); border-radius: 12px; padding: 26px; text-align: center; color: var(--muted); cursor: pointer; }
.drop-zone.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { position: sticky; top: calc(var(--top-h) + 20px); display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { padding: 8px 12px; border-radius: 8px; color: var(--text-2); font-weight: 550; text-decoration: none; display: flex; align-items: center; gap: 9px; }
.settings-nav a:hover { background: var(--panel); }
.settings-nav a.on { background: var(--brand-soft); color: var(--brand); }
.settings-nav .grp { font-size: 10.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 12px 12px 4px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-side { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .shell.nav-open .side { transform: none; }
  .shell.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 25; }
  .topbar { padding: 0 12px; }
  .topbar .menu-btn { display: grid; }
  .topbar-brand { display: flex; }
  .search:not(.search-pop) { width: auto; flex: 1; }
  .content { padding: 16px 16px 90px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .org-page { grid-template-columns: 1fr; height: calc(100vh - 220px); }
  .org-tray { display: none; }
  .org-canvas { border-left: 1px solid var(--line); border-radius: var(--radius); }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; }
  .settings-nav .grp { display: none; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--panel);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 4px 0; }
  .bottom-nav a.on { color: var(--brand); }
  .kv { grid-template-columns: 120px 1fr; }
  .form { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 19px; }
  .modal { max-height: calc(100vh - 20px); }
  .overlay { padding: 10px; align-items: end; }
  .modal { border-radius: 16px 16px 12px 12px; }
  .hide-sm { display: none !important; }
  .payslip { padding: 18px; }
  .payslip .ps-cols, .payslip .ps-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat .value { font-size: 22px; }
  .toasts { left: 12px; right: 12px; bottom: 80px; }
  .toast { min-width: 0; }
}

/* ---------------------------------------------------------------- print */
@media print {
  body { background: #fff; }
  .side, .topbar, .bottom-nav, .no-print, .page-head .actions, .toasts { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; }
  .payslip { box-shadow: none; border: 0; padding: 0; }
  .org-canvas { height: auto; overflow: visible; border: 0; background: #fff; }
}

/* roles & rights matrix, approval workflow editor */
.table.rights th.rights-role { text-align: center; min-width: 110px; white-space: normal; }
.table.rights td.rights-cell { text-align: center; }
.table.rights td.rights-cell input { width: 17px; height: 17px; accent-color: var(--brand); cursor: pointer; }
.table.rights td.rights-label { min-width: 260px; }
.table.rights tr.rights-group td { background: var(--panel-2); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 7px 14px; }
.linkish { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--text); cursor: pointer; }
.linkish:hover:not(:disabled) { color: var(--brand); text-decoration: underline; }
.linkish:disabled { cursor: default; }
.wf-step { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.wf-step.initiator { background: var(--panel-2); }
.wf-num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 12px; flex: none; }
