/* ── Leave Portal CSS — based on original Leave app design ─────── */

:root {
  color-scheme: light;
  --ink: #132336;
  --muted: #54697f;

  --glass-bg: linear-gradient(140deg, rgba(255,255,255,0.38), rgba(255,255,255,0.26));
  --glass-bg-strong: linear-gradient(140deg, rgba(255,255,255,0.5), rgba(255,255,255,0.3));
  --glass-border: rgba(255,255,255,0.84);
  --glass-shadow: 0 12px 24px rgba(12,29,48,0.1);
  --glass-shadow-soft: 0 6px 14px rgba(20,38,60,0.08);
  --glass-inner: inset 0 1px 0 rgba(255,255,255,0.42);

  --accent-start: rgba(55,122,182,0.9);
  --accent-end: rgba(38,93,147,0.88);
  --surface-blue: rgba(212,232,255,0.28);
  --surface-blue-strong: rgba(192,220,252,0.36);
  --border: rgba(104,137,178,0.58);
  --border-strong: rgba(86,122,168,0.72);

  --brand: #264f78;
  --brand-soft: #dde8f2;
  --warn: #9a6a21;
  --danger: #933f46;
  --bg: #eef3f7;
  --card: #ffffff;
  --line: #cfd8e4;
  --line-soft: #e4ebf3;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope","Segoe UI",sans-serif;
  line-height: 1.52;
  letter-spacing: 0.01em;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(116,162,238,0.08), transparent 40%),
    radial-gradient(circle at 85% 12%, rgba(92,164,229,0.09), transparent 42%),
    radial-gradient(circle at 55% 88%, rgba(86,168,232,0.05), transparent 44%),
    linear-gradient(155deg, #f5f9ff 0%, #edf4ff 56%, #e5f0ff 100%);
  background-attachment: fixed;
}

h1,h2,h3,h4 {
  font-family: "Manrope","Segoe UI",sans-serif;
  letter-spacing: 0.015em;
  margin: 0 0 0.45rem;
  font-weight: 700;
  line-height: 1.25;
}
h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.05rem; }

.bg-orb {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(45px);
  opacity: 0.12;
  pointer-events: none;
  animation: drift 12s ease-in-out infinite alternate;
}
.bg-orb-1 { width: 340px; height: 340px; background: #6aa4ff; left: -110px; top: -80px; }
.bg-orb-2 { width: 300px; height: 300px; background: #57c6ff; right: -100px; top: 80px; }

.shell {
  max-width: 1720px;
  margin: 0 auto;
  padding: 1.6rem 2rem;
}

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-shadow: var(--glass-shadow), var(--glass-inner);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
}

.card {
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-shadow: var(--glass-shadow), var(--glass-inner);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  padding: 1.3rem;
}

/* ── Topbar ─────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 1rem 0.9rem;
  animation: rise 0.5s ease;
  position: relative;
  z-index: 3000;
  overflow: visible;
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, #fdfefe 100%);
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.action-icon { display: none; }
.action-icon svg { width: 1em; height: 1em; display: block; }
.action-label { display: inline; }

.notif-badge {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  border-radius: 10px;
  padding: 0 0.35rem;
  align-items: center;
  justify-content: center;
  background: #9a3d3d;
  color: #fff;
  font-size: 0.74rem;
  margin-left: 0.35rem;
}

.decision-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #cfd8e4;
  background: #f7fafc;
  color: #27435f;
  border-radius: 999px;
  padding: 0.33rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 700;
}

/* ── Notification panel ─────────────────────────────────────────── */
.notification-panel {
  position: fixed;
  top: 78px;
  right: 1.1rem;
  width: min(440px, 92vw);
  max-height: 420px;
  overflow: auto;
  background: linear-gradient(160deg, rgba(10,18,32,0.72), rgba(14,24,42,0.64)) !important;
  border: 1px solid rgba(120,180,255,0.22) !important;
  border-radius: 14px;
  box-shadow: 0 20px 48px rgba(0,0,0,0.45), 0 0 32px rgba(60,130,220,0.12), inset 0 1px 0 rgba(255,255,255,0.1) !important;
  backdrop-filter: blur(32px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(32px) saturate(180%) !important;
  padding: 0.7rem;
  z-index: 2147483647;
  color: #dce9f6;
}
.notification-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.14);
  color: #f0f6ff;
}
.notification-list { display: grid; gap: 0.45rem; margin-top: 0.6rem; }
.notification-item {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  background: rgba(255,255,255,0.07);
  padding: 0.5rem 0.58rem;
  cursor: pointer;
  color: #d8e6f2;
}
.notification-item:hover { border-color: rgba(255,255,255,0.22); background: rgba(255,255,255,0.13); }
.notification-row { display: flex; justify-content: space-between; align-items: center; gap: 0.45rem; }
.notification-type { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; color: #7aadce; }
.notification-time { font-size: 0.78rem; color: #7a96ae; white-space: nowrap; }
.notification-text { margin-top: 0.2rem; color: #cee0f2; font-size: 0.9rem; }
.notification-empty { color: #7a96ae; font-size: 0.9rem; padding: 0.2rem 0; }

/* ── Tabs ───────────────────────────────────────────────────────── */
.tabs {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.35rem;
  border: 1px solid rgba(111,146,189,0.56);
  border-radius: 14px;
  background: linear-gradient(140deg, rgba(255,255,255,0.42), rgba(255,255,255,0.16));
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 8px 16px rgba(18,39,61,0.08), inset 0 1px 0 rgba(255,255,255,0.34);
  margin: 1rem 0;
}

.tab-slider {
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 0;
  border-radius: 999px;
  background: linear-gradient(155deg, var(--accent-start), var(--accent-end));
  box-shadow: 0 6px 12px rgba(28,84,141,0.24), inset 0 1px 0 rgba(255,255,255,0.22);
  pointer-events: none;
  z-index: 0;
  will-change: transform, width, height;
  transition: transform 380ms cubic-bezier(0.25,0.46,0.45,0.94),
              width 380ms cubic-bezier(0.25,0.46,0.45,0.94),
              height 380ms cubic-bezier(0.25,0.46,0.45,0.94);
}

.tab-btn {
  position: relative;
  z-index: 1;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #24384d;
  padding: 0.52rem 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 220ms ease;
  letter-spacing: 0.01em;
  font-size: 0.95rem;
  box-shadow: none;
}
.tab-btn.active { color: #f6fbff; }
.tab-btn.roster-tool-start { margin-left: auto; }

/* No transform in tab-content animation — transform creates a containing block
   for position:fixed in Chrome, which clips the flatpickr calendar. */
@keyframes tab-fade { from { opacity: 0; } to { opacity: 1; } }
.tab-content { min-height: 420px; padding: 1.15rem; animation: tab-fade 0.35s ease; }

/* ── Glass theme overrides ─────────────────────────────────────── */
.topbar,
.tab-content,
.table-wrap,
.month-card,
.request-card,
.request-item,
.request-panel,
.decision-history-item,
.decision-history-row,
.decision-history-content,
.request-content,
.edit-popup,
.history-item,
.admin-create-user,
.profile-section-card,
.profile-box,
.profile-push-box,
.profile-notification-item,
.log-box,
.role-option-card-body,
.draft-item {
  background: var(--glass-bg);
  border-color: var(--glass-border);
  box-shadow: var(--glass-shadow), var(--glass-inner);
  backdrop-filter: blur(26px) saturate(165%);
  -webkit-backdrop-filter: blur(26px) saturate(165%);
}

/* tab-content backdrop-filter creates a Chrome GPU compositing layer whose
   painted bounds clip the flatpickr calendar even when the calendar is a
   child of body. Remove backdrop-filter from tab-content only; all elements
   INSIDE it (cards, panels etc.) keep their own glass effect. */
#tab-content.tab-content {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
}

/* Ensure the calendar is never clipped — no will-change (avoids compositing issues) */
.flatpickr-calendar {
  isolation: isolate;
}

.weekday-cell,
thead th,
.month-title,
.request-item[open] .request-content,
.request-item[open] .request-summary,
.decision-history-item[open] .decision-history-row {
  background: linear-gradient(140deg, rgba(255,255,255,0.6), rgba(255,255,255,0.22));
}

.profile-push-debug {
  border-left-color: #2a84b8;
  background: linear-gradient(145deg, rgba(218,242,255,0.65), rgba(196,233,255,0.3));
  color: #0f3b57;
}


/* ── Forms ──────────────────────────────────────────────────────── */
.form-stack { display: grid; gap: 0.7rem; }
.form-stack label { display: grid; gap: 0.35rem; font-weight: 600; font-size: 0.92rem; }
.date-row { display: grid; grid-template-columns: 1fr auto; gap: 0.6rem; align-items: end; }
.session-label { display: block; font-size: 0.8rem; color: #5f7285; margin-bottom: 0.2rem; }
.session-toggle { display: inline-flex; border: 1px solid #c7d3e0; border-radius: 6px; overflow: hidden; }
.session-btn { border: 0; border-right: 1px solid #c7d3e0; background: #f2f6fa; color: #36526e; padding: 0.42rem 0.75rem; font-weight: 700; }
.session-btn:last-child { border-right: 0; }
.session-btn.active { background: #375d86; color: #fff; }

.draft-list { display: grid; gap: 0.45rem; }
.draft-item { border: 1px solid var(--line); border-radius: 6px; padding: 0.45rem 0.6rem; background: #fafbfd; display: flex; justify-content: space-between; align-items: center; gap: 0.55rem; }
.draft-main { display: grid; gap: 0.1rem; }
.draft-item .danger { padding: 0.3rem 0.55rem; }

input, select, textarea {
  width: 100%;
  border: 1px solid rgba(117,151,189,0.62);
  border-radius: 9px;
  padding: 9px 11px;
  font: inherit;
  color: var(--ink);
  background: linear-gradient(145deg, rgba(241,248,255,0.48), rgba(232,242,255,0.34));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.54);
  backdrop-filter: blur(14px) saturate(155%);
  -webkit-backdrop-filter: blur(14px) saturate(155%);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(98,148,218,0.9);
  box-shadow: 0 0 0 3px rgba(141,187,255,0.22);
}

button {
  border: 0;
  border-radius: 9px;
  padding: 8px 12px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(160deg, var(--accent-start), var(--accent-end));
  box-shadow: 0 12px 26px rgba(20,43,69,0.22), inset 0 1px 0 rgba(255,255,255,0.25);
}
button:hover:not(:disabled) { background: linear-gradient(160deg, rgba(67,132,191,0.92), rgba(44,99,154,0.9)); }
button.secondary { background: linear-gradient(180deg, #5e7590 0%, #435f7e 100%); color: white; }
button.warn { background: linear-gradient(180deg, #b07d2f 0%, var(--warn) 100%); color: white; }
button.danger { background: linear-gradient(180deg, #ab5058 0%, var(--danger) 100%); color: white; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Password eye toggle */
.pw-field { position: relative; display: flex; align-items: center; }
.pw-field input { flex: 1; padding-right: 2.6rem !important; }
.pw-toggle { position: absolute; right: 0.55rem; top: 50%; transform: translateY(-50%); background: none; border: none; padding: 0.25rem; cursor: pointer; color: #7a9ec0; display: flex; align-items: center; justify-content: center; border-radius: 6px; transition: color 0.15s; box-shadow: none; }
.pw-toggle:hover { color: #3d6f9f; background: rgba(100,160,220,0.1); }
.pw-toggle svg { width: 1.15rem; height: 1.15rem; display: block; }

/* Flatpickr overrides */
/* Date input wrapper with calendar icon button */
.fp-date-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}
.fp-date-wrap input[data-input] {
  flex: 1;
  padding-right: 36px; /* room for icon */
  min-width: 0;
}
.fp-cal-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: none;
  background: none;
  color: rgba(74,124,168,0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 4px;
  transition: color .14s;
  pointer-events: auto;
}
.fp-cal-btn:hover { color: rgba(29,78,129,0.8); background: none; }
/* No horizontal padding — flatpickr's .flatpickr-days has a hard-coded
   width: 307.875px, but .flatpickr-weekdays uses width: 100%. Any horizontal
   padding on the calendar makes weekdays narrower than the day container,
   pushing the SAT column header under the right edge and clipping it.
   Use vertical padding only. */
.flatpickr-calendar { z-index: 99999 !important; border: 1px solid var(--glass-border); border-radius: 16px; background: linear-gradient(145deg, rgba(255,255,255,0.74), rgba(241,249,255,0.52)); backdrop-filter: blur(20px) saturate(145%); -webkit-backdrop-filter: blur(20px) saturate(145%); box-shadow: 0 18px 34px rgba(15,34,54,0.2), inset 0 1px 0 rgba(255,255,255,0.5); padding: 0.35rem 0; }
.flatpickr-months { margin-bottom: 0.3rem; }
.flatpickr-month, .flatpickr-current-month { color: #173451; fill: #173451; }
.flatpickr-current-month { font-weight: 800; }
/* flatpickr bundled CSS sets overflow:hidden on .flatpickr-weekdays;
   border-radius + overflow:hidden clips the "SAT" text at the top-right corner.
   Override overflow to visible so the rounded background shows without clipping. */
.flatpickr-weekdays { background: rgba(255,255,255,0.35); border-radius: 10px; margin-bottom: 0.2rem; overflow: visible; }
span.flatpickr-weekday { color: #35546e; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.68rem; }
.flatpickr-day { border-radius: 10px; border: 1px solid transparent; color: #1b3b57; transition: all 140ms ease; }
.flatpickr-day:hover { background: rgba(147,189,245,0.25); border-color: rgba(113,158,220,0.45); }
.flatpickr-day.today { border-color: rgba(78,135,203,0.85); color: #0f3d6f; }
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange { background: linear-gradient(155deg, var(--accent-start), var(--accent-end)); border-color: transparent; color: #fff; box-shadow: 0 6px 14px rgba(29,79,130,0.25); }
.flatpickr-day.inRange { background: rgba(121,171,239,0.2); border-color: rgba(111,155,219,0.38); }
.flatpickr-day.flatpickr-disabled, .flatpickr-day.flatpickr-disabled:hover { color: rgba(78,102,124,0.38); background: transparent; }
.flatpickr-prev-month, .flatpickr-next-month { border-radius: 10px; color: #224767; }
.flatpickr-prev-month:hover, .flatpickr-next-month:hover { background: rgba(146,189,241,0.25); }

/* ── Layout ─────────────────────────────────────────────────────── */
.grid-two { display: grid; grid-template-columns: 2fr 1fr; gap: 1.2rem; }
.grid-two > :first-child { border-right: 1px solid var(--line-soft); padding-right: 1rem; }
.subtle { color: var(--muted); margin: 0.4rem 0 0.9rem; font-size: 0.93rem; }
.stack { display: grid; gap: 0.85rem; }
.form-inline { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.form-inline input { min-width: 140px; }

/* ── Legend ─────────────────────────────────────────────────────── */
.legend-row { display: flex; flex-wrap: wrap; gap: 0.55rem 0.9rem; margin-bottom: 0.85rem; }
.legend-item { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; color: #36526e; }
.legend-circle { width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(to bottom, var(--am-color,#eee) 50%, var(--pm-color,#eee) 50%); box-shadow: 0 0 0 1px rgba(0,0,0,0.08); flex-shrink: 0; }
.legend-square { width: 16px; height: 16px; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,0.08); flex-shrink: 0; }

/* ── Calendar ───────────────────────────────────────────────────── */
.months-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; }
.month-card { border: 1px solid var(--glass-border); border-radius: 14px; overflow: hidden; background: var(--glass-bg); backdrop-filter: blur(16px) saturate(130%); -webkit-backdrop-filter: blur(16px) saturate(130%); box-shadow: var(--glass-shadow), var(--glass-inner); }
.month-title { background: linear-gradient(140deg, rgba(255,255,255,0.5), rgba(255,255,255,0.3)); color: #153251; text-align: center; font-weight: 700; padding: 0.55rem; border-bottom: 1px solid var(--glass-border); }
.weekday-row, .week-row { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); }
.weekday-cell { text-align: center; font-size: 0.75rem; color: #2c4a62; padding: 0.38rem 0; border-bottom: 1px solid var(--glass-border); background: rgba(255,255,255,0.3); font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; }
.day-cell { min-height: 38px; border-right: 1px solid rgba(255,255,255,0.4); border-bottom: 1px solid rgba(255,255,255,0.4); display: flex; justify-content: center; align-items: center; background: rgba(255,255,255,0.15); transition: background 120ms; }
.day-cell:hover { background: rgba(255,255,255,0.28); }
.day-num { font-size: 0.85rem; color: #334155; }
.day-num.out { color: #a0adb2; }
.day-dot { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.75); }
.day-dot.past    { background: #b7bec7 !important; }
.day-dot.blocked { background: rgba(148,163,184,0.55) !important; opacity: 0.65; cursor: default; }
.day-dot .day-num { color: #fff; font-weight: 700; font-size: 0.82rem; }
.day-cell.leave-day { position: relative; }
.status-ok { background: #2e7d32; }
.status-low { background: #ff9800; }
.status-deficit { background: #ff0033; }
.status-deficit-heavy { background: #5e0b15; }
.status-empty { background: #c0c8d2; }

/* ── Request cards ──────────────────────────────────────────────── */
.request-card { border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem; display: grid; gap: 0.65rem; background: linear-gradient(180deg,#ffffff 0%,#fcfdff 100%); box-shadow: 0 10px 24px rgba(26,40,58,0.05); }
.decision-history-item { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 10px 24px rgba(26,40,58,0.05); }
.decision-history-item + .decision-history-item { margin-top: 0.45rem; }
.decision-history-row { list-style: none; display: grid; grid-template-columns: minmax(160px,1fr) minmax(260px,2fr) minmax(140px,1fr) auto; gap: 0.75rem; align-items: center; padding: 0.58rem 0.7rem; font-size: 0.9rem; background: #fff; cursor: pointer; }
.decision-history-row::-webkit-details-marker { display: none; }
.decision-history-item[open] .decision-history-row { border-bottom: 1px solid #d3dde8; background: #f4f8fc; }
.decision-history-name, .decision-history-period, .decision-history-type { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.decision-history-name { color: #21364a; font-weight: 700; }
.decision-history-period { color: #355d86; }
.decision-history-type { color: #556b83; }
.decision-history-status { justify-self: end; }
.decision-history-content { padding: 0.55rem 0.7rem 0.7rem; background: #eef4fa; }
.decision-history-content .request-panel { margin: 0; }
.decision-history-controls { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 0.6rem; }
.decision-history-size { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); font-size: 0.82rem; white-space: nowrap; }
.decision-history-size select { padding: 0.25rem 0.4rem; border-radius: 5px; font-size: 0.82rem; }
.decision-nav-btn { padding: 0.28rem 0.5rem; font-size: 0.8rem; min-width: 1.9rem; background: #eef3f8; color: #3e556d; }
.decision-nav-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.decision-page-info { color: var(--muted); font-size: 0.82rem; margin-left: 0.1rem; }

.request-item { border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 8px 18px rgba(26,40,58,0.04); }
.request-item[open] { border-color: #b8cadd; box-shadow: 0 6px 18px rgba(55,93,134,0.08); }
.request-summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 0.7rem; padding: 0.85rem 0.95rem; cursor: pointer; border-bottom: 1px solid transparent; }
.request-summary::-webkit-details-marker { display: none; }
.summary-main { display: grid; gap: 0.12rem; }
.request-summary-compact { align-items: center; }
.summary-main-compact { display: grid; grid-template-columns: minmax(150px,1fr) minmax(260px,2fr) minmax(150px,1fr); gap: 0.75rem; align-items: center; }
.summary-main-compact .summary-name, .summary-main-compact .summary-period, .summary-main-compact .summary-type, .summary-main-compact .summary-type-grp { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary-name { font-size: 0.9rem; color: #3d546d; font-weight: 650; letter-spacing: 0.01em; }
.summary-period { color: #2f5d8a; font-size: 0.94rem; font-weight: 650; letter-spacing: 0.01em; }
.summary-type { color: #536982; font-size: 0.85rem; }
.summary-type-grp { display: inline-flex; align-items: center; gap: 0.35rem; min-width: 0; overflow: hidden; }
.summary-type-grp .summary-type { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary-status { flex-shrink: 0; }
.summary-actions { position: relative; display: inline-flex; align-items: center; gap: 0.45rem; }
.edit-inline-btn { display: none; padding: 0.38rem 0.6rem; font-size: 0.82rem; }
.request-item[open] .edit-inline-btn { display: inline-flex; }
.request-content { border-top: 1px solid var(--line); padding: 0.85rem 0.95rem; display: grid; gap: 0.7rem; }
.request-item[open] .request-content { background: #eef4fa; }
.request-item[open] .request-summary { border-bottom-color: var(--line-soft); }
.request-meta { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0.5rem; }
.request-meta > div { display: grid; gap: 0.12rem; border-left: 1px solid var(--line-soft); padding-left: 0.55rem; background: rgba(255,255,255,0.5); border-radius: 4px; padding-top: 0.25rem; padding-bottom: 0.25rem; }
.request-meta > div:nth-child(odd) { border-left: 0; padding-left: 0; }
.request-panel { border: 1px solid var(--line); border-radius: 10px; padding: 0.55rem 0.6rem; background: #f7fbff; }
.activation-notice { background: #fff8e8; border-color: #ead6aa; }
.request-panel + .request-panel { margin-top: 0.2rem; }
.panel-date { color: #315a83; font-weight: 700; font-size: 0.92rem; }
.panel-title { font-size: 0.82rem; color: #425b74; font-weight: 700; margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.04em; }
.edit-row { gap: 0.45rem; }
.edit-popup .edit-row input, .edit-popup .edit-row select { min-width: 110px; }
.comment-input-lg { min-width: 340px; width: min(520px,100%); }
.request-actions { gap: 0.45rem; }

/* Info peek button */
.info-peek-btn { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: none; background: none; box-shadow: none; color: #4f80ae; border-radius: 50%; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity 140ms ease, background 120ms ease; }
.request-summary:hover .info-peek-btn { opacity: 1; pointer-events: auto; }
.info-peek-btn:hover { background: rgba(79,128,174,0.15); color: #2a5f8f; }

.edit-popup { display: none; position: absolute; top: calc(100% + 6px); right: 0; width: min(460px,92vw); border: 1px solid #c5d4e4; border-radius: 12px; background: #ffffff; box-shadow: 0 10px 24px rgba(22,34,49,0.14); padding: 0.6rem; z-index: 12; }
.edit-popup.open { display: grid; gap: 0.5rem; }

/* Availability popover */
.avail-popover { display: none; position: absolute; z-index: 1200; width: min(680px,92vw); background: var(--glass-bg); backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%); border: 1px solid var(--glass-border); border-radius: 16px; box-shadow: 0 8px 32px rgba(30,60,100,0.22), 0 1.5px 6px rgba(30,60,100,0.1); padding: 0.85rem 1rem 0.9rem; overflow: hidden; }
.avail-popover.avail-popover-open { display: block; }
.avail-popover-header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.55rem; }
.avail-popover-title { font-size: 0.88rem; font-weight: 650; color: #1e3a55; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avail-popover-close { flex-shrink: 0; width: 24px; height: 24px; padding: 0; border: none; background: none; box-shadow: none; font-size: 0.95rem; color: #536982; border-radius: 50%; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background 120ms ease; }
.avail-popover-close:hover { background: rgba(79,128,174,0.15); color: #1e3a55; }
.avail-popover-legend { margin-bottom: 0.65rem; padding-bottom: 0.55rem; }
.avail-popover-leave-swatch { background: rgba(59,130,246,0.35) !important; border: 2px solid rgba(59,130,246,0.7); }
.avail-popover-months { display: grid; grid-template-columns: 1fr; gap: 0.85rem; max-height: calc(2 * 240px + 0.85rem); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(79,128,174,0.4) transparent; }

/* ── History ─────────────────────────────────────────────────────── */
.history { border-top: 1px dashed #cad6e3; padding-top: 0.5rem; display: grid; gap: 0.45rem; }
.history-item { font-size: 0.94rem; color: #183044; background: #ffffff; border-radius: 4px; padding: 0.5rem 0.55rem; border: 1px solid #d8e2ec; }
.history-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; }
.history-left { display: inline-flex; align-items: center; gap: 0.3rem; }
.history-time { font-size: 0.8rem; color: #5a7188; white-space: nowrap; }
.history-text { margin-top: 0.3rem; color: #22384a; line-height: 1.55; }
.history-tag { display: inline-block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; border-radius: 4px; padding: 0.08rem 0.35rem; margin-right: 0.45rem; font-weight: 700; }
.tag-create { background: #e5edf7; color: #375d86; }
.tag-edit { background: #f6ede2; color: #8b5e2a; }
.tag-status { background: #e8efe6; color: #46704d; }
.tag-message { background: #ececf2; color: #61657b; }
.tag-internal { background: #fef3c7; color: #92400e; }
.history-accordion summary { cursor: pointer; font-size: 0.82rem; color: #3f5a74; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.history-accordion[open] summary { margin-bottom: 0.45rem; }
.history-item strong { color: #1f3347; }
.hist-list { display: grid; gap: 0.35rem; margin-top: 0.35rem; }
.hist-list:empty { margin-top: 0; }
.messages-section {
  border: 1px solid rgba(99,131,189,0.3);
  border-radius: 8px;
  background: rgba(219,234,254,0.25);
  padding: 0.6rem 0.7rem;
}
.messages-section > summary {
  list-style: none;
  color: #2d5080;
}
.messages-section > summary::-webkit-details-marker { display: none; }

/* ── Unread message dot ──────────────────────────────────────────── */
.unread-msg-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e05252;
  margin-left: 6px;
  vertical-align: middle;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(224,82,82,0.22);
}

/* ── Internal notes section ─────────────────────────────────────── */
.internal-notes-section {
  border: 1px solid rgba(234,179,8,0.35);
  border-radius: 8px;
  background: rgba(254,243,199,0.38);
  padding: 0.6rem 0.7rem;
}
.internal-notes-section > .internal-notes-label,
.internal-notes-section > summary.internal-notes-label {
  list-style: none;
  cursor: pointer;
}
.internal-notes-section > summary.internal-notes-label::-webkit-details-marker { display: none; }
.internal-notes-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #92400e;
  user-select: none;
}
.internal-notes-form {
  border: 1px solid rgba(234,179,8,0.35);
  border-radius: 8px;
  background: rgba(254,243,199,0.22);
  padding: 0.6rem 0.7rem;
}

/* ── Badges ─────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; border-radius: 4px; padding: 0.2rem 0.65rem; font-size: 0.82rem; font-weight: 700; }
.status-pending { background: #f2ece1; color: #7a5a2f; }
.status-under_review { background: #e8edf5; color: #415b79; }
.status-approved { background: #e3eee5; color: #3f6950; }
.status-declined { background: #f2e2e2; color: #7f4040; }

/* ── Meta ───────────────────────────────────────────────────────── */
.meta-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: #62788f; font-weight: 700; }
.meta-value { font-size: 0.88rem; color: #182a3c; }
.period-text { color: #355d86; font-weight: 600; }
.type-text { color: #5e7290; }

/* ── Table ──────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
thead th { background: #f8fafd; color: #425267; font-size: 0.85rem; font-weight: 700; }
table { width: 100%; border-collapse: collapse; min-width: 580px; }
th, td { padding: 0.62rem; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line-soft); text-align: left; }
th:last-child, td:last-child { border-right: 0; }

/* ── Profile ────────────────────────────────────────────────────── */
.profile-layout { align-items: start; gap: 1rem; }
.profile-column { display: grid; gap: 0.9rem; }
.profile-section-card { border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(180deg,#fcfeff 0%,#f4f9fd 100%); padding: 0.85rem; box-shadow: 0 8px 20px rgba(22,70,112,0.05); }
.profile-section-title { margin: 0 0 0.55rem; font-size: 1rem; }
.profile-box { display: grid; gap: 0.4rem; border: 1px solid var(--line); border-radius: 12px; padding: 0.8rem; background: linear-gradient(180deg,#fbfdff 0%,#f6fafe 100%); }
.profile-install-box { display: flex; flex-direction: column; gap: 0.65rem; }
.profile-install-desc { margin: 0; font-size: 0.9rem; color: #4a6880; }
.profile-install-installed { font-size: 0.9rem; color: #2e7d4f; font-weight: 500; }
.profile-notification-form { margin-top: 0.1rem; border: 0; border-radius: 0; padding: 0; background: transparent; }
.profile-notification-top-actions { display: flex; justify-content: flex-end; }
.profile-notification-list { display: grid; gap: 0.7rem; }
.profile-notification-group { display: grid; gap: 0.45rem; }
.profile-notification-group-title { margin: 0; font-size: 0.86rem; font-weight: 800; color: #2f4961; letter-spacing: 0.01em; }
.profile-notification-item { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; align-items: center; border: 1px solid var(--line-soft); border-radius: 10px; background: #fff; padding: 0.55rem 0.6rem; }
.profile-notification-body { display: grid; gap: 0.18rem; }
.profile-notification-switch { position: relative; width: 42px; height: 24px; display: inline-block; }
.profile-notification-switch-input { position: absolute; opacity: 0; width: 0; height: 0; }
.profile-notification-slider { position: absolute; inset: 0; cursor: pointer; background: #c6d4e0; border-radius: 999px; transition: background 0.2s ease; }
.profile-notification-slider::before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: transform 0.2s ease; }
.profile-notification-switch-input:checked + .profile-notification-slider { background: #2e7d32; }
.profile-notification-switch-input:checked + .profile-notification-slider::before { transform: translateX(18px); }
.profile-notification-switch-input:focus-visible + .profile-notification-slider { outline: 2px solid #2f6a98; outline-offset: 2px; }
.profile-notification-title { font-size: 0.88rem; font-weight: 700; color: #213a52; }
.profile-notification-copy { font-size: 0.79rem; color: #61778a; line-height: 1.32; }
.profile-push-box { margin-top: 0.25rem; border: 1px solid var(--line-soft); border-radius: 12px; padding: 0.7rem; background: #fff; display: grid; gap: 0.55rem; }
.profile-push-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.profile-push-debug { font-size: 0.84rem; color: #21455f; font-weight: 500; border-left: 4px solid #1f6b9d; background: rgba(236,245,252,0.8); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-radius: 8px; padding: 0.6rem 0.7rem; }
.profile-push-help { font-size: 0.8rem; color: #3f5b70; line-height: 1.35; }
.profile-push-help a { color: #1d5f8a; text-decoration: underline; }

/* Push badges */
.push-inline { display: flex; align-items: center; gap: 0.85rem; flex-wrap: wrap; font-size: 0.82rem; color: #23445c; }
.push-segment { display: inline-flex; align-items: center; gap: 0.45rem; }
.push-badge { display: inline-flex; align-items: center; padding: 0.2rem 0.55rem; border-radius: 12px; font-weight: 700; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.02em; background: #d4e3f2; color: #1e5a8a; box-shadow: 0 2px 4px rgba(30,90,138,0.12); }
.push-badge.push-granted { background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%); color: #fff; }
.push-badge.push-denied { background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%); color: #fff; }
.push-badge.push-default { background: linear-gradient(135deg, #757575 0%, #616161 100%); color: #fff; }
.push-badge.push-unsupported { background: linear-gradient(135deg, #f57c00 0%, #e65100 100%); color: #fff; }
.push-badge.push-yes { background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%); color: #fff; }
.push-badge.push-no { background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%); color: #fff; }
.push-warning { margin-top: 0.5rem; padding: 0.5rem 0.6rem; background: linear-gradient(135deg, rgba(255,193,7,0.15), rgba(255,152,0,0.1)); border-left: 3px solid #ff9800; border-radius: 6px; color: #e65100; font-size: 0.8rem; font-weight: 600; }

/* ── Log ────────────────────────────────────────────────────────── */
.log-box { max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 0.65rem; background: linear-gradient(180deg,#fbfdff 0%,#f7fbfe 100%); display: grid; gap: 0.45rem; }
.log-row { font-size: 0.9rem; border-left: 3px solid #99acc1; border-bottom: 1px solid var(--line-soft); padding-bottom: 0.32rem; padding-left: 0.5rem; color: #42586d; }
.log-row:last-child { border-bottom: 0; padding-bottom: 0; }

/* ── Admin ──────────────────────────────────────────────────────── */
.admin-create-user { display: grid; gap: 0.65rem; padding: 0.7rem; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(180deg,#fcfeff 0%,#f3f8fc 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,0.75); }
.admin-create-user-fields { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 0.5rem; }
.admin-create-user-fields label { display: grid; gap: 0.22rem; font-size: 0.8rem; font-weight: 700; color: #35506b; }
.admin-create-user-fields input { width: 100%; min-width: 0; padding: 0.55rem 0.68rem; font-size: 0.9rem; }
.admin-create-user-roles { display: grid; gap: 0.4rem; }
.admin-create-user-heading { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #506881; }
.admin-create-user-role-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0.5rem; }
.admin-create-user-note { font-size: 0.76rem; }
.admin-create-user-actions { display: flex; justify-content: flex-end; }
.admin-create-user-actions button { min-width: 132px; padding: 0.62rem 0.9rem; }
.role-option-card { position: relative; display: block; cursor: pointer; }
.role-option-card input { position: absolute; opacity: 0; pointer-events: none; }
.role-option-card-body { display: grid; gap: 0.16rem; min-height: 100%; padding: 0.58rem 0.7rem; border: 1px solid #cfdbe7; border-radius: 10px; background: linear-gradient(180deg,rgba(255,255,255,0.98) 0%,#eef5fb 100%); box-shadow: 0 6px 12px rgba(28,45,64,0.04); transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease; }
.role-option-card:hover .role-option-card-body { border-color: #8ea9c5; transform: translateY(-1px); }
.role-option-card input:checked + .role-option-card-body { border-color: #2d5a86; background: linear-gradient(180deg,#eef5fd 0%,#dfeaf6 100%); box-shadow: 0 8px 14px rgba(38,79,120,0.1); }
.role-option-card-admin input:checked + .role-option-card-body { border-color: #7c4a18; background: linear-gradient(180deg,#fff5e7 0%,#f9ead3 100%); box-shadow: 0 8px 14px rgba(154,106,33,0.11); }
.role-option-title { font-size: 0.88rem; font-weight: 800; color: #1f3851; }
.role-option-copy { font-size: 0.76rem; line-height: 1.32; color: #597086; }

/* ── Utilities ──────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Animations ─────────────────────────────────────────────────── */
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes drift {
  from { transform: translate3d(0,0,0); }
  to { transform: translate3d(20px,-16px,0); }
}
@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 rgba(55,93,134,0.35); }
  100% { box-shadow: 0 0 0 12px rgba(55,93,134,0); }
}

/* ── Toast (showMessage) ─────────────────────────────────────────── */
#app-message {
  position: fixed;
  bottom: 1.4rem;
  left: 50%;
  transform: translateX(-50%);
  background: #1c3352;
  color: #e8f4ff;
  padding: 0.65rem 1.2rem;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(18,36,60,0.28);
  z-index: 99999;
  pointer-events: none;
  animation: rise 0.25s ease;
  max-width: min(480px, 88vw);
  text-align: center;
}

/* ── Media queries ──────────────────────────────────────────────── */
@media (max-width: 980px) {
  .topbar { align-items: center; flex-direction: row; flex-wrap: wrap; gap: 0.5rem; padding: 0.55rem 0.75rem; }
  .topbar > div:first-child { min-width: 0; flex: 1 1 auto; }
  .topbar h2 { font-size: 0.95rem; margin: 0; line-height: 1.2; }
  .topbar p { font-size: 0.74rem; margin: 0; line-height: 1.2; }
  .topbar-actions { flex: 1 1 100%; width: 100%; min-width: 0; flex-wrap: wrap; justify-content: flex-end; gap: 0.35rem; }
  .topbar-actions button, .topbar-actions .decision-pill { font-size: 0.78rem; padding: 0.38rem 0.6rem; max-width: 100%; white-space: nowrap; }
  #logout-btn { margin-left: auto; }
  .tabs { overflow-x: auto; overflow-y: visible; flex-wrap: nowrap; scrollbar-width: none; -ms-overflow-style: none; padding: 0.28rem; margin: 0.6rem 0; gap: 0.22rem; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-btn { white-space: nowrap; flex-shrink: 0; padding: 0.42rem 0.72rem; font-size: 0.8rem; }
  .tab-btn.roster-tool-start { margin-left: 0; }
  .notification-panel { top: 72px; left: 0.9rem; right: 0.9rem; width: auto; }
  .grid-two { grid-template-columns: 1fr; }
  .grid-two > :first-child { border-right: 0; padding-right: 0; }
  .months-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .request-grid { grid-template-columns: 1fr; }
  .summary-main-compact { grid-template-columns: 1fr; gap: 0.15rem; }
  .summary-main-compact .summary-name, .summary-main-compact .summary-period, .summary-main-compact .summary-type { white-space: normal; overflow: visible; text-overflow: clip; }
  .request-meta { grid-template-columns: 1fr; }
  .request-meta > div, .request-meta > div:nth-child(odd) { border-left: 0; padding-left: 0; }
  .comment-input-lg { min-width: 0; width: 100%; }
  .edit-popup { left: auto; right: 0; width: 100%; }
  .date-row { grid-template-columns: 1fr; }
  .shell { padding: 1rem; }
  .admin-create-user-fields, .admin-create-user-role-grid { grid-template-columns: 1fr; }
  .admin-create-user-actions { justify-content: stretch; }
  .admin-create-user-actions button { width: 100%; }
  .decision-history-row { grid-template-columns: 1fr; gap: 0.2rem; white-space: normal; }
  .decision-history-status { justify-self: start; }
  .decision-history-name, .decision-history-period, .decision-history-type { white-space: normal; overflow: visible; text-overflow: clip; }
}

@media (max-width: 700px) {
  .topbar-actions { flex: 0 0 auto; width: auto; margin-left: auto; flex-wrap: nowrap; justify-content: flex-end; gap: 0.3rem; }
  .topbar-actions button, .topbar-actions .decision-pill { width: auto; min-width: 2.2rem; height: 2.2rem; padding: 0.35rem 0.45rem; border-radius: 999px; justify-content: center; }
  .action-icon { display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; line-height: 1; }
  .topbar-actions .action-label { display: none; }
  #notifications-btn, #logout-btn, #decision-pill { display: inline-flex; align-items: center; justify-content: center; }
  #notifications-btn { position: relative; }
  .notif-badge { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; font-size: 0.65rem; padding: 0 0.22rem; margin-left: 0; }
  #logout-btn { margin-left: 0; }
  .months-grid { grid-template-columns: repeat(1, minmax(0,1fr)); }
  .history-head { flex-direction: column; align-items: flex-start; gap: 0.2rem; }
  .history-time { white-space: normal; }
}

/* ── Login overlay ─────────────────────────────────────────────────────────── */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: hidden;
  background: linear-gradient(135deg, #080f1e 0%, #0e1f3d 40%, #132a55 70%, #0a1830 100%);
}
.login-overlay.hidden { display: none; }

/* Animated orbs */
.login-overlay::before {
  content: '';
  position: absolute;
  width: 520px; height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30,111,168,0.35) 0%, transparent 68%);
  top: -210px; left: -160px;
  animation: leave-orb-a 14s ease-in-out infinite alternate;
  pointer-events: none;
}
.login-overlay::after {
  content: '';
  position: absolute;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(48,165,210,0.20) 0%, transparent 68%);
  bottom: -170px; right: -110px;
  animation: leave-orb-b 18s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes leave-orb-a {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(30px,20px) scale(1.12); }
}
@keyframes leave-orb-b {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(-22px,28px) scale(1.08); }
}

/* Glass card */
.login-card {
  position: relative;
  z-index: 1;
  background: linear-gradient(145deg, rgba(255,255,255,0.13) 0%, rgba(255,255,255,0.07) 100%);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 24px;
  box-shadow: 0 32px 72px rgba(0,0,0,0.48), inset 0 1px 0 rgba(255,255,255,0.22);
  backdrop-filter: blur(36px) saturate(180%);
  -webkit-backdrop-filter: blur(36px) saturate(180%);
  padding: 2.4rem 2.2rem 2rem;
  width: 100%;
  max-width: 400px;
}

/* Logo mark */
.login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px; height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1e6fa8 0%, #38b0e0 100%);
  box-shadow: 0 8px 24px rgba(30,111,168,0.50), inset 0 1px 0 rgba(255,255,255,0.28);
  margin: 0 0 1.1rem;
}
.login-logo svg {
  width: 28px; height: 28px;
  color: #fff; fill: none;
  stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

.login-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #f0f7ff;
  margin: 0 0 0.3rem;
  letter-spacing: -0.02em;
}
.login-subtitle {
  font-size: 0.88rem;
  color: rgba(190,215,242,0.75);
  margin: 0 0 1.5rem;
}

/* Override form inputs inside login overlay to match dark theme */
.login-card input[type="text"],
.login-card input[type="password"] {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.16);
  color: #f0f7ff;
}
.login-card input[type="text"]::placeholder,
.login-card input[type="password"]::placeholder { color: rgba(150,185,220,0.45); }
.login-card input[type="text"]:focus,
.login-card input[type="password"]:focus {
  border-color: rgba(60,160,230,0.65);
  background: rgba(255,255,255,0.12);
  box-shadow: 0 0 0 3px rgba(30,111,168,0.28);
}
.login-card label { color: rgba(210,230,250,0.88); }
.login-card .pw-toggle { color: rgba(150,190,225,0.6); }
.login-card .pw-toggle:hover { color: rgba(210,238,255,0.95); }

/* Submit button */
.login-card button[type="submit"] {
  background: linear-gradient(135deg, #1e6fa8 0%, #2a90d8 100%);
  box-shadow: 0 4px 18px rgba(30,111,168,0.45), inset 0 1px 0 rgba(255,255,255,0.22);
  transition: opacity .15s, transform .1s, box-shadow .15s;
}
.login-card button[type="submit"]:hover {
  opacity: 0.92;
  box-shadow: 0 6px 22px rgba(30,111,168,0.55), inset 0 1px 0 rgba(255,255,255,0.22);
  background: linear-gradient(135deg, #1e6fa8 0%, #2a90d8 100%);
}

.login-error {
  font-size: 0.87rem;
  color: #fca5a5;
  background: rgba(220,38,38,0.15);
  border: 1px solid rgba(248,113,113,0.32);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  margin: 0;
}
.login-error.hidden { display: none; }

/* ── Apply-to-Roster Preview Modal ────────────────────────────────────────── */
.atr-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10500;
  background: rgba(8, 18, 40, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.atr-modal {
  background: rgba(244,249,255,0.97);
  border: 1px solid rgba(180,210,240,0.6);
  box-shadow: 0 28px 72px rgba(10,26,60,0.30), inset 0 1px 0 rgba(255,255,255,0.9);
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  border-radius: 18px;
  width: min(700px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.atr-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.1rem 0.75rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.6);
  flex-shrink: 0;
}
.atr-initials {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e6fa8, #38b0e0);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(30,111,168,0.35);
}
.atr-header-info { flex: 1; min-width: 0; }
.atr-header-name { font-weight: 700; font-size: 0.97rem; }
.atr-header-sub  { font-size: 0.8rem; color: #64748b; margin-top: 0.1rem; }
.atr-header-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 0;
  background: rgba(0,0,0,0.07);
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.atr-header-close:hover { background: rgba(0,0,0,0.14); }
.atr-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.6rem 0.75rem;
}
.atr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.atr-table th {
  padding: 0.38rem 0.55rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #334155;
  border-bottom: 2px solid rgba(0,0,0,0.12);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: rgba(234,242,252,0.98);
  z-index: 1;
}
.atr-table td {
  padding: 0.34rem 0.45rem;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  vertical-align: middle;
  text-align: center;
}
.atr-table tbody tr:nth-child(even) td { background: rgba(0,0,0,0.022); }
.atr-table tr:last-child td { border-bottom: 0; }
.atr-td-date {
  text-align: left;
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.8rem;
  border-right: 1px solid rgba(0,0,0,0.08);
  padding-left: 0.6rem;
  width: 72px;
  max-width: 72px;
}
.atr-td-date-inner { display: flex; flex-direction: column; gap: 1px; }
.atr-td-date-day  { font-weight: 700; color: #334155; }
.atr-td-date-dmy  { font-size: 0.73rem; color: #64748b; font-weight: 500; }
.atr-td-session {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #334155;
  border-right: 1px solid rgba(0,0,0,0.08);
  width: 2.6rem;
}
.atr-td-metric { width: 3.4rem; font-weight: 700; }
.atr-td-current {
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
  width: 5.5rem;
}
.atr-td-current.code-leave { color: #92400e; font-weight: 700; }
.atr-td-current.code-off   { color: #9f1239; font-weight: 700; }
.atr-td-current.code-clinical { color: #1e3a8a; font-weight: 700; }
.atr-td-current.code-empty { color: #94a3b8; font-style: italic; font-weight: 400; font-size: 0.75rem; }
.atr-td-after { width: 7.5rem; }
.atr-td-after select {
  width: 100%;
  font-size: 0.78rem;
  padding: 0.22rem 0.3rem;
  border-radius: 6px;
  border: 1px solid rgba(100,140,200,0.4);
  background: rgba(255,255,255,0.95);
  cursor: pointer;
  font-family: inherit;
  color: #1e3a5f;
  font-weight: 600;
}
.atr-td-after select:focus { outline: 2px solid #3b82f6; border-color: #3b82f6; }
.atr-td-after--off select { background: rgba(100,116,139,0.12); }
.atr-td-after.locked {
  color: #94a3b8;
  font-style: italic;
  font-size: 0.77rem;
}
/* Week separator row */
.atr-week-sep td {
  background: linear-gradient(90deg, rgba(59,130,246,0.08), rgba(59,130,246,0.03));
  font-size: 0.73rem;
  font-weight: 700;
  color: #3b82f6;
  padding: 0.28rem 0.6rem;
  text-align: left;
  letter-spacing: 0.03em;
  border-bottom: 1px solid rgba(59,130,246,0.15);
}
/* Row state striping for outside-range rows */
.atr-row-out-of-range { opacity: 0.5; }
.atr-row-locked td { background: rgba(0,0,0,0.018); }
/* Avail colour classes (mirrors styles.css metric-avail-*) */
.atr-avail-good { background: #d1fae5 !important; color: #065f46 !important; font-weight: 700; border-radius: 5px; }
.atr-avail-warn { background: #fed7aa !important; color: #9a3412 !important; font-weight: 700; border-radius: 5px; }
.atr-avail-zero { background: #fee2e2 !important; color: #991b1b !important; font-weight: 700; border-radius: 5px; }
.atr-avail-neg  { background: #7f1d1d !important; color: #fecaca !important; font-weight: 700; border-radius: 5px; }
.atr-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  padding: 0.75rem 1.1rem;
  border-top: 1px solid rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.6);
  flex-shrink: 0;
}
.atr-footer-note { flex: 1; font-size: 0.77rem; color: #475569; }

/* ── Impact bar (request card, visible without opening) ──────────────────────── */
.impact-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}
.impact-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  width: 72px;
  flex-shrink: 0;
  gap: 1px;
  background: rgba(0,0,0,0.07);
}
.impact-bar-seg { height: 100%; transition: flex 0.2s; }
.impact-bar-seg.good { background: #10b981; }
.impact-bar-seg.warn { background: #f59e0b; }
.impact-bar-seg.zero { background: #ef4444; }
.impact-bar-seg.neg  { background: #7f1d1d; }
.impact-label {
  font-size: 0.71rem;
  color: #64748b;
}
.impact-label.has-risk { color: #991b1b; font-weight: 600; }
.impact-loading { font-size: 0.7rem; color: #94a3b8; }

/* ── Peer conflict badge (request card) ─────────────────────────────────────── */
.peer-conflicts {
  font-size: 0.71rem;
  color: #92400e;
  background: #fef3c7;
  border-radius: 4px;
  padding: 0.12rem 0.42rem;
  margin-top: 0.15rem;
  display: inline-block;
}

/* ── Modal impact summary panel ─────────────────────────────────────────────── */
.atr-impact-panel {
  padding: 0.6rem 1.1rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  background: rgba(248,250,252,0.9);
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.atr-impact-left {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  flex: 1;
  min-width: 180px;
}
.atr-impact-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #64748b;
}
.atr-impact-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  width: 150px;
  gap: 1.5px;
  background: rgba(0,0,0,0.06);
}
.atr-impact-bar-seg { height: 100%; transition: flex 0.2s; }
.atr-impact-bar-seg.good { background: #10b981; }
.atr-impact-bar-seg.warn { background: #f59e0b; }
.atr-impact-bar-seg.zero { background: #ef4444; }
.atr-impact-bar-seg.neg  { background: #7f1d1d; }
.atr-impact-text {
  font-size: 0.77rem;
  color: #334155;
}
.atr-impact-text.risk { color: #991b1b; font-weight: 600; }
.atr-impact-conflicts {
  font-size: 0.73rem;
  color: #92400e;
  background: #fef3c7;
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  display: inline-block;
  margin-top: 0.1rem;
}

/* ── AI assessment panel (inside modal, below impact panel) ─────────────────── */
.atr-ai-panel {
  padding: 0.7rem 1.1rem;
  font-size: 0.82rem;
  color: #334155;
  line-height: 1.6;
  background: rgba(239,246,255,0.7);
  border-bottom: 1px solid rgba(59,130,246,0.12);
  white-space: pre-wrap;
  flex-shrink: 0;
}
.atr-ai-loading { color: #64748b; font-style: italic; }

/* ── Dark mode additions ─────────────────────────────────────────────────────── */
