/* Time Off app — mobile-first, Odoo-inspired.
   Tokens follow the dataviz reference palette (ink/surface/status);
   brand accent is Odoo purple. Dark mode is a selected token set. */

:root {
  --brand: #714B67;
  --brand-strong: #5d3d55;
  --brand-tint: #f3edf2;
  --on-brand: #ffffff;

  --page: #f6f5f3;
  --surface: #ffffff;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --hairline: #e1e0d9;
  --ring: rgba(11, 11, 11, 0.10);

  --good: #0ca30c;      --good-ink: #006300;    --good-tint: #e3f6e3;
  --warn: #fab219;      --warn-ink: #7a5600;    --warn-tint: #fdf3d8;
  --crit: #d03b3b;      --crit-ink: #9c2626;    --crit-tint: #fbe4e4;
  --neutral-tint: #efeeeb;

  --s1: #2a78d6; --s2: #1baf7a; --s3: #eda100; --s4: #008300;
  --s5: #4a3aa7; --s6: #e34948; --s7: #e87ba4; --s8: #eb6834;

  --radius: 14px;
  --radius-s: 9px;
  --shadow: 0 1px 2px rgba(11,11,11,.05), 0 6px 24px -12px rgba(11,11,11,.18);
  --shadow-sheet: 0 -8px 40px -8px rgba(11,11,11,.28);
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #b287a5;
    --brand-strong: #c9a3bd;
    --brand-tint: #322a30;
    --on-brand: #1a1219;

    --page: #0d0d0d;
    --surface: #1a1a19;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --hairline: #2c2c2a;
    --ring: rgba(255, 255, 255, 0.10);

    --good-ink: #6fdc6f;  --good-tint: #14310f;
    --warn-ink: #ffd069;  --warn-tint: #3a2f10;
    --crit-ink: #ff9c9c;  --crit-tint: #3d1414;
    --neutral-tint: #262624;

    --s1: #3987e5; --s2: #199e70; --s3: #c98500; --s4: #008300;
    --s5: #9085e9; --s6: #e66767; --s7: #d55181; --s8: #d95926;

    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 24px -12px rgba(0,0,0,.6);
    --shadow-sheet: 0 -8px 40px -8px rgba(0,0,0,.7);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
}
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 650; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* ---------- App shell ---------- */

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.topbar-inner {
  max-width: 960px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--brand);
  color: #fff; display: grid; place-items: center; font-size: 15px; flex: none;
}
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); line-height: 1.1; }
.topbar-spacer { flex: 1; }

.tabs { display: flex; gap: 2px; background: var(--neutral-tint); border-radius: 999px; padding: 3px; }
.tab {
  border: 0; background: transparent; color: var(--ink-2);
  padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 550;
}
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.avatar-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--ring);
  background: var(--brand-tint); color: var(--brand);
  font-weight: 700; font-size: 14px; flex: none;
}
@media (prefers-color-scheme: dark) { .avatar-btn { color: var(--brand-strong); } }

/* On a phone an admin's four tabs are wider than the viewport. Left alone the
   bar pushes the avatar — and the sign-out menu behind it — off-screen and the
   whole page scrolls sideways. Drop the wordmark and let the tabs scroll. */
@media (max-width: 600px) {
  .topbar-inner { gap: 10px; padding: 8px 12px; }
  .topbar-inner:has(.tabs) .brand-text { display: none; }
  .tabs {
    flex: 0 1 auto; min-width: 0;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: none; white-space: nowrap; }
  .menu { right: 12px; }
}

.menu {
  position: absolute; right: 16px; top: 54px; z-index: 40;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-s);
  box-shadow: var(--shadow); min-width: 220px; padding: 6px; margin: 0; list-style: none;
}
.menu-head { padding: 8px 10px 6px; border-bottom: 1px solid var(--hairline); margin-bottom: 6px; }
.menu-head .name { font-weight: 650; font-size: 14px; }
.menu-head .mail { font-size: 12px; color: var(--muted); word-break: break-all; }
.menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: 0; background: none; border-radius: 7px;
  font-size: 14px; color: var(--ink); text-align: left;
}
.menu button:hover { background: var(--neutral-tint); }
.menu button.danger { color: var(--crit-ink); }

.container { max-width: 960px; margin: 0 auto; padding: 20px 16px 110px; }

.page-head { margin: 6px 0 18px; }
.page-head h1 { font-size: 22px; letter-spacing: -0.01em; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 26px 0 10px;
}
.section-head h2 { font-size: 15px; color: var(--ink-2); font-weight: 650; text-transform: none; }
.section-head .hint { font-size: 13px; color: var(--muted); }

/* ---------- Balance stat tiles ---------- */

.tiles {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
@media (max-width: 480px) {
  .tiles {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 72%;
    overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px;
    margin: 0 -16px; padding-left: 16px; padding-right: 16px;
  }
  .tile { scroll-snap-align: start; }
}
.tile {
  background: var(--surface); border: 1px solid var(--ring); border-radius: var(--radius);
  padding: 14px 14px 12px; position: relative; overflow: hidden; box-shadow: var(--shadow);
}
.tile::before {
  content: ""; position: absolute; inset: 0 auto auto 0; width: 100%; height: 3px;
  background: var(--type-color, var(--brand));
}
.tile .label {
  font-size: 13px; color: var(--ink-2); font-weight: 550;
  display: flex; align-items: center; gap: 7px;
}
.tile .label .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--type-color, var(--brand)); flex: none; }
.tile .value { font-size: 30px; font-weight: 650; margin-top: 6px; line-height: 1.1; }
.tile .value small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.tile .caption { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ---------- Cards & request list ---------- */

.card {
  background: var(--surface); border: 1px solid var(--ring); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; border-bottom: 1px solid var(--hairline);
}
.list-row:last-child { border-bottom: 0; }
.type-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; font-size: 14.5px; }
.row-sub { font-size: 13px; color: var(--muted); margin-top: 1px; }
.row-side { display: flex; align-items: center; gap: 8px; flex: none; }
.row-days { font-size: 13px; color: var(--ink-2); font-weight: 550; white-space: nowrap; }

.empty {
  padding: 34px 20px; text-align: center; color: var(--muted); font-size: 14px;
}
.empty .art { font-size: 30px; margin-bottom: 6px; }

/* Status chips: tinted bg + dark text + dot — never color alone. */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  white-space: nowrap;
}
.chip .cdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.chip.pending { background: var(--warn-tint); color: var(--warn-ink); }
.chip.approved { background: var(--good-tint); color: var(--good-ink); }
.chip.refused { background: var(--crit-tint); color: var(--crit-ink); }
.chip.neutral { background: var(--neutral-tint); color: var(--ink-2); }

.badge-mini {
  font-size: 11px; font-weight: 600; color: var(--warn-ink);
  background: var(--warn-tint); border-radius: 6px; padding: 2px 6px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 10px 16px; font-size: 14.5px; font-weight: 600;
  background: var(--neutral-tint); color: var(--ink);
  min-height: 42px;
}
.btn:hover { filter: brightness(0.97); }
.btn.primary { background: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-strong); filter: none; }
.btn.danger { background: var(--crit-tint); color: var(--crit-ink); }
.btn.ghost { background: transparent; border-color: var(--hairline); color: var(--ink-2); }
.btn.small { padding: 6px 11px; min-height: 34px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.icon-x {
  padding: 6px; min-height: 34px; min-width: 34px; border-radius: 8px;
  background: transparent; color: var(--muted);
}
.btn.icon-x:hover { background: var(--crit-tint); color: var(--crit-ink); }

.fab {
  position: fixed; right: 18px; bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 25; border: 0; border-radius: 999px;
  background: var(--brand); color: var(--on-brand);
  padding: 15px 22px; font-size: 15px; font-weight: 650;
  display: inline-flex; align-items: center; gap: 9px;
  box-shadow: 0 10px 28px -8px color-mix(in srgb, var(--brand) 70%, black);
}
.fab:hover { background: var(--brand-strong); }
@media (min-width: 720px) { .fab { display: none; } }
.desktop-cta { display: none; }
@media (min-width: 720px) { .desktop-cta { display: inline-flex; } }

/* ---------- Forms ---------- */

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field .control {
  width: 100%; border: 1px solid var(--hairline); border-radius: 10px;
  background: var(--surface); padding: 11px 12px; font-size: 15px;
  min-height: 44px;
}
.field .control:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
.field textarea.control { resize: vertical; min-height: 74px; }
.field .help { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checkline { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; color: var(--ink-2); }
.checkline input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--brand); }

.pw-wrap { position: relative; }
.pw-wrap .control { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; color: var(--muted); padding: 8px; border-radius: 8px;
}

.form-error {
  background: var(--crit-tint); color: var(--crit-ink);
  border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 14px;
  display: flex; gap: 8px; align-items: flex-start;
}

.duration-hint {
  background: var(--brand-tint); color: var(--ink-2);
  border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 14px;
}
.duration-hint b { color: var(--ink); }

/* ---------- Auth screens ---------- */

.auth-wrap {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
}
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--ring);
  border-radius: 18px; box-shadow: var(--shadow); padding: 28px 24px;
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand .brand-mark { width: 44px; height: 44px; border-radius: 13px; font-size: 22px; }
.auth-brand h1 { font-size: 20px; }
.auth-brand p { margin: 0; font-size: 13px; color: var(--muted); }
.auth-note { font-size: 13px; color: var(--muted); text-align: center; margin-top: 16px; }

/* ---------- Admin ---------- */

.person-cell { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: var(--brand-tint); color: var(--brand);
}
@media (prefers-color-scheme: dark) { .avatar { color: var(--brand-strong); } }
.person-cell .who { min-width: 0; }
.person-cell .who .nm { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-cell .who .sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Narrow screens: a row's subtitle carries the date range, and the trailing
   chip/button is flex:none — together they ellipse "17–21 Aug 2026" down to
   "17…". Let the subtitle use a second line, and on rows with an action
   (Accounts) give that action its own line so the name isn't cut to "Ab…". */
@media (max-width: 560px) {
  .person-cell .who .nm { white-space: normal; overflow-wrap: anywhere; }
  .person-cell .who .sub { white-space: normal; overflow: visible; }
  .list-row:has(.row-side .btn) { flex-wrap: wrap; }
  .list-row:has(.row-side .btn) .person-cell { flex: 1 1 100%; }
  .list-row:has(.row-side .btn) .row-side { width: 100%; justify-content: flex-end; }
}

.searchbar { position: relative; margin-bottom: 12px; }
.searchbar input {
  width: 100%; border: 1px solid var(--hairline); border-radius: 999px;
  background: var(--surface); padding: 10px 16px 10px 38px; font-size: 14.5px; min-height: 42px;
}
.searchbar svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* ---------- Modal / bottom sheet ---------- */

.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(11,11,11,.44);
  display: grid; align-items: end; justify-items: stretch;
}
.sheet {
  background: var(--surface); border-radius: 18px 18px 0 0;
  box-shadow: var(--shadow-sheet);
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom));
  max-height: 88dvh; overflow-y: auto;
  animation: slide-up .22s cubic-bezier(.2,.9,.3,1);
}
.sheet-grab {
  width: 40px; height: 4px; border-radius: 2px; background: var(--hairline);
  margin: 6px auto 14px;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h2 { font-size: 17px; }
.sheet-close { border: 0; background: var(--neutral-tint); border-radius: 50%; width: 32px; height: 32px; color: var(--ink-2); display: grid; place-items: center; }
@media (min-width: 640px) {
  .overlay { align-items: center; justify-items: center; }
  .sheet {
    border-radius: 18px; width: min(480px, 92vw); max-height: 90dvh;
    padding-left: 28px; padding-right: 28px;
    padding-bottom: 22px; animation: pop-in .18s ease-out;
  }
  .sheet.sheet-wide { width: min(880px, 94vw); }
  .sheet-grab { display: none; }

  /* Two-column request form: calendar left, everything else right,
     so the whole form fits without scrolling. */
  .req-grid {
    display: grid;
    grid-template-columns: minmax(330px, 400px) 1fr;
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas:
      "dates type"
      "dates attach"
      "dates reason"
      "hint  reason";
    column-gap: 26px;
    align-items: start;
  }
  #type-field { grid-area: type; }
  #dates-field { grid-area: dates; margin-bottom: 8px; }
  #dur-hint { grid-area: hint; }
  #attach-field { grid-area: attach; }
  #reason-field { grid-area: reason; display: flex; flex-direction: column; height: 100%; }
  #reason-field textarea { flex: 1; min-height: 96px; }

  /* On-behalf ("Log time off") variant: employee picker above the type,
     approve toggle sharing the bottom row with the duration hint. */
  .req-grid.on-behalf {
    grid-template-rows: auto auto auto 1fr auto;
    grid-template-areas:
      "dates emp"
      "dates type"
      "dates attach"
      "dates reason"
      "hint  approve";
  }
  .req-grid.on-behalf #emp-field { grid-area: emp; }
  .req-grid.on-behalf #approve-field { grid-area: approve; align-self: center; }
}
@keyframes slide-up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes pop-in { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }

.sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.sheet-actions .btn { flex: 1; }

/* Temp password reveal */
.temp-pass {
  display: flex; align-items: center; gap: 10px;
  background: var(--neutral-tint); border: 1px dashed var(--hairline);
  border-radius: 12px; padding: 14px; margin: 12px 0 4px;
}
.temp-pass code {
  flex: 1; font-family: ui-monospace, "Cascadia Mono", Menlo, monospace;
  font-size: 19px; letter-spacing: .06em; word-break: break-all;
}

/* Action sheet rows (admin manage) */
.action-list { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.action-list button {
  display: flex; align-items: center; gap: 12px;
  border: 0; background: none; text-align: left;
  padding: 13px 10px; border-radius: 10px; font-size: 15px; color: var(--ink);
}
.action-list button:hover { background: var(--neutral-tint); }
.action-list button.danger { color: var(--crit-ink); }
.action-list button .sub { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.action-list svg { flex: none; color: var(--muted); }
.action-list button.danger svg { color: currentColor; }

/* ---------- Range calendar ---------- */

.cal {
  border: 1px solid var(--hairline); border-radius: 12px;
  padding: 10px 10px 8px; background: var(--surface);
  user-select: none;
}
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.cal-title { font-weight: 650; font-size: 14.5px; }
.cal-nav {
  border: 0; background: var(--neutral-tint); color: var(--ink-2);
  width: 34px; height: 34px; border-radius: 9px; font-size: 18px; line-height: 1;
}
.cal-nav:hover:not(:disabled) { background: var(--brand-tint); color: var(--brand); }
.cal-nav:disabled { opacity: .35; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 650; color: var(--muted); padding: 6px 0 4px; }
.cal-day {
  border: 0; background: none; color: var(--ink);
  height: 40px; font-size: 13.5px; font-weight: 500;
  display: grid; place-items: center; border-radius: 9px;
  padding: 0;
}
.cal-day.pad { pointer-events: none; }
.cal-day:hover:not(:disabled):not(.sel):not(.in-range) { background: var(--neutral-tint); }
.cal-day:disabled { color: color-mix(in srgb, var(--muted) 40%, transparent); cursor: default; }
.cal-day.wkend:not(.sel):not(:disabled) { color: var(--muted); }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--brand); }
.cal-day.in-range { background: var(--brand-tint); border-radius: 0; }
.cal-day.sel { background: var(--brand); color: var(--on-brand); font-weight: 700; }
.cal-day.sel.cap-l { border-radius: 9px 0 0 9px; }
.cal-day.sel.cap-r { border-radius: 0 9px 9px 0; }

/* ---------- Attachments ---------- */

.file-chips { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.file-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--neutral-tint); border-radius: 9px;
  padding: 8px 10px; font-size: 13.5px; min-height: 38px;
}
.file-chip svg { flex: none; color: var(--muted); }
.file-chip .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.file-chip .fsize { flex: none; color: var(--muted); font-size: 12px; }
.file-chip button {
  flex: none; border: 0; background: none; color: var(--muted);
  padding: 6px; border-radius: 6px; display: grid; place-items: center;
}
.file-chip button:hover { background: var(--crit-tint); color: var(--crit-ink); }

.doc-row { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; }
.doc-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; color: var(--brand); text-decoration: none; font-weight: 550;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.doc-link:hover { text-decoration: underline; }
.doc-link svg { flex: none; }
@media (prefers-color-scheme: dark) { .doc-link { color: var(--brand-strong); } }

/* ---------- Toasts ---------- */

#toast-region {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: max(20px, env(safe-area-inset-bottom)); z-index: 80;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  width: min(94vw, 420px); pointer-events: none;
}
.toast {
  background: var(--ink); color: var(--page);
  border-radius: 12px; padding: 11px 16px; font-size: 14px; font-weight: 550;
  box-shadow: var(--shadow); display: flex; gap: 9px; align-items: center;
  animation: slide-up .2s ease-out; max-width: 100%;
}
.toast.error { background: #7f1d1d; color: #fff; }

/* ---------- Utility ---------- */

.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--hairline); border-top-color: var(--brand);
  animation: spin .7s linear infinite; margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center-pad { padding: 60px 0; }
.duration-hint .dur-loading { color: var(--muted); }
.duration-hint .spin-sm {
  display: inline-block; width: 11px; height: 11px; vertical-align: -1px; margin-right: 6px;
  border: 2px solid var(--hairline); border-top-color: var(--brand); border-radius: 50%;
  animation: spin .7s linear infinite;
}
details.alloc { margin-top: 10px; }
details.alloc summary {
  cursor: pointer; font-size: 13.5px; color: var(--ink-2); font-weight: 600;
  padding: 6px 2px; user-select: none;
}
.muted-note { color: var(--muted); font-size: 12.5px; margin-top: 8px; }

/* ---------- Approvals (manager / HR) ---------- */

/* Manager role badge on account rows + tab badge alignment. */
.chip.mgr { background: var(--brand-tint); color: var(--brand); }
@media (prefers-color-scheme: dark) { .chip.mgr { color: var(--brand-strong); } }
.tab .badge-mini { margin-left: 6px; padding: 1px 6px; }
.tab[aria-selected="true"] .badge-mini { background: var(--warn); color: #fff; }

/* Read-only rows (a report's sick request a manager may see but not action). */
.list-row.readonly { opacity: .66; }

/* Decision sheet: request detail key/value rows. */
.kv {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 8px 0; border-bottom: 1px solid var(--hairline); font-size: 14px;
}
.kv:last-of-type { border-bottom: 0; }
.kv .k { color: var(--muted); flex: none; }
.kv .v { font-weight: 600; text-align: right; min-width: 0; }
.decision-docs { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; }

.reassign-warn {
  background: var(--warn-tint); color: var(--warn-ink);
  border-radius: 10px; padding: 9px 12px; font-size: 13px; margin: 2px 0 12px;
}

/* ---------- team calendar ---------- */
.page-head.with-actions {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.head-tools { display: flex; align-items: center; gap: 8px; flex: none; flex-wrap: wrap; }
#approve-field { margin: 4px 0 2px; }
.seg {
  display: inline-flex; background: var(--neutral-tint); border-radius: 10px;
  padding: 3px; gap: 2px; flex: none;
}
.seg-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer;
  background: transparent; color: var(--ink-2); font: inherit; font-size: 13px;
  font-weight: 600; padding: 6px 11px; border-radius: 8px; min-height: 32px;
}
.seg-btn.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg-btn svg { opacity: .8; }

.tcal-head {
  display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 12px;
}
.tcal-nav { display: flex; align-items: center; gap: 6px; flex: none; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--hairline); background: var(--surface); color: var(--ink-2);
  border-radius: 9px;
}
.icon-btn:hover { color: var(--ink); }
.tcal-title { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; flex: none; }
.tcal-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  color: var(--muted); font-size: 12.5px;
}
.tcal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tcal-legend .lg-lbl { font-weight: 650; color: var(--ink-2); }
.tcal-legend .lg { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.tcal-legend .lg.dot { border-radius: 50%; }
.tcal-legend .lg.approved { background: var(--good); }
.tcal-legend .lg.pending {
  background: repeating-linear-gradient(45deg, var(--warn), var(--warn) 2px, transparent 2px, transparent 4px), var(--warn-tint);
  border: 1px solid var(--warn);
}
.tcal-legend .lg.refused { background: var(--crit-tint); border: 1px solid var(--crit); }
.tcal-foot { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 12px; }

/* Stacked week rows; each week overlays a spanning-bar grid on a day-cell grid,
   both sharing the column template so bars align to cell edges. */
.tcal-grid {
  display: flex; flex-direction: column; gap: 1px;
  background: var(--hairline); border: 1px solid var(--ring);
  border-radius: var(--radius); overflow: hidden;
}
.tcal-dow-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--hairline); }
.tcal-dow {
  background: var(--surface); text-align: center; font-size: 11.5px; font-weight: 600;
  color: var(--muted); padding: 8px 0; text-transform: uppercase; letter-spacing: .03em;
}
.tcal-week { position: relative; overflow: hidden; }
.tcal-week-bg { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--hairline); }
.tcal-cell { background: var(--surface); min-height: 94px; }
.tcal-cell.out { background: var(--page); }
.tcal-daynum { font-size: 12px; color: var(--ink-2); font-weight: 600; text-align: right; padding: 4px 6px 0; }
.tcal-cell.out .tcal-daynum { color: var(--muted); opacity: .6; }
.tcal-cell.today .tcal-daynum {
  color: #fff; background: var(--brand-strong); border-radius: 999px;
  width: 22px; height: 22px; line-height: 22px; padding: 0; text-align: center; margin: 3px 4px 0 auto;
}
.tcal-bars {
  position: absolute; inset: 0; display: grid; grid-template-columns: repeat(7, 1fr);
  column-gap: 1px; grid-auto-rows: 19px; padding-top: 27px; align-content: start; pointer-events: none;
}
.tcal-bar {
  pointer-events: auto; display: flex; align-items: center; gap: 5px; min-width: 0;
  height: 17px; margin-bottom: 2px; padding: 0 6px; border: 1px solid transparent;
  font: inherit; font-size: 11.5px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; cursor: pointer;
}
.tcal-bar .cdot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.tcal-bnm { overflow: hidden; text-overflow: ellipsis; }
.tcal-bar.sL { border-top-left-radius: 8px; border-bottom-left-radius: 8px; margin-left: 3px; }
.tcal-bar.sR { border-top-right-radius: 8px; border-bottom-right-radius: 8px; margin-right: 3px; }
.tcal-bar.approved { background: var(--good-tint); color: var(--good-ink); }
.tcal-bar.pending {
  background: var(--warn-tint); color: var(--warn-ink); border-color: color-mix(in srgb, var(--warn) 45%, transparent);
}
.tcal-bar.refused { background: var(--crit-tint); color: var(--crit-ink); text-decoration: line-through; opacity: .8; }
.tcal-bar.neutral { background: var(--hover); color: var(--ink-2); }
.tcal-bar:hover { filter: brightness(0.97); }
.tcal-more { pointer-events: auto; align-self: center; font-size: 10.5px; font-weight: 700; color: var(--muted); padding: 0 5px; }

@media (max-width: 620px) {
  .tcal-cell { min-height: 74px; }
  .tcal-bars { padding-top: 25px; grid-auto-rows: 18px; }
  .tcal-bar { font-size: 10.5px; height: 16px; }
  .page-head.with-actions { flex-direction: column; }
  .seg { align-self: flex-start; }
}

/* ---- admin: Odoo connection settings ---- */
.settings-card {
  background: var(--surface); border: 1px solid var(--ring); border-radius: var(--radius);
  padding: 18px 18px 20px; margin-bottom: 16px; max-width: 640px;
}
.settings-card .field { margin-bottom: 14px; }
.conn-status {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px; margin-bottom: 16px;
}
.conn-status .cdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.conn-status.ok { background: var(--good-tint); color: var(--good-ink); }
.conn-status.ok .cdot { background: var(--good); }
.conn-status.warn { background: var(--warn-tint); color: var(--warn-ink); }
.conn-status.warn .cdot { background: var(--warn); }
.lbl-note { font-weight: 400; color: var(--muted); }
.field-hint { margin: 5px 0 0; font-size: 12px; color: var(--muted); line-height: 1.4; }
.field-hint.err { color: var(--crit-ink); }
.settings-adv { margin-bottom: 14px; }
.settings-adv summary {
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2);
  padding: 6px 0; user-select: none;
}
.settings-adv[open] summary { margin-bottom: 8px; }
.settings-actions { display: flex; gap: 10px; }
.set-result { margin-top: 14px; padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 500; }
.set-result.ok { background: var(--good-tint); color: var(--good-ink); }
.set-result.err { background: var(--crit-tint); color: var(--crit-ink); }
.page-head.compact { margin-bottom: 10px; }
.page-head.compact h2 { font-size: 16px; margin: 0 0 2px; }
.types-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.types-table th, .types-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--hairline); }
.types-table th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; }
.types-table td { color: var(--ink); }

/* ---- admin: all requests (bird's-eye) + payroll report ---- */
.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
/* .control is normally styled via .field — these live in a toolbar row. */
.filterbar .control, .report-controls .control {
  width: auto; flex: none; min-height: 38px; padding: 6px 10px; font-size: 13.5px;
  border: 1px solid var(--hairline); border-radius: 10px;
  background: var(--surface); color: var(--ink);
}
.filterbar .control:focus, .report-controls .control:focus {
  outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent;
}
/* multi-select dropdowns (report filters) */
.mselect { position: relative; }
.ms-btn { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.ms-btn svg { opacity: .7; flex: none; }
.ms-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  min-width: 230px; max-height: 300px; overflow: auto;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius-s); box-shadow: var(--shadow); padding: 6px;
}
.ms-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border-radius: 7px; cursor: pointer; font-size: 13.5px; color: var(--ink);
}
.ms-item:hover { background: var(--neutral-tint); }
.ms-item input { accent-color: var(--brand); margin: 0; flex: none; }
.pager {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  margin-top: 12px; color: var(--muted); font-size: 13px;
}
.decision-note { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.report-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.report-controls .spacer { flex: 1; }
.table-scroll {
  overflow-x: auto; background: var(--surface);
  border: 1px solid var(--ring); border-radius: var(--radius);
}
/* separate, not collapse: collapsed borders defeat position:sticky on cells */
.report-table { margin-top: 0; border-collapse: separate; border-spacing: 0; }
.report-table th, .report-table td { white-space: nowrap; }
.report-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.report-table .grp { border-left: 1px solid var(--ring); }
.report-table td.zero { color: var(--muted); opacity: .55; }
.report-table .hl { background: var(--brand-tint); }
.report-table .emp-cell { font-weight: 600; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.report-table tfoot td { font-weight: 700; border-top: 2px solid var(--ring); border-bottom: 0; }
.report-table .tcol { font-weight: 600; background: color-mix(in srgb, var(--neutral-tint) 55%, transparent); }
.report-table .hl.tcol { background: var(--brand-tint); }

/* ---- report overview: KPI tiles + per-employee meter rows ---- */
.rep-kpis { margin-bottom: 14px; }
.rep-legend {
  display: flex; justify-content: flex-end; gap: 14px;
  font-size: 12px; color: var(--muted); margin: 0 2px 6px;
}
.rep-legend span { display: inline-flex; align-items: center; gap: 5px; }
.rep-legend .k { width: 16px; height: 8px; border-radius: 4px; }
.rep-legend .k.tk { background: var(--ink-2); }
.rep-legend .k.pd {
  background: repeating-linear-gradient(45deg,
    color-mix(in srgb, var(--ink-2) 80%, var(--surface)) 0 3px,
    color-mix(in srgb, var(--ink-2) 30%, var(--surface)) 3px 6px);
}
.rep-legend .k.lf { background: color-mix(in srgb, var(--ink-2) 16%, var(--surface)); }
.rep-emp { padding: 12px 14px 13px; border-bottom: 1px solid var(--hairline); }
.rep-emp:last-child { border-bottom: 0; }
.rep-emp-head { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; }
.rep-emp-head .nm { font-weight: 600; font-size: 14.5px; flex: 1; min-width: 0; }
.rep-emp-head .tot { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.rep-emp-head .tot b { font-weight: 650; color: var(--ink); }
.rep-none { color: var(--muted); font-weight: 400; }
.rep-types { display: grid; gap: 7px; margin-top: 9px; }
.rep-type {
  display: grid; grid-template-columns: 175px minmax(140px, 320px) 1fr;
  align-items: center; gap: 4px 12px; font-size: 12.5px;
}
.rep-tname { display: flex; align-items: center; gap: 7px; color: var(--ink-2); min-width: 0; }
.rep-tname .type-dot { width: 8px; height: 8px; }
.rep-tname .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-mw { min-width: 0; }
.rep-meter {
  --tc: var(--brand);
  display: flex; height: 8px; min-width: 24px; border-radius: 999px; overflow: hidden;
  background: color-mix(in srgb, var(--tc) 16%, var(--surface));
}
.rep-meter .sg { height: 100%; flex: none; }
.rep-meter .sg:last-child { border-radius: 0 4px 4px 0; }
.rep-meter .sg + .sg { border-left: 2px solid var(--surface); }
.rep-meter .sg.tk { background: var(--tc); }
.rep-meter .sg.pd {
  background: repeating-linear-gradient(45deg,
    color-mix(in srgb, var(--tc) 85%, var(--surface)) 0 3px,
    color-mix(in srgb, var(--tc) 35%, var(--surface)) 3px 6px);
}
.rep-nums { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rep-nums b { font-weight: 650; color: var(--ink-2); }
.rep-nums b.neg { color: var(--crit-ink); }
.rep-pd {
  display: inline-block; padding: 0 7px; border-radius: 999px;
  background: var(--brand-tint); color: var(--ink-2); font-weight: 600; font-size: 11.5px;
}
@media (max-width: 640px) {
  .rep-type { grid-template-columns: 1fr auto; }
  .rep-type .rep-mw { grid-column: 1 / -1; grid-row: 2; }
  .rep-emp-head .tot { white-space: normal; }
}
