/* HR Portal styles. Colours are tokens so dark mode only redefines them. */
/* Beinit Energy Group palette: brand green + charcoal, taken from the logo. */
:root {
  --brand-green: #00A03A;
  --brand-charcoal: #232527;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f1f3f5;
  --surface-head: #fafbfc;
  --border: #e3e6ea;
  --border-strong: #cfd4da;
  --text: #1a1d21;
  --muted: #5b636e;
  --accent: #00853a;          /* brand green, a shade deeper so text and buttons stay readable on white */
  --accent-hover: #006f30;
  --accent-soft: #e6f4ea;
  --success: #00873a;
  --success-soft: #e4f5e9;
  --danger: #c62828;
  --danger-soft: #fdecea;
  --warning: #b25e00;
  --warning-soft: #fff3e0;
  --info: #2b5f8a;
  --info-soft: #e8f0f7;
  --violet: #5b4bb7;
  --violet-soft: #eeebfa;
  /* Leave types on the calendar: a validated categorical palette, most common first. The letter in each cell
     carries the type too, so colour is never the only cue. */
  --leave-annual: #2a78d6; --leave-sick: #eb6834; --leave-family: #1baf7a; --leave-unpaid: #eda100;
  --leave-study: #e87ba4; --leave-religious: #008300; --leave-bereavement: #6250d6; --leave-national: #e34948;
  --leave-away: #8a9099;
  --ink-on-dark: #ffffff; --ink-on-light: #111315;
  --sidebar: #232527;
  --sidebar-text: #b8bdbe;
  --sidebar-active: #2f3235;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, .08);
  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131517;
    --surface: #1b1e21;
    --surface-2: #24282c;
    --surface-head: #1f2225;
    --border: #2f3439;
    --border-strong: #3d4349;
    --text: #eceef0;
    --muted: #9aa1a9;
    --accent: #1fb456;
    --accent-hover: #3cc56c;
    --accent-soft: #19301f;
    --success: #3cc56c;
    --success-soft: #19301f;
    --danger: #f07070;
    --danger-soft: #3a1f21;
    --warning: #f0a54a;
    --warning-soft: #3a2b17;
    --info: #79aee0;
    --info-soft: #1a2a3a;
    --violet: #a596f0;
    --violet-soft: #2a2545;
    --leave-annual: #3987e5; --leave-sick: #d95926; --leave-family: #199e70; --leave-unpaid: #c98500;
    --leave-study: #d55181; --leave-religious: #008300; --leave-bereavement: #9085e9; --leave-national: #e66767;
    --leave-away: #6c737b;
    --sidebar: #101213;
    --sidebar-active: #212426;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.45rem; font-weight: 650; letter-spacing: -.015em; }
h2 { font-size: .98rem; font-weight: 650; letter-spacing: -.005em; }
p { margin: 0 0 .5rem; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: .1em .4em; border-radius: 5px; }
code.warn { color: var(--danger); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.prewrap { white-space: pre-wrap; }
.center { text-align: center; }
.mono { font-family: var(--mono); }
.icon { width: 18px; height: 18px; flex: none; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 256px; flex: none; background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar::before { content: ""; display: block; height: 3px; background: var(--brand-green); flex: none; }
.brand { display: flex; flex-direction: column; gap: .55rem; padding: 1.35rem 1.25rem 1.1rem; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.brand:hover { text-decoration: none; }
.brand-logo { height: 40px; width: auto; align-self: flex-start; }
.brand-sub { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: #8d9394; font-weight: 600; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--brand-charcoal); color: var(--brand-green); font-weight: 800;
}
.brand-text, .me-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong, .me-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small, .me small { color: var(--sidebar-text); font-size: .78rem; }
.sidebar nav { flex: 1; padding: .25rem .75rem 1rem; }
.nav-label { font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; color: #80878a; font-weight: 650; margin: 1.15rem .65rem .35rem; }
.nav-label-hr { margin-top: 1.5rem; padding-top: 1.1rem; border-top: 1px solid rgba(255, 255, 255, .07); color: #c3c8ca; }
.nav-link {
  display: flex; align-items: center; gap: .7rem; padding: .44rem .65rem; border-radius: 6px;
  color: var(--sidebar-text); font-weight: 500; font-size: .9rem;
}
.nav-link:hover { background: var(--sidebar-active); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--sidebar-active); color: #fff; box-shadow: inset 3px 0 0 var(--brand-green); }
.nav-link.active .icon { color: var(--brand-green); }
.nav-count {
  margin-left: auto; background: #d9480f; color: #fff; font-size: .7rem; font-weight: 700; min-width: 1.35rem; text-align: center;
  padding: .05rem .4rem; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, .08); padding: 1rem 1.25rem; }
.me { display: flex; align-items: center; gap: .7rem; color: #fff; margin-bottom: .75rem; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .8rem;
}
.sidebar .avatar { background: #00a03a; color: #fff; }
.avatar.sm { width: 30px; height: 30px; font-size: .72rem; }
.foot-actions { display: flex; gap: 1rem; font-size: .85rem; }
.foot-actions a, .foot-actions .linklike { color: var(--sidebar-text); display: inline-flex; align-items: center; gap: .35rem; }
.foot-actions .icon { width: 15px; height: 15px; }
.foot-actions form { margin: 0; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; --gutter: max(2rem, calc((100% - 1320px) / 2)); }
.topbar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1.15rem var(--gutter) 1.15rem;
  background: var(--surface); border-bottom: 1px solid var(--border); margin-bottom: 1.5rem;
}
.titles { flex: 1; min-width: 220px; }
.app-footer {
  margin-top: auto; padding: 1rem var(--gutter) 1.25rem; display: flex; justify-content: space-between; flex-wrap: wrap;
  gap: .5rem 1.5rem; color: var(--muted); font-size: .78rem; border-top: 1px solid var(--border);
}
.subtitle { color: var(--muted); margin: .25rem 0 0; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: .9rem; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.page-actions form { margin: 0; }
.topbar .menu-toggle { display: none; }
.content { padding: 0 var(--gutter) 2.5rem; display: flex; flex-direction: column; gap: 1.25rem; }
.flashes { padding: 0 var(--gutter) 1rem; display: flex; flex-direction: column; gap: .5rem; }
.scrim { display: none; }

.grid-2, .grid-3 { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.align-start { align-items: start; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.section-title { font-size: 1.1rem; margin-top: .5rem; }

/* ---------- Cards, stats ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; box-shadow: var(--shadow); }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .35rem 1rem; margin-bottom: .9rem; }
.card > .card-head:first-child {
  margin: -1.25rem -1.5rem 1.1rem; padding: .8rem 1.5rem; background: var(--surface-head);
  border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0;
}
.card-attention > .card-head:first-child { background: transparent; }
.card-head a, .card-links { font-size: .84rem; font-weight: 500; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.stat-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem;
  display: flex; flex-direction: column; gap: .3rem; color: var(--text); box-shadow: var(--shadow);
}
a.stat:hover { border-color: var(--accent); box-shadow: var(--shadow-md); text-decoration: none; }
.stat-label { color: var(--muted); font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.stat-value { font-size: 1.6rem; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat-attention .stat-value { color: var(--warning); }
.big-number { font-size: 1.8rem; font-weight: 700; margin: .25rem 0 0; font-variant-numeric: tabular-nums; }

.balance-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.balance-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; box-shadow: var(--shadow); }
.balance-label { color: var(--muted); font-size: .85rem; margin: 0; }
.balance-value { font-size: 1.6rem; font-weight: 700; margin: .1rem 0 .5rem; font-variant-numeric: tabular-nums; }
.balance-value span { font-size: .85rem; font-weight: 500; color: var(--muted); }
.balance-meta { font-size: .8rem; color: var(--muted); margin: .4rem 0 0; }
progress { appearance: none; -webkit-appearance: none; width: 100%; height: 6px; border: 0; border-radius: 99px; background: var(--surface-2); overflow: hidden; display: block; }
progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
.balance-sick progress::-webkit-progress-value { background: #f76707; }
.balance-sick progress::-moz-progress-bar { background: #f76707; }
.balance-family progress::-webkit-progress-value { background: #2f8f9d; }
.balance-family progress::-moz-progress-bar { background: #2f8f9d; }
.balance-unpaid progress::-webkit-progress-value { background: var(--muted); }

/* ---------- Lists & tables ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li + li { border-top: 1px solid var(--border); }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .65rem 0; color: var(--text); }
a.list-row:hover { text-decoration: none; background: var(--surface-2); margin: 0 -.6rem; padding: .65rem .6rem; border-radius: 8px; }
.list-row > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.list-row small { color: var(--muted); }
.list-meta { color: var(--muted); font-size: .87rem; white-space: nowrap; text-align: right; }
.list-meta small { display: block; font-size: .78rem; }

.table-wrap { overflow-x: auto; margin: 0 -1.5rem; padding: 0 1.5rem; }
.table { width: 100%; border-collapse: collapse; font-size: .91rem; }
.table th { text-align: left; font-weight: 650; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .55rem .75rem; border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
.table td { padding: .7rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table.compact td { padding: .45rem .75rem; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.truncate { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions > * { display: inline-flex; vertical-align: middle; }
.row-actions form { margin: 0; }
.person { display: flex; align-items: center; gap: .65rem; color: var(--text); }
.person:hover { text-decoration: none; }
.person span:last-child { display: flex; flex-direction: column; }
.person small { color: var(--muted); }
.file-cell { display: inline-flex; align-items: center; gap: .5rem; word-break: break-word; }
.file-cell .icon { color: var(--muted); }

.details { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1.5rem; margin: 0 0 1rem; }
.details dt { color: var(--muted); font-size: .88rem; }
.details dd { margin: 0; word-break: break-word; }
.details dd .icon { width: 15px; height: 15px; vertical-align: -2px; margin-right: .3rem; }
.details.compact { gap: .4rem 1rem; font-size: .92rem; }

.empty { text-align: center; padding: 1.5rem 1rem; color: var(--muted); }
.empty p { margin-bottom: .75rem; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .4rem; padding: .16rem .55rem; border-radius: var(--radius-sm); font-size: .75rem; font-weight: 600; white-space: nowrap; line-height: 1.35; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge-pending, .badge-open { background: var(--warning-soft); color: var(--warning); }
.badge-approved, .badge-completed { background: var(--success-soft); color: var(--success); }
.badge-rejected, .badge-declined { background: var(--danger-soft); color: var(--danger); }
.badge-cancelled { background: var(--surface-2); color: var(--muted); }
.badge-in_progress { background: var(--violet-soft); color: var(--violet); }
.pill { display: inline-block; font-size: .7rem; font-weight: 600; padding: .06rem .45rem; border-radius: 4px; background: var(--accent-soft); color: var(--accent); vertical-align: middle; }

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .52rem .95rem;
  border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .88rem;
  cursor: pointer; text-decoration: none !important; white-space: nowrap; line-height: 1.2;
  transition: background-color .12s, border-color .12s, box-shadow .12s;
}
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success:hover, .btn-danger:hover { filter: brightness(1.08); }
.danger { color: var(--danger) !important; }
.btn-sm { padding: .32rem .65rem; font-size: .8rem; }
.btn-block { width: 100%; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 0;
  background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.back-link { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; font-weight: 500; margin-bottom: .25rem; color: var(--muted); }
.back-link:hover { color: var(--accent); text-decoration: none; }
.back-link .icon { width: 15px; height: 15px; }

label { display: block; font-size: .88rem; font-weight: 600; color: var(--text); }
/* Field name and its "(optional)" note share a line; the control sits underneath. */
label > input, label > select, label > textarea { display: block; margin-top: .35rem; }
label > .money-input, label > .hint { margin-top: .35rem; }
label > .hint { display: block; font-weight: 400; }
input, select, textarea {
  font: inherit; font-weight: 400; font-size: .95rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .55rem .7rem; width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="file"] { padding: .5rem; background: var(--surface-2); }
.optional { font-weight: 400; color: var(--muted); }
.hint { font-size: .83rem; color: var(--muted); margin: 0; }
.filters { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; margin: 0; }
.filters label { min-width: 180px; }
.filters .grow { flex: 1; }
fieldset { border: 0; margin: 0; padding: 0; }
legend { font-size: .88rem; font-weight: 600; margin-bottom: .5rem; padding: 0; }
.type-picker { display: flex; flex-direction: column; }
.type-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
.type-picker legend { grid-column: 1 / -1; }
.type-option { display: flex; flex-direction: row; align-items: center; gap: .5rem; border: 1px solid var(--border); border-radius: 10px; padding: .7rem .8rem; cursor: pointer; font-weight: 500; }
.type-option input { width: auto; margin: 0; accent-color: var(--accent); }
.type-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.days-estimate { background: var(--accent-soft); color: var(--accent); padding: .55rem .8rem; border-radius: 8px; font-weight: 600; font-size: .9rem; margin: 0; }
.money-field { margin-bottom: .75rem; }
.money-input { display: flex; align-items: stretch; }
.money-input span { display: grid; place-items: center; padding: 0 .75rem; background: var(--surface-2); border: 1px solid var(--border-strong); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); color: var(--muted); font-weight: 500; }
.money-input input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; text-align: right; font-variant-numeric: tabular-nums; }
.totals-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.totals-bar div { display: flex; flex-direction: column; }
.totals-bar span { color: var(--muted); font-size: .85rem; }
.totals-bar strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.totals-bar .net strong { color: var(--success); }
.totals-bar .negative { color: var(--danger) !important; }

/* ---------- Flash ---------- */
.flash { padding: .7rem 1rem .7rem .95rem; border-radius: var(--radius-sm); font-size: .9rem; border: 1px solid transparent; border-left-width: 4px; margin: 0; }
.flash-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 22%, transparent); border-left-color: var(--success); }
.flash-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 22%, transparent); border-left-color: var(--danger); }
.flash-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 22%, transparent); border-left-color: var(--info); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { padding: .6rem .9rem; color: var(--muted); font-weight: 600; font-size: .88rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-count { background: var(--surface-2); color: var(--muted); border-radius: 99px; font-size: .72rem; padding: .05rem .45rem; margin-left: .2rem; }

/* ---------- Documents ---------- */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.folder-tile {
  display: flex; flex-direction: column; gap: .25rem; padding: 1.1rem 1.2rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); box-shadow: var(--shadow);
}
.folder-tile:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.folder-icon { color: var(--accent); margin-bottom: .3rem; }
.folder-icon .icon { width: 28px; height: 28px; }
.folder-name { font-weight: 650; }
.folder-no { font-family: var(--mono); font-size: .75rem; font-weight: 600; color: var(--muted); margin-right: .15rem; }
.folder-desc { color: var(--muted); font-size: .84rem; flex: 1; }
.folder-meta { color: var(--muted); font-size: .8rem; margin-top: .4rem; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center;
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 1.75rem 1rem; transition: border-color .15s, background .15s;
}
.dropzone.dragging { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-icon { color: var(--accent); }
.dropzone-icon .icon { width: 30px; height: 30px; }
.dropzone input[type="file"] { max-width: 420px; }
.file-names { font-size: .85rem; color: var(--muted); margin: 0; word-break: break-word; }
.storage-note { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; font-size: .85rem; color: var(--muted); }

/* ---------- Requests ---------- */
.request-list { list-style: none; margin: 0; padding: 0; }
.request-list li { padding: .9rem 0; }
.request-list li + li { border-top: 1px solid var(--border); }
.request-top { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .3rem; }
.response { background: var(--surface-2); border-left: 3px solid var(--accent); padding: .55rem .8rem; border-radius: 0 8px 8px 0; margin: .5rem 0; font-size: .92rem; }
.response span { display: block; font-size: .75rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.quick-actions { display: flex; flex-direction: column; gap: .25rem; }
.quick-actions a { display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem; border-radius: 8px; color: var(--text); font-weight: 500; }
.quick-actions a:hover { background: var(--surface-2); text-decoration: none; }
.quick-actions .icon { color: var(--accent); }

/* ---------- Payslip document ---------- */
.payslip { background: #fff; color: #1c2233; border: 1px solid var(--border); border-radius: var(--radius); padding: 2.25rem; max-width: 860px; box-shadow: var(--shadow); }
.payslip .muted, .payslip .table th { color: #697089; }
.payslip .table td, .payslip .table th { border-color: #e3e6ee; }
.payslip .table tbody tr:hover td { background: transparent; }
.payslip-head { display: flex; justify-content: space-between; gap: 1.5rem; align-items: flex-start; padding-bottom: 1.25rem; border-bottom: 2px solid #1c2233; flex-wrap: wrap; }
.payslip-company { font-size: 1.1rem; font-weight: 700; margin: .4rem 0 0; }
.payslip-logo { height: 46px; width: auto; display: block; }
.payslip-head { border-bottom-color: var(--brand-green) !important; }
.payslip-net { text-align: right; display: flex; flex-direction: column; }
.payslip-net span { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: #697089; }
.payslip-net strong { font-size: 1.9rem; font-variant-numeric: tabular-nums; }
.payslip-net small { color: #697089; }
.payslip-employee { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1.25rem 0 1.5rem; }
.payslip-employee dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: #697089; }
.payslip-employee dd { margin: .15rem 0 0; font-weight: 600; }
.payslip-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.payslip-table tfoot th { color: #1c2233; font-size: .9rem; text-transform: none; letter-spacing: 0; border-top: 1px solid #1c2233; border-bottom: 0; padding-top: .7rem; }
.payslip-notes { margin-top: 1rem; font-size: .9rem; }
.payslip-foot { margin-top: 1.75rem; font-size: .75rem; color: #697089; text-align: center; }

/* ---------- Auth pages ---------- */
body.auth { background: radial-gradient(circle at 15% 0%, rgba(0, 160, 58, .10) 0, transparent 42%), radial-gradient(circle at 100% 100%, rgba(35, 37, 39, .08) 0, transparent 45%), var(--bg); }
@media (prefers-color-scheme: dark) { body.auth { background: radial-gradient(circle at 15% 0%, rgba(0, 160, 58, .12) 0, transparent 42%), var(--bg); } }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 2.25rem 2.25rem 2rem; box-shadow: 0 12px 32px rgba(16, 24, 40, .1); display: flex; flex-direction: column; gap: .75rem; }
.auth-card.wide { max-width: 560px; }
.auth-card h1 { font-size: 1.45rem; }
.auth-card .flashes { padding: 0; }
.auth-brand { display: flex; flex-direction: column; align-items: flex-start; gap: .6rem; margin-bottom: 1rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--border); }
.auth-logo { height: 56px; width: auto; }
.auth-card { border-top: 4px solid var(--brand-green); }
.auth-brand div { display: flex; flex-direction: column; }
.auth-brand small { color: var(--muted); }
.auth-company { font-size: .78rem; font-weight: 650; color: var(--text); letter-spacing: .02em; }
.auth-product { font-size: .68rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .14em; }
.auth-foot { text-align: center; font-size: .75rem; color: var(--muted); margin-top: 1.25rem; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; margin: 0; }
.fine-print { font-size: .8rem; color: var(--muted); margin: .25rem 0 0; }
.error-code { font-size: 3rem; font-weight: 800; color: var(--accent); margin: 0; }
.credentials { max-width: 640px; }
.secret { font-size: 1.15rem; letter-spacing: .05em; padding: .25em .6em; }

/* ---------- Document compliance & expiry ---------- */
.small-title { font-size: .95rem; margin: 0 0 .6rem; color: var(--muted); font-weight: 600; }
.sub-title { font-size: .9rem; margin: 1.25rem 0 .5rem; }
.card-head h2 .icon { vertical-align: -3px; margin-right: .2rem; }
.card-attention { border-color: color-mix(in srgb, var(--warning) 45%, var(--border)); background: linear-gradient(0deg, var(--surface), var(--surface)) padding-box; box-shadow: inset 4px 0 0 var(--warning), var(--shadow); }
.attention-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.attention { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem .9rem; border-radius: 10px; background: var(--surface-2); }
.attention > div { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.attention span { font-size: .9rem; }
.attention small { color: var(--muted); }
.attention-expired, .attention-missing { box-shadow: inset 3px 0 0 var(--danger); }
.attention-soon, .attention-requested { box-shadow: inset 3px 0 0 var(--warning); }
.expiry-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.expiry-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; box-shadow: var(--shadow); border-top: 4px solid var(--success); }
.expiry-card-soon { border-top-color: var(--warning); }
.expiry-card-expired { border-top-color: var(--danger); }
.expiry-card-unknown { border-top-color: var(--border); }
.expiry-label { color: var(--muted); font-size: .85rem; margin: 0; }
.expiry-days { font-size: 1.7rem; font-weight: 700; margin: .1rem 0 .2rem; font-variant-numeric: tabular-nums; }
.expiry-days span { font-size: .9rem; font-weight: 500; color: var(--muted); }
.expiry-card-expired .expiry-days { color: var(--danger); }
.expiry-card-soon .expiry-days { color: var(--warning); }
.expiry-meta { font-size: .8rem; color: var(--muted); margin: 0 0 .4rem; }
.expiry-edit summary { cursor: pointer; font-size: .82rem; color: var(--accent); list-style: none; }
.expiry-edit summary::-webkit-details-marker { display: none; }
.expiry-edit[open] summary { margin-bottom: .5rem; }
.expiry-edit form { margin: 0 0 .3rem; }
.inline-form { display: flex; gap: .4rem; align-items: center; }
.inline-form input { padding: .35rem .5rem; font-size: .88rem; }
form.inline { display: inline; margin: 0; }
.expiry { display: inline-block; padding: .16rem .55rem; border-radius: var(--radius-sm); font-size: .75rem; font-weight: 600; white-space: nowrap; }
.expiry-ok { background: var(--success-soft); color: var(--success); }
.expiry-soon { background: var(--warning-soft); color: var(--warning); }
.expiry-expired { background: var(--danger-soft); color: var(--danger); }
.stat-danger .stat-value { color: var(--danger); }
.matrix th.center, .matrix td.center { text-align: center; }
.cell-link { display: inline-block; text-decoration: none !important; }
.cell-ok { color: var(--success); font-weight: 600; font-size: .85rem; }
.cell-missing { display: inline-block; background: var(--danger-soft); color: var(--danger); font-weight: 600; font-size: .76rem; padding: .15rem .55rem; border-radius: var(--radius-sm); }
.cell-requested { display: inline-block; background: var(--warning-soft); color: var(--warning); font-weight: 600; font-size: .76rem; padding: .15rem .55rem; border-radius: var(--radius-sm); }
.folder-attention { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.folder-attention .folder-meta { color: var(--danger); font-weight: 600; }
.checks { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-bottom: 1rem; }
.checks legend { width: 100%; }
.check { display: flex; flex-direction: row; align-items: center; gap: .45rem; font-weight: 500; }
.check input { width: auto; margin: 0; accent-color: var(--accent); }
.narrow { max-width: 340px; }
.request-form { margin-top: 1rem; }
.request-form summary { list-style: none; display: inline-flex; }
.request-form summary::-webkit-details-marker { display: none; }
.request-form[open] summary { margin-bottom: 1rem; }
.hint-list { margin: .5rem 0 0; padding-left: 1.1rem; font-size: .85rem; color: var(--muted); display: flex; flex-direction: column; gap: .3rem; }

/* ---------- Payroll ---------- */
.stat-brand { background: var(--brand-charcoal); border-color: var(--brand-charcoal); }
.stat-brand .stat-label { color: #b8bdbe; }
.stat-brand .stat-value { color: #fff; }
.payroll-table tbody tr.detail-row td { padding-top: 0; border-bottom: 1px solid var(--border); }
.payroll-table tbody tr:not(.detail-row) td { border-bottom: 0; }
.payroll-table tbody tr.detail-row:hover td { background: transparent; }
.row-muted td { opacity: .65; }
.row-problem { display: block; color: var(--warning); font-size: .8rem; margin-top: .2rem; }
.row-current td { background: var(--accent-soft); }
.adjust summary { cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; font-size: .84rem; color: var(--accent); font-weight: 600; list-style: none; padding: .2rem 0 .5rem; }
.adjust summary::-webkit-details-marker { display: none; }
.adjust summary .icon { width: 14px; height: 14px; }
.adjust[open] { background: var(--surface-2); border-radius: 10px; padding: .4rem .9rem .9rem; margin-bottom: .6rem; }
.adjust-list { list-style: none; margin: 0 0 .75rem; padding: 0; }
.adjust-list li { display: grid; grid-template-columns: 9.5rem 1fr auto auto; gap: .75rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.adjust-list form { margin: 0; }
.adjust-text a { margin-left: .4rem; font-size: .82rem; }
.adjust-text .icon { width: 13px; height: 13px; vertical-align: -2px; margin-right: .15rem; }
.adjust-kind { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: .15rem .5rem; border-radius: 6px; justify-self: start; }
.adjust-addition { background: var(--accent-soft); color: var(--success); }
.adjust-expense { background: var(--info-soft); color: var(--info); }
.adjust-deduction { background: var(--danger-soft); color: var(--danger); }
.adjust-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.adjust-form label { font-size: .8rem; }
.adjust-form .grow { flex: 1; min-width: 200px; }
.adjust-form select, .adjust-form input { padding: .45rem .6rem; font-size: .88rem; }
.adjust-form input[type="file"] { max-width: 210px; padding: .35rem; }
.adjust-form .money-input input { width: 8.5rem; }
.suggestion { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--warning-soft); border-radius: 8px; padding: .6rem .8rem; margin-bottom: .75rem; font-size: .88rem; }
.pill-warn { background: var(--warning-soft); color: var(--warning); }
.pay-panel { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; border-left: 4px solid var(--brand-green); }
.pay-panel h2 { margin-bottom: .3rem; }
.pay-panel p { margin: 0; max-width: 640px; }
.totals-bar.single { grid-template-columns: 1fr; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Currency & bank ---------- */
.currency-tag { display: inline-block; font-family: var(--mono); font-size: .75rem; font-weight: 600; padding: .1rem .45rem; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.stat-sub { font-size: .75rem; color: #b8bdbe; }
.payslip-bank { margin-top: 1.25rem; border: 1px solid #e0e4e1; border-radius: 10px; padding: .9rem 1.1rem; }
.payslip-bank-title { margin: 0 0 .5rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: #697089; font-weight: 700; }
.payslip-bank dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem 1.2rem; margin: 0; }
.payslip-bank dt { font-size: .72rem; color: #697089; }
.payslip-bank dd { margin: .1rem 0 0; font-weight: 600; font-variant-numeric: tabular-nums; word-break: break-word; }

.consolidated { border-left: 4px solid var(--brand-green); }
.consolidated-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.consolidated-cell { display: flex; flex-direction: column; gap: .2rem; background: var(--surface-2); border-radius: 10px; padding: .9rem 1.1rem; }
.consolidated-net { font-size: 1.6rem; font-weight: 750; font-variant-numeric: tabular-nums; }

.account-list { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.account { border: 1px solid var(--border); border-radius: 10px; padding: .9rem 1rem; }
.account-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.account-head .badge { margin-left: auto; }
.account .details { margin-bottom: .6rem; }
.account .form-actions form { margin: 0; display: inline-flex; gap: .4rem; align-items: center; }
.account .check { font-size: .8rem; }
.account-pending { border-color: color-mix(in srgb, var(--warning) 50%, var(--border)); background: var(--warning-soft); }
.account-rejected { opacity: .7; }

.leave-rule { margin: -.4rem 0 0; padding: .6rem .8rem; border-radius: 8px; background: var(--accent-soft); color: var(--text); font-size: .88rem; }
.rule-list { margin: 0; padding-left: 1rem; display: flex; flex-direction: column; gap: .45rem; font-size: .83rem; color: var(--muted); }
.rule-list strong { color: var(--text); display: block; }
.add-doc { margin-top: .4rem; }
.add-doc input[type="file"] { max-width: 180px; font-size: .78rem; padding: .25rem; }

/* ---------- Expenses ---------- */
.expense-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; }
.expense-grid .span-wide { grid-column: span 2; }
.currency-select { width: auto; border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: 0; background: var(--surface-2); font-weight: 600; padding-right: .3rem; }
.expense-submitted { background: var(--warning-soft); color: var(--warning); }
.expense-approved, .expense-in_payroll { background: var(--info-soft); color: var(--info); }
.expense-paid { background: var(--success-soft); color: var(--success); }
.expense-rejected { background: var(--danger-soft); color: var(--danger); }
.expense-withdrawn { background: var(--surface-2); color: var(--muted); }
.line-rejected td { color: var(--muted); }
.line-reject { align-items: center; gap: .6rem; }
.line-reject summary { list-style: none; }
.line-reject summary::-webkit-details-marker { display: none; }
.line-reject[open] summary { font-size: 0; }
.line-reject[open] summary::after { content: "Cancel"; font-size: .85rem; color: var(--muted); }
.line-reject .inline-form input { width: 12rem; }

/* ---------- Responsive ---------- */
/* Leave calendar */
.leave-cal { border-collapse: separate; border-spacing: 0; font-size: .78rem; width: 100%; }
.leave-cal th, .leave-cal td { border-bottom: 1px solid var(--border); text-align: center; padding: 0; min-width: 1.7rem; height: 2.1rem; }
.leave-cal thead th { font-weight: 600; color: var(--muted); line-height: 1.1; }
.leave-cal thead th small { display: block; font-size: .65rem; font-weight: 500; }
.leave-cal .cal-name { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; padding: .3rem .75rem .3rem 0; min-width: 11rem; font-weight: 600; color: var(--text); }
.leave-cal .cal-name small { display: block; font-weight: 400; color: var(--muted); }
.leave-cal .cal-off { background: var(--surface-2); }
/* Each leave group sets its colour and the ink that reads on it (checked for contrast in both modes). */
.leave-annual { --leave: var(--leave-annual); --leave-ink: var(--ink-on-dark); }
.leave-sick { --leave: var(--leave-sick); --leave-ink: var(--ink-on-light); }
.leave-family { --leave: var(--leave-family); --leave-ink: var(--ink-on-light); }
.leave-unpaid { --leave: var(--leave-unpaid); --leave-ink: var(--ink-on-light); }
.leave-study { --leave: var(--leave-study); --leave-ink: var(--ink-on-light); }
.leave-religious { --leave: var(--leave-religious); --leave-ink: var(--ink-on-dark); }
.leave-bereavement { --leave: var(--leave-bereavement); --leave-ink: var(--ink-on-dark); }
.leave-national { --leave: var(--leave-national); --leave-ink: var(--ink-on-light); }
.leave-away { --leave: var(--leave-away); --leave-ink: var(--ink-on-light); }
@media (prefers-color-scheme: dark) {
  .leave-annual, .leave-bereavement { --leave-ink: var(--ink-on-light); }
  .leave-away { --leave-ink: var(--ink-on-dark); }
}
.leave-cal td.cal-approved, .cal-key.cal-approved { background: var(--leave, var(--accent)); color: var(--leave-ink, #fff); font-weight: 700; box-shadow: inset 0 0 0 1px var(--surface); }
.leave-cal td.cal-pending, .cal-key.cal-pending {
  background: color-mix(in srgb, var(--leave, var(--warning)) 16%, var(--surface)); color: var(--text); font-weight: 700;
  outline: 1.5px dashed var(--leave, var(--warning)); outline-offset: -3px;
}
.cal-legend { display: flex; flex-wrap: wrap; gap: .45rem 1.1rem; margin: .9rem 0 .4rem; font-size: .82rem; color: var(--text); }
.cal-legend-item { display: inline-flex; align-items: center; gap: .4rem; }
.cal-legend .cal-key { margin: 0; }
.leave-cal th.cal-busy { color: var(--danger); box-shadow: inset 0 -3px 0 var(--danger); }
.leave-cal th.cal-today { color: var(--accent); }
.cal-key { display: inline-block; min-width: 1.4rem; height: 1.4rem; line-height: 1.4rem; padding: 0 .2rem; text-align: center; border-radius: 4px; font-size: .68rem; font-weight: 700; margin: 0 .2rem 0 .4rem; vertical-align: middle; }
.cal-key.cal-off { background: var(--surface-2); border: 1px solid var(--border); }
/* Air ticket monthly prices */
.fare-months { text-align: left; margin-top: .3rem; }
.fare-months ul { list-style: none; margin: .4rem 0 0; padding: 0; min-width: 12rem; font-size: .8rem; }
.fare-months li { display: flex; justify-content: space-between; gap: 1rem; padding: .1rem 0; border-bottom: 1px dashed var(--border); }
/* SharePoint tidy-up */
.tidy-path { font-family: var(--mono); font-size: .78rem; word-break: break-word; max-width: 28rem; }
.tidy-fix { display: flex; gap: .4rem; align-items: flex-start; margin-bottom: .75rem; }
.tidy-fix .icon { width: 15px; height: 15px; color: var(--accent); margin-top: .1rem; }
/* Org chart */
.org-chart, .org-chart ul { list-style: none; margin: 0; padding: 0; }
.org-chart ul { margin-left: 1.25rem; padding-left: 1rem; border-left: 2px solid var(--border); }
.org-chart li { margin: .5rem 0; }
.org-node { display: inline-flex; flex-direction: column; gap: .1rem; padding: .5rem .8rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.org-node small { color: var(--muted); }
.org-me { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
@media (max-width: 1100px) {
  .balance-grid, .stat-grid, .expiry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .first-when-stacked { order: -1; }
  .type-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 30; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 20; }
  .topbar .menu-toggle { display: inline-grid; }
  .main { --gutter: 16px; }
  .topbar { padding-top: .85rem; padding-bottom: .85rem; margin-bottom: 1rem; }
  .card { padding: 1.1rem 1rem; }
  .card > .card-head:first-child { margin: -1.1rem -1rem 1rem; padding: .75rem 1rem; }
  .table-wrap { margin: 0 -1rem; padding: 0 1rem; }
  .grid-2, .stat-grid.three, .totals-bar, .payslip-columns { grid-template-columns: 1fr; }
  .payslip { padding: 1.25rem; }
  .payslip-employee, .payslip-bank dl { grid-template-columns: repeat(2, 1fr); }
  .consolidated-grid { grid-template-columns: 1fr; }
  .expense-grid { grid-template-columns: 1fr; }
  .expense-grid .span-wide { grid-column: auto; }
  .details:not(.compact) { grid-template-columns: 1fr; gap: .15rem; }
  .details:not(.compact) dd { margin-bottom: .5rem; }
  .details.compact { gap: .35rem .9rem; }
  h1 { font-size: 1.3rem; }
}
@media (max-width: 480px) {
  .type-picker, .expiry-grid { grid-template-columns: 1fr; }
  .balance-grid, .stat-grid { gap: .6rem; }
  .stat, .balance { padding: .85rem 1rem; }
  .stat-value { font-size: 1.5rem; }
  .stat-grid .stat-brand { grid-column: 1 / -1; }  /* money totals get the whole row */
  .attention { flex-direction: column; align-items: flex-start; }
  .adjust-list li { grid-template-columns: 1fr auto; }
  .adjust-list .adjust-kind { grid-column: 1 / -1; }
}

/* ---------- Print: payslip only ---------- */
@media print {
  .sidebar, .topbar, .flashes, .scrim, .app-footer { display: none !important; }
  body, .content { background: #fff; padding: 0; }
  .payslip { border: 0; box-shadow: none; padding: 0; max-width: none; }
}

.align-end { align-self: end; padding-bottom: .7rem; }
.span-full { grid-column: 1 / -1; }
.contact-columns { gap: 1.5rem; }
.contact-columns legend { font-size: .95rem; color: var(--text); border-bottom: 1px solid var(--border); width: 100%; padding-bottom: .4rem; margin-bottom: .75rem; }
.field-group { font-size: .85rem; font-weight: 600; margin: .5rem 0 0; color: var(--muted); }
.raise-helper { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; padding: .85rem 1rem; background: var(--accent-soft); border-radius: 10px; }
.raise-helper .raise-title { width: 100%; font-weight: 600; font-size: .9rem; }
.raise-helper label { display: flex; flex-direction: row; align-items: center; gap: .5rem; margin: 0; }
.raise-helper input { width: 7rem; margin-top: 0; }
.raise-helper select { width: auto; }
.salary-change { display: block; font-size: .82rem; margin-top: .2rem; color: var(--muted); }
.change-up { color: var(--success); }
.change-down { color: var(--danger); }
.hide { display: none; }
.template-row { display: flex; flex-direction: column; align-items: stretch; gap: .45rem; padding: .7rem 0; }
.template-row small { display: block; color: var(--muted); font-weight: 400; word-break: break-word; }
.template-row .inline-form { display: flex; gap: .4rem; align-items: center; }
.template-row input[type="file"] { font-size: .8rem; padding: .3rem; }
.settlement-lines { margin-top: 1.25rem; }
.settlement-lines tfoot th { border-top: 1px solid #e3e6ee; }
.settlement-net th { font-size: 1.05rem; border-top: 2px solid #1c2233 !important; }
.settlement-gratuity { margin-top: 1.25rem; padding: 1rem 1.1rem; background: #f5f6fa; border-radius: 10px; }
.settlement-gratuity h3 { margin: 0 0 .4rem; font-size: .95rem; }
.settlement-gratuity p { margin: .3rem 0; }
.settlement-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 2rem; }
.settlement-sign p { font-size: .85rem; margin: 0 0 2.5rem; }
.settlement-sign span { display: block; border-top: 1px solid #1c2233; padding-top: .35rem; font-size: .8rem; color: #697089; }
.extra-row { display: grid; grid-template-columns: 7rem 1fr 9rem; gap: .5rem; }
@media (max-width: 480px) { .settlement-sign { grid-template-columns: 1fr; } .extra-row { grid-template-columns: 5.5rem 1fr; } .extra-row input[type="number"] { grid-column: 2; } }
@media print { .no-print { display: none !important; } }
.day-rate .days-input { width: 6rem; margin-left: auto; text-align: right; display: inline-block; }
.letter-groups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem 1.5rem; }
.letter-links { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .15rem; }
.letter-links a { display: flex; align-items: center; gap: .45rem; padding: .35rem .5rem; border-radius: 8px; font-size: .9rem; color: var(--text); }
.letter-links a:hover { background: var(--accent-soft); color: var(--accent-hover); }
.letter-links .icon { width: 15px; height: 15px; color: var(--accent); flex: none; }
.details-body { margin-top: .6rem; }
@media (max-width: 1100px) { .letter-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .letter-groups { grid-template-columns: 1fr; } }
progress.progress { appearance: none; -webkit-appearance: none; width: 100%; max-width: 220px; height: 8px; border: 0; border-radius: 99px; background: var(--surface-2); overflow: hidden; display: block; margin: .3rem 0; }
progress.progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 99px; }
progress.progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
progress.progress::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
progress.progress.wide { max-width: none; height: 10px; margin-bottom: 1rem; }
.checklist-mini { display: block; padding: .5rem 0; border-bottom: 1px solid var(--border); color: var(--text); }
.task-list { list-style: none; margin: 0; padding: 0; }
.task { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: start; padding: .7rem 0; border-top: 1px solid var(--border); }
.task-body strong { display: block; font-weight: 600; }
.task-body small { color: var(--muted); }
.task-done .task-body strong { color: var(--muted); text-decoration: line-through; }
.task-overdue .task-body strong { color: var(--danger); }
.tick { width: 26px; height: 26px; border-radius: 7px; border: 2px solid var(--border); background: var(--surface); display: grid; place-items: center; cursor: pointer; padding: 0; color: #fff; }
.task-done .tick { background: var(--accent); border-color: var(--accent); }
.tick .icon { width: 15px; height: 15px; }
.tick:disabled { cursor: default; }
.review-text dt { font-weight: 600; font-size: .88rem; margin-top: .8rem; }
.review-text dd { margin: .25rem 0 0; }
.review-rating { font-size: 1.05rem; margin: 0; }
.ticket-box { border: 1px dashed var(--accent); border-radius: 10px; padding: .9rem 1rem; margin-bottom: .9rem; background: var(--accent-soft); }
.ticket-box p { margin: .15rem 0; }
.ticket-route { font-size: 1.3rem; font-weight: 700; }
.ticket-actions[open] form { margin-top: .6rem; text-align: left; }
.fares th, .fares td { padding-left: .4rem; padding-right: .4rem; }
.btn-microsoft { background: #fff; color: #1e2124; border: 1px solid #8c8c8c; gap: .6rem; font-weight: 600; }
.btn-microsoft:hover { background: #f3f3f3; }
.ms-logo { width: 18px; height: 18px; }
.password-signin { margin-top: .5rem; }
.password-signin[open] form { margin-top: .8rem; }
.inline-label { display: flex; align-items: center; gap: .5rem; font-size: .85rem; }
.inline-label > select { margin-top: 0; width: auto; }
[dir="rtl"] { text-align: right; }
