/* ============================================================
   Labdox Pulse — Member portal (Home + Attendance redesign)
   Mobile-first. Desktop shell (sidebar) at >= 1024px.
   Light by default, dark via html[data-theme="dark"].
   ============================================================ */

:root {
  --bg: #f3f4f6;
  --panel-solid: #ffffff;
  --surface-2: #f8fafb;
  --line: #e2e6eb;
  --line-strong: #cfd6de;
  --text: #0f172a;
  --muted: #5b6678;
  --faint: #8a94a3;

  --brand: #0f766e;          /* primary button / filled teal */
  --brand-deep: #115e59;
  --brand-ink: #0f766e;      /* teal text / links on surfaces */
  --brand-soft: #d6eeec;     /* active nav, icon tiles */
  --brand-tint: #ecf7f6;
  --accent: #0e7490;

  --ok: #15803d;
  --ok-bg: #dcfce7;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --warn-ring: #f59e0b;
  --bad: #be123c;
  --bad-bg: #ffe4e6;
  --info: #1d4ed8;
  --info-bg: #dbeafe;
  --violet: #6d28d9;
  --violet-bg: #ede9fe;

  --radius: 12px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-pop: 0 12px 32px rgba(15, 23, 42, 0.14);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --fs-body: 0.9375rem;
  --fs-label: 0.8125rem;
  --control-min: 44px;
  --sidebar-w: 232px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  max-width: 100%;
}
body {
  font-family: var(--font);
  font-size: var(--fs-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--brand-ink); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }
img, svg, video, canvas { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 2px; }

.ico {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* release every Swipepages wrapper level */
body > div,
body > div > div,
body > div > div > div,
.be-preview,
.tatsu-section-offset,
.tatsu-section-pad-inner,
.tatsu-column-inner {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  max-width: none !important;
  width: 100% !important;
  min-height: 0 !important;
}

/* viewport utilities */
.long { display: none; }
@media (min-width: 1024px) {
  .long { display: inline; }
  .short { display: none !important; }
  .mobile-only, .only-mobile { display: none !important; }
}
@media (max-width: 1023.98px) {
  .only-desktop { display: none !important; }
}

.page-title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.page-title:focus, .page-title:focus-visible { outline: none; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.45; }
.relative { position: relative; }

/* ============================================================
   AUTH (login gate, signup, reset)
   ============================================================ */
.auth-wrap {
  max-width: 440px;
  margin: 8vh auto;
  padding: 0 16px 40px;
  max-height: 100vh;
  overflow-y: auto;
}
.auth-card {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: var(--shadow);
}
.auth-card h1 { margin: 0 0 6px; font-size: 1.45rem; letter-spacing: -0.02em; }
.auth-tabs { display: flex; gap: 8px; margin: 16px 0; }
.auth-tabs button {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  border-radius: 12px;
  padding: 10px;
  font-weight: 650;
  color: var(--muted);
}
.auth-tabs button.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.signup-done { text-align: center; padding: 8px 0 4px; }
.signup-done h1 { margin: 0 0 8px; font-size: 1.45rem; letter-spacing: -0.02em; }
.signup-done-icon {
  width: 56px;
  height: 56px;
  margin: 4px auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 1.5rem;
  font-weight: 800;
}
.signup-done-steps {
  text-align: left;
  margin: 18px 0 0;
  padding: 14px 14px 14px 32px;
  background: var(--brand-tint);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
}
.signup-done-steps li { margin: 6px 0; }
.signup-done .btn { margin-top: 18px; }

/* ============================================================
   BRAND
   ============================================================ */
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo {
  height: 28px;
  width: auto;
  max-width: 132px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-sep { width: 1px; height: 24px; background: var(--line-strong); flex-shrink: 0; }
.brand-pulse { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.auth-card .brand strong { display: block; font-size: 14px; }
.auth-card .brand span { font-size: 11px; color: var(--muted); }

/* ============================================================
   SHELL — mobile first
   ============================================================ */
.app-shell { display: none; }
.app-shell.show {
  display: flex;
  flex-direction: row;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}
.sidebar { display: none; }
.main-col {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.topbar {
  flex: 0 0 auto;
  background: var(--panel-solid);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  height: 58px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mobile .brand-logo { height: 26px; }
.top-title, .top-date, .top-divider { display: none; }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  padding: 18px 16px 28px;
  scrollbar-width: thin;
}
.content > .view { max-width: 1180px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
  position: relative;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #14b8a6;
  border: 2px solid var(--panel-solid);
}
.icon-btn.has-unread .dot { background: #ef4444; }
.avatar-btn { border: 0; background: transparent; padding: 0; border-radius: 50%; }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #14b8a6;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 750;
  flex-shrink: 0;
  position: relative;
}
.avatar-btn .avatar { background: var(--brand-soft); color: var(--brand-ink); width: 36px; height: 36px; }
.avatar .online {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid var(--panel-solid);
}

/* nav dot / badge */
.nav-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn-ring);
  flex-shrink: 0;
}
.nav-dot.danger { background: #ef4444; }

/* bottom nav (mobile) */
.bottom-nav {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--panel-solid);
  border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
}
.bottom-nav button {
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  min-height: 52px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 10px;
}
.bottom-nav button .ico { width: 24px; height: 24px; }
.bottom-nav button.active { color: var(--brand-ink); }
.bottom-nav button.active > .ico,
.bottom-nav button.active .bn-ico .ico { stroke-width: 2.1; }
.bn-ico { position: relative; display: inline-flex; }
.bn-ico .nav-dot { position: absolute; top: -1px; right: -3px; border: 2px solid var(--panel-solid); width: 11px; height: 11px; }
.bn-badge {
  position: absolute;
  top: -6px;
  right: -9px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}

/* account menu — bottom sheet on mobile, popover on desktop */
.account-menu {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-pop);
  padding: 14px;
  z-index: 60;
  max-height: 70dvh;
  overflow-y: auto;
}
.account-menu.open { display: block; }
.account-head { padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.account-head b { display: block; font-size: 14px; }
.account-head span { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); word-break: break-all; }
.account-rows { display: grid; gap: 8px; margin-bottom: 12px; }
.account-rows > div { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.account-rows span { color: var(--muted); }
.account-rows b { font-weight: 650; }
.account-menu .btn.block { margin-top: 8px; }

/* notifications menu */
.notif-menu {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  top: 62px;
  max-height: min(420px, 70dvh);
  overflow: auto;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-pop);
  padding: 10px;
  z-index: 50;
}
.notif-menu.open { display: block; }
.notif-item {
  padding: 10px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin-top: 8px;
  font-size: 12px;
}
.notif-item.unread { background: var(--brand-tint); border-color: var(--brand-soft); }
.notif-item strong { display: block; margin-bottom: 2px; }
.notif-flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 auto 14px;
  max-width: 1180px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid #fcd34d;
  background: var(--warn-bg);
}
.notif-flash strong { display: block; margin-bottom: 2px; }
.notif-flash p { margin: 0; }

/* ============================================================
   DESKTOP SHELL (>= 1024px)
   ============================================================ */
@media (min-width: 1024px) {
  .sidebar {
    flex: 0 0 var(--sidebar-w);
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    background: var(--panel-solid);
    border-right: 1px solid var(--line);
    padding: 22px 14px 14px;
    height: 100%;
  }
  .sidebar .brand { padding: 2px 8px 22px; }
  .side-nav { display: grid; gap: 4px; }
  .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 14.5px;
    font-weight: 600;
    padding: 11px 12px;
    border-radius: 10px;
    text-align: left;
  }
  .nav-item .ico { color: var(--muted); }
  .nav-item:hover { background: var(--surface-2); }
  .nav-item.active { background: var(--brand-soft); color: var(--brand-deep); }
  .nav-item.active .ico { color: var(--brand-ink); }
  .nav-item .nav-dot { margin-left: auto; }
  .side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
  .user-chip {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    background: transparent;
    padding: 8px;
    border-radius: 10px;
    text-align: left;
    color: var(--text);
  }
  .user-chip:hover { background: var(--surface-2); }
  .user-chip .meta { display: grid; min-width: 0; flex: 1; }
  .user-chip .meta b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .user-chip .meta span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .user-chip .chev { color: var(--muted); width: 18px; height: 18px; }

  .topbar { background: transparent; border-bottom: 0; }
  .topbar-inner { height: 72px; padding: 0 32px; }
  .brand-mobile, .avatar-btn, .bottom-nav { display: none !important; }
  .top-title {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    white-space: nowrap;
  }
  .top-title .crumb { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
  .top-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
  }
  .top-date .ico { width: 18px; height: 18px; color: var(--muted); }
  .top-divider { display: block; width: 1px; height: 28px; background: var(--line); margin: 0 6px; }
  .top-actions { gap: 4px; }
  .content { padding: 4px 32px 40px; }

  .account-menu {
    left: 14px;
    right: auto;
    bottom: 76px;
    width: 264px;
  }
  .notif-menu {
    position: absolute;
    left: auto;
    right: 0;
    top: calc(100% + 8px);
    width: 340px;
  }
  .menu-mobile { display: none !important; }
}

/* ============================================================
   BUTTONS / LINKS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 11px 18px;
  min-height: var(--control-min);
  font-weight: 700;
  font-size: 14.5px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
}
.btn:hover { background: var(--brand-deep); text-decoration: none; }
.btn:disabled, .btn[disabled] { cursor: not-allowed; }
.btn:disabled:hover { background: var(--brand); }
.btn.primary:disabled, .btn:disabled {
  background: var(--surface-2);
  color: var(--faint);
  border-color: var(--line);
}
.btn.ghost {
  background: var(--panel-solid);
  color: var(--text);
  border-color: var(--line);
}
.btn.ghost:hover { background: var(--surface-2); }
.btn.outline {
  background: transparent;
  color: var(--brand-ink);
  border: 1.5px solid var(--brand);
}
.btn.outline:hover { background: var(--brand-tint); }
.btn.outline:disabled { background: transparent; border-color: var(--line); color: var(--faint); }
.btn.danger { background: var(--bad); }
.btn.danger:hover { background: #9f1239; }
.btn.ok { background: var(--ok); }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 12px; font-size: 13px; min-height: 36px; }
.btn.lg { min-height: 48px; padding: 12px 22px; font-size: 15.5px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  padding: 6px 4px;
  min-height: 32px;
  color: var(--brand-ink);
  font-weight: 700;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn .ico { width: 16px; height: 16px; text-decoration: none; }
.link-btn:hover { color: var(--brand-deep); }

.msg { font-size: 13px; margin-top: 10px; }
.msg:empty { display: none; }
.msg.err { color: var(--bad); }
.msg.ok { color: var(--ok); }

/* ============================================================
   CARDS
   ============================================================ */
.card, .panel, .kpi {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}
.card, .panel { padding: 18px; }
.card-hd, .panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.card-hd h2, .panel-hd h2 { font-size: 1.1rem; font-weight: 800; letter-spacing: -0.015em; }
.card-sub, .panel-hd p { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.page-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.empty { padding: 28px 12px; text-align: center; color: var(--faint); font-size: 13px; }
.stack { display: grid; gap: 14px; align-content: start; }

/* ============================================================
   HOME
   ============================================================ */
.greet { margin-bottom: 16px; }
.greet-tag { display: none; margin-top: 4px; color: var(--muted); font-size: 15px; }
.greet-meta { margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 1.5; }
@media (min-width: 1024px) {
  .greet { margin: 8px 0 18px; }
  .page-title { font-size: 2rem; }
  .greet-tag { display: block; }
  .greet-meta { display: none; }
}

.status-card {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 16px;
  margin-bottom: 14px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.status-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--brand);
}
.status-card[data-state="finalized"]::before { background: var(--ok); }
.status-card[data-state="holiday"]::before { background: var(--info); }
.status-card[data-state="absent"]::before,
.status-card[data-state="warn"]::before { background: var(--bad); }
.status-card[data-state="loading"]::before { background: var(--line-strong); }

.status-badges { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.today-badge {
  display: none;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.state-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  background: var(--line);
  color: var(--text);
}
.status-card[data-state="draft"] .state-badge,
.status-card[data-state="work_pending"] .state-badge,
.status-card[data-state="signoff_pending"] .state-badge { background: var(--warn-bg); color: var(--warn); }
.status-card[data-state="ready"] .state-badge { background: var(--brand-soft); color: var(--brand-deep); }
.status-card[data-state="finalized"] .state-badge { background: var(--ok-bg); color: var(--ok); }
.status-card[data-state="holiday"] .state-badge { background: var(--info-bg); color: var(--info); }
.status-card[data-state="absent"] .state-badge,
.status-card[data-state="warn"] .state-badge { background: var(--bad-bg); color: var(--bad); }
.status-card[data-state="loading"] .state-badge { background: var(--line); color: var(--muted); }

.status-title { margin-top: 10px; font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.status-detail { margin-top: 6px; color: var(--muted); font-size: 14px; }
.status-card[data-state="loading"] .status-title,
.status-card[data-state="loading"] .status-detail { color: var(--faint); }

/* stepper — mobile: inline row */
.stepper {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  align-items: center;
}
.step { display: flex; align-items: center; gap: 7px; min-width: 0; }
.step:not(:last-child) { flex: 1 1 0; }
.step:not(:last-child)::after {
  content: "";
  flex: 1;
  height: 2px;
  margin: 0 8px;
  background: var(--line-strong);
  border-radius: 2px;
}
.step[data-state="done"]:not(:last-child)::after { background: var(--brand); }
.step-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--panel-solid);
  color: #fff;
  position: relative;
  z-index: 1;
}
.step-dot .ico { width: 13px; height: 13px; stroke-width: 3; display: none; }
.step[data-state="done"] .step-dot { background: var(--ok); border-color: var(--ok); }
.step[data-state="done"] .step-dot .ico { display: block; }
.step[data-state="active"] .step-dot {
  border: 3px solid var(--warn-ring);
  border-right-color: transparent;
  transform: rotate(0deg);
}
.step-label { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.step[data-state="done"] .step-label { color: var(--ok); }
.step[data-state="active"] .step-label { color: var(--warn); }

.status-cta { display: grid; gap: 8px; justify-items: stretch; }
.status-cta .btn { width: 100%; }
.status-cta .link-btn { justify-self: center; }
#gotoReqBtn { display: none; }

.warn-banner {
  margin-top: 14px;
  background: var(--warn-bg);
  border: 1px solid #fdba74;
  color: var(--warn);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.45;
}

@media (min-width: 1024px) {
  .status-card {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 0;
    padding: 22px 0 22px 28px;
    margin-bottom: 16px;
  }
  .status-main { padding-right: 28px; }
  .status-badges { justify-content: flex-start; gap: 12px; }
  .today-badge { display: inline; color: var(--brand-ink); }
  .status-title { font-size: 1.7rem; margin-top: 8px; }
  .status-detail { font-size: 15px; }

  .stepper { margin-top: 22px; align-items: flex-start; max-width: 560px; }
  .step { flex-direction: column; align-items: center; gap: 10px; flex: 1 1 0 !important; position: relative; }
  .step:not(:last-child)::after {
    position: absolute;
    top: 11px;
    left: 50%;
    width: 100%;
    margin: 0;
    flex: none;
    z-index: 0;
  }
  .step-dot { width: 24px; height: 24px; }
  .step-label { font-size: 13px; text-align: center; white-space: normal; }
  .step[data-state="done"] .step-label { color: var(--text); font-weight: 700; }

  .status-cta {
    border-left: 1px solid var(--line);
    padding: 8px 28px;
    align-content: center;
    gap: 10px;
  }
  #gotoReqBtn { display: inline-flex; }
}

/* KPIs */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.kpi { display: flex; gap: 12px; padding: 14px; align-items: flex-start; }
.kpi-ico {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  place-items: center;
  flex-shrink: 0;
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.kpi-ico.amber { background: #ffedd5; color: #c2410c; }
.kpi-ico.green { background: var(--ok-bg); color: var(--ok); }
.kpi-body { min-width: 0; }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--text); }
.kpi-val { margin-top: 4px; font-size: 1.85rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; color: var(--text); }
.kpi-val.amber { color: var(--warn); }
.kpi-val.green { color: var(--ok); }
.kpi-unit { font-size: 0.55em; font-weight: 700; letter-spacing: 0; }
.kpi-sub { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.kpi-leave { display: none; }
@media (min-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
  .kpi { padding: 16px 18px; align-items: center; }
  .kpi-ico { display: grid; }
  .kpi-ico .ico { width: 22px; height: 22px; }
  .kpi-leave { display: flex; }
  .kpi-val { font-size: 2rem; }
  .kpi-pending-zero .kpi-val { color: var(--muted); }
}

/* Home grid */
.home-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.home-side { display: grid; gap: 12px; align-content: start; }
@media (min-width: 1024px) {
  .home-grid { grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
  .home-side { gap: 16px; }
}

/* recent attendance */
.recent-card { padding: 16px; }
.recent-card .card-hd { margin-bottom: 10px; }
.att-scroll { overflow: auto; scrollbar-width: thin; }
.att-scroll.expanded { max-height: 440px; }
.att-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.recent-table thead { display: none; }
.recent-table tbody { display: block; }
.recent-table tr {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line);
}
.recent-table tr:last-child { border-bottom: 0; }
.recent-table td { display: block; padding: 0; border: 0; min-width: 0; }
.recent-table .c-work { display: none; }
.recent-table .c-date { font-weight: 600; }
.recent-table .c-status .badge { background: none; padding: 0; color: var(--text); font-size: 14px; font-weight: 600; }
.recent-table .c-sub { justify-self: end; }
.recent-table .sub-desktop { display: none; }
.recent-table .sub-mobile { display: inline-flex; }
.recent-table .empty-row { display: block; }
.recent-table .empty-row td { grid-column: 1 / -1; }
.recent-table .work-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.sub-ok { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 600; }
.sub-ok .tick {
  width: 16px; height: 16px; border-radius: 50%; background: var(--ok);
  display: inline-grid; place-items: center; color: #fff; flex-shrink: 0;
}
.sub-ok .tick .ico { width: 10px; height: 10px; stroke-width: 3.4; }
.sub-none { color: var(--muted); }

@media (min-width: 1024px) {
  .recent-card { padding: 20px; }
  .recent-card .card-hd h2 { font-size: 1.15rem; }
  .recent-table thead { display: table-header-group; }
  .recent-table tbody { display: table-row-group; }
  .recent-table tr { display: table-row; padding: 0; }
  .recent-table th {
    text-align: left;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--muted);
    padding: 10px 12px;
    background: var(--surface-2);
  }
  .recent-table th:first-child { border-radius: 8px 0 0 8px; }
  .recent-table th:last-child { border-radius: 0 8px 8px 0; }
  .recent-table td { display: table-cell; padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
  .recent-table tr:last-child td { border-bottom: 0; }
  .recent-table .c-work { display: table-cell; max-width: 280px; }
  .recent-table .c-date { white-space: nowrap; }
  .recent-table .c-status .badge { padding: 3px 12px; font-size: 12px; font-weight: 700; }
  .recent-table .c-status .badge.holiday { background: var(--info-bg); color: var(--info); }
  .recent-table .c-status .badge.present { background: var(--ok-bg); color: var(--ok); }
  .recent-table .c-status .badge.half { background: var(--warn-bg); color: var(--warn); }
  .recent-table .c-status .badge.absent { background: var(--bad-bg); color: var(--bad); }
  .recent-table .c-sub { justify-self: auto; }
  .recent-table .sub-desktop { display: inline-flex; }
  .recent-table .sub-mobile { display: none; }
  .recent-table .empty-row { display: table-row; }
}

/* holiday + request cards */
.hol-card, .req-update {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
}
.hol-ico {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  flex-shrink: 0;
}
.hol-ico.amber { background: #ffedd5; color: #c2410c; }
.hol-body { min-width: 0; flex: 1; }
.hol-label { font-size: 13px; font-weight: 700; color: var(--text); }
.hol-date { display: none; }
.hol-name { display: none; }
.hol-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.hol-inline { margin-top: 1px; font-size: 14px; font-weight: 700; color: var(--text); }
.hol-card { gap: 10px; padding: 12px 14px; }
.hol-card .hol-ico { width: 34px; height: 34px; }
.hol-card .hol-body { display: flex; align-items: center; gap: 12px; }
.hol-card .hol-label { color: var(--muted); font-weight: 600; white-space: nowrap; padding-right: 12px; border-right: 1px solid var(--line-strong); line-height: 22px; }
.hol-card .hol-inline { font-size: 13.5px; line-height: 1.3; }
.hol-card .hol-meta { display: none; }
.req-update { align-items: flex-start; }
.req-update-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.req-update-title { margin-top: 4px; font-size: 14.5px; font-weight: 800; }
.req-update .hol-meta { margin-top: 2px; }

@media (min-width: 1024px) {
  .hol-card { align-items: flex-start; padding: 18px; gap: 12px; }
  .hol-card .hol-ico { width: 38px; height: 38px; }
  .hol-card .hol-body { display: block; }
  .hol-card .hol-label { font-weight: 700; color: var(--text); padding: 0; border: 0; line-height: inherit; }
  .hol-date { display: block; margin-top: 4px; font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; color: var(--brand-ink); text-transform: uppercase; }
  .hol-name { display: block; margin-top: 6px; font-weight: 800; font-size: 15px; }
  .hol-card .hol-meta { display: block; }
  .hol-inline { display: none; }
  .req-update { padding: 16px 18px; }
}
.tz-note { text-align: right; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
#gotoReqBtnMobile { margin-top: 2px; min-height: 48px; font-size: 15.5px; }
@media (max-width: 1023.98px) { .tz-note { display: none; } }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.blue, .badge.holiday { background: var(--info-bg); color: var(--info); }
.badge.violet { background: var(--violet-bg); color: var(--violet); }
.badge.present { background: var(--ok-bg); color: var(--ok); }
.badge.half { background: var(--warn-bg); color: var(--warn); }
.badge.absent { background: var(--bad-bg); color: var(--bad); }

/* ============================================================
   ATTENDANCE (mark)
   ============================================================ */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.page-sub { margin-top: 4px; color: var(--muted); font-size: 14px; }
.mark-as { margin: -6px 0 12px; color: var(--muted); font-size: 13.5px; }
.mark-as:empty { display: none; }
.draft-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.draft-pill::before {
  content: "";
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 70% no-repeat;
}
.draft-pill[data-kind="local"] { background: var(--brand-tint); color: var(--brand-deep); }
.draft-pill[data-kind="local"]::before { background-color: var(--brand); }

.info-banner {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--info-bg);
  border: 1px solid transparent;
  color: var(--info);
  font-size: 14px;
  line-height: 1.45;
  max-width: 640px;
}
.info-banner strong { display: block; margin-bottom: 4px; font-size: 15px; }
.info-banner p { margin: 0; }

.mark-banners { display: grid; gap: 8px; margin-bottom: 12px; }
.mbanner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 14px;
  font-weight: 700;
}
.mbanner[data-state="done"] { background: var(--ok-bg); color: var(--ok); }
.mbanner .ico { width: 20px; height: 20px; }

.mark-grid { display: grid; gap: 14px; align-items: start; }
.mark-col { display: grid; gap: 14px; min-width: 0; }
.form-card { padding: 16px; }
.card-num-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.015em;
}
.card-num-head h2 { font-size: inherit; font-weight: inherit; }
.card-num-head .num {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 14px;
  font-weight: 800;
}

.info-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.info-cell .field-label { margin-bottom: 2px; }
.info-val { font-size: 15px; font-weight: 700; }
.dept-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.info-dept select { margin-top: 8px; width: 100%; }
.info-dept select:not([hidden]) { display: block; }
@media (min-width: 1024px) {
  .info-row { grid-template-columns: 1fr 1.4fr; gap: 0; padding: 0; }
  .info-cell { padding: 10px 16px; }
  .info-cell + .info-cell { border-left: 1px solid var(--line); }
  .form-card { padding: 22px; }
}
@media (max-width: 1023.98px) {
  .info-row { grid-template-columns: 1fr; }
  .info-cell { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
  .info-cell .field-label { margin: 0; }
  .info-cell .field-label::after { content: ":"; }
  .info-dept { display: block; }
  .info-dept .dept-line { display: inline-flex; width: auto; gap: 10px; }
  .info-dept .field-label { display: inline; }
}

/* fields */
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label, .field-label {
  display: block;
  font-size: var(--fs-label);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.field input, .field select, .field textarea, .info-dept select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  min-height: var(--control-min);
  background: var(--panel-solid);
  color: var(--text);
  font-size: 15px;
  outline: 2px solid transparent;
  outline-offset: 1px;
}
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .info-dept select:focus {
  border-color: var(--brand);
  outline-color: color-mix(in srgb, var(--brand) 30%, transparent);
}
.field-help { margin-top: 6px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.field-optional { margin-bottom: 0; }
.form-grid { display: grid; gap: 12px; }
.form-grid.two { grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 1023.98px) { .form-grid.two { grid-template-columns: 1fr; } }

.input-icon { position: relative; }
.input-icon .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.field .input-icon input { padding-left: 40px; }
.add-link { margin-top: 6px; padding-left: 0; text-decoration: none; }
.add-link .ico { width: 16px; height: 16px; }

.counter-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.counter { font-size: 13px; font-weight: 650; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.counter.ok { color: var(--ok); }
.counter.ok::before {
  content: "";
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 70% no-repeat;
}
.counter.warn { color: var(--warn); }
.counter-total { margin-left: auto; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.counter-total.limit { color: var(--bad); }

/* segmented controls (backed by hidden <select>) */
.segmented {
  display: flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel-solid);
  overflow: hidden;
}
.segmented button {
  flex: 1 1 0;
  border: 0;
  border-left: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font-weight: 650;
  font-size: 14.5px;
  min-height: 44px;
  padding: 10px 12px;
  position: relative;
}
.segmented button:first-child { border-left: 0; }
.segmented button:hover { background: var(--surface-2); }
.segmented button[aria-checked="true"] { background: var(--brand); color: #fff; border-left-color: var(--brand); }
.segmented button:focus-visible { outline-offset: -3px; }
.segmented.seg-compact { max-width: 260px; }

@media (max-width: 1023.98px) {
  .segmented.seg-radio {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    border: 0;
    background: transparent;
    overflow: visible;
  }
  .segmented.seg-radio button {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--panel-solid);
    color: var(--text);
    text-align: left;
    font-weight: 600;
  }
  .segmented.seg-radio button::before {
    content: "";
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--line-strong);
    flex-shrink: 0;
    background: transparent;
  }
  .segmented.seg-radio button[aria-checked="true"] {
    background: var(--brand-tint);
    border-color: var(--brand);
    color: var(--text);
  }
  .segmented.seg-radio button[aria-checked="true"]::before {
    border-color: var(--brand);
    background: radial-gradient(circle, var(--brand) 0 45%, transparent 50%);
  }
  .segmented.seg-compact { max-width: none; }
}

/* disclosure blocks */
.blockers { margin-bottom: 14px; }
.blockers > summary, .accordion > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}
.blockers > summary::-webkit-details-marker, .accordion > summary::-webkit-details-marker { display: none; }
.blockers > summary > span { flex: 1; }
.blockers > summary .ico { transition: transform 0.15s; }
.blockers[open] > summary .ico { transform: rotate(180deg); }
.blockers[open] > summary { margin-bottom: 12px; }
.accordion .chev { transition: transform 0.15s; width: 18px; height: 18px; }
.accordion[open] .chev { transform: rotate(90deg); }
.accordion[open] > summary { margin-bottom: 12px; }
.accordion { margin-top: 2px; }
@media (min-width: 1024px) {
  .blockers > summary { display: none; }
  .blockers[open] > summary { margin: 0; }
}

/* review card */
.review-card { padding: 16px; display: grid; gap: 14px; }
.review-head h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.review-head .muted { margin-top: 2px; font-size: 13.5px; }
.checklist { list-style: none; margin: 0; padding: 0; }
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.check-item:last-child { border-bottom: 0; }
.check-item b { display: block; font-size: 14.5px; font-weight: 700; }
.check-item small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--muted); }
.check-item small:empty { display: none; }
.check-ico {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2.5px solid var(--warn-ring);
  display: grid;
  place-items: center;
  color: #fff;
  flex-shrink: 0;
  margin-top: 1px;
}
.check-ico .ico { width: 14px; height: 14px; stroke-width: 3.2; display: none; }
.check-item[data-state="done"] .check-ico { background: var(--ok); border-color: var(--ok); }
.check-item[data-state="done"] .check-ico .ico { display: block; }
.check-item[data-state="optional"] .check-ico { border-color: var(--line-strong); }
.check-item[data-state="optional"] b { color: var(--muted); }

.review-lead { font-size: 14px; color: var(--muted); }
.review-lead:empty { display: none; }
.review-lead[data-tone="ok"] { color: var(--ok); font-weight: 600; }
.verify-box { display: grid; gap: 10px; }
.verify-status { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.verify-box[data-mode="pending"] .verify-status,
.verify-box[data-mode="verified"] .verify-status {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0;
}
.verify-box[data-mode="checking"] .verify-status {
  padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px dashed var(--line-strong);
}
.verify-box[data-mode="unavailable"] .verify-status,
.verify-box[data-mode="unconfigured"] .verify-status {
  padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn); border: 1px solid #fcd34d;
}
.slack-actions { display: grid; gap: 8px; }
.slack-actions .btn { min-height: 46px; }
.slack-actions .btn .ico { width: 18px; height: 18px; }
.refresh-link { justify-self: center; font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 2px; }
.verify-active { display: grid; gap: 4px; }
.fallback-checks { display: grid; gap: 8px; }
.check-row { display: flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; min-height: 36px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--brand); }
.fallback-checks .link-btn { justify-self: start; }

.finalize-block { display: grid; gap: 6px; }
.finalize-hint { text-align: center; font-size: 12.5px; color: var(--muted); }
.stay-saved { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--muted); }
.stay-saved .ico { width: 16px; height: 16px; margin-top: 1px; }
.review-card .msg { margin-top: 0; }

#attSubmit { min-height: 48px; font-size: 15px; }

@media (max-width: 1023.98px) {
  .checklist { display: none; }
  .review-lead { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn); font-weight: 600; }
  .review-lead[data-tone="ok"] { background: var(--ok-bg); color: var(--ok); }
  #attSubmit:disabled { display: none; }
  .finalize-block { display: contents; }
  #attSubmit { order: 1; }
  #attSaveDraft { order: 2; }
  .finalize-hint { order: 3; text-align: left; margin-top: -6px; }
  .stay-saved { order: 4; }
  .review-card .msg { order: 5; }
  .card-num-head.only-mobile { margin-bottom: 0; }
}
@media (min-width: 1024px) {
  .mark-banners { display: none; }
  .mark-grid { grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; }
  .mark-col { gap: 20px; }
  .review-card {
    position: sticky;
    top: 8px;
    padding: 22px;
    gap: 16px;
  }
  .review-lead { text-align: left; }
  .page-head { margin: 4px 0 18px; }
}

/* ============================================================
   CALENDAR
   ============================================================ */
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav button:not(.btn) {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  color: var(--text);
}
.cal-grid { width: 100%; min-width: 0; }
.cal-table {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  min-width: 0;
}
.cal-dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--faint); padding: 4px 0; min-width: 0; }
.cal-day {
  display: block;
  min-height: 52px;
  min-width: 0;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--surface-2);
  padding: 4px 2px;
  text-align: left;
  overflow: hidden;
}
.cal-day.empty { background: transparent; }
.cal-day.today { border-color: var(--brand); background: var(--brand-tint); }
button.cal-day { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }

/* Swipepages ships a global .n rule with negative margins — force ours */
.cal-table .cal-day .n,
.cal-day .n {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  margin: 0 0 4px 0 !important;
  padding: 0 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  color: var(--text) !important;
  font-family: inherit !important;
  text-align: left !important;
  text-indent: 0 !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 16px !important;
  max-height: none !important;
  position: static !important;
  float: none !important;
  transform: none !important;
  clip: auto !important;
  overflow: visible !important;
  flex: none !important;
}
.cal-day .tag {
  display: inline-block;
  width: 8px;
  height: 8px;
  padding: 0;
  margin: 0 0 0 2px;
  border-radius: 50%;
  font-size: 0;
  overflow: hidden;
}
.tag.present { background: #86efac; color: var(--ok); }
.tag.half, .tag.wfh { background: #93c5fd; color: var(--info); }
.tag.absent { background: #fda4af; color: var(--bad); }
.tag.holiday { background: #c4b5fd; color: var(--violet); }
.tag.leave { background: #fdba74; color: var(--warn); }
@media (min-width: 1024px) {
  .cal-table { gap: 6px; }
  .cal-day { min-height: 64px; padding: 6px 4px; }
  .cal-day .tag {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 3px 4px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 0.02em;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .tag.present { background: var(--ok-bg); }
  .tag.half { background: var(--warn-bg); color: var(--warn); }
  .tag.wfh { background: var(--info-bg); }
  .tag.absent { background: var(--bad-bg); }
  .tag.holiday { background: var(--violet-bg); }
  .tag.leave { background: #ffedd5; color: #c2410c; }
}
.cal-legend { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.cal-legend i.leg { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.cal-legend .leg.present { background: #22c55e; }
.cal-legend .leg.absent { background: #f43f5e; }
.cal-legend .leg.holiday { background: #8b5cf6; }
.cal-legend .leg.leave { background: #f59e0b; }
.cal-day-detail {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 14px;
}
.cal-summary { margin-top: 16px; min-width: 0; }
.cal-sum-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; }
@media (min-width: 640px) { .cal-sum-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cal-sum {
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  text-align: center;
  border: 1px solid var(--line);
  background: var(--surface-2);
  min-width: 0;
}
.cal-sum b { display: block; font-size: 22px; font-weight: 800; line-height: 1.1; }
.cal-sum span { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.cal-sum.present b { color: var(--ok); }
.cal-sum.absent b { color: var(--bad); }
.cal-sum.leave b { color: var(--warn); }
.cal-sum.holiday b { color: var(--violet); }
.cal-sum-note {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--brand-tint);
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.5;
}

/* lists / tables shared */
.hol-list { display: grid; gap: 0; }
.hol-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.hol-row:last-child { border-bottom: 0; }
.hol-row time { font-size: 12px; font-weight: 700; color: var(--brand-ink); white-space: nowrap; }
.hol-row strong { display: block; font-size: 13px; }
.hol-row span { font-size: 12px; color: var(--muted); }
.hol-item { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hol-item strong { display: block; font-size: 13px; }
.hol-item span { font-size: 12px; color: var(--muted); }
.hol-item .grow { min-width: 0; }

/* ============================================================
   REQUESTS
   ============================================================ */
.req-page-hd { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.req-layout { display: flex; flex-direction: column; gap: 14px; }
.req-create-col { order: -1; }
.req-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.req-table th, .req-table td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.req-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.type-pill { display: inline-flex; padding: 3px 8px; border-radius: 8px; font-size: 11px; font-weight: 750; }
.type-pill.leave { background: var(--info-bg); color: var(--info); }
.type-pill.missed { background: var(--bad-bg); color: var(--bad); }
.summary-pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.summary-pills div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 8px; text-align: center; border: 1px solid var(--line); }
.summary-pills b { display: block; font-size: 18px; }
.summary-pills span { font-size: 11px; color: var(--muted); }
@media (min-width: 1024px) {
  .req-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.85fr); gap: 16px; }
  .req-create-col { order: 0; }
}

/* ============================================================
   MESSAGES
   ============================================================ */
.msg-thread { display: grid; gap: 10px; }
.msg-thread-block { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-solid); }
.msg-bubble { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--surface-2); }
.msg-bubble.mine { background: var(--brand-tint); border-color: var(--brand-soft); }
.msg-bubble.unread { border-color: #fcd34d; background: var(--warn-bg); }
.msg-bubble.reply { margin-left: 18px; border-left: 3px solid var(--brand); }
.msg-bubble .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
#teamPulse { max-height: 320px; }

/* ============================================================
   TOASTS / OFFLINE
   ============================================================ */
.toast {
  position: fixed;
  right: 16px;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  background: #0f172a;
  color: #fff;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  display: none;
  max-width: min(320px, calc(100vw - 32px));
}
.toast.show { display: block; }
@media (min-width: 1024px) { .toast { bottom: 18px; right: 18px; } }
.offline-banner {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 24px);
  padding: 10px 14px;
  border-radius: 12px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 600;
}
.offline-banner .btn { color: #0f172a; background: #fff; border: none; }
@media (min-width: 1024px) { .offline-banner { bottom: 18px; } }

/* ============================================================
   DARK THEME — tokens carry most of the work
   ============================================================ */
html[data-theme="dark"] {
  --bg: #0b0f12;
  --panel-solid: #12181d;
  --surface-2: #0e1317;
  --line: #222c34;
  --line-strong: #34414b;
  --text: #e8edf1;
  --muted: #9aa7b2;
  --faint: #6c7a86;

  --brand: #0f766e;
  --brand-deep: #14877e;
  --brand-ink: #5eead4;
  --brand-soft: #123a38;
  --brand-tint: #0f2a29;
  --accent: #22d3ee;

  --ok: #4ade80;
  --ok-bg: #11301f;
  --warn: #fbbf24;
  --warn-bg: #33270b;
  --warn-ring: #f59e0b;
  --bad: #fb7185;
  --bad-bg: #3a1620;
  --info: #93c5fd;
  --info-bg: #14233d;
  --violet: #c4b5fd;
  --violet-bg: #261f47;
  --shadow: none;
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.55);
}
html[data-theme="dark"] .step[data-state="done"] .step-dot,
html[data-theme="dark"] .check-item[data-state="done"] .check-ico,
html[data-theme="dark"] .sub-ok .tick { background: #16a34a; border-color: #16a34a; }
html[data-theme="dark"] .step[data-state="done"] .step-label { color: #4ade80; }
html[data-theme="dark"] .kpi-ico.amber,
html[data-theme="dark"] .hol-ico.amber { background: #3a2410; color: #fdba74; }
html[data-theme="dark"] .tag.present { background: #1f6f43; }
html[data-theme="dark"] .tag.half, html[data-theme="dark"] .tag.wfh { background: #2f5fa8; }
html[data-theme="dark"] .tag.absent { background: #9f2b45; }
html[data-theme="dark"] .tag.holiday { background: #6a4fc4; }
html[data-theme="dark"] .tag.leave { background: #b9690f; }
@media (min-width: 1024px) {
  html[data-theme="dark"] .tag.present { background: var(--ok-bg); color: var(--ok); }
  html[data-theme="dark"] .tag.half { background: var(--warn-bg); color: var(--warn); }
  html[data-theme="dark"] .tag.wfh { background: var(--info-bg); color: var(--info); }
  html[data-theme="dark"] .tag.absent { background: var(--bad-bg); color: var(--bad); }
  html[data-theme="dark"] .tag.holiday { background: var(--violet-bg); color: var(--violet); }
  html[data-theme="dark"] .tag.leave { background: #3a2410; color: #fdba74; }
}
html[data-theme="dark"] .btn:disabled,
html[data-theme="dark"] .btn.primary:disabled { background: #161d23; color: #5d6b77; border-color: var(--line); }
html[data-theme="dark"] .btn.ghost:hover { background: #1a232a; }
html[data-theme="dark"] .btn.outline { color: var(--brand-ink); border-color: #14877e; }
html[data-theme="dark"] .btn.outline:hover { background: var(--brand-tint); }
html[data-theme="dark"] .notif-flash { border-color: #6b5312; }
html[data-theme="dark"] .warn-banner,
html[data-theme="dark"] .verify-box[data-mode="unavailable"] .verify-status,
html[data-theme="dark"] .verify-box[data-mode="unconfigured"] .verify-status { border-color: #6b5312; }
html[data-theme="dark"] .toast,
html[data-theme="dark"] .offline-banner { background: #1c252c; }
html[data-theme="dark"] .offline-banner .btn { background: #e8edf1; color: #0b0f12; }
html[data-theme="dark"] .content { scrollbar-color: #34414b transparent; }
html[data-theme="dark"] .draft-pill::before { background-color: #16a34a; }
html[data-theme="dark"] .counter.ok::before { background-color: #16a34a; }
html[data-theme="dark"] .field select option { background: #12181d; color: #e8edf1; }

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
