/* Studio YOKO Team Portal. Brand values match src/brand.js */
@font-face { font-family: 'Aileron'; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/aileron-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Aileron'; font-weight: 400; font-style: italic; font-display: swap; src: url(/fonts/aileron-latin-400-italic.woff2) format('woff2'); }
@font-face { font-family: 'Aileron'; font-weight: 600; font-style: normal; font-display: swap; src: url(/fonts/aileron-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Aileron'; font-weight: 700; font-style: normal; font-display: swap; src: url(/fonts/aileron-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Aileron'; font-weight: 800; font-style: normal; font-display: swap; src: url(/fonts/aileron-latin-800-normal.woff2) format('woff2'); }

:root {
  --black: #000; --ink: #1a1a1a; --muted: #5d5c70;
  --lime: #BECF04; --lime-soft: #f3f6c7;
  --purple: #6A65D2; --purple-dark: #5550bd; --purple-soft: #dddcf6;
  --lavender: #EEEEFA; --white: #FEFEFE; --line: #dcdcee;
  --warn: #fff4cc; --danger: #b3261e; --danger-soft: #fde8e6; --ok-soft: #e9f3c2;
  --r: 22px; --r-sm: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--lavender); color: var(--ink); font: 400 15px/1.5 'Aileron', Helvetica, Arial, sans-serif; }
a { color: var(--purple-dark); }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 12px; color: var(--black); }
h1 { font-size: clamp(30px, 5vw, 46px); }
h2 { font-size: 22px; }
h3 { font-size: 17px; letter-spacing: -0.01em; }
p { margin: 0 0 12px; }
small, .muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Header */
.top { background: var(--black); color: var(--lavender); position: sticky; top: 0; z-index: 20; }
.top-inner { max-width: 1200px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 18px; }
.top .logo img { height: 40px; display: block; }
.nav { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--lavender); text-decoration: none; padding: 8px 14px; border-radius: 999px; font-weight: 600; white-space: nowrap; font-size: 14px; }
.nav a:hover { background: #1f1f1f; }
.nav a.on { background: var(--lime); color: var(--black); }
.nav .count { background: var(--purple); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; margin-left: 4px; }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; white-space: nowrap; }
.who form { margin: 0; }
.who button { background: none; border: 1px solid #333; color: var(--lavender); border-radius: 999px; padding: 6px 12px; cursor: pointer; font: inherit; }
.who button:hover { border-color: var(--lime); }

main { max-width: 1200px; margin: 0 auto; padding: 28px 20px 80px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin-top: 6px; }

/* Cards & grid */
.card { background: var(--white); border-radius: var(--r); padding: 22px; margin-bottom: 18px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

.stat { border-radius: var(--r); padding: 20px; background: var(--white); }
.stat .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.stat .value { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat.purple { background: var(--purple); color: var(--lavender); }
.stat.purple .label, .stat.purple .hint { color: #dcdaf8; }
.stat.lime { background: var(--lime); color: var(--black); }
.stat.lime .label, .stat.lime .hint { color: #2d3100; }
.stat.black { background: var(--black); color: var(--lavender); }
.stat.black .label, .stat.black .hint { color: #b9b8d0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 999px; padding: 11px 20px; font: 700 14px/1 'Aileron', sans-serif; cursor: pointer; text-decoration: none; background: var(--purple); color: #fff; }
.btn:hover { background: var(--purple-dark); }
.btn.lime { background: var(--lime); color: var(--black); }
.btn.lime:hover { background: #aebe00; }
.btn.black { background: var(--black); color: var(--lavender); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--purple); }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px #f0c4c0; }
.btn.danger.armed { background: var(--danger); color: #fff; }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Forms */
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.field .help { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=month], select, textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--r-sm); font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft); }
textarea { min-height: 80px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--purple); }
.inline-form { display: inline; margin: 0; }
fieldset { border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 14px; margin: 0 0 14px; }
legend { font-weight: 700; padding: 0 6px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week label { text-align: center; font-size: 12px; }
.week select { padding: 8px 4px; font-size: 13px; }
@media (max-width: 620px) { .week { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Tables (black header like YOKO invoices) */
.table-wrap { overflow-x: auto; border-radius: var(--r-sm); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { background: var(--black); color: var(--lavender); font-weight: 700; text-align: left; padding: 10px 12px; white-space: nowrap; }
table.t th.num { text-align: right; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tbody tr:nth-child(even) td { background: #f7f7fd; }
table.t tr.total td { background: var(--lime) !important; color: var(--black); font-weight: 800; }
table.t tr.muted-row td { color: var(--muted); }
table.t td details summary { cursor: pointer; color: var(--purple-dark); font-weight: 600; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.b-pending { background: var(--lime); color: #000; }
.b-approved { background: var(--purple); color: #fff; }
.b-rejected { background: #000; color: var(--lavender); }
.b-cancelled { background: #e2e2ea; color: #555; }
.b-soft { background: var(--purple-soft); color: #2f2b8a; }
.b-warn { background: var(--warn); color: #6b5200; }
.b-danger { background: var(--danger-soft); color: var(--danger); }

/* Alerts */
.flash { border-radius: var(--r-sm); padding: 12px 16px; margin-bottom: 16px; font-weight: 600; }
.flash.ok { background: var(--ok-soft); }
.flash.error { background: var(--danger-soft); color: var(--danger); }
.note { background: var(--lavender); border-radius: var(--r-sm); padding: 12px 14px; font-size: 14px; }
.note.warn { background: var(--warn); }
.note.error { background: var(--danger-soft); color: var(--danger); }
.note.lime { background: var(--lime-soft); }
.note ul { margin: 6px 0 0; padding-left: 18px; }

/* Tabs */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 18px; scrollbar-width: none; }
.tabs a { padding: 9px 16px; border-radius: 999px; background: var(--white); text-decoration: none; color: var(--ink); font-weight: 700; font-size: 14px; white-space: nowrap; }
.tabs a.on { background: var(--black); color: var(--lavender); }

/* Leave preview */
.preview { margin-top: 12px; }
.days { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.day { border-radius: 10px; padding: 6px 8px; font-size: 12px; min-width: 62px; text-align: center; background: #f1f1f7; }
.day b { display: block; font-size: 13px; }
.day.c1 { background: var(--purple); color: #fff; }
.day.cR { background: #e8e8ef; }
.day.cH { background: var(--lime); }
.day.cO { background: #d6d4f5; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--c); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 18px 38px; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 4px; width: 16px; height: 16px; border-radius: 6px; background: var(--purple); }
.timeline li.k-start::before, .timeline li.k-end::before { background: var(--black); }
.timeline li.k-raise::before { background: var(--lime); }
.timeline li.k-cut::before { background: #f1a79f; }
.timeline li.k-status::before { background: #000; box-shadow: 0 0 0 3px var(--lime); }
.timeline li.k-maternity::before { background: #e9a8d8; }
.timeline li.k-adjust::before { background: #aaa; }
.timeline .when { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.timeline .what { font-weight: 800; }
.timeline .detail { font-size: 14px; color: var(--muted); }

/* Holiday picks */
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.pick { display: flex; gap: 6px; align-items: center; }
.pick input { flex: 1; }
.pick .x { background: none; border: 0; font-size: 20px; cursor: pointer; color: var(--muted); padding: 0 6px; }

/* Auth pages */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px 140px; position: relative; overflow: hidden; }
.auth .box { background: var(--white); border-radius: 28px; padding: 34px; width: 100%; max-width: 420px; position: relative; z-index: 1; }
.auth .brandmark { background: var(--black); border-radius: 22px; padding: 22px; display: flex; justify-content: center; margin-bottom: 24px; }
.auth .brandmark { padding: 30px 26px; }
.auth .brandmark img { width: 100%; max-width: 280px; height: auto; }
.blocks { position: absolute; right: 0; bottom: -40px; display: flex; gap: 18px; }
.blocks span { display: block; background: var(--lime); border-radius: 28px 28px 0 0; height: 120px; }
.blocks span:nth-child(1) { width: 110px; } .blocks span:nth-child(2) { width: 110px; } .blocks span:nth-child(3) { width: 280px; }
@media (max-width: 620px) { .blocks span:nth-child(3) { width: 120px; } .blocks { bottom: -70px; } }

.split { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; }
.pw { font: 700 20px/1.2 ui-monospace, Menlo, monospace; background: var(--lime); padding: 6px 10px; border-radius: 8px; display: inline-block; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.empty { color: var(--muted); padding: 10px 0; }
footer.foot { text-align: center; font-size: 12px; color: var(--muted); padding: 20px; }

@media (max-width: 760px) {
  .top-inner { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .top .logo img { height: 34px; }
  .who { margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; }
  main { padding: 20px 16px 60px; }
  table.t { min-width: 600px; }
  .card { padding: 18px; }
}

/* Leave summary with hover info */
.summary { margin-top: 14px; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 4px 14px; }
.sumline { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.sumline:last-child { border-bottom: 0; }
.sumline b { font-size: 16px; font-variant-numeric: tabular-nums; }
.info { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 6px; border-radius: 50%;
  border: 1.5px solid var(--purple); color: var(--purple); font: 700 11px/1 Georgia, serif; font-style: italic; cursor: help; vertical-align: 1px; outline: none; }
.info .tip { display: none; position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); background: var(--black); color: var(--lavender);
  font: 600 13px/1.6 'Aileron', sans-serif; font-style: normal; padding: 10px 14px; border-radius: 12px; white-space: nowrap; z-index: 30; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.info .tip::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top-color: var(--black); }
.info:hover .tip, .info:focus .tip, .info:focus-within .tip { display: block; }
.info:hover, .info:focus { background: var(--purple); color: #fff; }

/* Dropdowns: custom arrow with breathing room */
select { -webkit-appearance: none; appearance: none; padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%231a1a1a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 12px 8px; }
.week select { padding-right: 30px; background-position: right 10px center; }

/* Deleted (restorable) rows */
table.t tr.deleted-row td { color: #9a99ad; text-decoration: line-through; text-decoration-color: #c8c7d8; }
table.t tr.deleted-row td .keep { text-decoration: none; display: inline-block; }
.b-deleted { background: #e2e2ea; color: #666; }

/* Confirmation modal */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal-back.open { display: flex; }
.modal { background: var(--white); border-radius: 26px; padding: 28px; max-width: 440px; width: 100%; text-align: center; }
.modal .emoji { font-size: 44px; line-height: 1; margin-bottom: 10px; }
.modal h2 { margin-bottom: 8px; }
.modal .actions { justify-content: center; margin-top: 18px; }

/* Holiday slots */
.slots { display: grid; gap: 8px; }
.slot { display: grid; grid-template-columns: 34px minmax(140px, 190px) 1fr; gap: 8px; align-items: center; }
.slot .n { width: 30px; height: 30px; border-radius: 10px; background: var(--lavender); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
@media (max-width: 620px) { .slot { grid-template-columns: 30px 1fr; } .slot input[type=text] { grid-column: 2; } }
.locked-list { display: grid; gap: 6px; }
.locked-list .item { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--lime-soft); border-radius: 12px; font-size: 14px; }

/* Settlement lines */
table.t.settle td:nth-child(2) { color: var(--muted); font-size: 13px; }
.handbook { font-size: 15px; line-height: 1.7; }
.handbook h2, .handbook h3 { margin-top: 18px; }
.inline-bonus summary { list-style: none; }
.inline-bonus summary::-webkit-details-marker { display: none; }
.inline-bonus[open] .btn { background: var(--black); color: var(--lavender); }
.inline-bonus form { margin-top: 8px; display: grid; gap: 6px; min-width: 260px; }
.timeline li.k-gift::before { background: var(--lime); }
.timeline li.k-doc::before { background: #fff; box-shadow: inset 0 0 0 3px var(--purple); }

/* Batch 2 */
.btn.red { background: var(--danger); color: #fff; }
.btn.red:hover { background: #a3281d; }
.tabs.sub { margin-top: -8px; }
.tabs.sub a { padding: 6px 13px; font-size: 13px; background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.tabs.sub a.on { background: var(--purple); color: #fff; box-shadow: none; }
.is-partner [data-staff-only] { display: none !important; }
.linkbtn { background: none; border: 0; padding: 0; font: 700 13px 'Aileron', sans-serif; color: var(--purple); cursor: pointer; text-decoration: underline; }
.payline { font-size: 14px; margin-bottom: 8px; }
.payline b { white-space: nowrap; }
.payctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.payctl .kd { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; }
.payctl .kd input { width: 120px; }
.payextra { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px; padding: 10px; background: var(--lavender); border-radius: 12px; }
.payextra input, .payextra select { width: auto; min-width: 0; }
.payextra input[type=text] { flex: 1 1 140px; }
.modal.left { text-align: left; max-width: 520px; }
.modal.left .actions { justify-content: flex-end; }
.law { background: var(--lavender); border-radius: 12px; padding: 12px 14px; font-size: 13px; margin: 12px 0; }
details.previews > summary { cursor: pointer; font-weight: 800; font-size: 16px; list-style: none; }
details.previews > summary::-webkit-details-marker { display: none; }
details.previews > summary::after { content: ' ▾'; color: var(--muted); }
details.previews[open] > summary::after { content: ' ▴'; }
.preview-list { display: grid; gap: 6px; margin-top: 12px; }
.preview-list .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; background: var(--lavender); border-radius: 12px; font-size: 14px; }
[hidden] { display: none !important; }
.offrow { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(170px, 1.3fr) minmax(180px, 1fr) 180px; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.offrow .who { font-weight: 700; }
.offrow .what { color: var(--muted); }
.offrow .when { color: var(--muted); text-align: right; white-space: nowrap; }
.offrow .offact { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.offrow.offhead { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 4px 0 8px; }
.offrow.offhead .r { text-align: right; }
.offrow.reminders { display: flex; justify-content: space-between; border-bottom: 0; font-size: 13px; gap: 12px; }
@media (max-width: 760px) { .offrow { grid-template-columns: 1fr auto; } .offrow .what, .offrow.offhead { display: none; } .offrow .offact { grid-column: 1 / -1; } }
.btn.armed { background: var(--danger) !important; color: #fff !important; box-shadow: none !important; }
.payextra { flex-wrap: nowrap; }
.payextra input[type=text] { min-width: 120px; }
.back-link { display: inline-block; margin-bottom: 8px; font-weight: 700; font-size: 14px; color: var(--purple); text-decoration: none; }
.settings-list { display: grid; gap: 0; }
.settings-list a { display: flex; justify-content: space-between; align-items: center; padding: 16px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.settings-list a:last-child { border-bottom: 0; }
.settings-list a b { font-size: 16px; }
.settings-list a small { display: block; color: var(--muted); margin-top: 2px; }
.settings-list a::after { content: '›'; font-size: 22px; color: var(--muted); }
.pdf-frame { width: 100%; height: 78vh; border: 0; display: block; background: #fff; }
.amber { color: #b26a00; font-weight: 700; }
.checklist { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.checklist .done { color: #5a6500; font-weight: 700; }
.loginrow { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.loginrow .actions { display: flex; gap: 8px; }
.pill { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 1.3; }
.p-full { background: var(--lime); color: #000; }
.p-part { background: #000; color: var(--lavender); }
.p-partner { background: var(--purple); color: #fff; }
.p-leaving { background: var(--danger); color: #fff; }
.p-left { background: #e2e2ea; color: #555; }
.typepair { display: flex; gap: 8px; }
.typepair select { flex: 1 1 0; min-width: 0; }
tr.editrow > td { background: #f7f7fd; border-top: 2px solid var(--black) !important; border-bottom: 2px solid var(--black) !important; padding: 18px 16px !important; }
tr.editrow form { min-width: 0 !important; }
tr.editing > td { background: #f7f7fd; }
/* Same title position on every page (the back link sits in a fixed slot above it) and no side-to-side jumps */
html { overflow-y: scroll; scrollbar-gutter: stable; }
main { padding-top: 14px; }
.page-head { position: relative; padding-top: 24px; }
.back-link { position: absolute; top: 0; left: 0; margin: 0; line-height: 20px; font-size: 13px; }
/* Payroll: every cell centred vertically; KWD box as tall as the pills */
.payroll-table td { vertical-align: middle; }
.payctl .kd { line-height: 1; }
.payctl .kd input { height: 31px; padding: 4px 10px; font-size: 13px; }
.payroll-table .payctl { flex-wrap: nowrap; }
.payroll-table td:last-child { min-width: 400px; }
/* Payroll: all cells share one centre line (beats the general "top" rule) */
table.t.payroll-table td { vertical-align: middle; }
table.t.payroll-table .payctl > span { white-space: nowrap; }
table.t.payroll-table .btn { white-space: nowrap; }
/* KWD box exactly as tall as the small pill buttons, label on the same line */
table.t.payroll-table .payctl { align-items: center; }
table.t.payroll-table .payctl .kd { display: inline-flex; align-items: center; gap: 6px; line-height: 27px; }
table.t.payroll-table .payctl .kd input { height: 27px; min-height: 0; padding: 0 10px; border-radius: 999px; box-sizing: border-box; line-height: 25px; }
table.t.payroll-table .payctl .kd { margin: 0; }
/* Pay column: fixed slots so Paid and +/- line up straight down every row */
table.t.payroll-table .payctl { display: grid; grid-template-columns: 190px 170px 64px auto; gap: 10px; justify-items: start; }
table.t.payroll-table .payctl .kd input { width: 120px; }
/* Leave form: type wide, dates just wide enough; preview left, note + override right */
.lv-top { display: grid; grid-template-columns: minmax(330px, 2fr) 170px 170px minmax(140px, 1fr); gap: 14px; align-items: end; }
.lv-mid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.lv-mid .preview { margin-top: 0; }
.lv-mid .preview .grid { grid-template-columns: 1fr !important; margin-top: 0 !important; }
.lv-mid .preview .summary { margin-top: 10px; }
.lv-actions { margin-top: 12px; }
@media (max-width: 900px) { .lv-top { grid-template-columns: 1fr 1fr; } .lv-top > :first-child { grid-column: 1 / -1; } .lv-mid { grid-template-columns: 1fr; } }
.lv-top { align-items: start; }
/* Admin leave form: purple card (fixed height) holds days + how they're counted; Note/Override match its height exactly */
.lv-mid { align-items: stretch; }
.pv-card { height: 150px; box-sizing: border-box; background: var(--purple); color: #fff; border-radius: 22px; padding: 18px 20px; display: grid; grid-template-columns: 150px 1fr; gap: 16px; overflow: hidden; }
.pv-card .label { font-size: 13px; font-weight: 600; opacity: .85; }
.pv-card .value { font: 800 40px/1.1 'Aileron', sans-serif; margin: 6px 0 4px; }
.pv-card .hint { font-size: 12px; opacity: .85; }
.pv-lines { align-self: center; font-size: 12.5px; }
.pv-lines .sumline { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; border: 0; color: #fff; }
.pv-lines .sumline b { color: #fff; }
.pv-lines .info { background: rgba(255,255,255,.25); color: #fff; }
.lv-side { display: flex; flex-direction: column; justify-content: space-between; height: 150px; }
.lv-side .field { margin: 0; }
.lv-mid + .preview:not(:empty) { margin-top: 12px; }
.pv-card { overflow: visible; }
.pv-lines .sumline b { font-size: 13px; }
.pv-lines .tip { color: var(--ink); }
/* Top row mirrors the row below: Type = purple box width; dates + status = Note width, three equal boxes */
.lv-top { grid-template-columns: 1fr 1fr; gap: 18px; }
.lv-right { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lv-right .field { margin-bottom: 0; }
@media (max-width: 900px) { .lv-top { grid-template-columns: 1fr; } .lv-right { grid-template-columns: 1fr 1fr 1fr; } }
.btn { white-space: nowrap; }
.settle-pay { grid-template-columns: 1fr 1fr 1fr auto; }
@media (max-width: 760px) { .settle-pay { grid-template-columns: 1fr; } }
/* Titles start exactly at the box's left edge (everywhere) */
.field > label:not(.check) { padding-left: 0; margin-left: 0; }
/* Final settlement "paid" row: compact date and KD boxes, note takes the rest, buttons fit their text */
.settle-pay { grid-template-columns: 170px 150px 1fr auto; align-items: end !important; }
.settle-pay .field { margin-bottom: 0; }
.settle-pay input[type=date] { height: 44px; }
.settle-pay input { height: 44px; }
.settle-pay .actions .btn { height: 44px; }
/* Opening +/- must never widen the column: the box fills the cell but doesn't size it */
table.t.payroll-table .payextra { width: 0; min-width: 100%; box-sizing: border-box; }
table.t.payroll-table .payextra select { flex: 0 0 110px; }
table.t.payroll-table .payextra .kd { flex: 1 1 0; min-width: 0; }
table.t.payroll-table .payextra .kd input { width: 100%; min-width: 60px; }
table.t.payroll-table .payextra input[type=text] { flex: 2 1 0; min-width: 0; }
table.t.payroll-table .payextra input[type=number] { min-width: 0; }
table.t.payroll-table .payextra { align-items: center; }
table.t.payroll-table .payextra .kd { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 700; font-size: 13px; padding: 0; }
table.t.payroll-table .payextra select, table.t.payroll-table .payextra input { height: 40px; }
/* Payroll: breakdown lives in the (i) next to Due, so every row is the same height */
table.t.payroll-table .pay-info { margin: 0 8px 0 0; }
table.t.payroll-table .pay-info .tip { left: auto; right: -12px; transform: none; text-align: left; }
table.t.payroll-table .pay-info .tip::after { left: auto; right: 15px; }
@media (min-width: 900px) { .table-wrap:has(.payroll-table) { overflow: visible; } }
table.t.payroll-table .pay-info { margin: 0 0 0 8px; vertical-align: middle; position: relative; top: -3px; }
table.t.payroll-table .pay-info.blank { visibility: hidden; }
/* Payroll layout v3: left-aligned money columns of equal width; Paid and +/- on the right edge */
table.t.payroll-table th.num, table.t.payroll-table td.num { text-align: left; }
table.t.payroll-table th:nth-child(2), table.t.payroll-table th:nth-child(3), table.t.payroll-table th:nth-child(4) { width: 175px; }
table.t.payroll-table .pay-info.blank { display: none; }
table.t.payroll-table .payctl { grid-template-columns: 200px 200px 1fr auto; gap: 10px; padding-right: 10px; }
table.t.payroll-table .payctl > :nth-child(3) { justify-self: end; }
table.t.payroll-table { table-layout: fixed; width: 100%; }
table.t.payroll-table th:nth-child(1) { width: 215px; }
table.t.payroll-table th:nth-child(2), table.t.payroll-table th:nth-child(3), table.t.payroll-table th:nth-child(4) { width: 150px; }
table.t.payroll-table td:last-child { min-width: 0; }
table.t.payroll-table td:first-child { overflow: hidden; text-overflow: ellipsis; }
table.t.payroll-table .payctl { grid-template-columns: auto auto 1fr auto; gap: 10px; }
table.t.payroll-table .payctl .kd { margin-left: 14px; }
table.t.payroll-table .payctl .kd input { width: 105px; }
table.t.payroll-table .payextra select { flex: 0 0 120px; width: 120px; }
table.t.payroll-table .payextra .kd { flex: 0 0 auto; }
table.t.payroll-table .payextra .kd input { width: 110px; min-width: 110px; }
table.t.payroll-table .payextra input[type=text] { flex: 1 1 0; min-width: 0; }
table.t.payroll-table .payextra select { flex: 0 0 105px; width: 105px; }
table.t.payroll-table .payextra .kd input { width: 90px; min-width: 90px; }
/* Employee leave preview: days · balance after · breakdown in one row of equal height */
.pv-row { align-items: stretch; }
.pv-row .summary.pv-sum { margin-top: 0; background: var(--white); border-radius: var(--r); padding: 8px 20px; display: flex; flex-direction: column; justify-content: center; }
table.t.payroll-table th:nth-child(1) { width: 155px; }
table.t.payroll-table th:nth-child(2), table.t.payroll-table th:nth-child(3), table.t.payroll-table th:nth-child(4) { width: 170px; }
table.t.payroll-table .pay-amt { display: inline-block; min-width: 118px; }
/* Status colours: pending purple, approved lime, rejected red */
.b-pending { background: var(--purple); color: #fff; }
.b-approved { background: var(--lime); color: #000; }
.b-rejected { background: var(--danger); color: #fff; }
/* Leave list: Approve / Reject on the right, in line with Edit */
td.row-acts { white-space: nowrap; text-align: right; }
td.row-acts .decide { display: inline-flex; gap: 8px; margin: 0 14px 0 0; vertical-align: middle; }
td.row-acts > details { display: inline-block; vertical-align: middle; }
.btn.red { background: var(--danger); color: #fff; }
td.row-acts .linkbtn { vertical-align: middle; }
td.row-acts .decide { margin-top: 0; margin-bottom: 0; }
td.row-acts .decide .btn { margin: 0; }
table.t tr:has(> td.row-acts) > td { vertical-align: middle; }
td.row-acts { line-height: 0; } td.row-acts .linkbtn { line-height: 1.5; }
.pill.p-test, .p-test { background: #e2e2ea; color: #555; }
.note.plain { background: var(--white); }
/* Side-by-side action cards: same description height so boxes line up; button bottom-right */
.card-row { align-items: stretch; }
.card-row > .card { display: flex; flex-direction: column; }
.card-row > .card > p.muted { min-height: 3lh; margin-bottom: 14px; }
.card-row > .card > .btn { margin-top: auto; align-self: flex-end; }
.card-row > .card > .field:last-of-type { margin-bottom: 18px; }
.field > label.check { padding-left: 0; } .field > label.check input[type=checkbox] { margin-left: 0; }
/* Leave pill: Add leave panel */
.add-leave { margin-top: 14px; padding: 18px; border: 1.5px solid var(--line); border-radius: var(--r-sm); }
.add-leave .lv-actions { justify-content: flex-end; }
/* Fold-away card (details) */
details.fold > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h2 { margin: 0; }
details.fold .fold-hint { font: 700 13px 'Aileron', sans-serif; color: var(--purple); text-decoration: underline; }
details.fold .fold-hint::after { content: 'Show ▸'; }
details.fold[open] .fold-hint::after { content: 'Hide ▾'; }
details.fold[open] > summary { margin-bottom: 14px; }
/* Leave tables share one column layout so Waiting and All leave line up */
table.t.leave-t { table-layout: fixed; width: 100%; }
table.t.leave-t th:nth-child(1) { width: 17%; } table.t.leave-t th:nth-child(2), table.t.leave-t th:nth-child(3) { width: 13%; }
table.t.leave-t th:nth-child(4) { width: 6%; } table.t.leave-t th:nth-child(5) { width: 9%; } table.t.leave-t th:nth-child(6) { width: 10%; }
table.t.leave-t th:nth-child(7) { width: 13%; } table.t.leave-t th:nth-child(8) { width: 19%; }
table.t.leave-t td { overflow: hidden; text-overflow: ellipsis; }
table.t.leave-t th:nth-child(1) { width: 15%; } table.t.leave-t th:nth-child(5) { width: 11%; }
table.t.leave-t td:nth-child(5) { white-space: normal; overflow: visible; }
table.t.leave-t td:nth-child(5) small { white-space: nowrap; font-size: 11px; }
/* ---------- Public holidays: full-year calendar ---------- */
.hol-year > summary .hol-sum { display: inline-flex; align-items: center; gap: 10px; }
.hol-year .counter { font-weight: 800; font-size: 15px; }
.hol-year .hol-sum .muted { font-size: 13px; }
.cal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 22px; }
@media (max-width: 900px) { .cal-grid { grid-template-columns: repeat(2, 1fr); } }
.mon h4 { margin: 0 0 6px; font-size: 14px; }
.mon .wk, .mon .days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.mon .wk span { font-size: 10px; color: #888; font-weight: 700; }
.mon .d { all: unset; box-sizing: border-box; height: 26px; line-height: 26px; border-radius: 7px; font: 600 12px 'Aileron', sans-serif; text-align: center; cursor: pointer; color: var(--ink); }
.mon .d:hover { outline: 2px solid var(--ink); }
.mon .d.past { color: #b9b9c6; }
.mon .d.fri { background: repeating-linear-gradient(135deg, #f1f1f6 0 3px, #fff 3px 6px); color: #aaa; }
.mon .d.fri:not(.past) { background: repeating-linear-gradient(135deg, #d6d6e2 0 3px, #fff 3px 6px); color: #666; }
.mon .d.today { background: var(--lime); color: #000; }
.mon .d.hpick { background: var(--purple); color: #fff; }
.mon .d.hpick.past { background: #c9c7ef; color: #fff; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: #555; margin-top: 16px; align-items: center; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; }
.legend .lg-up { background: var(--purple); } .legend .lg-done { background: #c9c7ef; } .legend .lg-today { background: var(--lime); }
.legend .lg-fri { background: repeating-linear-gradient(135deg, #f1f1f6 0 3px, #fff 3px 6px); border: 1px solid #ddd; }
.legend .lg-fri-up { background: repeating-linear-gradient(135deg, #d6d6e2 0 3px, #fff 3px 6px); border: 1px solid #ccc; }
.hol-foot { margin-top: 14px; }
.hol-allow { display: flex; align-items: center; gap: 6px; font-size: 13px; flex-wrap: wrap; }
.hol-allow input { width: 80px; height: 30px; }
.cal-tip { position: fixed; z-index: 60; background: #000; color: var(--lavender); font: 600 12px/1.5 'Aileron', sans-serif; padding: 8px 12px; border-radius: 10px; pointer-events: none; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }
.cal-tip small { color: #b9b8d0; font-size: 11px; }
/* Pop-up layout: icon left, centred title, left text, buttons right */
.modal.pm { text-align: left; max-width: 460px; }
.pm .pm-head { position: relative; text-align: center; padding: 0 46px; margin-bottom: 14px; }
.pm .pm-ic { position: absolute; left: 0; top: 0; font-size: 30px; line-height: 1; }
.pm .pm-head h2 { margin: 0; }
.pm .pm-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.pm .pm-body { color: var(--muted); font-size: 14px; line-height: 1.55; }
.pm .pm-body .field { margin-top: 12px; }
.pm .pm-act { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
/* ---------- Dashboard: 45-day list beside a 30-day calendar ---------- */
.two.dash-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: stretch; margin-bottom: 18px; }
.two.dash-two > .card { margin: 0; }
@media (max-width: 980px) { .two.dash-two { grid-template-columns: 1fr; } .offc .lwrap { min-height: 420px; } }
.offc { display: flex; flex-direction: column; }
.offc .lwrap { flex: 1 1 auto; position: relative; min-height: 0; }
.offc .list { position: absolute; top: 0; bottom: 0; left: 0; right: 18px; overflow-y: auto; scrollbar-width: none; }
.offc .list::-webkit-scrollbar { display: none; }
.offc .track { position: absolute; top: 0; bottom: 0; right: 0; width: 8px; border-radius: 8px; background: #ececf5; cursor: pointer; }
.offc .thumb { position: absolute; left: 0; right: 0; top: 0; border-radius: 8px; background: var(--purple); cursor: grab; }
.offc .fade { position: absolute; left: 0; right: 18px; bottom: 0; height: 48px; background: linear-gradient(rgba(255,255,255,0), #fff); pointer-events: none; display: flex; align-items: flex-end; justify-content: center; }
.offc .fade span { background: #fff; border: 1.5px solid var(--line); border-radius: 999px; font-size: 12px; font-weight: 700; padding: 3px 12px; color: var(--purple); }
.offc .lwrap.no-scroll .track, .offc .lwrap.no-scroll .fade, .offc .lwrap.at-end .fade { display: none; }
.offc .offrow { grid-template-columns: 1fr auto; grid-template-areas: "who when" "what act"; row-gap: 4px; font-size: 13px; padding: 10px 0; }
.offc .offrow .who { grid-area: who; } .offc .offrow .what { grid-area: what; } .offc .offrow .when { grid-area: when; } .offc .offrow .offact { grid-area: act; }
.offc .offrow .what { display: block !important; }
.offc .offrow.offhead { display: none; }
.offc .rem-row { margin-top: 12px; font-size: 12px; }
i.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; box-sizing: border-box; border: 1.5px solid var(--c); }
.calc .tl { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 12px; }
.calc .tl .h { font-size: 11px; color: #888; font-weight: 700; text-align: center; }
.calc .tl .c { min-height: 70px; border-radius: 10px; background: #f6f6fb; padding: 5px; display: flex; flex-direction: column; gap: 3px; }
.calc .tl .c.today { box-shadow: inset 0 0 0 2px var(--lime); }
.calc .tl .c.out { background: transparent; }
.calc .tl .n { font-size: 11px; font-weight: 700; color: #555; }
.calc .bar { height: 10px; border-radius: 4px; box-sizing: border-box; border: 1.5px solid var(--c); cursor: default; }
.calc .bar.pend, .legend.dl i.pend { opacity: .45; border-style: dashed; }
.legend.dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 14px; }
.legend.dl i { width: 22px; height: 12px; box-sizing: border-box; border: 1.5px solid var(--c); }
.rem-pm { max-width: 560px; }
.rem-pm .pm-body { max-height: 55vh; overflow-y: auto; }
.rem-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); color: var(--ink); }
.rem-item input { margin-top: 3px; flex: 0 0 auto; width: 18px; height: 18px; }
.rem-item span, .rem-item small { color: var(--muted); }
input[type=checkbox] { accent-color: var(--purple); }
/* Profile: read-only facts until Edit */
.facts { margin-top: 14px; row-gap: 14px; }
.fact { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fact span { font-size: 12px; font-weight: 600; color: var(--muted); }
.fact b { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.fact b.notes { white-space: pre-wrap; font-weight: 400; }
.example { position: relative; opacity: .55; }
.example .ex-tag { position: absolute; right: 10px; top: -10px; z-index: 2; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
/* Payment history: one line per payment or item, action on the right */
.pline { display: flex; align-items: center; gap: 12px; font-size: 13px; padding: 2px 0; }
.pline > span { flex: 1; min-width: 0; }
.pline > .linkbtn, .pline > form { margin-left: auto; flex: 0 0 auto; }
.linkbtn.danger-link { color: var(--danger); }
.linkbtn.danger-link.armed { background: var(--danger); color: #fff; border-radius: 999px; padding: 2px 8px; text-decoration: none; }
.mpick { display: flex; gap: 8px; }
.mpick select:first-child { flex: 1 1 auto; min-width: 0; }
.mpick select:last-child { flex: 0 0 96px; }
form.actions .mpick select { height: 34px; }
.stat .paysum { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin-top: 8px; font-size: 13px; align-items: baseline; }
.stat .paysum b { font-size: 15px; font-weight: 800; }
a.stat:hover { filter: brightness(.97); }
.offrow .who a { color: inherit; text-decoration: none; } .offrow .who a:hover { text-decoration: underline; color: var(--purple); }
.offrow .decide { display: inline-flex; gap: 6px; margin: 0; }
.calc a.bar { display: block; cursor: pointer; } .calc a.bar:hover { outline: 2px solid var(--ink); outline-offset: 1px; }
/* Who's off: a normal table like every other one */
table.t.off-t { width: 100%; }
table.t.off-t td, table.t.off-t th { vertical-align: middle; }
table.t.off-t th.r, table.t.off-t td.offact { text-align: right; }
table.t.off-t .offact-in { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; }
table.t.off-t td.offwho { font-weight: 700; white-space: nowrap; }
table.t.off-t td.what { color: var(--muted); }
table.t.off-t td.when { white-space: nowrap; color: var(--muted); }
.offc table.t.off-t { font-size: 13px; }
.offc table.t.off-t td, .offc table.t.off-t th { padding: 9px 8px; }
.vscroll thead th { position: sticky; top: 0; z-index: 2; }
/* Team on the dashboard: 5 rows, then scroll */
.vscroll { position: relative; }
.vscroll > .list { overflow-y: auto; scrollbar-width: none; margin-right: 18px; }
.vscroll > .list::-webkit-scrollbar { display: none; }
.vscroll > .track { position: absolute; top: 0; bottom: 0; right: 0; width: 8px; border-radius: 8px; background: #ececf5; cursor: pointer; }
.vscroll > .track .thumb { position: absolute; left: 0; right: 0; top: 0; border-radius: 8px; background: var(--purple); cursor: grab; }
.vscroll.no-scroll > .track { display: none; } .vscroll.no-scroll > .list { margin-right: 0; }
.offc .lwrap .list table.t.off-t thead th { position: sticky; top: 0; z-index: 2; }
table.t.off-t td.offwho a { color: inherit; text-decoration: none; } table.t.off-t td.offwho a:hover { color: var(--purple); text-decoration: underline; }
table.t.off-t .decide { display: inline-flex; gap: 6px; margin: 0; }
table.t.off-t td.offwho { white-space: normal; }
table.t.off-t td.offwho .what { font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 2px; }
table.t.off-t td.offwho i.sw { vertical-align: -1px; }
table.t.off-t td.offwho .what { padding-left: 19px; }
table.t.off-t td.offwho { font-weight: 700; }
table.t.off-t td.offwho a { white-space: nowrap; }
.legend-scroll > .list { max-height: 104px; }
.legend i.pend { opacity: .45; border: 1.5px dashed var(--c); width: 22px; height: 12px; box-sizing: border-box; }
/* 4 or more people off on one day: bars go two per line */
.calc .tl .c.many { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; align-content: start; }
.calc .tl .c.many .n { grid-column: 1 / -1; }
.legend .lg-pick { cursor: pointer; border-radius: 6px; padding: 2px 4px; margin: -2px -4px; }
.legend .lg-pick:hover { background: #f1f1f7; }
.legend.filtering .lg-pick { opacity: .4; }
.legend.filtering .lg-pick.on { opacity: 1; font-weight: 700; background: #f1f1f7; }
