@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap");
/* =========================================================
   StaffHub HR — main stylesheet
   Colours live in variables (the "--name" lines) so light and
   dark mode can swap them in one place.
   ========================================================= */

:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f3f3f0;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #898781;
  --border: rgba(11, 11, 11, 0.10);
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --accent: #2a78d6;
  --accent-soft: #e6f0fc;
  --series-1: #2a78d6;
  --good: #0ca30c;
  --good-text: #006300;
  --warning: #fab219;
  --critical: #d03b3b;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232321;
  --text: #f0efec;
  --text-2: #c3c2b7;
  --muted: #898781;
  --border: rgba(255, 255, 255, 0.10);
  --grid: #2c2c2a;
  --axis: #383835;
  --accent: #3987e5;
  --accent-soft: #1b2a3d;
  --series-1: #3987e5;
  --good-text: #0ca30c;
  --shadow: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--page);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 24px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 600; }

/* ---------- Buttons & form fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: 10px; font: inherit; font-size: 14px;
  cursor: pointer; transition: background .15s;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn-icon { padding: 8px; width: 38px; height: 38px; }

input, select {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; width: 100%;
}
input:focus, select:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label { font-size: 13px; font-weight: 500; color: var(--text-2); display: block; margin-bottom: 6px; }

/* ---------- Login page ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-art {
  background: linear-gradient(150deg, #1c5cab, #2a78d6 55%, #5598e7);
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-art h2 { font-size: 34px; font-weight: 650; max-width: 420px; }
.login-art p { opacity: .85; max-width: 420px; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { margin-bottom: 4px; }
.login-card .sub { color: var(--text-2); margin: 0 0 24px; }
.field { margin-bottom: 16px; }
.demo-box { margin-top: 28px; padding: 16px; border: 1px dashed var(--border); border-radius: var(--radius); }
.demo-box p { margin: 0 0 10px; font-size: 13px; color: var(--text-2); }
.demo-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 17px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 700;
}
.login-art .brand-mark { background: #fff; color: #1c5cab; }

/* Company logo & unit badge in the menu */
.brand-logo { width: 34px; height: 34px; border-radius: 9px; object-fit: contain; background: #fff; flex-shrink: 0; }
.brand-name { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.2; }
.unit-badge { display: flex; align-items: center; gap: 10px; margin: -12px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--accent-soft); }
.unit-badge img { width: 28px; height: 28px; border-radius: 7px; object-fit: contain; background: #fff; }
.unit-badge small { display: block; font-size: 11px; color: var(--muted); line-height: 1.1; }
.unit-badge b { font-size: 13px; color: var(--accent); }
.powered { font-size: 11px; opacity: .8; }

/* ---------- App layout (sidebar + main) ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 24px;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto; overscroll-behavior: contain; /* long menus scroll on small screens */
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  color: var(--text-2); font-size: 14px;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-foot { margin-top: auto; font-size: 12px; color: var(--muted); padding: 0 10px; }

.main { min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 14px 28px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.topbar .grow { flex: 1; }
.topbar select { width: auto; min-width: 200px; }
.menu-btn { display: none; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 600; font-size: 13px; flex-shrink: 0;
}
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
a.user-chip { color: inherit; text-decoration: none; border-radius: 999px; padding: 2px 8px 2px 2px; }
a.user-chip:hover { background: var(--accent-soft); }
.user-chip .who { line-height: 1.2; }
.user-chip .who small { color: var(--muted); font-size: 12px; }

.content { padding: 28px; max-width: 1280px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }

/* ---------- Cards & grid ---------- */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-main { grid-template-columns: 2fr 1fr; margin-top: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; margin-top: 16px; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; margin-top: 16px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); min-width: 0;
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-head small { color: var(--muted); }

.stat .label { font-size: 13px; color: var(--text-2); }
.stat .value { font-size: 28px; font-weight: 650; margin: 6px 0 4px; letter-spacing: -.01em; }
.stat .note { font-size: 13px; color: var(--muted); }
.delta-up { color: var(--good-text); font-weight: 500; }

/* Progress meter (sales target, leave balance) */
.meter { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.meter span { display: block; height: 100%; background: var(--series-1); border-radius: 99px; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.list li:first-child { border-top: 0; padding-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 550; font-size: 14px; }
.list .meta { font-size: 13px; color: var(--muted); }
.list .actions { display: flex; gap: 6px; }

.date-badge {
  width: 46px; flex-shrink: 0; text-align: center; border-radius: 10px; background: var(--surface-2); padding: 5px 0;
}
.date-badge b { display: block; font-size: 17px; line-height: 1.1; }
.date-badge span { font-size: 11px; text-transform: uppercase; color: var(--muted); }

.pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500;
  padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); white-space: nowrap;
}
.pill.good::before, .pill.warn::before, .pill.bad::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.pill.good::before { background: var(--good); }
.pill.warn::before { background: var(--warning); }
.pill.bad::before { background: var(--critical); }

/* Leave balance tiles */
.leave-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.leave-tile { background: var(--surface-2); border-radius: 12px; padding: 14px; }
.leave-tile .label { font-size: 13px; color: var(--text-2); }
.leave-tile .value { font-size: 24px; font-weight: 650; }
.leave-tile .value small { font-size: 13px; font-weight: 400; color: var(--muted); }

/* ---------- Bar chart ---------- */
.chart-wrap { position: relative; }
.chart-wrap svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-wrap .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart-wrap .base-line { stroke: var(--axis); stroke-width: 1; }
.chart-wrap .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-wrap .bar { fill: var(--series-1); }
.chart-wrap .hit { fill: transparent; cursor: pointer; }
.chart-wrap .hit:hover + .bar, .chart-wrap .bar.on { filter: brightness(0.85); }
.tooltip {
  position: absolute; pointer-events: none; background: var(--text); color: var(--surface);
  padding: 6px 10px; border-radius: 8px; font-size: 12px; white-space: nowrap;
  transform: translate(-50%, -110%); opacity: 0; transition: opacity .1s;
}
.tooltip.show { opacity: 1; }

table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--border); }
table.data th { color: var(--muted); font-weight: 500; font-size: 12px; border-top: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Toast message ("coming soon" etc.) */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--surface); padding: 10px 18px; border-radius: 10px;
  font-size: 14px; opacity: 0; transition: all .2s; pointer-events: none; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.empty { color: var(--muted); font-size: 14px; }

/* ---------- Staff directory ---------- */
a.card-link { color: inherit; transition: border-color .15s; }
a.card-link:hover { border-color: var(--accent); }

/* ---------- Attendance ---------- */
.clock-card { margin-bottom: 16px; }
.clock-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.clock-now { font-size: 34px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.btn-big { font-size: 17px; padding: 14px 30px; border-radius: 12px; min-width: 160px; }
.btn-out { background: var(--text); color: var(--surface); border-color: var(--text); }
.btn-out:hover { opacity: .9; }
.att-table td, .att-month td { vertical-align: middle; }
.today-row td { background: var(--accent-soft); }
#pickD { width: auto; padding: 6px 8px; }
.att-rules .inline-fields input { width: 70px; }

/* ---------- Payslips ---------- */
.drop-zone { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; margin-top: 16px; padding: 22px 16px;
  border: 2px dashed var(--axis); border-radius: var(--radius); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.drop-zone:hover, .drop-zone.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-zone.small { margin-top: 0; padding: 18px 12px; }
.slip-list { display: grid; gap: 12px; }
.slip-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px; }
.slip-card.new { border-color: var(--accent); }
.slip-card .grow { flex: 1; min-width: 180px; }
.slip-card .title { font-weight: 600; }
.slip-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.bulk-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.bulk-row select { margin-top: 6px; }
.pay-line { display: grid; grid-template-columns: 1fr 170px; gap: 10px; align-items: center; margin-bottom: 8px; }
.pay-line label { font-size: 14px; margin: 0; }
.net-box { display: flex; justify-content: space-between; align-items: center; background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; margin: 14px 0; font-size: 15px; }
.net-box b { font-size: 22px; }
.change-opts { display: grid; gap: 8px; }

/* ---------- Notifications (bell) ---------- */
.bell-wrap { position: relative; }
#bellBtn { position: relative; }
#bellBtn svg { width: 18px; height: 18px; }
.bell-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--critical); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.bell-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 370px; max-height: 70vh; overflow: auto; z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); }
.bell-list { list-style: none; margin: 0; padding: 0; }
.bell-list a { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; color: var(--text); border-bottom: 1px solid var(--border); }
.bell-list li:last-child a { border-bottom: 0; }
.bell-list a:hover { background: var(--surface-2); }
.bell-list a.unread { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.bell-list a.unread:hover { background: var(--accent-soft); }
.bell-list .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bell-list .title { font-size: 14px; font-weight: 550; }
.bell-list .when { font-size: 12px; }
.bell-icon { font-size: 18px; line-height: 1.3; }
.bell-list .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 7px; flex-shrink: 0; }

/* ---------- Tips: how they are shared ---------- */
.tip-methods li { padding: 8px 0; flex-wrap: wrap; }
.tip-methods li.sub .title { padding-left: 14px; font-weight: 450; }
.tip-methods select { width: auto; max-width: 100%; padding: 6px 8px; font-size: 13px; }

/* ---------- Documents ---------- */
button.card { font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; }
button.card-link:hover, .doc-card:hover { border-color: var(--accent); }
.doc-tile.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.warn-days { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.warn-days select { width: auto; padding: 5px 8px; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.doc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.doc-card { display: flex; align-items: center; gap: 12px; padding: 16px; }
.doc-card .grow { flex: 1; min-width: 0; }
.doc-card .title { font-weight: 600; }
.doc-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.doc-icon svg { width: 20px; height: 20px; }
.doc-preview { max-width: 100%; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 8px; display: block; }
.panel-foot .grow { flex: 1; }
.head-actions { display: flex; gap: 8px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input { flex: 1 1 260px; }
.toolbar select { flex: 0 1 200px; width: auto; }
.table-scroll { overflow-x: auto; }
.staff-table td { vertical-align: middle; padding: 12px 8px; }
.staff-table tbody tr { cursor: pointer; }
.staff-table tbody tr:hover, .staff-table tbody tr:focus { background: var(--surface-2); outline: none; }
.staff-table .pill { margin: 2px 0; }
.person { display: flex; align-items: center; gap: 12px; }
.title { font-weight: 550; }
.meta { font-size: 13px; color: var(--muted); font-weight: 400; }

/* Side panel (slides in from the right) */
.panel-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 30; display: flex; justify-content: flex-end; }
.panel-backdrop[hidden] { display: none; }
.panel {
  background: var(--surface); width: 100%; max-width: 520px; height: 100%;
  display: flex; flex-direction: column; animation: slideIn .2s ease-out;
}
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }
.panel-head, .panel-foot { display: flex; align-items: center; gap: 10px; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.panel-head h2 { flex: 1; font-size: 17px; }
.panel-foot { border-bottom: 0; border-top: 1px solid var(--border); justify-content: flex-end; }
.panel-body { flex: 1; overflow-y: auto; padding: 22px; }
.profile { display: flex; gap: 16px; align-items: center; margin-bottom: 22px; }
.profile h2 { font-size: 20px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-xl { width: 96px; height: 96px; font-size: 32px; }

/* My Profile */
.profile-hero { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.profile-hero h2 { font-size: 22px; margin: 0 0 4px; }
.profile-hero .grow { flex: 1; min-width: 200px; }
.profile-hero .pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.photo-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.photo-actions .btn { display: inline-flex; align-items: center; margin: 0; }
#err_photo:empty { display: none; }
.profile-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; margin-top: 20px; align-items: start; }
.profile-grid .card-head small { color: var(--muted); }
.profile-saved { color: var(--muted); font-size: 13px; }
.details { margin: 0; display: grid; gap: 0; }
.detail { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 14px; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; word-break: break-word; }
.section-title { font-size: 15px; margin: 24px 0 12px; }
.section-title small { font-weight: 400; color: var(--muted); }
.leave-tiles.two { grid-template-columns: 1fr 1fr; }

/* Form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; align-content: start; }
.form-grid .field.full { grid-column: 1 / -1; }
.form-grid .field { margin-bottom: 6px; }
.error { color: var(--critical); font-size: 12px; min-height: 16px; margin-top: 3px; }
.checks { display: flex; flex-direction: column; gap: 8px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); margin: 0;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- Leave page ---------- */
:root {
  --lt-annual: #2a78d6; --lt-sick: #eb6834; --lt-off: #1baf7a; --lt-holiday: #eda100; --lt-unpaid: #e87ba4;
}
:root[data-theme="dark"] {
  --lt-annual: #3987e5; --lt-sick: #d95926; --lt-off: #199e70; --lt-holiday: #c98500; --lt-unpaid: #d55181;
}
textarea {
  font: inherit; color: var(--text); background: var(--surface); width: 100%; resize: vertical;
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px;
}
textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hint { font-size: 13px; color: var(--text-2); background: var(--surface-2); border-radius: 8px; padding: 8px 12px; margin: 4px 0 16px; }
.hint:empty { display: none; }
.text-bad { color: var(--critical); }
.nowrap { white-space: nowrap; }

.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tab {
  font: inherit; font-size: 14px; background: none; border: 0; color: var(--text-2); cursor: pointer;
  padding: 10px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab .count { background: var(--accent); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; margin-left: 4px; }

/* Leave-type colour square with a letter (letter = not relying on colour alone) */
.lt {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 5px;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.lt-annual { background: var(--lt-annual); }
.lt-sick { background: var(--lt-sick); }
.lt-off { background: var(--lt-off); }
.lt-holiday { background: var(--lt-holiday); color: #0b0b0b; }
.lt-unpaid { background: var(--lt-unpaid); }
.lt.pending { opacity: .4; }
.type-chip { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.req-table td { vertical-align: middle; padding: 12px 8px; }
.req-table .unit { display: none; }

.cal-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav h2 { min-width: 150px; text-align: center; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend .lt { width: 16px; height: 16px; font-size: 9px; border-radius: 4px; }

.cal-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
table.cal { border-collapse: separate; border-spacing: 0; font-size: 12px; min-width: 100%; }
.cal th, .cal td { width: 30px; min-width: 30px; height: 36px; text-align: center; padding: 0; border-bottom: 1px solid var(--border); }
.cal thead th { font-weight: 600; color: var(--text-2); height: 44px; line-height: 1.1; }
.cal thead th small { display: block; font-weight: 400; color: var(--muted); font-size: 10px; }
.cal .weekend { background: var(--surface-2); }
.cal thead th.today { color: #fff; background: var(--accent); }
.cal thead th.today small { color: #fff; }
.cal td.today { box-shadow: inset 2px 0 0 var(--accent), inset -2px 0 0 var(--accent); }
.cal .cal-name {
  position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; font-weight: 500;
  min-width: 150px; padding: 0 12px; white-space: nowrap; border-right: 1px solid var(--border); color: var(--text);
}
.cal tfoot th, .cal tfoot td { border-bottom: 0; font-weight: 600; color: var(--text-2); }
.cal .lt { cursor: default; }

/* ---------- Shifts ---------- */
:root { --sh-0: #2a78d6; --sh-1: #eb6834; --sh-2: #7d5bd0; --sh-3: #1baf7a; --sh-4: #e87ba4; --sh-5: #1a9fb0; }
:root[data-theme="dark"] { --sh-0: #3987e5; --sh-1: #d95926; --sh-2: #9277e0; --sh-3: #199e70; --sh-4: #d55181; --sh-5: #2bb3c4; }
.sh-chip, .sh-sel { --c: var(--axis); background: color-mix(in srgb, var(--c) 16%, var(--surface)); border-left: 3px solid var(--c); color: var(--text); }
.sh-chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 5px; padding: 2px 7px; font-size: 12px; white-space: nowrap; }
.sh-c0 { --c: var(--sh-0); } .sh-c1 { --c: var(--sh-1); } .sh-c2 { --c: var(--sh-2); }
.sh-c3 { --c: var(--sh-3); } .sh-c4 { --c: var(--sh-4); } .sh-c5 { --c: var(--sh-5); }
.sh-off { --c: var(--lt-off); }
.sh-leave { --c: var(--lt-annual); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--lt-annual) 22%, var(--surface)) 0 4px, var(--surface) 4px 8px); }
.sh-none { --c: var(--border); background: var(--surface); color: var(--muted); }
.rota th, .rota td { width: auto; min-width: 92px; height: 48px; padding: 4px; }
.rota .cal-name { min-width: 170px; line-height: 1.2; }
.rota .cal-name small { display: block; font-size: 11px; }
.rota td { position: relative; }
.sh-sel { width: 100%; min-width: 84px; padding: 6px 4px 6px 6px; font-size: 12px; border-radius: 6px; border-top: 0; border-right: 0; border-bottom: 0; cursor: pointer; }
.sh-sel.sh-none { border-left: 3px solid var(--border); }
.rota td.sh-warn .sh-sel { outline: 2px solid var(--warning); outline-offset: -1px; }
.sh-flag { position: absolute; top: 0; right: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--warning); color: #0b0b0b; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.sh-flag.static { position: static; display: inline-grid; vertical-align: middle; }
.rota .sh-hours { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 64px; }
.rota .sh-count { font-size: 11px; line-height: 1.3; height: auto; padding: 6px 4px; }
.rota tfoot .cal-name { color: var(--text-2); }
.sh-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.sh-top .value.small { font-size: 20px; }
.sh-mates { display: flex; margin: 8px 0 4px; }
.sh-mates .avatar { width: 30px; height: 30px; font-size: 11px; border: 2px solid var(--surface); margin-left: -6px; }
.sh-mates .avatar:first-child { margin-left: 0; }
.sh-list li.today { background: var(--accent-soft); border-radius: 8px; padding-left: 10px; padding-right: 10px; }
.sh-day { width: 78px; display: flex; flex-direction: column; line-height: 1.25; }
.sh-what { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sh-types input, .sh-types select { min-width: 70px; }
.sh-types .st-short { width: 64px; min-width: 0; }

.bal { font-size: 14px; min-width: 90px; }
.bal b { font-size: 16px; }
.bal .meter { height: 5px; margin-top: 6px; }
.bal-table td { vertical-align: middle; padding: 12px 8px; }
.bal-row { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px 4px; margin: 0 0 12px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.bal-row legend { font-weight: 600; font-size: 14px; padding: 0 4px; }
.bal-row .error { grid-column: 1 / -1; }

/* Scheduled off day (from rules) in the calendar */
.lt-sched { background: transparent; color: var(--muted); border: 1.5px dashed var(--axis); }
.leave-tile .value.small { font-size: 18px; margin: 4px 0 2px; }

/* Off-day rules tab */
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.rule-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.rule-card .card-head { align-items: flex-start; flex-wrap: wrap; }
.rule-card .card-head > div { flex: 1 1 160px; }
.rule-option { display: flex; gap: 12px; align-items: flex-start; padding: 12px; margin: 0 0 8px; border: 1px solid var(--border);
  border-radius: 12px; cursor: pointer; color: var(--text); font-size: 14px; }
.rule-option.on { border-color: var(--accent); background: var(--accent-soft); }
.rule-option > input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }
.rule-body { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.weekdays { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.day { margin: 0; cursor: pointer; position: relative; }
.day input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.day span { display: inline-block; padding: 5px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 13px; color: var(--text); }
.day input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.day input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Leave rules: extra sections */
.rule-section { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 14px; }
.rule-section h3 { font-size: 14px; margin: 0 0 8px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-size: 14px; cursor: pointer; }
.choice > input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }
.choice input[type="number"] { width: 64px; padding: 4px 6px; display: inline-block; }
.hol-list { display: grid; gap: 6px; }
.hol-row { display: grid; grid-template-columns: minmax(118px, 138px) minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.hol-row input { padding: 6px 8px; min-width: 0; width: 100%; }
.rule-section, .hol-box, .hol-list { min-width: 0; }
.hol-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.hol-actions select { width: auto; padding: 5px 8px; font-size: 13px; }
/* Off days that will be / were lost */
.forfeit { font-size: 12px; color: var(--muted); margin-top: 4px; }
.forfeit.risk { color: var(--text); background: color-mix(in srgb, var(--warning) 22%, transparent); border-radius: 6px; padding: 3px 7px; display: inline-block; }
.forfeit-text { color: var(--text-2); }
/* Public holiday marks on calendars */
th.holiday { background: color-mix(in srgb, var(--warning) 18%, var(--surface)); }
th .ph { display: block; font-style: normal; font-size: 9px; font-weight: 600; color: var(--text-2); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0 auto; }
.inline-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 4px; color: var(--text); }
.inline-fields input[type="number"] { width: 64px; padding: 6px 8px; }
.inline-fields input[type="date"] { width: auto; padding: 6px 8px; }

/* ---------- Sales page ---------- */
.chart-wrap .ref-line { stroke: var(--text-2); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart-wrap .ref-label { fill: var(--text-2); font-size: 11px; font-weight: 500; }
.month-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
[hidden] { display: none !important; }
.import-steps { margin: 0 0 4px; padding-left: 20px; display: grid; gap: 10px; font-size: 14px; }
.import-steps .btn { margin-top: 6px; }
.imp-summary { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 8px; }
.imp-table td { vertical-align: top; }
.imp-table .imp-bad td { background: color-mix(in srgb, var(--critical) 7%, transparent); }
.imp-table .imp-skip td { opacity: .65; }
.imp-msg { color: var(--critical); font-size: 13px; }
.by-unit-card { margin-bottom: 16px; }
.by-unit td, .by-unit th { white-space: nowrap; }
.by-unit .unit-cell { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.by-unit .unit-cell img { width: 24px; height: 24px; border-radius: 6px; object-fit: contain; }
.by-unit tfoot td { border-top: 2px solid var(--text); font-weight: 700; }
.by-unit-tiles { display: none; }
@media (max-width: 600px) {
  .by-unit-card .table-scroll { display: none; }
  .by-unit-tiles { display: grid; gap: 10px; }
  .bu-tile { border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
  .bu-tile.bu-total { border: 2px solid var(--text); }
  .bu-tile .unit-cell { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
  .bu-tile .unit-cell b { flex: 1; }
  .bu-tile .unit-cell img { width: 24px; height: 24px; border-radius: 6px; object-fit: contain; }
  .bu-tile dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 0; }
  .bu-tile dt { font-size: 12px; color: var(--text-2); }
  .bu-tile dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
}
/* Sign-in page: tabs and forms */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2, rgba(127,127,127,.12)); margin-bottom: 20px; }
.seg button { font: inherit; font-size: 13px; font-weight: 600; padding: 9px 6px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.auth-form h1 { font-size: 24px; }
.btn-wide { width: 100%; justify-content: center; margin-top: 4px; }
.small-note { font-size: 13px; margin-top: 14px; }
.pick-list { display: grid; gap: 8px; }
.pick-list .btn { justify-content: flex-start; }
.demo-box summary { cursor: pointer; }
.demo-company { margin: 14px 0 10px; font-size: 16px; }
.demo-box[open] summary { margin-bottom: 4px; }
/* Real version: "Saving… / Saved" sign and page loading */
.sync-badge { font: inherit; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; white-space: nowrap; }
.sync-badge[data-state="saved"] { color: var(--good, #1e8e3e); }
.sync-badge[data-state="error"] { color: var(--critical); border-color: var(--critical); }
.cloud-loading body::after { content: "Loading…"; position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg, #fafafa); color: var(--text-2); font-size: 15px; z-index: 50; }
.ai-list li { align-items: flex-start; flex-wrap: wrap; }
.ai-actions { flex-wrap: wrap; }
.ai-result:empty { display: none; }
.ai-result .notice { margin: 12px 0 0; }
.notice-bad { border-left-color: var(--critical); }
.jc-code { letter-spacing: .1em; font-variant-numeric: tabular-nums; }
.jc-table td { vertical-align: top; }
.join-code { display: grid; gap: 8px; padding: 10px 12px; border: 1px dashed var(--accent, #2a78d6); border-radius: 10px; }
.join-code small { display: block; color: var(--text-2); }
.join-code b { color: var(--text); font-size: 20px; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.join-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.boot-error { max-width: 480px; margin: 15vh auto; padding: 0 20px; text-align: center; }
@media (max-width: 600px) { .sync-badge { padding: 4px 8px; } }
.side-stack { display: grid; gap: 16px; align-content: start; }
.side-stack > .card { margin: 0; }
.si-odd { margin-top: 12px; }
.si-odd .odd-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.si-sum { margin-top: 8px; }
.head-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.head-logo { width: 52px; height: 52px; object-fit: contain; border-radius: 12px; flex: none; }
@media (max-width: 600px) { .head-logo { width: 40px; height: 40px; } }
.notice {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--warning);
  border-radius: 10px; padding: 10px 14px; margin-bottom: 16px;
}
.hbars { display: flex; flex-direction: column; gap: 14px; }
.hbar-row { display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 10px; font-size: 14px; }
.hbar-label { color: var(--text-2); }
.hbar-track { height: 10px; border-radius: 0 4px 4px 0; }
.hbar-track span { display: block; height: 100%; min-width: 2px; background: var(--series-1); border-radius: 0 4px 4px 0; }
.hbar-value { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.hbar-value small { color: var(--muted); margin-left: 4px; }
.money-field { margin-bottom: 10px; }
.money-input { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.money-input span { display: grid; place-items: center; padding: 0 12px; background: var(--surface-2); color: var(--text-2); font-size: 13px; }
.money-input input { border: 0; border-radius: 0; text-align: right; font-variant-numeric: tabular-nums; }
.money-input:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.money-input input:focus { outline: none; }
.total-row { display: flex; justify-content: space-between; padding: 12px 0; margin: 6px 0 4px; border-top: 2px solid var(--text); font-size: 16px; }
.entries-table td { vertical-align: middle; }

/* Personal sales goals */
.goal-card { margin-bottom: 0; }
.grid-goal { grid-template-columns: 2fr 1fr; margin-bottom: 16px; }
.grid-goal:empty { display: none; }
.grid-goal > :only-child { grid-column: 1 / -1; }
.sales-goal-wrap .goal-card { margin-bottom: 16px; }
.goal-card .card-head { margin-bottom: 8px; }
.goal-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.goal-row .value { font-size: 30px; font-weight: 650; letter-spacing: -.01em; }
.goal-pct { font-size: 22px; font-weight: 650; color: var(--accent); }
.team-sales { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
.team-sales .label { font-size: 13px; color: var(--text-2); }
.team-sales .value { font-size: 28px; font-weight: 650; letter-spacing: -.01em; margin: 2px 0; }
.team-sales > div + div { border-left: 1px solid var(--border); padding-left: 16px; }
.meter.big { height: 12px; }
.goals-table td { vertical-align: middle; padding: 10px 8px; }
.progress-cell { min-width: 120px; }
.progress-cell .meter { margin: 0 0 3px; }
.progress-cell small { color: var(--text-2); font-variant-numeric: tabular-nums; }

/* Locations page */
.loc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.loc-card .card-head { align-items: flex-start; }
.loc-title { display: flex; gap: 12px; align-items: center; }
.dept-list { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.dept-head { display: flex; gap: 8px; align-items: baseline; font-size: 14px; }
.dept-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface-2); border-radius: 10px; }
.dept-row .grow { flex: 1; min-width: 0; }
.dept-list > .btn { align-self: flex-start; }
table.by-unit tr.sub-row td { color: var(--text-2); font-size: 14px; padding-top: 6px; padding-bottom: 6px; }
table.by-unit tr.sub-row td:first-child { padding-left: 18px; }
.loc-logo { width: 44px; height: 44px; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--border); }
.loc-card .detail { grid-template-columns: 120px 1fr; }
.danger-zone { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.danger-zone h3 { font-size: 14px; margin-bottom: 8px; }

/* ---------- Login page: company logo + owner link ---------- */
.login-company { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; font-weight: 650; font-size: 18px; }
.login-company img { width: 48px; height: 48px; border-radius: 12px; object-fit: contain; background: #fff; border: 1px solid var(--border); }
.login-company .brand-mark { width: 48px; height: 48px; font-size: 20px; border-radius: 12px; }
.owner-link { text-align: center; margin-top: 18px; font-size: 13px; }

/* ---------- App owner console ---------- */
.owner-bar { position: sticky; top: 0; }
.owner-bar .brand .pill { margin-left: 6px; font-weight: 500; }
.owner-content { margin: 0 auto; }
.small-value { font-size: 16px !important; line-height: 1.6; }
.customer-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.customer { display: flex; align-items: center; gap: 16px; }
.customer.paused { opacity: .65; }
.customer > .grow { flex: 1; min-width: 0; }
.chart-empty { padding: 60px 0; text-align: center; }
.customer-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.customer-head h2 { font-size: 17px; }
.customer-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Settings page ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; align-items: start; }
.cat-list li { gap: 10px; }
.cat-list .cat-name { flex: 1; min-width: 0; padding: 7px 10px; }
.add-row { display: flex; gap: 8px; margin-top: 12px; }
.logo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.logo-row label.btn { margin: 0; color: var(--text); font-weight: 400; }
.logo-preview { width: 56px; height: 56px; border-radius: 12px; object-fit: contain; background: #fff; border: 1px solid var(--border); }
#logoPreview .brand-mark, .logo-cell .brand-mark { width: 56px; height: 56px; font-size: 22px; border-radius: 12px; }
input[type="color"] { width: 56px; height: 38px; padding: 3px; cursor: pointer; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sep { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.access-box { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.btn-danger { color: var(--critical); border-color: var(--critical); }
.btn-danger:hover { background: var(--critical); color: #fff; }

/* ---------- Events & News ---------- */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg button { font: inherit; font-size: 14px; border: 0; background: none; color: var(--text-2); padding: 8px 16px; cursor: pointer; }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.group-title { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 24px 0 10px; }
.group-title:first-child { margin-top: 0; }
.post { display: flex; gap: 18px; margin-bottom: 12px; }
.post h2 { font-size: 17px; margin-bottom: 2px; }
.post .grow { flex: 1; min-width: 0; }
.post-text { margin: 10px 0 0; white-space: pre-line; color: var(--text); overflow-wrap: anywhere; }
.post-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.post-foot .pill { margin-right: auto; }
.date-badge.big { width: 58px; padding: 8px 0; align-self: flex-start; }
.date-badge.big b { font-size: 22px; }
.pinned { display: inline-block; font-size: 12px; font-weight: 600; color: var(--accent); margin-bottom: 6px; }

/* ---------- Tablets ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-main, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hide-md { display: none; }
}

/* ---------- Phones (sidebar becomes a slide-out menu) ---------- */
@media (max-width: 820px) {
  .profile-grid { grid-template-columns: 1fr; }
  .pay-line { grid-template-columns: 1fr; gap: 4px; }
  .bell-panel { position: fixed; left: 8px; right: 8px; top: 64px; width: auto; }
  .sh-top { grid-template-columns: 1fr; gap: 12px; }
  .hol-row { grid-template-columns: 1fr auto; }
  .hol-row input[name="hname"] { grid-column: 1; }
  .hol-row [data-delhol] { grid-row: 1 / span 2; grid-column: 2; }
  .rota .cal-name { min-width: 120px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }

  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; width: 260px; z-index: 20;
    transform: translateX(-100%); transition: transform .2s;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .menu-close { display: inline-grid; place-items: center; position: absolute; top: 12px; right: 12px; z-index: 1; width: 36px; height: 36px; font-size: 15px; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
  .topbar select { min-width: 0; flex: 1 1 100%; order: 10; width: 100%; }
  .user-chip .who { display: none; }
  .content { padding: 18px 16px; }
  .leave-tiles { grid-template-columns: repeat(2, 1fr); }
  .hide-sm { display: none; }
  .staff-table .meta { display: none; }
  .staff-table td { padding: 10px 4px; font-size: 14px; }
  .staff-table .pill { font-size: 11px; padding: 2px 7px; }
  .staff-table .avatar { width: 30px; height: 30px; font-size: 11px; }
  .docs-table .avatar, .docs-table .person .meta { display: none; }
  .docs-table td { padding: 10px 4px; font-size: 14px; }
  .docs-table .pill { font-size: 11px; padding: 2px 7px; white-space: normal; }
  .person { gap: 8px; }

  /* Leave requests become small stacked cards on phones */
  .req-table thead { display: none; }
  .req-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 14px 0; border-top: 1px solid var(--border); }
  .req-table tr:first-child { border-top: 0; }
  table.data.req-table td { border: 0; padding: 0; font-size: 14px; }
  .req-table td:first-child { flex: 1 1 100%; }
  .req-table td:first-child .meta, .req-table .days-cell .meta { display: none; }
  .req-table .unit { display: inline; }
  table.data.req-table td.actions-cell { flex: 1 1 100%; text-align: left; }
  table.data.req-table td.actions-cell:empty { display: none; }
  .req-table .actions-cell .btn { padding: 8px 16px; }

  .cal .cal-name { min-width: 105px; padding: 0 8px; font-size: 12px; }
  .toolbar select { flex: 1 1 140px; }
}

@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat .value { font-size: 22px; }
  .card { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .settings-grid, .loc-grid, .grid-goal { grid-template-columns: 1fr; }
  .customer { flex-wrap: wrap; }
  .customer-actions { width: 100%; justify-content: flex-start; }
  .owner-bar .brand .pill { display: none; }
  .cat-list li { flex-wrap: wrap; }
  .cat-list .cat-name { flex: 1 1 100%; }
  .detail { grid-template-columns: 105px 1fr; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
}

/* =========================================================
   OCEAN THEME (Nov 2026)
   Soft blue-white background with faint waves, frosted glass
   cards, deep-navy pill highlights and big light numbers.
   Everything below only changes the LOOK. It sits last so it
   wins over the older styles above.
   ========================================================= */
:root {
  --page: #edf3fa;
  --surface: #ffffff;
  --surface-2: #eef4fb;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --glass-line: rgba(255, 255, 255, 0.9);
  --text: #0e1c33;
  --text-2: #4b5c75;
  --muted: #8292a8;
  --border: rgba(20, 52, 102, 0.09);
  --grid: #e3eaf4;
  --axis: #c6d3e4;
  --accent: #1f56b8;
  --accent-soft: #e2ecfb;
  --navy: #13336b;
  --navy-2: #1f56b8;
  --aqua: #39b3d6;
  --series-1: #2f6fd3;
  --shadow: 0 1px 2px rgba(18, 48, 97, 0.04), 0 12px 32px rgba(31, 86, 184, 0.08);
  --radius: 22px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
:root[data-theme="dark"] {
  --page: #061226;
  --surface: #0e1d36;
  --surface-2: #132745;
  --glass: rgba(16, 33, 61, 0.72);
  --glass-strong: rgba(16, 33, 61, 0.9);
  --glass-line: rgba(120, 170, 240, 0.12);
  --text: #e9f1fc;
  --text-2: #b4c3da;
  --muted: #7d90ad;
  --border: rgba(140, 180, 240, 0.12);
  --grid: #1b2f50;
  --axis: #29406a;
  --accent: #5ba3f5;
  --accent-soft: #15325a;
  --navy: #2d6fd6;
  --navy-2: #4b8ff0;
  --series-1: #4b8ff0;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

/* Page: soft light with gentle colour, and faint waves at the bottom */
body {
  font-family: var(--font);
  background:
    radial-gradient(1100px 620px at 8% -12%, #d6e8ff 0, transparent 62%),
    radial-gradient(900px 560px at 100% -5%, #dcf4f7 0, transparent 58%),
    var(--page);
  background-attachment: fixed;
  letter-spacing: -0.005em;
}
:root[data-theme="dark"] body {
  background:
    radial-gradient(1100px 620px at 8% -12%, #0f2b55 0, transparent 62%),
    radial-gradient(900px 560px at 100% -5%, #0b3446 0, transparent 58%),
    var(--page);
  background-attachment: fixed;
}
.app::after {
  content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 180px; pointer-events: none; z-index: 0; opacity: .55;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 180' preserveAspectRatio='none'%3E%3Cpath d='M0 110 C 240 60 480 160 720 110 S 1200 60 1440 105 L1440 180 L0 180Z' fill='%23d3e6fb'/%3E%3Cpath d='M0 140 C 260 100 520 185 760 140 S 1220 105 1440 140 L1440 180 L0 180Z' fill='%23c4dcf7'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
}
:root[data-theme="dark"] .app::after { opacity: .35; filter: brightness(.25) saturate(1.6); }
.main { position: relative; z-index: 1; }
.sidebar { z-index: 2; }

h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
h2 { font-weight: 600; letter-spacing: -0.01em; }

/* Buttons: round pills; the main button is deep navy */
.btn { border-radius: 999px; padding: 9px 18px; background: var(--glass-strong); border-color: var(--border); font-weight: 500; transition: background .15s, box-shadow .15s, transform .05s; }
.btn:hover { background: var(--surface); box-shadow: 0 4px 14px rgba(31, 86, 184, 0.10); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--navy-2), var(--navy)); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(19, 51, 107, 0.25); }
.btn-primary:hover { background: linear-gradient(135deg, var(--navy-2), var(--navy)); filter: brightness(1.08); }
.btn-sm { border-radius: 999px; padding: 6px 13px; }
.btn-icon { border-radius: 50%; width: 40px; height: 40px; padding: 0; }
.btn-danger { border-radius: 999px; }
input, select, textarea { border-radius: 14px; background: var(--surface); border-color: var(--border); }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 1px; border-color: var(--accent); }

/* Menu: frosted panel, the open page is a navy pill */
.sidebar { background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-right: 1px solid var(--glass-line); }
.brand-mark { border-radius: 12px; background: linear-gradient(135deg, var(--navy-2), var(--navy)); }
.nav a { border-radius: 999px; padding: 10px 14px; font-weight: 500; }
.nav a:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.nav a.active { background: linear-gradient(135deg, var(--navy-2), var(--navy)); color: #fff; font-weight: 600; box-shadow: 0 6px 16px rgba(19, 51, 107, 0.22); }
.unit-badge { border-radius: 16px; background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* Top bar: frosted, floating */
.topbar { background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-bottom: 1px solid var(--glass-line); }
.topbar select { border-radius: 999px; }
.avatar { background: linear-gradient(135deg, #dbe9ff, #c9f0f4); color: var(--navy); }
:root[data-theme="dark"] .avatar { background: linear-gradient(135deg, #1b3a66, #12475a); color: #d6e6ff; }

/* Cards: big rounded frosted glass */
.card { background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--glass-line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card-link:hover { box-shadow: 0 16px 40px rgba(31, 86, 184, 0.14); }
.stat .label, .leave-tile .label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.stat .value { font-size: 36px; font-weight: 500; letter-spacing: -0.03em; }
.leave-tile { background: linear-gradient(160deg, var(--surface-2), color-mix(in srgb, var(--surface-2) 60%, transparent)); border-radius: 18px; border: 1px solid var(--glass-line); }
.leave-tile .value { font-size: 30px; font-weight: 500; letter-spacing: -0.02em; }
.meter { height: 10px; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.meter span { background: linear-gradient(90deg, var(--navy-2), var(--aqua)); }
.date-badge { border-radius: 14px; background: var(--surface-2); }
.pill { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.notice { border-radius: 16px; background: var(--glass-strong); }

/* Tables: quiet headers, soft row lines */
table.data th { text-transform: uppercase; letter-spacing: .05em; font-size: 11px; font-weight: 600; }
table.data th, table.data td { padding: 10px 8px; }
table.data tbody tr:hover td { background: color-mix(in srgb, var(--accent) 4%, transparent); }

/* Charts */
.chart-wrap .bar { fill: var(--series-1); rx: 4; }
.tooltip { border-radius: 10px; background: var(--navy); color: #fff; }

/* Side panel and pop-ups: solid, rounded */
.panel-backdrop { background: rgba(8, 24, 52, 0.35); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.panel { background: var(--surface); border-radius: 26px 0 0 26px; box-shadow: -20px 0 60px rgba(8, 24, 52, 0.18); }
.toast { border-radius: 999px; background: var(--navy); color: #fff; box-shadow: 0 10px 30px rgba(19, 51, 107, 0.3); }
.seg { border-radius: 999px; background: color-mix(in srgb, var(--accent) 9%, transparent); }
.seg button { border-radius: 999px; white-space: nowrap; font-size: 12.5px; padding: 9px 4px; }
.grid-4 + .by-unit-card, .grid-4 + .grid { margin-top: 16px; }
.seg button[aria-selected="true"] { background: linear-gradient(135deg, var(--navy-2), var(--navy)); color: #fff; box-shadow: 0 4px 12px rgba(19, 51, 107, 0.25); }
.sync-badge { background: var(--glass-strong); }

/* Sign-in page: deep ocean with layered waves */
.login-art {
  position: relative; overflow: hidden;
  background: linear-gradient(170deg, #0b2a5b 0%, #1a4f9c 45%, #2f86c9 78%, #58bfe0 100%);
}
.login-art::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46%; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 400' preserveAspectRatio='none'%3E%3Cpath d='M0 120 C 150 60 300 180 450 120 S 700 60 800 110 L800 400 L0 400Z' fill='%23ffffff' fill-opacity='.10'/%3E%3Cpath d='M0 190 C 170 130 330 250 500 190 S 720 140 800 185 L800 400 L0 400Z' fill='%23ffffff' fill-opacity='.12'/%3E%3Cpath d='M0 270 C 160 220 340 320 520 265 S 730 230 800 262 L800 400 L0 400Z' fill='%23ffffff' fill-opacity='.16'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
}
.login-art::before {
  content: ""; position: absolute; width: 220px; height: 220px; right: 12%; top: 16%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.55) 0, rgba(255,255,255,.12) 45%, transparent 70%);
}
.login-art > * { position: relative; z-index: 1; }
.login-art h2 { font-size: 38px; font-weight: 600; letter-spacing: -0.02em; }
.login-panel { background: transparent; }
.login-card { background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--glass-line); border-radius: 28px; box-shadow: var(--shadow); padding: 28px; }
.demo-box { border-radius: 18px; background: color-mix(in srgb, var(--accent) 5%, transparent); border-style: solid; border-color: var(--border); }

/* Phones: the slide-out menu is solid so text behind doesn't show through */
@media (max-width: 820px) {
  .sidebar { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; z-index: 20; }
  .panel { border-radius: 0; }
  .login-card { padding: 22px 18px; border-radius: 24px; }
  .app::after { height: 110px; }
}
@media (max-width: 480px) {
  .stat .value { font-size: 26px; }
  .card { padding: 16px; border-radius: 18px; }
}

/* =========================================================
   STAFF DASHBOARD (welcome, progress bars, photo card, time tracker, to-do, my week)
   ========================================================= */
.sd-head { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: end; margin-bottom: 18px; }
.sd-head h1 { font-size: 40px; font-weight: 500; letter-spacing: -0.03em; margin: 0; }
.sd-head > div > .meta { margin: 4px 0 0; }
.sd-kpis { display: flex; flex-wrap: wrap; gap: 14px 10px; margin-top: 16px; }
.sd-kpi { display: grid; gap: 6px; min-width: 120px; flex: 1 1 120px; max-width: 220px; }
.sd-kpi .lbl { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.sd-bar { position: relative; height: 34px; border-radius: 999px; overflow: hidden;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--accent) 7%, transparent) 0 6px, color-mix(in srgb, var(--accent) 12%, transparent) 6px 7px);
  border: 1px solid var(--glass-line); }
.sd-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: linear-gradient(135deg, var(--navy-2), var(--navy)); }
.sd-bar b { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 12.5px; font-weight: 600; color: #fff; }
.sd-bar.low b { color: var(--text); left: auto; right: 12px; }
.sd-bigs { display: flex; gap: 26px; align-items: flex-end; flex-wrap: wrap; justify-content: flex-end; }
.sd-bigs > div { display: grid; text-align: left; }
.sd-bigs b { font-size: 44px; font-weight: 400; letter-spacing: -0.04em; line-height: 1; }
.sd-bigs span { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }

.sd-grid { display: grid; gap: 16px; margin-bottom: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr);
  grid-template-areas: "photo prog time side" "folds week week side"; }
.sd-photo { grid-area: photo; } .sd-progress { grid-area: prog; } .sd-time { grid-area: time; }
.sd-side { grid-area: side; display: grid; gap: 16px; align-content: start; }
.sd-folds { grid-area: folds; } .sd-cal { grid-area: week; }
.sd-grid .card { margin: 0; }
.sd-arrow { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); background: var(--glass-strong); font-size: 14px; color: var(--text); text-decoration: none; }

/* photo card */
.sd-photo { position: relative; padding: 0; overflow: hidden; min-height: 270px; display: flex; align-items: flex-end;
  background: linear-gradient(160deg, #cfe3fb, #9cc3ee 55%, #5c8fd6); }
.sd-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sd-initials { position: absolute; inset: 0 0 64px; display: grid; place-items: center; font-size: 76px; font-weight: 600; color: rgba(255,255,255,.92); letter-spacing: -0.03em; }
.sd-photo-foot { position: relative; width: 100%; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding: 46px 16px 16px;
  background: linear-gradient(transparent, rgba(8, 24, 52, .72)); color: #fff; }
.sd-photo-foot .who { display: grid; min-width: 0; }
.sd-photo-foot b { font-size: 18px; font-weight: 600; }
.sd-photo-foot span { font-size: 12.5px; opacity: .85; }
.sd-chip { flex: none; padding: 7px 13px; border-radius: 999px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.45);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-size: 13px; font-weight: 600; }
.sd-cam { position: absolute; top: 12px; right: 12px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: rgba(255,255,255,.85); color: var(--navy); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.sd-cam svg { width: 19px; height: 19px; }
.sd-cam:hover { background: #fff; }
.sd-photo-err { position: absolute; top: 56px; left: 12px; right: 12px; z-index: 2; }

/* progress (work time this week) */
.sd-progress { text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.sd-big { font-size: 34px; font-weight: 400; letter-spacing: -0.03em; display: flex; align-items: center; gap: 10px; }
.sd-big small { font-size: 11.5px; color: var(--text-2); line-height: 1.25; letter-spacing: 0; }
.sd-week { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; align-items: end; min-height: 120px; margin-top: 10px; }
.sd-week .col { display: grid; justify-items: center; gap: 6px; position: relative; height: 100%; grid-template-rows: 1fr auto; }
.sd-week .stick { width: 8px; height: 100%; min-height: 80px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 10%, transparent); display: flex; align-items: flex-end; overflow: hidden; }
.sd-week .stick i { display: block; width: 100%; border-radius: 999px; background: linear-gradient(180deg, var(--navy-2), var(--navy)); }
.sd-week .today .stick i { background: linear-gradient(180deg, var(--aqua), var(--navy-2)); }
.sd-week .day { font-size: 11.5px; color: var(--muted); }
.sd-week .today .day { color: var(--text); font-weight: 700; }
.sd-week .tip { position: absolute; top: -6px; white-space: nowrap; font-size: 10.5px; font-weight: 600; padding: 3px 7px; border-radius: 999px; background: var(--navy-2); color: #fff; }

/* time tracker */
.sd-time { display: flex; flex-direction: column; }
.sd-ring { position: relative; width: 150px; height: 150px; margin: 4px auto 6px; }
.sd-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.sd-ring circle { fill: none; stroke-width: 9; }
.sd-ring .bg { stroke: color-mix(in srgb, var(--accent) 10%, transparent); stroke-dasharray: 2 5; }
.sd-ring .fg { stroke: var(--navy-2); stroke-linecap: round; }
.sd-ring .mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.sd-ring .mid b { font-size: 30px; font-weight: 500; letter-spacing: -0.02em; }
.sd-ring .mid span { font-size: 11.5px; color: var(--text-2); }
.sd-time-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.sd-time-foot .meta { font-size: 12px; margin: 0; }

/* this month + to-do */
.sd-pct { font-size: 32px; font-weight: 400; letter-spacing: -0.03em; }
.sd-seg { position: relative; height: 34px; border-radius: 12px; overflow: hidden; margin-top: 4px;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--accent) 7%, transparent) 0 6px, color-mix(in srgb, var(--accent) 12%, transparent) 6px 7px); }
.sd-seg .a { position: absolute; inset: 0 auto 0 0; border-radius: 12px; background: linear-gradient(135deg, var(--navy-2), var(--navy)); }
.sd-seg .b { position: absolute; top: 4px; bottom: 4px; width: 3px; margin-left: -1px; border-radius: 3px; background: var(--aqua); }
.sd-seg-lbl { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.sd-todo { background: linear-gradient(160deg, #1d4a96, #102a57); color: #fff; border-color: rgba(255,255,255,.08); }
.sd-todo .card-head h2, .sd-todo .card-head b { color: #fff; }
.sd-todo .card-head b { font-size: 26px; font-weight: 400; }
.sd-todo ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.sd-todo a { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 12px; color: #fff; text-decoration: none; font-size: 13.5px; }
.sd-todo a:hover { background: rgba(255,255,255,.08); }
.sd-todo .ico { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); font-size: 13px; }
.sd-todo .tick { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid rgba(255,255,255,.4); font-size: 12px; }
.sd-todo .done .tick { background: #fff; color: var(--navy); border-color: #fff; font-weight: 700; }
.sd-todo .done .grow { opacity: .75; }

/* folding sections */
.sd-folds { padding: 10px 18px; }
.sd-fold { border-bottom: 1px solid var(--border); }
.sd-fold:last-child { border-bottom: 0; }
.sd-fold summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 13px 2px; font-weight: 600; font-size: 14px; }
.sd-fold summary::-webkit-details-marker { display: none; }
.sd-fold summary span { transition: transform .15s; color: var(--muted); }
.sd-fold[open] summary span { transform: rotate(180deg); }
.sd-fold > div { padding: 0 2px 14px; }
.sd-fold .leave-tiles { grid-template-columns: 1fr; gap: 8px; }
.sd-fold .leave-tile { padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; }
.sd-fold .leave-tile .value { font-size: 22px; grid-column: 2; grid-row: 1; }
.sd-fold .leave-tile .value.small { font-size: 15px; }
.sd-fold .leave-tile .label { grid-column: 1; grid-row: 1; }
.sd-fold .leave-tile .meter, .sd-fold .leave-tile .meta, .sd-fold .leave-tile .forfeit { grid-column: 1 / -1; font-size: 11.5px; }
.sd-fold .leave-tile .meter { height: 6px; }

/* my week */
.sd-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.sd-d { display: grid; gap: 6px; align-content: start; min-height: 120px; padding: 8px; border-radius: 16px; background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.sd-d.today { background: color-mix(in srgb, var(--accent) 12%, transparent); outline: 1.5px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.sd-dh { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; font-size: 11.5px; color: var(--text-2); }
.sd-dh em { font-style: normal; }
.sd-dh b { font-size: 16px; color: var(--text); font-weight: 600; }
.sd-days .blk { display: grid; padding: 6px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; }
.sd-days .blk small { font-weight: 500; opacity: .8; font-size: 10.5px; }
.sd-days .blk .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; }
.sd-days .blk.count { font-size: 17px; font-weight: 600; }
.sd-days .blk.count small { font-size: 10.5px; }
.sd-days .blk.shift { background: linear-gradient(135deg, var(--navy-2), var(--navy)); color: #fff; }
.sd-days .blk.leave { background: #dff5e8; color: #17603a; }
.sd-days .blk.off { background: var(--glass-strong); color: var(--text-2); border: 1px dashed var(--axis); }
.sd-days .blk.none { color: var(--muted); font-weight: 400; }
.sd-days .blk.event { background: #fff4dc; color: #7a5200; }
:root[data-theme="dark"] .sd-days .blk.leave { background: #12402a; color: #a6e8c2; }
:root[data-theme="dark"] .sd-days .blk.event { background: #45360f; color: #f5d98c; }

/* manager dashboard: team faces (when the sign-in has no staff record) */
.sd-faces { grid-area: photo; text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.sd-faces .faces { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.sd-faces .faces .avatar { margin-right: -14px; border: 3px solid var(--surface); box-shadow: 0 4px 10px rgba(19, 51, 107, .12); }
.sd-faces .meta { margin-top: auto; }
.sd-folds summary .pill { margin-left: 6px; font-size: 11.5px; }
.sd-folds summary { gap: 6px; }
.sd-folds summary > span:last-child { margin-left: auto; }

/* weather & sea (Windguru's own forecast frame) */
.wg-card .card-head { flex-wrap: wrap; gap: 8px; }
.wg-actions, .wg-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wg-box { width: 100%; overflow-x: auto; border-radius: 14px; background: #fff; min-height: 60px; }
.wg-box iframe { width: 100% !important; min-width: 0; border: 0; display: block; }
.wg-box .wg-loading { padding: 18px; margin: 0; color: #4b5c75; }
.wg-when { margin: 8px 0 0; font-size: 12px; }
.wg-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 9%, transparent); margin-bottom: 8px; }
.wg-seg button { font: inherit; font-size: 12.5px; font-weight: 600; padding: 8px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.wg-seg button[aria-pressed="true"] { background: linear-gradient(135deg, var(--navy-2), var(--navy)); color: #fff; box-shadow: 0 4px 12px rgba(19, 51, 107, .25); }
.wg-toolbar .wg-seg { margin-bottom: 0; }
.wg-error { display: grid; gap: 8px; justify-items: start; padding: 18px; color: #0e1c33; }
.wg-row { display: flex; gap: 8px; align-items: center; }
.wg-row input { flex: 1; min-width: 0; }
.wg-field .wg-box { margin-top: 10px; }
.wg-field .wg-box:empty { display: none; }
.wg-legend { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--text-2); font-size: 13.5px; }
@media (max-width: 820px) { .wg-toolbar { flex-direction: column; align-items: stretch; } .wg-toolbar .btn { text-align: center; } .wg-seg { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; } }

/* phone menu: dim the page behind it; tap there to close */
@media (min-width: 821px) { .menu-close { display: none; } }
@media (max-width: 820px) { .sidebar .brand { padding-right: 44px; } }
.menu-shade { position: fixed; inset: 0; z-index: 19; background: rgba(8, 20, 40, .35); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
@media (min-width: 821px) { .menu-shade { display: none; } }

/* staff photo controls in the Staff Directory panel */
.photo-edit { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

@media (max-width: 1280px) {
  .sd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "photo time" "prog side" "week week" "folds side"; }
}
@media (max-width: 820px) {
  .sd-head { grid-template-columns: 1fr; }
  .sd-head h1 { font-size: 30px; }
  .sd-bigs { justify-content: space-between; gap: 14px; }
  .sd-bigs b { font-size: 32px; }
  .sd-bigs .btn { width: 100%; }
  .sd-kpi { max-width: none; flex-basis: 40%; }
  .sd-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "photo" "time" "side" "prog" "week" "folds"; }
  .sd-photo { min-height: 300px; }
  .sd-days { grid-template-columns: repeat(7, minmax(78px, 1fr)); overflow-x: auto; padding-bottom: 4px; }
}

/* ---------- Birthdays, transfers (seaplane…), phone notifications ---------- */
.bday-notice { border-left-color: #e2559a; }
.tr-notice { border-left-color: var(--accent); }
.tr-notice .meta { flex-basis: 100%; margin-top: -6px; }
.push-card { margin-bottom: 16px; }
.push-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tr-line { margin-top: 2px; }
.tr-cell b { font-weight: 600; }
.tr-leg { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px 4px; margin: 0 0 14px; }
.tr-leg legend { font-weight: 600; padding: 0 6px; }
.tr-drop { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 18px; margin-bottom: 8px; border: 2px dashed var(--border);
  border-radius: 16px; cursor: pointer; background: var(--surface); }
.tr-drop:hover, .tr-drop:focus-visible, .tr-drop.over { border-color: var(--accent); background: var(--accent-soft, rgba(42,120,214,.08)); outline: none; }
.tr-drop .ico { font-size: 28px; }
.tr-drop .grow { flex: 1 1 260px; display: flex; flex-direction: column; gap: 2px; }
.tr-upload-notice .grow { flex: 1 1 200px; }
.sc-table input[type="time"] { width: 9.5em; min-width: 9.5em; }
.sc-table input[data-note] { width: 100%; min-width: 120px; }
.sc-table td { vertical-align: top; }
.tr-src { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: italic; }
.sc-text { margin-top: 14px; }
.sc-text summary { cursor: pointer; color: var(--text-2); font-size: 13px; }
.sc-text pre { max-height: 220px; overflow: auto; font-size: 12px; white-space: pre-wrap; background: var(--surface-2); padding: 10px; border-radius: 10px; }

.set-h3 { font-size: 15px; margin: 18px 0 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.set-h3:first-of-type { border-top: 0; padding-top: 0; margin-top: 4px; }
#extrasForm .check { display: flex; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.people-box { max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; }
.people-box .meta { margin-left: 4px; }

/* ---------- Equipment ---------- */
.eq-sum { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.eq-chip { display: flex; align-items: baseline; gap: 8px; padding: 10px 16px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.eq-chip b { font-size: 22px; font-variant-numeric: tabular-nums; }
.eq-chip span { color: var(--text-2); font-size: 13px; }
.eq-chip.due b { color: var(--critical); }
.eq-chip.soon b { color: #b7791f; }
.eq-chip[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft, rgba(42,120,214,.15)); }
.eq-next { min-width: 120px; font-size: 13px; }
.eq-next .meter { margin-top: 4px; height: 6px; }
.meter.warn span { background: var(--warning); }
.meter.bad span { background: var(--critical); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.link-btn.title { font-weight: 600; }
.link-btn:hover, .link-btn:focus-visible { color: var(--accent); text-decoration: underline; }
.eq-hero { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-bottom: 16px; }
.eq-hero > div { display: flex; flex-direction: column; }
.eq-hero b { font-size: 26px; font-variant-numeric: tabular-nums; }
.eq-hero span:not(.pill) { color: var(--text-2); font-size: 13px; }
.eq-h3 { font-size: 15px; margin: 20px 0 6px; }
@media (max-width: 600px) {
  .eq-chip { padding: 8px 12px; }
  .eq-chip b { font-size: 18px; }
  /* each machine becomes a small card */
  .eq-table thead { display: none; }
  .eq-table, .eq-table tbody { display: block; }
  .eq-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
  table.data.eq-table td { display: block; padding: 0; border: 0; text-align: left; }
  .eq-table td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .eq-table td:nth-child(2) { grid-column: 1; grid-row: 2; color: var(--text-2); font-size: 13px; }
  table.data.eq-table td:nth-child(3) { grid-column: 2; grid-row: 1 / span 2; text-align: right; }
  .eq-table td:nth-child(4) { grid-column: 1 / -1; }
  .eq-table td:nth-child(5) { grid-column: 1 / -1; }
  .eq-table td:nth-child(6) { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
  .eq-next { display: flex; align-items: center; gap: 10px; }
  .eq-next .meter { flex: 1; margin-top: 0; }
}
