/* Strive design system layer.
   Tokens from the Strive design system (SSSB_web navy + blues, Strive's sky accent).
   Loaded after css/styles.css; every page style lives here instead of inline <style> blocks. */

@font-face { font-family: "Lato"; src: url("../fonts/Lato-Light.ttf") format("truetype"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Lato"; src: url("../fonts/Lato-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Lato"; src: url("../fonts/Lato-Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }

/* ---------- Tokens ---------- */

:root {
  /* brand */
  --navy: #003374;
  --navy-deep: #00132b;
  --sapphire: #273896;
  --blue: #1669bb;
  --blue-hover: #197ad9;
  --sky: #00aeff;

  /* grounds */
  color-scheme: light;
  --page: #f4f7fb;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --track: #f1f2f6;
  --tint-brand: #e8f0fa;

  /* text */
  --ink: #1d242a;
  --ink-2: #363c4b;
  --ink-muted: #525252;
  --ink-subtle: #5f6873;
  --heading-accent: #003c87;
  --link: #1669bb;
  --on-brand: #ffffff;
  --on-brand-muted: rgba(255, 255, 255, 0.72);
  --on-sky: #00132b;

  /* lines */
  --line: #dfdfdf;
  --control-border: #8a93a0;
  --focus: #1669bb;

  /* status */
  --success: #146c43;  --success-tint: #e8f5ee;
  --warning: #7a6000;  --warning-tint: #fff4cc;
  --danger: #dc0016;   --danger-tint: #fff5f5;
  --info: #087990;     --info-tint: #e6f4f7;

  /* type */
  --font-display: Montserrat, "Helvetica Neue", Helvetica, sans-serif;
  --font-text: Lato, "Helvetica Neue", Helvetica, sans-serif;
  --font-mono: ui-monospace, Menlo, "Courier New", monospace;

  /* space */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-12: 48px;

  /* radius */
  --radius-xs: 3px; --radius-sm: 8px; --radius-md: 12px;
  --radius-lg: 20px; --radius-xl: 36px; --radius-pill: 999px;

  /* depth */
  --shadow-card: 0 10px 20px rgba(43, 57, 144, 0.08);
  --shadow-header: 0 10px 30px rgba(0, 51, 116, 0.2);
  --shadow-nav: 0 -10px 30px rgba(0, 0, 0, 0.05);

  /* layout */
  --app-max-width: 500px;
  --nav-width-desktop: 440px;
  --tap-target: 44px;

  /* kept so older inline styles still resolve */
  --sssb-blue: var(--heading-accent);
  --bg-light: var(--page);
  --card-shadow: var(--shadow-card);
  --sssb-gradient: var(--navy);
}

/* Light is the default theme. Put data-theme="dark" on <html> for the navy theme. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #00132b;
  --surface: #081a2e;
  --surface-raised: #0f2a4d;
  --track: #16304f;
  --tint-brand: #16304f;
  --ink: #ffffff;
  --ink-2: #cccccc;
  --ink-muted: #acb1b5;
  --ink-subtle: #8a93a0;
  --heading-accent: #9ccdeb;
  --link: #00aeff;
  --line: #1d3657;
  --control-border: #6a7f9e;
  --focus: #00aeff;
  --success: #4cc38a;  --success-tint: #0f2a2a;
  --warning: #f7a401;  --warning-tint: #2b2410;
  --danger: #ff6b7d;   --danger-tint: #2a1420;
  --info: #5fd0e6;     --info-tint: #0d2a36;
  --shadow-card: 0 10px 20px rgba(0, 0, 0, 0.35);
  --shadow-header: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-nav: 0 -10px 30px rgba(0, 0, 0, 0.4);
}

/* ---------- Base ---------- */

body {
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 24px;
  color: var(--ink-2);
  background-color: var(--page);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-family: var(--font-display); color: var(--ink); }
a { color: var(--link); }
a:hover { color: var(--blue-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.text-muted { color: var(--ink-muted) !important; }
.text-danger { color: var(--danger) !important; }
.text-primary { color: var(--heading-accent) !important; }
.small, small { font-size: 13px; line-height: 18px; }

/* ---------- App header (AppHeader) ---------- */

.app-header {
  position: relative;
  background: var(--surface);
  color: var(--ink);
  padding: 64px var(--space-5) var(--space-6);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  box-shadow: 0 1px 0 var(--line);
  text-align: center;
  overflow: hidden;
}
.brand-container {
  position: absolute;
  top: var(--space-5);
  left: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.strive-brand-logo { height: 18px; width: auto; filter: none; display: block; }
.beta-tag {
  margin-left: 0;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--track);
  color: var(--ink-subtle);
  font-family: var(--font-text);
  font-size: 10px;
  line-height: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: none;
}
.header-action {
  position: absolute;
  top: 8px;
  right: var(--space-3);
  width: var(--tap-target);
  height: var(--tap-target);
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  color: var(--heading-accent);
  font-size: 18px;
}
.header-action:hover { color: var(--heading-accent); background: var(--tint-brand); }

.profile-img {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-pill);
  border: 4px solid var(--tint-brand);
  background: var(--tint-brand);
  object-fit: cover;
  margin-bottom: var(--space-3);
}
.profile-name { margin: 0; font-family: var(--font-display); font-size: 22px; line-height: 28px; font-weight: 700; color: var(--heading-accent); }
.profile-meta { margin: var(--space-1) 0 0; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.profile-facts { margin: var(--space-3) 0 0; font-size: 13px; line-height: 20px; color: var(--ink-subtle); }
.profile-facts b { font-weight: 700; color: var(--ink-2); }
.profile-facts .role-text { font-weight: 700; color: var(--heading-accent); }

/* Tab pages (Leave, Attendance): just a title that stays at the top while scrolling */
.page-bar {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--page);
  padding: var(--space-6) var(--space-5) var(--space-3);
}
.page-title {
  max-width: var(--app-max-width);
  margin: 0 auto;
  padding: 0 var(--space-5);
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 32px;
  font-weight: 700;
  color: var(--heading-accent);
}
@media (max-width: 540px) { .page-title { padding: 0; } }
.page-bar + .main-content { margin-top: var(--space-2); }

/* Small header on inner pages */
.app-header.small-header { padding: var(--space-5) var(--space-5) var(--space-6); text-align: left; }
.app-header.small-header .brand-container { position: static; gap: var(--space-2); }
.header-back {
  width: var(--tap-target);
  height: var(--tap-target);
  margin-left: calc(-1 * var(--space-3));
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  color: var(--heading-accent);
  font-size: 18px;
}
.header-back:hover { color: var(--heading-accent); background: var(--tint-brand); }
.header-title { font-family: var(--font-display); font-size: 20px; line-height: 26px; font-weight: 700; color: var(--heading-accent); }

/* ---------- Layout ---------- */

.main-content {
  max-width: var(--app-max-width);
  margin: var(--space-6) auto 0;
  padding: 0 var(--space-3);   /* 12px from the screen edge on every page */
}
.container.main-content, .container-fluid.main-content { max-width: var(--app-max-width); }

/* Section title (overline) */
.section-title,
.card-title-overline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 22px;
  font-weight: 700;
  color: var(--heading-accent);
}
.section-title i, .card-title-overline i { margin: 0; font-size: 14px; letter-spacing: 0; }
.section-title.text-danger { color: var(--danger) !important; }

/* ---------- Badges ---------- */

.st-badge, .update-tag, .history-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) 10px;
  border: 0;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}
.history-badge, .st-badge--neutral { background: var(--track); color: var(--heading-accent); }
.tag-synced, .st-badge--success { background: var(--tint-brand); color: var(--heading-accent); }
.tag-pending, .st-badge--warning { background: var(--track); color: var(--ink-muted); }
.st-badge--danger { background: var(--danger-tint); color: var(--danger); }

/* ---------- Cards ---------- */

.dashboard-attendance-card,
.entitlement-card,
.attendance-card {
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.dashboard-attendance-card { padding: var(--space-5); }
.card-header-flex { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-4); }
.card-header-flex .card-title-overline { margin: 0; }

/* Today's log */
.attendance-grid { display: grid; gap: var(--space-2); }
.att-row {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--track);
  border: 0;
}
.att-col { flex: 1; text-align: center; }
.att-col small {
  display: block;
  font-family: var(--font-display);
  font-size: 10px;
  line-height: 14px;
  font-weight: 600;
  color: var(--ink-muted);
}
.time-text { font-family: var(--font-display); font-size: 16px; line-height: 22px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.time-text .text-danger { font-weight: 800; }
.att-divider { width: 1px; height: 24px; margin: 0 var(--space-3); background: var(--line); }
.att-empty { padding: var(--space-4) 0; text-align: center; font-size: 13px; color: var(--ink-muted); }
.sync-disclaimer {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--tint-brand);
  font-size: 12px;
  line-height: 17px;
  color: var(--ink-2);
}
.sync-disclaimer i { margin-top: 2px; color: var(--heading-accent); }

/* Entitlement (ProgressCard) */
.entitlement-card { padding: var(--space-6) var(--space-5) var(--space-5); margin-bottom: var(--space-4); }
.entitlement-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); }
.entitlement-head .card-title-overline { margin: 0; }
.entitlement-figure { font-family: var(--font-display); font-size: 22px; line-height: 28px; font-weight: 700; color: var(--heading-accent); }
.entitlement-figure small { font-size: 13px; font-weight: 600; color: var(--ink-muted); }
.progress {
  height: 12px;
  margin: var(--space-4) 0 var(--space-2);
  border-radius: var(--radius-pill);
  background-color: var(--track);
  overflow: hidden;
}
.progress-bar { background: var(--blue); border-radius: var(--radius-pill); box-shadow: none; }
.entitlement-foot { display: flex; justify-content: space-between; font-size: 13px; line-height: 18px; color: var(--ink-muted); }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-bottom: var(--space-6); }
.stat-card {
  margin: 0;
  padding: var(--space-5) var(--space-3) var(--space-4);
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  text-align: center;
}
.stat-card:active { transform: scale(0.96); }
.icon-box { color: var(--ink-subtle); font-size: 18px; }
.stat-value {
  display: block;
  margin-top: var(--space-2);
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 32px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--heading-accent);
}
.stat-label {
  display: block;
  margin-top: var(--space-1);
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 16px;
  font-weight: 600;
  color: var(--ink-muted);
}
.stat-card.is-danger .icon-box, .stat-card.is-danger .stat-value { color: var(--danger); }

/* ---------- History (ListItem) ---------- */

.history-section { padding: 0; margin-bottom: var(--space-8); }
.history-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  padding: var(--space-4);
  border: 0;
  border-left: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.history-icon {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--tint-brand);
  color: var(--heading-accent);
  font-size: 16px;
}
.history-info { flex: 1; min-width: 0; }
.history-info h6 { margin: 0; font-family: var(--font-text); font-size: 15px; line-height: 22px; font-weight: 700; color: var(--ink); }
.history-info small { display: block; color: var(--ink-muted); overflow-wrap: anywhere; }
.history-trail { color: var(--ink-subtle); }
.history-empty { padding: var(--space-4); text-align: center; font-size: 13px; color: var(--ink-muted); background: var(--surface); border-radius: var(--radius-lg); }

.penalty-badge { background: var(--surface); color: inherit; border-left: 0; }
.penalty-badge .history-icon { background: var(--danger-tint); color: var(--danger); }
.penalty-status { font-family: var(--font-display); font-size: 12px; font-weight: 700; color: var(--danger); background: var(--danger-tint); padding: var(--space-1) 10px; border-radius: var(--radius-sm); }

/* ---------- Attendance (AttendanceList) ---------- */

.month-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-3); }
.month-label { font-family: var(--font-display); font-size: 16px; line-height: 22px; font-weight: 700; color: var(--heading-accent); }
.attendance-card { overflow: hidden; margin-bottom: var(--space-8); }
.attendance-card .table-responsive { margin: 0; }
.cc-staff { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--line); }
.cc-staff .overline { font-family: var(--font-display); font-size: 12px; font-weight: 600; color: var(--ink-muted); }
.cc-staff .name { font-family: var(--font-display); font-weight: 700; color: var(--heading-accent); }
.cc-staff .role { font-size: 13px; color: var(--ink-muted); }

table.clockcard { margin: 0; border: 0 !important; color: var(--ink-2); font-size: 13px; background: transparent; }
table.clockcard thead th {
  padding: var(--space-3) var(--space-1);
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  background: var(--track);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--heading-accent);
  vertical-align: middle !important;
}
table.clockcard tbody tr td { padding: var(--space-2) var(--space-1); vertical-align: middle; border-color: var(--line) !important; }
table.clockcard tr.weekend { background-color: var(--track); }
table.clockcard tr.is-holiday { background-color: var(--tint-brand); }
.flex-con { display: flex; gap: var(--space-1); justify-content: center; }
.flex-con > div {
  flex: 1;
  min-width: 48px;
  padding: var(--space-1) 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--heading-accent);
}
.flex-con > div:not(:empty) { border-color: var(--line); color: var(--heading-accent); }
.red { color: var(--danger) !important; font-weight: 700; }
.grey { color: var(--ink-subtle) !important; }
.ta_remarks { max-width: 120px; font-size: 11px; line-height: 15px; color: var(--ink-muted); }
.day-num { font-family: var(--font-display); font-size: 16px; line-height: 1; font-weight: 800; color: var(--ink); }
.day-name { font-size: 11px; color: var(--ink-muted); }
.holiday-tag { display: inline-block; padding: 1px 6px; border-radius: var(--radius-xs); background: var(--tint-brand); color: var(--heading-accent); font-size: 10px; font-weight: 700; }
.ta_leaverecord i { color: var(--warning); }
.ta_absentrecord i { color: var(--danger); }
.ta_gooutrecord i { color: var(--blue); }
.empty-state { padding: var(--space-12) var(--space-5); text-align: center; color: var(--ink-muted); }
.empty-state i { display: block; margin-bottom: var(--space-3); font-size: 28px; color: var(--ink-subtle); }

/* ---------- Bottom nav (BottomNav) ---------- */

body { padding-bottom: 140px; }
.fixed-footer {
  position: fixed;
  left: var(--space-3);
  right: var(--space-3);
  bottom: var(--space-3);
  padding: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  backdrop-filter: none;
  z-index: 1000;
}
.bottom-nav {
  display: flex;
  justify-content: space-around;
  gap: var(--space-1);
  max-width: var(--nav-width-desktop);
  margin: 0 auto;
  padding: var(--space-2);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-nav), 0 0 0 1px var(--line);
}
.nav-item {
  position: relative;
  flex: 1;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  border-radius: 28px;
  color: var(--ink-subtle);
  font-family: var(--font-display);
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  text-align: center;
}
.nav-item i { display: block; margin: 0; font-size: 20px; }
.nav-item:hover { color: var(--heading-accent); }
.nav-item.active, .nav-item.active:hover { background: var(--tint-brand); color: var(--heading-accent) !important; }
.nav-item.active i { transform: none; }
.fixed-footer .copyright {
  display: block;
  margin-top: var(--space-2);
  font-size: 11px;
  line-height: 14px;
  color: var(--ink-subtle);
  text-align: center;
}
@media (min-width: 768px) {
  .fixed-footer { width: auto; left: var(--space-3); transform: none; bottom: var(--space-5); border-radius: 0; }
}

/* ---------- Sign in, setup, password ---------- */

body.auth-page { padding-bottom: var(--space-8); background: var(--page); }
.auth-hero {
  position: relative;
  color: var(--ink);
  text-align: center;
  padding: 56px var(--space-5) var(--space-6);
}
.auth-hero .strive-brand-logo { height: 30px; margin: 0 auto; }
.auth-hero p { margin: var(--space-2) 0 0; opacity: 1; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.auth-wrap { padding: 0 var(--space-5); }
.auth-card {
  max-width: 420px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  position: relative;
}
.auth-card h5 { margin-bottom: var(--space-1); font-size: 22px; line-height: 28px; font-weight: 700; color: var(--heading-accent); text-align: left; }
.auth-card .lead-text { margin-bottom: var(--space-5); font-size: 14px; line-height: 20px; color: var(--ink-muted); text-align: left; }
.auth-card .form-group { margin-bottom: var(--space-4); }
.auth-card label {
  margin-bottom: 6px;
  font-family: var(--font-text);
  font-size: 14px;
  line-height: 20px;
  font-weight: 700;
  color: var(--ink-2);
}
.form-control, .auth-card .form-control {
  height: 48px;
  padding: 0 var(--space-4);
  border: 1.5px solid var(--control-border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 16px;
}
.form-control::placeholder { color: var(--ink-subtle); }
.form-control:focus { border-color: var(--focus); background: var(--surface); color: var(--ink); box-shadow: 0 0 0 3px var(--tint-brand); }
.auth-card .input-group .form-control, .pw-card .input-group .form-control { border-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.auth-card .input-group .btn, .pw-card .input-group .btn {
  width: 48px;
  border: 1.5px solid var(--control-border);
  border-left: 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--surface);
  color: var(--ink-subtle);
}
.auth-card .input-group:focus-within .form-control,
.auth-card .input-group:focus-within .btn,
.pw-card .input-group:focus-within .form-control,
.pw-card .input-group:focus-within .btn { border-color: var(--focus); }

.btn-strive {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--blue);
  color: var(--on-brand);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  transition: background-color 0.2s ease;
}
.btn-strive:hover, .btn-strive:focus { background: var(--blue-hover); color: var(--on-brand); opacity: 1; }

.auth-alert {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  border: 0;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 20px;
}
.auth-alert i { margin-top: 3px; }
.auth-alert.error { background: var(--danger-tint); color: var(--danger); border: 0; }
.auth-alert.info { background: var(--tint-brand); color: var(--heading-accent); border: 0; }
.auth-staff { margin-bottom: var(--space-4); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--tint-brand); text-align: left; }
.auth-staff strong { display: block; color: var(--ink); }
.auth-staff small { color: var(--ink-muted); }
.auth-username { display: block; margin-top: 6px; font-size: 14px; color: var(--heading-accent); }
.auth-foot { margin-top: var(--space-5); text-align: center; font-size: 13px; line-height: 19px; color: var(--ink-muted); }
.auth-foot a { color: var(--link); font-weight: 700; }
.auth-copy { display: block; margin-top: var(--space-6); text-align: center; font-size: 11px; color: var(--ink-subtle); }

/* ---------- Light-theme polish ---------- */


/* Stat icons sit on a small brand-tint tile. */
.stat-card .icon-box {
  width: 40px;
  height: 40px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--tint-brand);
  color: var(--heading-accent);
  font-size: 16px;
}
.stat-card.is-danger .icon-box { background: var(--danger-tint); color: var(--danger); }

/* Normal-case headings and labels everywhere (css/styles.css uppercases some of these). */
.section-title, .card-title-overline, .stat-label, .att-col small, .month-label,
.auth-card label, .btn-strive, .profile-meta, .day-name, .cc-staff .overline,
table.clockcard thead th, .nav-item {
  text-transform: none;
  letter-spacing: 0;
}

/* Language switch: EN · BM · 中文 */
.lang-switch {
  display: flex;
  justify-content: center;
  gap: var(--space-1);
  margin: var(--space-5) auto 0;
}
.lang-switch a {
  min-width: var(--tap-target);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 20px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.lang-switch a:hover { color: var(--heading-accent); background: var(--tint-brand); }
.lang-switch a.active { color: var(--heading-accent); background: var(--tint-brand); }
.main-content > .lang-switch { margin: 0 auto var(--space-6); }

/* Annual leave: days left is the headline; over the entitlement shows in red */
.entitlement-figure { font-size: 18px; line-height: 24px; white-space: nowrap; }
.entitlement-figure.is-over { color: var(--danger); }
.entitlement-foot { flex-wrap: wrap; gap: 2px var(--space-3); }

/* Chinese text reads better with a CJK-friendly font stack */
:lang(zh) body, body:lang(zh) { font-family: var(--font-text), "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif; }

/* =====================================================================
   Solid theme (after boss feedback: the app should feel substantial).
   Navy bands top and bottom, firm cards, heavy numbers.
   ===================================================================== */

:root {
  --page: #e9eef5;
  --card-border: #d3dce8;
  --shadow-solid: 0 1px 0 rgba(0, 51, 116, 0.08), 0 6px 16px rgba(0, 51, 116, 0.10);
}
body { padding-bottom: 96px; }

/* Home header: navy band */
.app-header {
  background: var(--navy);
  color: var(--on-brand);
  padding: 60px var(--space-5) var(--space-6);
  border-radius: 0 0 28px 28px;
  box-shadow: var(--shadow-header);
}
.app-header .beta-tag { background: rgba(255, 255, 255, 0.16); color: var(--on-brand); }
.app-header .header-action { color: var(--on-brand); }
.app-header .header-action:hover { color: var(--on-brand); background: rgba(255, 255, 255, 0.14); }
.app-header .profile-img { border-color: rgba(255, 255, 255, 0.25); background: var(--sapphire); }
.app-header .profile-name { color: var(--on-brand); font-size: 24px; line-height: 30px; font-weight: 800; }
.app-header .profile-meta { color: var(--on-brand-muted); }
.app-header .profile-facts { color: var(--on-brand-muted); }
.app-header .profile-facts b { color: var(--on-brand); }
.app-header .profile-facts .role-text { color: #9ccdeb; }
/* Home: today screen (greeting, waiting strip, two small boxes) */
.today-head { margin-top: var(--space-2); }
.dashboard-attendance-card { margin-bottom: var(--space-4); }
.today-date { margin: 0; color: var(--on-brand-muted); font-size: 14px; font-weight: 700; }
.today-greet { margin: 2px 0 0; color: var(--on-brand); font-family: var(--font-display); font-size: 24px; line-height: 30px; font-weight: 800; }
.waiting-strip { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); padding: 12px 16px; border-radius: 14px; background: #fff4e0; color: #8a5300; text-decoration: none; }
.waiting-strip:hover { color: #8a5300; text-decoration: none; filter: brightness(.98); }
.waiting-strip > i:first-child { font-size: 18px; }
.waiting-strip span { flex: 1; min-width: 0; }
.waiting-strip b { display: block; font-size: 15px; }
.waiting-strip small { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-2); margin-bottom: var(--space-4); }
.today-box { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--card-border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-solid); color: var(--ink); text-decoration: none; }
.today-box:hover { color: var(--ink); text-decoration: none; background: var(--tint-brand); }
.today-box small { color: var(--ink-muted); font-size: 12px; font-weight: 700; }
.today-box > b { font-family: var(--font-display); font-size: 18px; font-weight: 800; color: var(--navy); }
.today-box > span { color: var(--ink-subtle); font-size: 12px; }
.today-box .is-over { color: var(--danger); }
.today-counts { display: flex; flex-wrap: wrap; gap: 2px 10px; color: var(--ink-muted) !important; font-size: 13px !important; }
.today-counts b { color: var(--ink); font-size: 16px; font-weight: 800; }
.form-tiles--4 { grid-template-columns: repeat(4, 1fr); }

/* Tab pages: compact navy bar with the title */
.page-bar {
  background: var(--navy);
  padding: 0;
  box-shadow: var(--shadow-header);
}
.page-bar-inner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  max-width: var(--app-max-width);
  min-height: 60px;
  margin: 0 auto;
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-5);
}
.page-bar .page-title {
  flex: 1;
  margin: 0;
  padding: 0;
  color: var(--on-brand);
  font-size: 22px;
  line-height: 28px;
  font-weight: 800;
}
.page-bar-btn {
  width: var(--tap-target);
  height: var(--tap-target);
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  color: var(--on-brand);
  font-size: 18px;
}
.page-bar-btn:hover { color: var(--on-brand); background: rgba(255, 255, 255, 0.14); }
.page-bar-inner .page-bar-btn:first-child { margin-left: calc(-1 * var(--space-3)); }
.page-bar + .main-content { margin-top: var(--space-4); }

/* Cards: firm edge + solid shadow */
.dashboard-attendance-card, .entitlement-card, .attendance-card, .stat-card, .auth-card, .acc, .settings-group {
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-solid);
}
.dashboard-attendance-card, .entitlement-card, .attendance-card, .stat-card { border-radius: 16px; }
.section-title, .card-title-overline { font-size: 17px; font-weight: 800; }

/* Heavy numbers */
.stat-card { position: relative; overflow: hidden; padding-top: var(--space-6); }
.stat-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--navy); }
.stat-card.is-danger::before { background: var(--danger); }
.stat-value { font-size: 34px; line-height: 38px; font-weight: 800; color: var(--navy); }
.entitlement-figure { font-size: 20px; font-weight: 800; color: var(--navy); }
.time-text { font-weight: 800; }
.progress { height: 14px; }
.progress-bar { background: var(--navy); }

/* Bottom menu: navy bar across the bottom */
.fixed-footer { left: 0; right: 0; bottom: 0; }
.bottom-nav {
  max-width: none;
  padding: var(--space-2) var(--space-3) calc(var(--space-2) + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: var(--navy);
  box-shadow: 0 -6px 20px rgba(0, 19, 43, 0.25);
}
.nav-item { min-height: 54px; color: rgba(255, 255, 255, 0.7); font-size: 12px; font-weight: 700; }
.nav-item:hover { color: var(--on-brand); }
.nav-item.active, .nav-item.active:hover { background: rgba(255, 255, 255, 0.16); color: var(--on-brand) !important; }
.fixed-footer .copyright { display: none; }
@media (min-width: 768px) {
  .fixed-footer { left: 0; right: 0; bottom: 0; }
  .bottom-nav { max-width: var(--nav-width-desktop); }
}

/* Sign-in pages: navy band, card overlapping it */
.auth-hero {
  background: var(--navy);
  color: var(--on-brand);
  padding: 64px var(--space-5) 80px;
  border-radius: 0 0 28px 28px;
  box-shadow: var(--shadow-header);
}
.auth-hero p { color: var(--on-brand-muted); }
.auth-card { margin: -52px auto 0; }
.btn-strive { background: var(--navy); font-weight: 800; }
.btn-strive:hover, .btn-strive:focus { background: var(--sapphire); }
/* Send waits for a real reason (includes/sign_sheet.php) */
.btn-strive.is-waiting, .btn-strive.is-waiting:hover { background: #b8c2d3; box-shadow: none; }
.form-control.is-invalid { border-color: var(--danger, #c0392b); box-shadow: 0 0 0 3px rgba(192, 57, 43, .12); }
.need-text-msg { margin: 6px 0 0; color: var(--danger, #c0392b); font-size: 13px; font-weight: 600; }

/* Tighter pages (Leave, Attendance) */
.main-content--tight { padding-left: var(--space-3); padding-right: var(--space-3); }
.main-content--tight > .row { margin-left: 0; margin-right: 0; }
.main-content--tight .col-lg-12 { padding-left: 0; padding-right: 0; }

/* ---------- Settings ---------- */
.settings-profile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: var(--space-5);
  padding: var(--space-4) var(--space-5);
  border-radius: 16px;
  background: var(--tint-brand);
  color: var(--ink-muted);
  font-size: 14px;
}
.settings-profile strong { color: var(--navy); font-family: var(--font-display); font-size: 18px; font-weight: 800; }
.settings-profile b { color: var(--ink-2); }
.settings-heading { margin: 0 0 var(--space-2); font-size: 14px; font-weight: 800; color: var(--ink-muted); }
.settings-group { margin-bottom: var(--space-5); border-radius: 16px; background: var(--surface); overflow: hidden; }
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: var(--space-3) var(--space-5);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}
.settings-row + .settings-row { border-top: 1px solid var(--line); }
.settings-row:hover { color: var(--navy); background: var(--tint-brand); text-decoration: none; }
.settings-row i { color: var(--ink-subtle); }
.settings-row span i { width: 22px; margin-right: var(--space-2); color: var(--navy); }
.settings-row.is-active { color: var(--navy); }
.settings-row.is-active > i { color: var(--navy); font-size: 20px; }
.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  height: 52px;
  border: 1.5px solid var(--danger);
  border-radius: 14px;
  background: var(--surface);
  color: var(--danger);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
}
.btn-logout:hover { background: var(--danger); color: #fff; }

/* ---------- Leave: fold-open sections ---------- */
.acc { margin-bottom: var(--space-3); border-radius: 16px; background: var(--surface); overflow: hidden; }
.acc summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 60px;
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  list-style: none;
}
.acc summary::-webkit-details-marker { display: none; }
.acc-icon {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  font-size: 15px;
}
.acc-title { flex: 1; font-family: var(--font-display); font-size: 16px; line-height: 20px; font-weight: 800; color: var(--navy); }
.acc-count {
  min-width: 30px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--tint-brand);
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}
.acc-chevron { color: var(--ink-subtle); transition: transform 0.2s ease; }
.acc[open] .acc-chevron { transform: rotate(180deg); }
.acc[open] summary { border-bottom: 1px solid var(--line); }
.acc--danger .acc-icon { background: var(--danger); }
.acc--danger .acc-title { color: var(--danger); }
.acc--danger .acc-count { background: var(--danger-tint); color: var(--danger); }
.acc-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-4);
}
.acc-row + .acc-row { border-top: 1px solid var(--line); }
.acc-row-main { flex: 1; min-width: 0; }
.acc-row-main b { display: block; color: var(--ink); font-size: 15px; line-height: 20px; }
.acc-row-main small { display: block; color: var(--ink-muted); overflow-wrap: anywhere; }
/* Type of leave next to its date */
.lt-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 18px; vertical-align: 1px; background: #eef1f5; color: var(--ink-muted); }
.lt--annual { background: #e8f0fd; color: #1f4fa8; }
.lt--sick { background: #fdecec; color: #b42318; }
.lt--unpaid { background: #fff4e0; color: #9a5b00; }
.lt--special { background: #f1ebfd; color: #6b3fc4; }
.acc-side {
  flex: none;
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  background: var(--tint-brand);
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.acc--danger .acc-side { background: var(--danger-tint); color: var(--danger); }
.acc-empty { margin: 0; padding: var(--space-4); color: var(--ink-muted); font-size: 14px; text-align: center; }

/* ---------- Attendance clock card (earlier layout, solid look) ---------- */
.att-legend { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-3); font-size: 13px; color: var(--ink-muted); }
.att-legend .red { font-family: var(--font-mono); font-weight: 800; }
.attendance-card { border-radius: 16px; overflow: hidden; }
.cc-staff { background: var(--tint-brand); border-bottom: 1px solid var(--card-border); }
table.clockcard thead th { background: var(--navy); color: var(--on-brand); font-size: 12px; border-bottom: 0 !important; }
table.clockcard .day-num { color: var(--navy); }
/* Date stays in view while sliding sideways to OT and Remarks */
table.clockcard th:first-child, table.clockcard td:first-child { position: sticky; left: 0; z-index: 2; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
table.clockcard thead th:first-child { background: var(--navy); z-index: 3; }
table.clockcard tr.weekend td:first-child { background: var(--track); }
table.clockcard tr.is-holiday td:first-child { background: var(--tint-brand); }
.flex-con > div { background: var(--tint-brand); border-color: var(--card-border); font-weight: 700; }
.flex-con > div.red { background: var(--danger-tint); border-color: #f5c2c7; }

/* ---------- Absent (blue) and Permission To Go Out (pink), as on the HR page ---------- */
:root {
  --absent-tint: #d5f4ff; --absent: #0a6f94;
  --ptgo-tint: #ffd7e1;   --ptgo: #b0275a;
}
.acc--absent summary { background: var(--absent-tint); }
.acc--absent .acc-icon { background: var(--absent); }
.acc--absent .acc-title { color: #064f6b; }
.acc--absent .acc-count, .acc--absent .acc-side { background: #fff; color: var(--absent); }
.acc--ptgo summary { background: var(--ptgo-tint); }
.acc--ptgo .acc-icon { background: var(--ptgo); }
.acc--ptgo .acc-title { color: #7d1a40; }
.acc--ptgo .acc-count, .acc--ptgo .acc-side { background: #fff; color: var(--ptgo); }
.stat-card.is-absent::before { background: var(--absent); }
.stat-card.is-absent .icon-box { background: var(--absent-tint); color: var(--absent); }
.stat-card.is-ptgo::before { background: var(--ptgo); }
.stat-card.is-ptgo .icon-box { background: var(--ptgo-tint); color: var(--ptgo); }
/* Staff details stay put while the table slides sideways */
.attendance-card .cc-staff { position: sticky; left: 0; width: calc(100vw - 26px); max-width: calc(var(--app-max-width) - 26px); }

/* ---------- Clock card: one box per slot (In / Out for Morning, Afternoon, OT) ---------- */
table.clockcard--slots { table-layout: fixed; width: max(100%, 520px); }
table.clockcard--slots thead th { padding: 6px 2px; text-align: center; vertical-align: middle !important; }
table.clockcard--slots thead tr:first-child th { font-size: 12px; }
table.clockcard--slots thead tr.cc-sub th { padding-top: 0; font-size: 11px; font-weight: 600; color: var(--on-brand-muted); }
table.clockcard--slots th.cc-date, table.clockcard--slots td:first-child { width: 44px; }
table.clockcard--slots th.cc-remarks { width: 120px; }
table.clockcard--slots thead tr:first-child th:nth-child(2),
table.clockcard--slots thead tr:first-child th:nth-child(3),
table.clockcard--slots thead tr:first-child th:nth-child(4) { box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.18); }
table.clockcard--slots td.cc-slot { padding: 6px 2px; text-align: center; }
table.clockcard--slots td.cc-slot:nth-child(2n) { box-shadow: inset 1px 0 0 var(--line); }
table.clockcard--slots .ta_record {
  display: block;
  padding: 3px 0;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  background: var(--tint-brand);
  color: var(--navy);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
}
table.clockcard--slots .ta_record.red { background: var(--danger-tint); border-color: #f5c2c7; color: var(--danger); }
table.clockcard--slots .ta_record_status,
table.clockcard--slots .ta_record_OT,
table.clockcard--slots .ta_record_penalty { display: none; }
table.clockcard--slots .ta_remarks { max-width: none; font-size: 11px; line-height: 15px; }
table.clockcard--slots .cc-leave { color: var(--blue); }
.ta_hide { display: none !important; }

/* Clock card fits the phone: no Remarks column (remarks go on a line under the day) */
table.clockcard--slots { width: 100%; }
table.clockcard--slots th.cc-date, table.clockcard--slots td:first-child { width: 40px; }
table.clockcard--slots td.cc-slot { padding: 5px 1px; }
table.clockcard--slots .ta_record { padding: 3px 0; font-size: 11.5px; letter-spacing: -0.03em; }
table.clockcard--slots tr.cc-remark td { padding: 0 4px 6px; border-top: 0 !important; font-size: 11.5px; line-height: 15px; color: var(--ink-muted); }
table.clockcard--slots tr.cc-remark td:first-child { box-shadow: none; }
.attendance-card .cc-staff { width: auto; max-width: none; }
@media (min-width: 400px) { table.clockcard--slots .ta_record { font-size: 12.5px; letter-spacing: 0; } }

/* =====================================================================
   Phase 2: apply, approvals, official form view, notifications
   ===================================================================== */

/* Header: bell + gear side by side */
.header-actions { position: absolute; top: 8px; right: var(--space-3); display: flex; gap: 2px; }
.header-actions .header-action { position: relative; top: auto; right: auto; }
.bell { position: relative; }
.bell-count, .nav-count {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: #fff;
  font-family: var(--font-display);
  font-size: 11px;
  line-height: 18px;
  font-weight: 800;
  text-align: center;
}
.nav-count { top: 2px; right: 18%; }

/* Apply form */
.apply-btn { margin-bottom: var(--space-4); }
.apply-form { display: grid; gap: var(--space-3); }
.apply-card {
  padding: var(--space-4);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-solid);
}
.apply-label { display: block; margin: 0 0 var(--space-2); font-family: var(--font-display); font-size: 15px; font-weight: 800; color: var(--navy); }
.list-heading { margin-top: var(--space-2); }
/* Section labels and intro lines outside a card: the same small inset on every page */
.list-heading, .settings-heading, .apply-form > .field-hint { padding-left: var(--space-1); padding-right: var(--space-1); }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.choice { margin: 0; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 52px;
  padding: var(--space-2) var(--space-3);
  border: 1.5px solid var(--card-border);
  border-radius: 12px;
  color: var(--ink);
  font-weight: 700;
  line-height: 18px;
}
.choice span i { color: var(--navy); width: 18px; text-align: center; }
.choice input:checked + span { border-color: var(--navy); background: var(--tint-brand); color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.choice input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.date-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.field { display: block; margin: 0 0 var(--space-3); }
.field .form-control { width: 100%; }
.pw-card .field:last-child { margin-bottom: 0; }
.pw-card .input-group { display: flex; flex-wrap: nowrap; }
.pw-card .input-group .form-control { flex: 1 1 auto; width: 1%; min-width: 0; }
.pw-card .input-group-append { display: flex; }
textarea.form-control { height: auto; padding: var(--space-3) var(--space-4); line-height: 22px; }
.check-row { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-3); font-weight: 700; color: var(--ink-2); }
.check-row input { width: 20px; height: 20px; }
.field-hint { margin: 0; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.balance-card { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); background: var(--tint-brand); }
.balance-card div { display: flex; flex-direction: column; }
.balance-card span { font-size: 13px; color: var(--ink-muted); }
.balance-card b { font-family: var(--font-display); font-size: 20px; color: var(--navy); }
.balance-card b.is-over, .is-over { color: var(--danger) !important; }
.route { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.route li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--tint-brand); color: var(--navy); font-weight: 700; font-size: 14px; }
.route li + li::before { content: "\2192"; margin: 0 var(--space-1) 0 calc(-1 * var(--space-2)); color: var(--ink-subtle); }

/* Status banner on a request */
.status-banner { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: 14px; font-weight: 800; }
.status-banner i { font-size: 20px; }
.status--pending { background: var(--warning-tint); color: var(--warning); }
.status--ok      { background: var(--tint-brand); color: var(--navy); }
.status--done    { background: var(--success-tint); color: var(--success); }
.status--no      { background: var(--danger-tint); color: var(--danger); }
.status--muted   { background: var(--track); color: var(--ink-muted); }
.status-text--pending { color: var(--warning) !important; }
.status-text--ok      { color: var(--navy) !important; }
.status-text--done    { color: var(--success) !important; }
.status-text--no      { color: var(--danger) !important; }
.status-text--muted   { color: var(--ink-subtle) !important; }

/* The official form, as on paper */
.paper {
  margin-bottom: var(--space-4);
  padding: var(--space-4) var(--space-3);
  border: 1px solid #c9ced6;
  border-radius: 6px;
  background: #fff;
  color: #111;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  line-height: 18px;
  box-shadow: var(--shadow-solid);
}
.paper-head { margin-bottom: var(--space-3); text-align: center; }
.paper-head strong { display: block; font-size: 15px; letter-spacing: 0.04em; }
.paper-head span { display: block; font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-decoration: underline; }
.paper-box { padding: var(--space-3); border: 2px solid #111; }
.paper-box + .paper-box { border-top: 0; }
.paper-label { margin-bottom: 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; }
.paper-row { display: flex; gap: var(--space-2); align-items: baseline; padding: 3px 0; }
.paper-row > span { flex: 0 0 44%; font-size: 11.5px; letter-spacing: 0.02em; }
.paper-row > b { flex: 1; min-width: 0; padding-bottom: 1px; border-bottom: 1px solid #111; font-weight: 600; overflow-wrap: anywhere; }
.paper-row small { font-size: 11px; font-weight: 400; }
.paper-checks { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 6px; }
.paper-checks i { margin-right: 4px; }
.paper-text { margin: 0; min-height: 36px; border-bottom: 1px solid #111; overflow-wrap: anywhere; }
.paper-sign { display: grid; grid-template-columns: 1fr 1.4fr; gap: var(--space-3); }
.paper-sign span { display: block; font-size: 11.5px; }
.paper-sign b { display: block; min-height: 22px; border-bottom: 1px solid #111; font-weight: 600; }
.paper-signature { font-family: "Brush Script MT", "Segoe Script", cursive; font-size: 17px; font-weight: 400 !important; color: #1a2b6d; }
.paper-approvals { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.paper-approvals .paper-row > span { flex-basis: 34%; }
.paper-official { background: #f4f6f9; }
@media (max-width: 360px) { .paper-approvals { grid-template-columns: 1fr; } }

/* Decide */
.decide-card { margin-bottom: var(--space-4); padding: var(--space-4); border: 2px solid var(--navy); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-solid); }
.decide-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.btn-decide-yes, .btn-decide-no { height: 52px; border-radius: 14px; font-family: var(--font-display); font-size: 16px; font-weight: 800; }
.btn-decide-yes { background: var(--navy); color: #fff; border: 0; }
.btn-decide-yes:hover { background: var(--sapphire); color: #fff; }
.btn-decide-no { background: var(--surface); color: var(--danger); border: 1.5px solid var(--danger); }
.btn-decide-no:hover { background: var(--danger); color: #fff; }

/* History */
.history { margin-bottom: var(--space-4); }
.timeline { margin: 0; padding: 0 0 0 var(--space-4); list-style: none; border-left: 3px solid var(--card-border); }
.timeline li { position: relative; padding: 0 0 var(--space-3) var(--space-3); }
.timeline li::before { content: ""; position: absolute; left: -24px; top: 4px; width: 13px; height: 13px; border-radius: 50%; background: var(--navy); border: 2px solid var(--page); }
.timeline li.tl--rejected::before { background: var(--danger); }
.timeline li.tl--cancelled::before { background: var(--ink-subtle); }
.timeline b { display: block; color: var(--ink); }
.timeline small { color: var(--ink-muted); }
.timeline p { margin: 4px 0 0; color: var(--ink-2); font-style: italic; }

/* Lists: approvals, my requests, notifications */
.tabs { display: flex; gap: var(--space-2); margin-bottom: var(--space-3); }
.tabs a { flex: 1; padding: 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--card-border); color: var(--ink-muted); font-weight: 800; text-align: center; text-decoration: none; }
.tabs a.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.tab-count { display: inline-block; min-width: 22px; margin-left: 4px; padding: 0 6px; border-radius: var(--radius-pill); background: rgba(255,255,255,0.2); }
.tabs a:not(.active) .tab-count { background: var(--tint-brand); color: var(--navy); }
.req-list { margin-bottom: var(--space-4); border: 1px solid var(--card-border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-solid); overflow: hidden; }
.req-item { display: flex; align-items: center; gap: var(--space-3); padding: 12px var(--space-4); color: inherit; text-decoration: none; }
.req-item + .req-item { border-top: 1px solid var(--line); }
.req-item:hover { background: var(--tint-brand); text-decoration: none; color: inherit; }
.req-item.is-unread { background: #f3f8ff; }
.req-item.is-unread .req-text { font-weight: 800; }
.req-icon { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--tint-brand); color: var(--navy); }
.req-main { flex: 1; min-width: 0; }
.req-main b, .req-text { display: block; color: var(--ink); line-height: 20px; }
.req-main small { display: block; color: var(--ink-muted); }
.req-status { font-weight: 700; }
.req-date { flex: none; font-size: 12px; color: var(--ink-subtle); }
.card-empty { border: 1px solid var(--card-border); border-radius: 16px; background: var(--surface); }
/* Two fields side by side must shrink to fit narrow phones (date inputs have a large minimum width) */
.date-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.date-row .form-control, .apply-form input[type="date"] { min-width: 0; padding-left: var(--space-3); padding-right: var(--space-2); font-size: 15px; }
.choice-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* Sign sheet: password to sign, remark to say no */
.sign-sheet { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: var(--space-4); padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom)); background: rgba(0, 19, 43, 0.55); overflow-y: auto; }
.sign-sheet[hidden] { display: none; }
.sign-panel { width: 100%; max-width: 440px; margin: auto; padding: var(--space-4); border-radius: 20px; background: var(--surface); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3); animation: sign-in .16s ease-out; }
@keyframes sign-in { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.sign-title { margin: 0 0 4px; font-family: var(--font-display); font-size: 20px; font-weight: 800; color: var(--ink); }
.sign-text { margin: 0 0 var(--space-3); color: var(--ink-muted); }
.sign-panel .field { display: block; margin-bottom: var(--space-3); }
.sign-panel .field[hidden] { display: none; }
.sign-error { margin: 0 0 var(--space-3); color: var(--danger); font-weight: 700; }

/* Approvals: tick several, decide together */
.req-item--pick { cursor: pointer; margin: 0; font-weight: normal; }
.req-pick { flex: none; width: 22px; height: 22px; accent-color: var(--navy); }
.req-open { flex: none; color: var(--link); font-size: 13px; font-weight: 700; padding: 6px; }
.req-reason { font-style: italic; }
.pick-bar { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 5; display: grid; gap: var(--space-2); margin-bottom: var(--space-4); padding: var(--space-3); border: 2px solid var(--navy); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-solid); }
.pick-bar-top { display: flex; justify-content: space-between; align-items: center; font-weight: 700; color: var(--ink); }
.pick-bar-top label { margin: 0; display: flex; align-items: center; gap: 8px; }

/* Attachments */
.attach-drop { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px 0; padding: 14px; border: 2px dashed var(--control-border); border-radius: 12px; color: var(--link); font-weight: 700; cursor: pointer; }
.attach-drop:hover { background: var(--tint-brand); }
.attach-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.attach-list { margin: 0 0 6px; padding: 0; list-style: none; }
.attach-list li { padding: 6px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 14px; word-break: break-all; }
.attach-list li i { color: var(--link); margin-right: 4px; }
.attach-files { margin: 0; padding: 0; list-style: none; }
.attach-files a { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 6px; border: 1px solid var(--card-border); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; word-break: break-all; }
.attach-files a i { color: var(--link); font-size: 18px; }
.req-star { color: var(--danger); }
.ref-no { display: inline-block; margin-bottom: var(--space-3); padding: 4px 10px; border-radius: var(--radius-pill); background: var(--tint-brand); color: var(--heading-accent); font-weight: 800; letter-spacing: .3px; font-size: 14px; }
.convert-card { margin-bottom: var(--space-4); padding: var(--space-4); border: 1.5px solid var(--card-border); border-radius: 16px; background: var(--surface); }
.convert-card p { margin: 0 0 var(--space-3); color: var(--ink-2); }
.form-choices { display: grid; gap: var(--space-3); margin-bottom: var(--space-4); }
.form-choice { display: flex; align-items: center; gap: var(--space-3); padding: 14px var(--space-4); border: 1px solid var(--card-border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-solid); color: var(--ink); text-decoration: none; }
.form-choice:hover { background: var(--tint-brand); color: var(--ink); text-decoration: none; }
.form-choice i { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; font-size: 18px; }
.form-choice b { display: block; }
.form-choice small { color: var(--ink-muted); }
.fc-leave i { background: var(--tint-brand); color: var(--navy); }
.fc-travel i { background: #fff6dc; color: #9a6b00; }
.fc-ptgo i { background: #fde7f0; color: #b8336f; }
.fc-absent i { background: #e5f0fc; color: #1f6fc4; }
.req-ref { font-size: 12px; font-weight: 700; color: var(--heading-accent) !important; letter-spacing: .2px; }
.req-item.kind--ptgo { background: #fde7f0; box-shadow: inset 4px 0 0 #e86aa0; }
.req-item.kind--absent { background: #e5f0fc; box-shadow: inset 4px 0 0 #3a86d8; }
:root[data-theme="dark"] .req-item.kind--ptgo { background: #3a1a2a; }
:root[data-theme="dark"] .req-item.kind--absent { background: #10284a; }

/* Leave page: three small apply tiles, short request list */
.form-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); margin-bottom: var(--space-4); }
.form-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border: 1px solid var(--card-border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-solid); color: var(--ink); text-align: center; font-size: 13px; font-weight: 800; line-height: 1.2; text-decoration: none; }
.form-tile:hover { background: var(--tint-brand); color: var(--ink); text-decoration: none; }
.form-tile i { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; font-size: 18px; }
.req-item[hidden] { display: none; }
.show-more { display: block; width: 100%; margin: calc(-1 * var(--space-2)) 0 var(--space-4); padding: 10px; border: 1px dashed var(--control-border); border-radius: 12px; background: transparent; color: var(--link); font-weight: 800; }

/* Travel check-in */
.req-item.kind--travel, .req-item.kind--travellate { background: #fff6dc; box-shadow: inset 4px 0 0 #e0a800; }
:root[data-theme="dark"] .req-item.kind--travel, :root[data-theme="dark"] .req-item.kind--travellate { background: #2e2710; }
.trip-card .trip-head { display: flex; gap: var(--space-3); align-items: center; }
.trip-card .trip-head i { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: #fff1c2; color: #8a6400; font-size: 20px; }
.trip-card .trip-head b { display: block; font-size: 18px; color: var(--ink); }
.trip-card .trip-head small { color: var(--ink-muted); }
.trip-purpose { margin: var(--space-3) 0 0; color: var(--ink-2); }
.checkin-card { margin-bottom: var(--space-4); padding: var(--space-4); border: 2px solid var(--navy); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-solid); }
.checkin-date { margin-bottom: var(--space-3); font-family: var(--font-display); font-weight: 800; color: var(--heading-accent); }
.checkin-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.checkin-btn { width: 100%; height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border-radius: 16px; font-family: var(--font-display); font-size: 17px; font-weight: 800; color: #fff; border: 0; }
.checkin-btn i { font-size: 26px; }
.checkin-btn--in { background: #1e8a4c; }
.checkin-btn--out { background: var(--navy); }
.checkin-btn:hover { color: #fff; opacity: .92; }
.checkin-btn.is-busy { opacity: .6; }
.checkin-done { height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 16px; background: var(--tint-brand); color: var(--heading-accent); }
.checkin-done i { font-size: 22px; color: #1e8a4c; }
.checkin-done b { font-size: 20px; }
.checkin-done small { color: var(--ink-muted); }
.checkin-gps { margin: var(--space-3) 0 0; }
.day-acc summary { display: flex; align-items: center; gap: var(--space-3); }
.day-date { min-width: 92px; }
.day-date b { display: block; color: var(--ink); }
.day-date small { color: var(--ink-muted); font-size: 12px; }
.day-checks { flex: 1; display: flex; gap: 6px; flex-wrap: wrap; }
.day-check { padding: 2px 8px; border-radius: var(--radius-pill); background: var(--track); color: var(--ink-muted); font-size: 12px; }
.day-check.is-ok { background: #e3f4ea; color: #1e7b45; }
.day-check.is-late { background: #e8eef9; color: #2b55a8; }
.day-check.is-pending { background: #fff1d6; color: #a86a00; }
.day-times { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.day-form .field { display: block; margin-bottom: var(--space-2); }
.btn-day-save { border: 1.5px solid var(--navy); border-radius: 12px; background: var(--surface); color: var(--navy); font-weight: 800; padding: 8px 14px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; }
.tag--pending { background: #fff1d6; color: #a86a00; }
.tag--late { background: #e8eef9; color: #2b55a8; }
.tag--rejected { color: var(--danger); }
.late-acc, .day-acc { margin-bottom: var(--space-2); }
.send-trip { margin-top: var(--space-4); }
.travel-entry { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); padding: 14px var(--space-4); border-radius: 16px; background: #fff6dc; border: 1px solid #f0d78a; color: var(--ink); text-decoration: none; }
.travel-entry:hover { color: var(--ink); text-decoration: none; filter: brightness(.98); }
.travel-entry i { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: #fff; color: #8a6400; font-size: 18px; }
.travel-entry b { display: block; }
.travel-entry small { color: var(--ink-muted); }
.trip-table-wrap { overflow-x: auto; }
.trip-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.trip-table th, .trip-table td { padding: 4px 6px; border-bottom: 1px solid #ccc; text-align: left; white-space: nowrap; vertical-align: top; }
.trip-table th { font-size: 10px; letter-spacing: .3px; }

/* Travel page spacing: cards apart, form sections padded inside */
.main-content > .apply-card, .main-content > .checkin-card, .main-content > .trip-card { margin-bottom: var(--space-3); }
.trip-edit .acc-body, .late-acc .acc-body, .day-acc .acc-body { padding: var(--space-3) var(--space-4) var(--space-4); border-top: 1px solid var(--line); }
.trip-edit .acc-body .apply-form, .late-acc .acc-body .apply-form { gap: var(--space-3); }
.trip-edit .acc-body .field, .late-acc .acc-body .field { display: block; margin: 0; }
.trip-edit .acc-body > form + form { margin-top: var(--space-3); }
.acc { border: 1px solid var(--card-border); box-shadow: var(--shadow-solid); }
.day-acc summary .day-checks { justify-content: flex-start; }
.more-times { margin: 0 0 var(--space-2); }
.more-times summary { display: inline-block; color: var(--link); font-weight: 700; font-size: 13px; cursor: pointer; padding: 0; }
.more-times summary::-webkit-details-marker { display: none; }
.more-times[open] summary { margin-bottom: var(--space-2); }
.day-form .btn-day-save { margin-top: var(--space-2); }

/* My requests / My travel requests: fold-open section with the list inside */
.acc--requests .acc-body { border-top: 1px solid var(--line); }
.acc--requests .acc-icon { background: var(--navy); }
.acc--travel .acc-icon { background: #b98a00; }
.req-list--flat { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.acc-sub { display: block; font-family: var(--font-text); font-size: 12px; font-weight: 700; color: #a86a00; }
.acc--requests .acc-empty { padding: var(--space-3) var(--space-4); margin: 0; }

/* History: in a box; the line joins the dots and stops at the latest one */
.history { margin-bottom: var(--space-4); padding: var(--space-4); border: 1px solid var(--card-border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-solid); }
.history .apply-label { margin-bottom: var(--space-3); }
/* (the old theme, styles.css, also draws a full-height line and 50px gaps on .timeline: switched off here) */
.history .timeline { border-left: 0; padding-left: var(--space-4); }
.history .timeline::before { display: none; }
.history .timeline > li { min-height: 0; margin-bottom: 0; padding: 0 0 var(--space-4) var(--space-3); }
.history .timeline > li::before { content: ""; display: block; position: absolute; left: -24px; top: 4px; width: 13px; height: 13px; border-radius: 50%; background: var(--navy); border: 2px solid var(--surface); box-sizing: border-box; }
.history .timeline > li.tl--rejected::before { background: var(--danger); }
.history .timeline > li.tl--cancelled::before, .history .timeline > li.tl--withdrawn::before { background: var(--ink-subtle); }
.history .timeline > li::after { content: ""; display: block; clear: none; position: absolute; left: -19px; top: 17px; bottom: 2px; width: 3px; border-radius: 2px; background: var(--card-border); }
.history .timeline > li:last-child::after { display: none; }
.history .timeline > li:last-child { padding-bottom: 0; }

/* Attendance: year so far + month buttons */
.year-card { margin-bottom: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--card-border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-solid); }
.year-title { margin-bottom: var(--space-2); font-family: var(--font-display); font-weight: 800; color: var(--heading-accent); }
.year-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; text-align: center; }
.year-stats div { padding: 8px 2px; border-radius: 12px; background: var(--tint-brand); }
.year-stats b { display: block; font-family: var(--font-display); font-size: 20px; line-height: 1.1; color: var(--navy); }
.year-stats small { display: block; font-size: 11px; line-height: 1.2; color: var(--ink-muted); }
.year-stats .is-warn { background: #fff1d6; }
.year-stats .is-warn b { color: #a86a00; }
.month-chips { display: flex; gap: 6px; overflow-x: auto; margin: 0 calc(-1 * var(--space-4)) var(--space-3); padding: 2px var(--space-4) 6px; scrollbar-width: none; }
.month-chips::-webkit-scrollbar { display: none; }
.month-chips a { flex: none; padding: 8px 14px; border-radius: var(--radius-pill); border: 1px solid var(--card-border); background: var(--surface); color: var(--ink-2); font-weight: 800; text-decoration: none; }
.month-chips a.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.travel-link-wrap { padding-top: 0; }
.travel-link { display: flex; align-items: center; gap: 8px; padding: 12px 4px; color: var(--ink-muted); font-weight: 700; text-decoration: none; border-top: 1px solid var(--line); }
.travel-link .fa-chevron-right { margin-left: auto; font-size: 12px; }
.how-card { margin-bottom: var(--space-3); }
.how-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.how-steps li { position: relative; padding: 0 0 var(--space-3) 44px; counter-increment: step; }
.how-steps li:last-child { padding-bottom: 0; }
.how-steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #fff1c2; color: #8a6400; font-weight: 800; }
.how-steps b { display: block; color: var(--ink); }
.how-steps small { display: block; color: var(--ink-muted); line-height: 1.35; }
.trip-day { display: inline-block; margin-bottom: 6px; padding: 2px 10px; border-radius: var(--radius-pill); background: #fff1c2; color: #8a6400; font-size: 12px; font-weight: 800; }
.trip-card .trip-head { flex-wrap: wrap; }
.trip-card .trip-day { flex-basis: 100%; width: max-content; flex-grow: 0; }

/* Travel: the trip's details, the timesheet box, the send button */
.trip-info { margin-bottom: var(--space-3); padding: var(--space-4); border: 1px solid #f0d78a; border-radius: 16px; background: linear-gradient(180deg, #fff8e1 0%, var(--surface) 70%); box-shadow: var(--shadow-solid); }
.trip-info-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2); }
.trip-kicker { font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: #8a6400; }
.trip-info .trip-day { margin: 0; }
.trip-dest { margin: 0 0 var(--space-3); font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--ink); }
.trip-dest i { color: #c48a00; font-size: 18px; }
.trip-facts { margin: 0; display: grid; gap: 8px; }
.trip-facts div { display: grid; grid-template-columns: 76px 1fr; gap: var(--space-2); padding-top: 8px; border-top: 1px dashed var(--line); }
.trip-facts dt { font-size: 12px; font-weight: 800; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .3px; padding-top: 2px; }
.trip-facts dd { margin: 0; color: var(--ink); }
.trip-facts dd small { color: var(--ink-muted); }
:root[data-theme="dark"] .trip-info { background: var(--surface); border-color: #5a4a15; }
.ts-box { margin-bottom: var(--space-3); padding: var(--space-4); border: 1px solid var(--card-border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-solid); }
.ts-box > .apply-label i { color: var(--link); margin-right: 4px; }
.ts-box > .field-hint { margin-bottom: var(--space-3); }
.ts-box .day-acc { box-shadow: none; }
.ts-box .day-acc:last-child { margin-bottom: 0; }
.send-trip { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.send-trip .route-card { margin-bottom: var(--space-3); }
.travel-entry--trip { display: block; padding: 0; overflow: hidden; }
.travel-entry-head { display: flex; align-items: center; gap: var(--space-3); padding: 14px var(--space-4); color: var(--ink); text-decoration: none; }
.travel-entry-head:hover { color: var(--ink); text-decoration: none; }
.travel-entry-head b { display: block; }
.travel-entry-head small { color: var(--ink-muted); }
.travel-entry-head .travel-entry-go { margin-left: auto; width: auto; height: auto; background: none; font-size: 14px; color: #8a6400; }
.travel-quick { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); padding: 0 var(--space-4) var(--space-4); }
.quick-btn { width: 100%; height: 48px; border: 0; border-radius: 12px; color: #fff; font-family: var(--font-display); font-weight: 800; }
.quick-btn--in { background: #1e8a4c; }
.quick-btn--out { background: var(--navy); }
.quick-btn:hover { color: #fff; opacity: .92; }
.quick-btn.is-busy { opacity: .6; }
.quick-done { height: 48px; display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 12px; background: #fff; color: var(--ink-2); font-size: 14px; }
.quick-done i { color: #1e8a4c; }
.travel-quick .quick-btn i, .travel-quick .quick-done i { width: auto; height: auto; display: inline; background: none; border-radius: 0; font-size: 15px; color: inherit; }
.travel-quick .quick-done i { color: #1e8a4c; }
.day-times > .field { min-width: 0; }
.day-times input.form-control { width: 100%; min-width: 0; padding-left: 10px; padding-right: 6px; }
.ts-box { padding: var(--space-3); }
.ts-box > .apply-label, .ts-box > .field-hint { padding: 0 4px; }
.ts-box .day-acc .acc-body { padding: var(--space-3); }

/* Travel: what to do next */
.next-step { display: flex; gap: 10px; align-items: flex-start; margin-top: var(--space-3); padding: 10px 12px; border-radius: 12px; background: var(--tint-brand); color: var(--ink-2); font-size: 14px; line-height: 1.4; }
.next-step i { margin-top: 3px; color: var(--link); }
.next-step b { color: var(--heading-accent); }
.next-step--next_send { background: #fff1c2; }
.next-step--next_send i { color: #8a6400; }
.travel-next { margin: 0; padding: 0 var(--space-4) var(--space-3); font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.travel-next i { color: #8a6400; margin-right: 4px; }

/* Travel: timesheet as rows (date | in | out) */
.ts-row { display: grid; grid-template-columns: 1fr 86px 86px 20px; align-items: center; gap: 6px; }
.ts-head { padding: 0 10px 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-muted); border-bottom: 1px solid var(--line); }
.ts-day { border-bottom: 1px solid var(--line); }
.ts-day:last-child { border-bottom: 0; }
.ts-day > summary { list-style: none; cursor: pointer; padding: 10px; }
.ts-day > summary::-webkit-details-marker { display: none; }
.ts-day.is-today > summary { background: var(--tint-brand); border-radius: 10px; }
.ts-date b { color: var(--ink); }
.ts-date { color: var(--ink-2); font-size: 14px; }
.ts-date em { margin-left: 6px; padding: 1px 6px; border-radius: var(--radius-pill); background: var(--navy); color: #fff; font-style: normal; font-size: 10px; font-weight: 800; vertical-align: 1px; }
.ts-time { display: inline-block; padding: 2px 8px; border-radius: 8px; font-weight: 800; font-size: 13px; white-space: nowrap; }
.ts-time i { font-size: 10px; opacity: .7; }
.ts-time.is-ok { background: #e3f4ea; color: #1e7b45; }
.ts-time.is-late { background: #e8eef9; color: #2b55a8; }
.ts-time.is-pending { background: #fff1d6; color: #a86a00; }
.ts-none { color: var(--ink-subtle); padding-left: 8px; }
.ts-chev { color: var(--ink-subtle); font-size: 12px; transition: transform .2s; }
.ts-day[open] .ts-chev { transform: rotate(180deg); }
.ts-sub { grid-column: 1 / -1; color: var(--ink-muted); font-size: 12px; }
.ts-loc { color: var(--ink); font-weight: 600; }
.ts-loc i { color: var(--ink-muted); margin-right: 2px; }
.ts-body { padding: 4px 10px var(--space-3); }
.ts-body .day-form .field { display: block; margin-bottom: var(--space-2); }
.save-state { margin: 4px 0 0; font-size: 12px; color: var(--ink-muted); }
.save-state.is-ok { color: #1e7b45; }
.save-state.is-err { color: var(--danger); }

/* Travel: trip summary before sending; the send button locked until the last day */
.route-card .apply-label i { color: var(--link); margin-right: 4px; }
.trip-review { margin: 0 0 var(--space-3); padding: 0; list-style: none; }
.trip-review li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.trip-review li span:first-child { font-weight: 800; color: var(--ink); }
.trip-review li.is-missing span:last-child { color: #a86a00; font-weight: 700; }
.trip-review li.is-future { color: var(--ink-subtle); }
.trip-review li.is-future span:first-child { color: var(--ink-subtle); }
.btn-locked, .btn-locked:hover, .btn-locked:disabled { background: #c9ced6 !important; border-color: #c9ced6 !important; color: #5f6873 !important; opacity: 1; cursor: not-allowed; }

/* Attendance card: approved work travel */
.cc-travel td { color: #8a6400; }
.cc-travel-times { color: var(--ink-muted); }
.ts-date { white-space: nowrap; }
.ts-date em { display: block; width: max-content; margin: 3px 0 0; }
.ts-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.ts-map { padding-left: 8px; font-size: 11px; font-weight: 700; color: var(--link); text-decoration: none; }
.ts-map i { font-size: 10px; }
.cc-travel-time { display: inline-block; padding: 2px 4px; border-radius: 6px; background: #fff1c2; color: #8a6400; font-family: var(--font-mono, monospace); font-weight: 700; font-size: 12px; white-space: nowrap; }
.cc-travel-time i { font-size: 9px; }
.cc-travel-wait { color: var(--ink-muted); font-style: italic; }
.ts-place { padding-left: 8px; font-size: 11px; font-weight: 700; color: var(--ink-muted); white-space: nowrap; }
.ts-place i { font-size: 10px; color: var(--link); }
.ts-place .ts-map { padding-left: 0; }
/* Timesheet: the town under the time is the map link (wraps on small phones, never overlaps) */
.ts-row { grid-template-columns: minmax(0, 1fr) minmax(0, 92px) minmax(0, 92px) 16px; }
.ts-cell { min-width: 0; }
.ts-place { display: block; max-width: 100%; padding: 2px 0 0 4px; font-size: 11px; font-weight: 700; line-height: 1.25; color: var(--link); text-decoration: none; white-space: normal; overflow-wrap: anywhere; }
.ts-place i { font-size: 10px; color: var(--link); }
.trip-place { font-size: 11px; white-space: normal; }
/* Timesheet rows: the date stacked in a fixed column, in / out share the rest */
.ts-row { grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr) 14px; gap: 6px; }
.ts-date { white-space: normal; line-height: 1.2; }
.ts-date b { display: block; font-size: 14px; }
.ts-date small { display: block; font-size: 12px; color: var(--ink-muted); white-space: nowrap; }
.ts-head span:first-child { white-space: nowrap; }

/* Travel times in "Change trip details and travel times" */
.tt-set { margin: 0; padding: var(--space-3); border: 1px solid var(--card-border); border-radius: 12px; }
.tt-set legend { width: auto; margin: 0; padding: 0 6px; font-size: 14px; font-weight: 800; color: var(--heading-accent); }
.tt-set legend i { color: #c48a00; }
.tt-set .day-times { margin-top: 4px; }
.trip-empty { color: var(--ink-muted); font-size: 13px; }

/* Spacing: the timesheet box's last row, and around the line before "Your trip summary" */
.ts-box { padding-bottom: var(--space-4); }
.ts-day:last-child > summary { margin-bottom: 2px; }
.send-trip { margin-top: var(--space-5, 24px); padding-top: var(--space-5, 24px); }
.tt-line { display: block; }
.tt-line i { width: 18px; color: #c48a00; font-size: 12px; }

/* Dates and times start on the left, like every other field */
input[type="date"].form-control, input[type="time"].form-control { text-align: left; }

/* Home: forms waiting for this HOD / supervisor */
.approve-card { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); padding: 14px var(--space-4); border-radius: 16px; background: var(--navy); color: #fff; text-decoration: none; box-shadow: var(--shadow-solid); }
.approve-card:hover { color: #fff; text-decoration: none; background: var(--sapphire); }
.approve-count { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: #e05555; font-family: var(--font-display); font-size: 20px; font-weight: 800; }
.approve-text { flex: 1; min-width: 0; }
.approve-text b { display: block; font-size: 16px; }
.approve-text small { display: block; color: rgba(255,255,255,.75); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Dates and times: value centred top to bottom, on the left side, also on iPhone (Safari puts it at the top otherwise) */
input[type="date"].form-control, input[type="time"].form-control {
  height: 48px; min-height: 48px; line-height: 46px;
  padding-top: 0; padding-bottom: 0;
}
@supports (-webkit-touch-callout: none) {   /* iPhone / iPad only */
  input[type="date"].form-control, input[type="time"].form-control {
    -webkit-appearance: none; appearance: none;
    display: flex; align-items: center; justify-content: flex-start;
  }
}
input[type="date"].form-control::-webkit-date-and-time-value,
input[type="time"].form-control::-webkit-date-and-time-value { margin: 0; height: auto; line-height: 46px; text-align: left; }
input[type="date"].form-control::-webkit-datetime-edit,
input[type="time"].form-control::-webkit-datetime-edit { display: inline-flex; flex: 1 1 auto; align-items: center; justify-content: flex-start; padding: 0; line-height: normal; }
input[type="date"].form-control::-webkit-calendar-picker-indicator,
input[type="time"].form-control::-webkit-calendar-picker-indicator { margin-left: auto; }
input[type="date"].form-control::-webkit-datetime-edit-fields-wrapper,
input[type="time"].form-control::-webkit-datetime-edit-fields-wrapper { display: inline-flex; align-items: center; padding: 0; }

/* Language on sign-in pages: a small globe button in the top-right corner of the navy band */
.auth-hero { position: relative; }
.lang-menu { position: absolute; top: var(--space-3); right: var(--space-3); z-index: 20; text-align: left; }
.lang-menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover, .lang-menu[open] summary { background: rgba(255, 255, 255, 0.22); color: #fff; }
.lang-menu nav {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 170px;
  padding: 6px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(0, 19, 43, 0.25);
}
.lang-menu nav a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--ink); font-weight: 700; text-decoration: none; }
.lang-menu nav a:hover { background: var(--tint-brand); color: var(--navy); }
.lang-menu nav a.active { color: var(--navy); background: var(--tint-brand); }
.lang-menu nav a.active::after { content: "\2713"; float: right; }

/* ---------- Clock card: remarks in the same row (leave, holiday, travel, go out, absent) ---------- */
table.clockcard--slots tbody td { vertical-align: middle; }
table.clockcard--slots td.cc-day { padding: 6px 2px; }
table.clockcard--slots .day-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; font-family: var(--font-display); font-size: 14px; font-weight: 800; line-height: 1; }
table.clockcard--slots .day-name { margin-top: 1px; font-size: 10.5px; color: var(--ink-muted); white-space: nowrap; }
table.clockcard--slots tr.is-today .day-num { background: var(--navy); color: #fff; box-shadow: 0 2px 6px rgba(0, 51, 116, .35); }
table.clockcard--slots tr.is-today td { background: #f3f7ff; }
table.clockcard tr.weekend td { background: #f6f7f9; }
table.clockcard tr.is-holiday td, table.clockcard tr.is-holiday td:first-child { background: #eefaf5; }
/* A coloured edge on the date shows there is a remark */
table.clockcard--slots tr.has-note td.cc-day { box-shadow: inset 3px 0 0 var(--note, var(--line)), 1px 0 0 var(--line); }
tr.k-leave { --note: #3a6fd8; } tr.k-sick { --note: #d64545; } tr.k-unpaid { --note: #d99a00; } tr.k-special { --note: #7c4ddb; }
tr.k-holiday { --note: #1d9e75; } tr.k-travel { --note: #c48a00; } tr.k-goout { --note: #c2366f; } tr.k-absent { --note: #0a8fb8; }
.cc-day-mark { color: #c2366f; font-size: 9px; }
table.clockcard--slots td.cc-note { padding: 5px 6px; text-align: left; overflow: hidden; }
.cc-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; }
.cc-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 3px 9px; border-radius: 12px; font-size: 11.5px; font-weight: 800; line-height: 14px; overflow-wrap: anywhere; }
.cc-chip i { font-size: 10px; }
.cc-chip.is-waiting { background: #fff !important; border: 1px dashed currentColor; }
.cc-chip.k-leave { background: #e8f0fd; color: #1f4fa8; }
.cc-chip.k-sick { background: #fdecec; color: #b42318; }
.cc-chip.k-unpaid { background: #fff4e0; color: #8f5a00; }
.cc-chip.k-special { background: #f1ebfd; color: #6b3fc4; }
.cc-chip.k-holiday { background: #dff5ec; color: #0f6e56; }
.cc-chip.k-travel { background: #fff3c9; color: #7a5800; }
.cc-chip.k-goout { background: var(--ptgo-tint); color: var(--ptgo); }
.cc-chip.k-absent { background: var(--absent-tint); color: var(--absent); }
.cc-why { min-width: 0; color: var(--ink-muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.clockcard--slots tr.cc-remark td { padding: 0 6px 7px; }

/* ---------- Clock card as a day list: one line a day (date · first in → last out · remark) ---------- */
.cc-list { background: var(--surface); }
.cc-dayrow { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; border-top: 1px solid var(--line); }
.cc-dayrow:first-child { border-top: 0; }
.cc-date { flex: none; width: 36px; text-align: center; line-height: 1.1; }
.cc-date b { display: block; font-family: var(--font-display); font-size: 16px; font-weight: 800; color: var(--navy); }
.cc-date small { display: block; font-size: 11px; color: var(--ink-muted); }
.cc-main { flex: 1; min-width: 0; }
.cc-times { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: var(--ink); }
.cc-t.is-red { color: var(--danger); }
.cc-t.is-none { color: var(--ink-subtle); }
.cc-arrow { color: var(--ink-subtle); font-weight: 400; }
.cc-plane { color: #b07d00; font-size: 11px; }
.cc-flag { font-family: var(--font-text); font-size: 11px; font-weight: 700; color: var(--danger); }
.cc-ot { padding: 0 6px; border-radius: 6px; background: var(--tint-brand); color: var(--navy); font-family: var(--font-text); font-size: 10.5px; font-weight: 800; }
.cc-miss { font-family: var(--font-text); font-size: 11.5px; font-weight: 700; color: var(--danger); }
.cc-missing { margin-top: 2px; font-size: 11.5px; font-weight: 700; color: var(--danger); }
.cc-missing i { font-size: 6px; vertical-align: 2px; }
.cc-off { color: var(--ink-subtle); font-size: 13px; }
.cc-notes { flex: none; max-width: 48%; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.cc-notes--full { max-width: none; align-items: flex-start; text-align: left; }
.cc-note-line { display: block; }
.cc-note-line .cc-why { display: inline; margin-left: 4px; }
/* Remarks are coloured words (no filled tags) */
.cc-list .cc-chip { display: inline; padding: 0; border-radius: 0; background: none !important; font-size: 12.5px; font-weight: 800; line-height: 17px; }
.cc-list .cc-chip i { font-size: 10px; margin-right: 1px; }
.cc-list .cc-chip.is-waiting { border: 0; border-bottom: 1px dashed currentColor; }
.cc-list .cc-chip.k-leave { color: #1f4fa8; } .cc-list .cc-chip.k-sick { color: #c0392b; } .cc-list .cc-chip.k-unpaid { color: #9a5b00; }
.cc-list .cc-chip.k-special { color: #6b3fc4; } .cc-list .cc-chip.k-holiday { color: #0f6e56; } .cc-list .cc-chip.k-travel { color: #8a6400; }
.cc-list .cc-chip.k-goout { color: var(--ptgo); } .cc-list .cc-chip.k-absent { color: var(--absent); }
.cc-list .cc-why { color: var(--ink-muted); font-size: 12.5px; white-space: normal; }
/* Quiet days, today, holidays */
.cc-dayrow.is-off { min-height: 34px; padding-top: 4px; padding-bottom: 4px; background: #fafbfc; }
.cc-dayrow.is-off .cc-date b { font-size: 13px; color: var(--ink-subtle); }
.cc-dayrow.is-off .cc-date small { display: inline; margin-left: 3px; }
.cc-dayrow.is-off .cc-date { width: auto; min-width: 36px; text-align: left; display: flex; align-items: baseline; }
.cc-dayrow.is-today { background: #f3f7ff; }
.cc-dayrow.is-today .cc-date b { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--navy); color: #fff; }
.cc-dayrow.is-holiday { background: #f0faf5; }

/* Day list with the lunch punches: a pair per session (morning, afternoon, OT) */
.cc-times { gap: 4px 16px; font-size: 13.5px; }
.cc-pair { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.cc-pair.is-ot { color: var(--sapphire); }
.cc-pair.is-ot small { margin-right: 4px; font-family: var(--font-text); font-size: 10.5px; font-weight: 800; color: var(--sapphire); }
.cc-dash { color: var(--ink-subtle); font-weight: 400; }
.cc-t.is-miss { color: var(--danger); font-family: var(--font-text); font-weight: 900; padding: 0 2px; }
.cc-pair--note { font-family: var(--font-text); }
.cc-plane { margin-right: 3px; }

/* Day list in columns: Date | Morning | Afternoon | OT (remarks fill the empty ones) */
.cc-list .cc-dayrow { display: grid; grid-template-columns: 38px repeat(3, minmax(0, 1fr)); align-items: center; gap: 0 6px; padding: 8px 10px; }
.cc-list .cc-head { position: sticky; top: 0; z-index: 2; min-height: 0; padding-top: 8px; padding-bottom: 8px; background: var(--navy); color: var(--on-brand); font-family: var(--font-display); font-size: 12px; font-weight: 800; }
.cc-list .cc-head span:first-child { text-align: center; }
.cc-cell { min-width: 0; font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.cc-cell.is-ot { color: var(--sapphire); }
.cc-span-2 { grid-column: span 2; }
.cc-span-3 { grid-column: span 3; }
.cc-under { grid-column: 2 / span 3; margin-top: 3px; }
.cc-list .cc-notes { max-width: none; align-items: flex-start; text-align: left; font-family: var(--font-text); }
.cc-list .cc-off { font-family: var(--font-text); font-weight: 400; }
.cc-list .cc-dayrow.is-off .cc-date { display: block; text-align: center; }
.cc-list .cc-dayrow.is-off .cc-date small { display: block; margin: 0; }
.cc-list .cc-pair { font-size: 13px; }
@media (max-width: 360px) { .cc-cell, .cc-list .cc-pair { font-size: 12px; } }

/* Remarks column after OT; each session shows in above out so four columns fit a phone */
.cc-list .cc-dayrow { grid-template-columns: 34px repeat(3, 46px) minmax(0, 1fr); gap: 0 8px; }
.cc-list .cc-head span { font-size: 11.5px; }
.cc-list .cc-pair { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; font-size: 12.5px; line-height: 16px; }
.cc-list .cc-pair .cc-t.is-none { color: var(--line-strong, #cbd5e1); }
.cc-span-4 { grid-column: span 4; }
.cc-list .cc-notes .cc-note-line { line-height: 16px; }
.cc-list .cc-cell.cc-notes:not(.cc-span-4) .cc-chip { font-size: 12px; }
.cc-list .cc-cell.cc-notes:not(.cc-span-4) .cc-why { display: none; }

/* Times on one line per session; Remarks gets the rest (OT column only in months with overtime) */
.cc-list .cc-dayrow { grid-template-columns: 30px 86px 86px minmax(0, 1fr); gap: 0 8px; padding: 8px 10px; }
.cc-list.has-ot .cc-dayrow { grid-template-columns: 26px 70px 70px 70px minmax(0, 1fr); gap: 0 4px; padding-left: 8px; padding-right: 8px; }
.cc-list .cc-pair { flex-direction: row; align-items: center; gap: 0; font-size: 12.5px; line-height: 18px; white-space: nowrap; }
.cc-list.has-ot .cc-pair { font-size: 11px; letter-spacing: -0.02em; }
.cc-list.has-ot .cc-date b { font-size: 14px; }
.cc-list .cc-dash { padding: 0 1px; }
.cc-span-all { grid-column: 2 / -1; }
.cc-list .cc-cell.cc-notes:not(.cc-span-all) .cc-chip { font-size: 11.5px; line-height: 15px; }
.cc-list .cc-cell.cc-notes:not(.cc-span-all) .cc-why { display: none; }
.cc-list.has-ot .cc-head span:first-child { font-size: 10px; }

/* Always Date | AM | PM | OT | Remarks: the times share the width, Remarks is a small column that wraps */
.cc-list .cc-dayrow, .cc-list.has-ot .cc-dayrow { grid-template-columns: 26px repeat(3, minmax(0, 1fr)) 62px; gap: 0 4px; padding: 7px 8px; }
.cc-list .cc-pair, .cc-list.has-ot .cc-pair { font-size: 11.5px; letter-spacing: -0.02em; }
.cc-list .cc-date b { font-size: 14px; }
.cc-list .cc-head span { font-size: 11px; }
.cc-list .cc-head span:first-child { font-size: 10px; }
.cc-list .cc-cell.cc-notes:not(.cc-span-all) { font-size: 10.5px; }
.cc-list .cc-cell.cc-notes:not(.cc-span-all) .cc-chip { font-size: 10.5px; line-height: 13px; }
@media (min-width: 400px) { .cc-list .cc-pair { font-size: 12.5px; letter-spacing: 0; } .cc-list .cc-dayrow { grid-template-columns: 30px repeat(3, minmax(0, 1fr)) 72px; gap: 0 6px; padding: 8px 10px; } }

/* =====================================================================
   Navy & paper theme (Oct 2026, from the reference mock-ups).
   Navy header, a white sheet with rounded top corners laid over it,
   serif for the greeting and big numbers, hairline cards, pale tiles,
   outline icons and a flat white tab bar. Overrides the solid theme above.
   ===================================================================== */

:root {
  --navy: #0f2d55;
  --navy-deep: #0b294e;
  --blue: #0a6fbd;
  --blue-hover: #0f2d55;
  --sky: #097dd5;

  --page: #f1f5fb;
  --surface: #ffffff;
  --tile: #f5f7fb;
  --track: #eef1f6;
  --tint-brand: #eef1f9;

  --ink: #1b2433;
  --ink-2: #4a5568;
  --ink-muted: #5b6880;
  --ink-subtle: #67758c;
  --heading-accent: #0f2d55;
  --link: #0a6fbd;
  --on-brand-muted: #b9c6dc;

  --line: #e3e9f2;
  --card-border: #e3e9f2;
  --control-border: #7d8aa0;
  --focus: #0a6fbd;

  --success: #286a5d;  --success-tint: #e7f2ef;

  --font-display: Lato, "Helvetica Neue", Helvetica, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  --sheet-radius: 24px;
  --shadow-solid: 0 1px 2px rgba(15, 45, 85, 0.05);
  --shadow-card: 0 1px 2px rgba(15, 45, 85, 0.05);
  --shadow-header: none;
}

body { background: var(--page); color: var(--ink-2); }
h1, h2, h3, h4, h5, h6 { font-weight: 700; }

/* Header: flat navy, content sheet laid over its lower edge */
.app-header,
.page-bar {
  background: var(--navy);
  border-radius: 0;
  box-shadow: none;
}
.app-header { padding: 56px var(--space-5) calc(var(--space-6) + var(--sheet-radius)); text-align: left; }
.page-bar { padding-bottom: var(--sheet-radius); }
.page-bar .page-title { font-size: 19px; line-height: 26px; font-weight: 700; }
.app-header .beta-tag { background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 700; }

.app-header + .main-content,
.page-bar + .main-content {
  position: relative;
  margin-top: calc(-1 * var(--sheet-radius));
  padding-top: var(--space-5);
  padding-bottom: var(--space-5);
  margin-bottom: var(--space-3);
  min-height: calc(100vh - 120px);
  border-radius: var(--sheet-radius);   /* round at the bottom too, like the top */
  background: var(--surface);
}
/* Leave and Attendance: the bar stays at the top while scrolling, so the sheet's rounded top edge is drawn
   by the bar itself (a white lip along its bottom); the sheet starts under it, with room above the first heading */
.page-bar::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100%;
  max-width: var(--app-max-width);
  height: var(--sheet-radius);
  transform: translateX(-50%);
  border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
  background: var(--surface);
}
.page-bar + .main-content { margin-top: 0; padding-top: var(--space-3); border-radius: 0 0 var(--sheet-radius) var(--sheet-radius);
  min-height: calc(100vh - 175px); }   /* short pages: the rounded bottom still shows above the bottom menu */
@media (min-width: 540px) {
  .app-header + .main-content,
  .page-bar + .main-content { box-shadow: 0 0 0 1px var(--line); }
}

/* Home greeting: the date as an italic serif line under a serif greeting */
.today-head { display: flex; flex-direction: column-reverse; margin-top: var(--space-4); }
.today-greet { margin: 0; font-family: var(--font-serif); font-size: 30px; line-height: 36px; font-weight: 600; letter-spacing: -0.01em; color: #fff; }
.today-date { margin: 6px 0 0; font-family: var(--font-serif); font-style: italic; font-size: 15px; line-height: 20px; font-weight: 400; color: var(--on-brand-muted); }

/* Cards: white, hairline, barely-there shadow */
.dashboard-attendance-card, .entitlement-card, .attendance-card, .stat-card,
.acc, .settings-group, .year-card, .req-item, .card-empty {
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.stat-card::before { display: none; }
.section-title, .card-title-overline, .acc-title, .year-title, .month-label {
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 20px;
  font-weight: 700;
  color: var(--ink);
}
.card-title-overline i, .section-title i { color: var(--navy); }

/* Today's log */
.update-tag { border-radius: var(--radius-pill); font-family: var(--font-display); font-size: 12px; }
.tag-synced { background: var(--success-tint); color: var(--success); }
.att-row { background: var(--tile); border-radius: 12px; }
.time-text { font-family: var(--font-display); font-weight: 700; color: var(--ink); }
.sync-disclaimer { background: var(--tile); color: var(--ink-muted); }
.sync-disclaimer i { color: var(--navy); }

/* Pale tiles: summary boxes, form shortcuts, month chips, year stats */
.today-box, .form-tile {
  border: 0;
  border-radius: 14px;
  background: var(--tile);
  box-shadow: none;
}
.today-box:hover, .form-tile:hover { background: var(--tint-brand); }
.today-box small { color: var(--ink-muted); font-weight: 400; }
.today-box > b, .stat-value, .year-stats b, .entitlement-figure, .approve-count {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--navy);
}
.today-box > b { font-size: 21px; line-height: 28px; }
.today-counts b { font-family: var(--font-serif); font-weight: 600; color: var(--navy); }
.form-tile {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 14px 12px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}
.form-tile i, .fc-leave i, .fc-ptgo i, .fc-absent i, .fc-travel i {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--navy);
  font-size: 15px;
}
.form-tiles { gap: 10px; }
.form-tile { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px 12px 12px; }
.form-tiles--4 { grid-template-columns: repeat(2, 1fr); }

.year-stats div { background: var(--tile); }
.year-stats b { font-size: 22px; }
.month-chips a { border: 0; background: var(--tile); color: var(--ink-2); font-weight: 700; }
.month-chips a.active { background: var(--navy); color: #fff; }

/* Leave: fold-open sections with quiet icons */
.acc-icon { background: var(--tint-brand); color: var(--navy); }
.acc-title { color: var(--ink); }
.acc-count, .acc-side { background: var(--tile); color: var(--navy); font-family: var(--font-display); font-weight: 700; }
.acc--danger .acc-icon { background: var(--danger-tint); color: var(--danger); }

/* Segmented tabs (Approvals: Waiting / Done) */
.tabs { gap: 4px; padding: 4px; border-radius: 14px; background: var(--tile); }
.tabs a { border: 0; border-radius: 10px; background: transparent; color: var(--ink-muted); font-weight: 700; }
.tabs a.active { background: var(--surface); color: var(--navy); box-shadow: 0 1px 3px rgba(15, 45, 85, 0.12); }
.tabs a.active .tab-count { background: var(--navy); color: #fff; }

/* Clock card: light header row */
table.clockcard thead th { background: var(--tile) !important; color: var(--navy) !important; font-family: var(--font-display); }

/* Buttons */
.btn-strive {
  height: 50px;
  border-radius: 12px;
  background: var(--navy);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
.btn-strive:hover, .btn-strive:focus { background: #173d70; }
.btn-strive-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50px;
  border: 1.5px solid var(--control-border);
  border-radius: 12px;
  background: transparent;
  color: var(--navy);
  font-weight: 700;
}

/* Tab bar: flat white, outline icons, solid when active */
.fixed-footer { left: 0; right: 0; bottom: 0; }
.bottom-nav {
  max-width: none;
  gap: 0;
  padding: 6px var(--space-2) calc(6px + env(safe-area-inset-bottom));
  border-radius: 0;
  background: var(--surface);
  box-shadow: 0 -1px 0 var(--line);
}
.nav-item {
  min-height: 52px;
  border-radius: 0;
  background: none;
  color: var(--ink-subtle);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 400;
}
.nav-item:hover { color: var(--navy); }
.nav-item i { font-size: 20px; }
.nav-item .nav-svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.nav-item.active, .nav-item.active:hover { background: none; color: var(--navy) !important; font-weight: 700; }
.nav-item.active i { font-weight: 900; }
.nav-item.active .nav-svg { fill: currentColor; }
.nav-item.active::after { display: none; }
@media (min-width: 768px) { .bottom-nav { max-width: none; } }

/* Sign in, setup, password: white page, navy wordmark, the sea at the bottom */
body.auth-page { min-height: 100vh; background: var(--surface); padding-bottom: 0; }
.auth-hero {
  background: none;
  color: var(--ink);
  padding: 88px var(--space-5) var(--space-6);
  border-radius: 0;
  box-shadow: none;
}
.auth-hero .strive-brand-logo { height: 34px; }
.auth-hero p { color: var(--ink-muted); font-size: 13px; letter-spacing: 0.08em; }
.auth-hero .lang-menu summary { background: var(--tile); color: var(--ink-2); }
.auth-hero .lang-menu summary:hover, .auth-hero .lang-menu[open] summary { background: var(--tint-brand); color: var(--navy); }
.auth-card {
  margin: 0 auto;
  padding: var(--space-2) 0 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.auth-card h5 { font-family: var(--font-serif); font-size: 28px; line-height: 34px; font-weight: 600; color: var(--navy); }
.auth-card .lead-text { color: var(--ink-muted); }
.auth-copy { color: var(--ink-subtle); }
.auth-sea {
  height: 200px;
  margin-top: var(--space-6);
  background: url("../img/sea.jpg") center 60% / cover no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 55%);
  mask-image: linear-gradient(to bottom, transparent, #000 55%);
}

/* Clock card day list: light header row */
.cc-list .cc-head { background: var(--tile); color: var(--navy); font-weight: 700; border-bottom: 1px solid var(--line); }
.cc-staff, .attendance-card .cc-staff { background: var(--surface); }

/* Leave sections and requests: white cards, the kind shows in the icon only */
.acc--absent summary, .acc--ptgo summary { background: none; }
.acc--absent .acc-icon { background: var(--absent-tint); color: var(--absent); }
.acc--ptgo .acc-icon { background: var(--ptgo-tint); color: var(--ptgo); }
.acc--travel .acc-icon { background: #fff6dc; color: #8a6200; }
.acc--requests .acc-icon { background: var(--tint-brand); color: var(--navy); }
.acc--absent .acc-title, .acc--ptgo .acc-title { color: var(--ink); }
.acc--absent .acc-count, .acc--absent .acc-side, .acc--ptgo .acc-count, .acc--ptgo .acc-side { background: var(--tile); color: var(--navy); }
.req-item.kind--ptgo, .req-item.kind--absent, .req-item.kind--travel, .req-item.kind--travellate { background: var(--surface); box-shadow: var(--shadow-card); }

/* The sea always sits at the bottom of the screen on short sign-in pages */
body.auth-page { display: flex; flex-direction: column; }
body.auth-page .auth-sea { flex: none; margin-top: auto; height: 220px; }
body.auth-page .auth-wrap { padding-bottom: var(--space-6); }
.settings-profile { background: var(--tile); }
.settings-profile strong { font-family: var(--font-serif); font-size: 20px; font-weight: 600; color: var(--navy); }

/* Go out (raspberry) and Absent (light blue) keep their colours, softened:
   a pale wash on the card or tile, the full colour on the icon and title. */
:root {
  --ptgo-soft: #fdf0f4;   --ptgo-icon: #ffe1ea;
  --absent-soft: #eef8fc; --absent-icon: #dcf2fb;
}
.form-tile.fc-ptgo { background: var(--ptgo-soft); color: #7d1a40; }
.form-tile.fc-absent { background: var(--absent-soft); color: #064f6b; }
.form-tile.fc-ptgo:hover { background: var(--ptgo-icon); color: #7d1a40; }
.form-tile.fc-absent:hover { background: var(--absent-icon); color: #064f6b; }
.form-tile.fc-ptgo i { background: var(--ptgo-icon); color: var(--ptgo); }
.form-tile.fc-absent i { background: var(--absent-icon); color: var(--absent); }

.acc--ptgo { background: var(--ptgo-soft); border-color: #f6d6e0; }
.acc--absent { background: var(--absent-soft); border-color: #cdeaf6; }
.acc--ptgo .acc-icon { background: var(--ptgo-icon); color: var(--ptgo); }
.acc--absent .acc-icon { background: var(--absent-icon); color: var(--absent); }
.acc--ptgo .acc-title { color: #7d1a40; }
.acc--absent .acc-title { color: #064f6b; }
.acc--ptgo .acc-count, .acc--ptgo .acc-side { background: #fff; color: var(--ptgo); }
.acc--absent .acc-count, .acc--absent .acc-side { background: #fff; color: var(--absent); }
.acc--ptgo[open] summary { border-bottom-color: #f6d6e0; }
.acc--absent[open] summary { border-bottom-color: #cdeaf6; }
.req-item.kind--ptgo { background: var(--ptgo-soft); }
.req-item.kind--absent { background: var(--absent-soft); }

/* Sign-in pages: the copyright sits at the bottom right of the sea picture, white with a soft shadow */
.auth-sea { position: relative; }
.auth-sea .auth-copy { position: absolute; right: var(--space-4); bottom: var(--space-4); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .01em;
  text-shadow: 0 1px 2px rgba(0, 19, 43, .7), 0 0 8px rgba(0, 19, 43, .45); }

/* Attendance months: the last 12 months, inside the sheet (soft fade at both ends), year where it starts */
.month-chips { margin: 0 0 var(--space-3); padding: 2px 10px 6px; align-items: center;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 14px, #000 calc(100% - 14px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 14px, #000 calc(100% - 14px), transparent); }
.mc-year { flex: none; align-self: center; padding: 0 2px 0 6px; font-size: 11px; font-weight: 800; color: var(--ink-subtle); letter-spacing: .02em; }
.mc-year:first-child { padding-left: 0; }
/* Month title with one-step arrows */
.month-step { display: inline-flex; align-items: center; gap: 6px; }
.month-arrow { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--tile); color: var(--navy); font-size: 12px; text-decoration: none; }
.month-arrow:hover { background: var(--tint-brand); color: var(--navy); text-decoration: none; }
.month-arrow.is-off { opacity: .35; }

/* Past records that came through Strive: the row opens the request (and shows its reference number) */
.acc-row--link, .acc-row--link:hover { color: inherit; text-decoration: none; }
.acc-row--link:hover { background: var(--tint-brand); }
.acc-row-main .req-ref { display: block; margin-top: 2px; }
