/* ================================================================
   AFLAN CARE — ACMS Design System
   A calm, clinical-professional visual language for a UK domiciliary
   & complex care provider. Built around the one thing this system
   actually manages: rota'd time — shifts, visits, expiries, clock
   in/outs. That idea shows up as the "rota strip" motif used in the
   hero, section dividers and card accents throughout.
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  /* ---- Palette — sampled from the real Aflan Care logo (navy + green),
     set against crisp, cool neutrals in the spirit of Stripe/Linear/Notion. ---- */
  --paper:        #F7F8FA;
  --surface:      #FFFFFF;
  --surface-2:    #EEF1F5;
  --ink:          #0B1220;
  --ink-soft:     #4B5565;
  --ink-faint:    #8A94A6;
  --line:         #E3E7EE;
  --line-soft:    #ECEFF3;

  --primary:      #0E2A57;
  --primary-600:  #16407F;
  --primary-dark: #081A3B;
  --primary-tint: #EAF0FA;

  --accent:       #2E7D32;
  --accent-dark:  #1F5D24;
  --accent-tint:  #E7F5E8;

  --info:         #2A5DAA;
  --info-tint:    #E9EFFA;

  --success:      #2E7D32;
  --success-tint: #E7F5E8;

  --warning:      #B8863E;
  --warning-tint: #F5EAD6;

  --danger:       #C0392B;
  --danger-tint:  #FBEAE8;

  /* ---- Type ---- */
  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body:    'Inter', 'Segoe UI', -apple-system, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, 'Courier New', monospace;

  /* ---- Radius / shadow ---- */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(11, 18, 32, 0.05);
  --shadow:    0 6px 20px rgba(11, 18, 32, 0.07);
  --shadow-lg: 0 20px 48px rgba(11, 18, 32, 0.14);

  /* ---- Spacing scale (kept compatible with existing p-*/m-* markup) ---- */
  --sp-0: 0;
  --sp-1: .25rem;
  --sp-2: .5rem;
  --sp-3: 1rem;
  --sp-4: 1.5rem;
  --sp-5: 3rem;

  /* ---- Legacy aliases (older inline styles reference these names) ---- */
  --acms-navy: var(--primary-dark);
  --acms-blue: var(--primary-600);
  --acms-blue-light: var(--primary-tint);
  --acms-green: var(--accent);
  --acms-green-light: var(--accent-tint);
  --acms-grey: var(--paper);
  --acms-text: var(--ink);
}

/* ================= Reset & base ================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--primary-dark);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 .5rem;
  letter-spacing: -.01em;
}

p { margin: 0 0 1rem; }
a { color: var(--primary-600); text-decoration: none; }
a:hover { color: var(--primary-dark); }
hr { border: none; border-top: 1px solid var(--line); margin: 1.5rem 0; }

::selection { background: var(--accent-tint); color: var(--primary-dark); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

img { max-width: 100%; display: block; }

code, .mono { font-family: var(--font-mono); }

.icon-inline { width: 14px; height: 14px; vertical-align: -2px; display: inline-block; }

/* ================= Layout: container & grid ================= */
.container { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 1.25rem; }

.row {
  display: flex;
  flex-wrap: wrap;
  margin-inline: -.75rem;
}
.row > [class*="col"] { padding-inline: .75rem; width: 100%; }

.g-2 { margin-inline: -.5rem; } .g-2 > [class*="col"] { padding-inline: .5rem; row-gap: 1rem; }
.g-3 { margin-inline: -.6rem; } .g-3 > [class*="col"] { padding-inline: .6rem; row-gap: 1.25rem; }
.g-4 { margin-inline: -.75rem; } .g-4 > [class*="col"] { padding-inline: .75rem; row-gap: 1.75rem; }

.col-6  { width: 50%; }
.col-12 { width: 100%; }

@media (min-width: 768px) {
  .col-md-2 { width: 16.6667%; }
  .col-md-3 { width: 25%; }
  .col-md-4 { width: 33.3333%; }
  .col-md-5 { width: 41.6667%; }
  .col-md-6 { width: 50%; }
  .d-md-none { display: none !important; }
}
@media (min-width: 992px) {
  .col-lg-4 { width: 33.3333%; }
  .col-lg-5 { width: 41.6667%; }
  .col-lg-6 { width: 50%; }
  .col-lg-7 { width: 58.3333%; }
  .col-lg-8 { width: 66.6667%; }
}

/* ================= Flex & spacing utilities ================= */
.d-flex { display: flex; }
.d-grid { display: grid; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-none { display: none !important; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-fill { flex: 1 1 auto; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.flex-grow-1 { flex-grow: 1; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: 1rem; }
.w-100 { width: 100%; }
.h-100 { height: 100%; }
.mx-auto { margin-inline: auto; }
.mt-auto { margin-top: auto; }

.p-0 { padding: 0; } .p-3 { padding: 1rem; } .p-4 { padding: 1.5rem; }
.px-0 { padding-inline: 0; } .px-2 { padding-inline: .5rem; } .px-3 { padding-inline: 1rem; } .px-4 { padding-inline: 1.5rem; }
.pt-1 { padding-top: .25rem; }
.py-3 { padding-block: 1rem; } .py-5 { padding-block: 3rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .25rem; } .mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: 1rem; } .mb-4 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: .25rem; } .mt-2 { margin-top: .5rem; } .mt-3 { margin-top: 1rem; } .mt-4 { margin-top: 1.5rem; }
.ms-lg-2 { }
@media (min-width: 992px) { .ms-lg-2 { margin-left: .5rem; } }

/* ================= Type utilities ================= */
.small { font-size: .84rem; }
.lead { font-size: 1.15rem; color: var(--ink-soft); }
.display-4 { font-family: var(--font-display); font-size: clamp(2.1rem, 4vw, 3.1rem); font-weight: 600; letter-spacing: -.02em; }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.fw-normal { font-weight: 400; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.text-uppercase { text-transform: uppercase; letter-spacing: .06em; }
.text-capitalize { text-transform: capitalize; }
.text-decoration-none { text-decoration: none; }
.text-muted { color: var(--ink-faint); }
.text-secondary { color: var(--ink-soft); }
.text-dark { color: var(--ink); }
.text-white { color: #fff; }
.text-white-50 { color: rgba(255,255,255,.62); }

/* ================= Buttons ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .88rem;
  padding: .62rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, color .15s ease, border-color .15s ease;
  line-height: 1.2;
  background: var(--primary);
  color: #fff;
}
.btn:hover { background: var(--primary-600); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-sm { padding: .4rem .8rem; font-size: .8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: .85rem 1.6rem; font-size: 1rem; border-radius: var(--radius); }

.btn-cta { background: var(--accent); color: #fff; }
.btn-cta:hover { background: var(--accent-dark); color: #fff; }

.btn-outline-primary { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }

.btn-outline-secondary { background: transparent; border-color: var(--line); color: var(--ink-soft); }
.btn-outline-secondary:hover { background: var(--surface-2); color: var(--ink); }

.btn-outline-light { background: transparent; border-color: rgba(255,255,255,.5); color: #fff; }
.btn-outline-light:hover { background: rgba(255,255,255,.12); color: #fff; }

.btn-outline-success { background: transparent; border-color: var(--success); color: var(--success); }
.btn-outline-success:hover { background: var(--success); color: #fff; }

.btn-outline-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger); color: #fff; }

/* ================= Forms ================= */
.form-label { display: block; font-weight: 600; font-size: .84rem; color: var(--ink); margin-bottom: .4rem; }

.form-control, .form-select {
  width: 100%;
  font-family: var(--font-body);
  font-size: .92rem;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .65rem .85rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary-600);
  box-shadow: 0 0 0 4px var(--primary-tint);
}
.form-control::placeholder { color: var(--ink-faint); }
.form-control-sm, .form-select-sm { padding: .45rem .65rem; font-size: .84rem; }
textarea.form-control { resize: vertical; min-height: 6rem; }

select.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2352655F' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .85rem center;
  padding-right: 2.2rem;
}

input[type="file"].form-control { padding: .5rem .7rem; }

.input-group { display: flex; }
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group-sm .form-control { padding: .45rem .65rem; font-size: .84rem; }

/* ================= Cards & panels ================= */
.card-panel {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.kpi-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  border-top: 3px solid var(--primary);
  box-shadow: var(--shadow-sm);
  padding: 1.15rem 1.3rem;
  transition: transform .18s ease, box-shadow .18s ease;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.kpi-card.green { border-top-color: var(--success); }
.kpi-card .kpi-value { font-family: var(--font-mono); font-size: 1.9rem; font-weight: 600; color: var(--primary-dark); }
.kpi-card .kpi-label { font-size: .74rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }

/* ================= Dashboard v2 — hero stats, bar chart, tx list ================= */
.dash-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 1.1rem;
}
.dash-stat-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.35rem 1.4rem 1.15rem;
  transition: transform .18s ease, box-shadow .18s ease;
}
.dash-stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.dash-stat-top { display: flex; align-items: center; gap: 1rem; }
.dash-stat-ring {
  --ring-color: var(--primary);
  width: 52px; height: 52px; border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  background: conic-gradient(var(--ring-color) 0deg 255deg, var(--line-soft) 255deg 360deg);
}
.dash-stat-ring::before {
  content: ''; position: absolute; inset: 5px;
  border-radius: 50%; background: var(--surface);
}
.dash-stat-ring svg { position: relative; width: 19px; height: 19px; color: var(--ring-color); }
.dash-stat-ring.green { --ring-color: var(--accent); }
.dash-stat-ring.blue  { --ring-color: var(--info); }
.dash-stat-ring.amber { --ring-color: var(--warning); }

.dash-stat-text { min-width: 0; }
.dash-stat-text .dash-stat-value { font-family: var(--font-mono); font-size: 1.65rem; font-weight: 700; color: var(--primary-dark); line-height: 1.15; white-space: nowrap; }
.dash-stat-text .dash-stat-label { font-size: .8rem; color: var(--ink-faint); margin-top: .1rem; }

.dash-stat-footer {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  margin-top: 1.05rem; padding-top: .85rem;
  border-top: 1px solid var(--line-soft);
}
.dash-stat-footer a.dash-stat-link { font-size: .8rem; font-weight: 600; color: var(--primary-600); display: inline-flex; align-items: center; gap: .3rem; }
.dash-stat-footer a.dash-stat-link:hover { color: var(--primary-dark); }
.dash-stat-footer a.dash-stat-link svg { width: 13px; height: 13px; }

.dash-badge {
  font-size: .7rem; font-weight: 700; padding: .22rem .55rem;
  border-radius: var(--radius-pill);
  background: var(--success-tint); color: var(--success);
  white-space: nowrap;
}
.dash-badge.neutral { background: var(--surface-2); color: var(--ink-soft); }
.dash-badge.amber { background: var(--warning-tint); color: var(--warning); }
.dash-badge.blue { background: var(--info-tint); color: var(--info); }

/* ---- bar chart card ---- */
.dash-chart-card { display: flex; flex-direction: column; height: 100%; }
.dash-bargraph {
  display: flex; align-items: flex-end; gap: 1.5rem;
  height: 210px; padding: .5rem .25rem 0;
}
.dash-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .55rem; height: 100%; justify-content: flex-end; }
.dash-bar-track { flex: 1; width: 100%; max-width: 58px; display: flex; align-items: flex-end; }
.dash-bar-fill {
  width: 100%;
  border-radius: 16px;
  background: var(--bar-color, var(--primary-600));
  min-height: 10px;
  transition: height .7s cubic-bezier(.2,.8,.2,1);
}
.dash-bar-col .dash-bar-num { font-size: .74rem; font-weight: 700; color: var(--ink-soft); font-family: var(--font-mono); }
.dash-bar-col .dash-bar-label { font-size: .78rem; color: var(--ink-faint); font-weight: 600; text-align: center; }

/* ---- transactions / list-style side panel ---- */
.dash-tx-list { display: flex; flex-direction: column; }
.dash-tx-item {
  display: flex; align-items: center; gap: .85rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.dash-tx-item:last-child { border-bottom: none; }
.dash-tx-icon {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--icon-bg, var(--primary-tint)); color: var(--icon-fg, var(--primary));
}
.dash-tx-icon svg { width: 17px; height: 17px; }
.dash-tx-body { flex: 1; min-width: 0; }
.dash-tx-title { font-size: .8rem; color: var(--ink-faint); }
.dash-tx-value { font-size: .9rem; font-weight: 700; color: var(--primary-dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-tx-viewall {
  margin-top: 1rem; width: 100%;
  background: var(--primary-dark); color: #fff;
  border: none; border-radius: var(--radius-pill);
  padding: .68rem 1rem; font-weight: 600; font-size: .84rem;
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  text-decoration: none;
  transition: background-color .15s ease;
}
.dash-tx-viewall:hover { background: var(--primary-600); color: #fff; }
.dash-tx-viewall svg { width: 15px; height: 15px; }

@media (max-width: 575.98px) {
  .dash-bargraph { gap: .7rem; height: 175px; }
  .dash-stat-text .dash-stat-value { font-size: 1.4rem; }
}

/* ================= Tables ================= */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--line-soft); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: .88rem; margin: 0; }
table.table thead { background: var(--primary-tint); }
table.table thead th {
  position: sticky; top: 0;
  text-align: left;
  font-family: var(--font-body);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  color: var(--primary-dark);
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.table tbody td {
  padding: .8rem 1.1rem;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  vertical-align: middle;
}
table.table tbody tr:last-child td { border-bottom: none; }
table.table.table-hover tbody tr { transition: background-color .12s ease; }
table.table.table-hover tbody tr:hover { background: var(--surface-2); }
table.table tbody tr:nth-child(even) { background: rgba(234, 239, 236, .45); }
table.table.table-sm td, table.table.table-sm th { padding: .55rem .8rem; }
.align-middle { vertical-align: middle; }

/* ================= Badges / status pills ================= */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: .72rem;
  font-weight: 700;
  padding: .28rem .6rem;
  border-radius: var(--radius-pill);
  letter-spacing: .02em;
}
.bg-light { background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line); }
.bg-danger { background: var(--danger); color: #fff; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .7rem .3rem .55rem;
  border-radius: var(--radius-pill);
  font-size: .74rem;
  font-weight: 600;
  text-transform: capitalize;
}
.status-pill::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.status-pill.scheduled, .status-pill.submitted, .status-pill.pending, .status-pill.new, .status-pill.open { background: var(--warning-tint); color: var(--warning); }
.status-pill.accepted, .status-pill.completed, .status-pill.hired, .status-pill.active, .status-pill.approved, .status-pill.fulfilled, .status-pill.available { background: var(--success-tint); color: var(--success); }
.status-pill.rejected, .status-pill.cancelled, .status-pill.missed, .status-pill.inactive, .status-pill.suspended, .status-pill.unavailable { background: var(--danger-tint); color: var(--danger); }
.status-pill.under_review, .status-pill.shortlisted, .status-pill.interview, .status-pill.reference_check, .status-pill.in_progress, .status-pill.contacted, .status-pill.received, .status-pill.swap_requested, .status-pill.on_leave { background: var(--info-tint); color: var(--info); }

/* ================= Alerts ================= */
.alert { border-radius: var(--radius); padding: .85rem 1.1rem; margin-bottom: 1.1rem; border: 1px solid transparent; font-size: .9rem; }
.alert-success { background: var(--success-tint); color: var(--success); border-color: rgba(46,125,91,.25); }
.alert-warning { background: var(--warning-tint); color: var(--warning); border-color: rgba(184,134,62,.25); }
.alert-info { background: var(--info-tint); color: var(--info); border-color: rgba(42,93,170,.25); }
.alert-danger { background: var(--danger-tint); color: var(--danger); border-color: rgba(173,70,56,.25); }
.alert-light { background: var(--surface-2); color: var(--ink-soft); }

/* ================= List group ================= */
.list-group { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-soft); }
.list-group-item { padding: .85rem 1.1rem; border-bottom: 1px solid var(--line-soft); background: var(--surface); }
.list-group-item:last-child { border-bottom: none; }
.list-group-flush { border: none; border-radius: 0; }
.list-unstyled { list-style: none; padding: 0; margin: 0; }

/* ================= Positioning helpers ================= */
.position-relative { position: relative; }
.position-absolute { position: absolute; }
.top-0 { top: 0; } .start-100 { left: 100%; }
.translate-middle { transform: translate(-50%, -50%); }
.rounded-circle { border-radius: 50%; }
.rounded-pill { border-radius: var(--radius-pill); }
.border { border: 1px solid var(--line); }
.border-secondary { border-color: rgba(255,255,255,.15) !important; }

/* ================================================================
   SIGNATURE MOTIF — the rota strip
   A row of ticks representing a 24hr day, used wherever the brand
   needs a moment of identity: hero, dividers, loading states.
   ================================================================ */
.rota-strip {
  display: flex;
  gap: 3px;
  height: 34px;
  align-items: flex-end;
}
.rota-strip span {
  flex: 1;
  border-radius: 3px 3px 1px 1px;
  background: rgba(255,255,255,.16);
  animation: rota-pulse 3.6s ease-in-out infinite;
}
.rota-strip span:nth-child(odd) { background: rgba(255,255,255,.28); }
.rota-strip.on-light span { background: var(--line); }
.rota-strip.on-light span:nth-child(odd) { background: var(--primary-tint); }
@keyframes rota-pulse {
  0%, 100% { transform: scaleY(.4); opacity: .55; }
  50% { transform: scaleY(1); opacity: 1; }
}
.rota-strip span:nth-child(1){animation-delay:.0s}.rota-strip span:nth-child(2){animation-delay:.15s}
.rota-strip span:nth-child(3){animation-delay:.3s}.rota-strip span:nth-child(4){animation-delay:.45s}
.rota-strip span:nth-child(5){animation-delay:.6s}.rota-strip span:nth-child(6){animation-delay:.75s}
.rota-strip span:nth-child(7){animation-delay:.9s}.rota-strip span:nth-child(8){animation-delay:1.05s}
.rota-strip span:nth-child(9){animation-delay:1.2s}.rota-strip span:nth-child(10){animation-delay:1.35s}
.rota-strip span:nth-child(11){animation-delay:1.5s}.rota-strip span:nth-child(12){animation-delay:1.65s}

/* ================= Public site ================= */
.site-navbar {
  background: rgba(242, 245, 243, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding-block: .85rem;
}
.site-navbar .container { flex-wrap: nowrap; gap: .5rem; }
.site-navbar .navbar-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary-dark);
  min-width: 0;
  flex-shrink: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.site-nav-links { display: none; align-items: center; gap: 1.9rem; }
.site-nav-links a.nav-link { color: var(--ink-soft); font-weight: 500; font-size: .92rem; padding: 0; }
.site-nav-links a.nav-link:hover, .site-nav-links a.nav-link.active { color: var(--primary-dark); }
.site-nav-actions { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.navbar-toggler { border: 1px solid #dc2626; background: #dc2626; color: #fff; border-radius: var(--radius-sm); padding: .4rem .6rem; cursor: pointer; flex-shrink: 0; }
@media (min-width: 992px) {
  .navbar-toggler { display: none; }
  .site-nav-links { display: flex; }
}
.nav-login-btn { display: inline-flex; }
.site-nav-mobile { display: none; flex-direction: column; gap: .25rem; padding: 1rem 0 .25rem; border-top: 1px solid var(--line); margin-top: .85rem; }
.site-nav-mobile.open { display: flex; }
.site-nav-mobile a { padding: .5rem .1rem; color: var(--ink-soft); font-weight: 500; }
@media (min-width: 992px) { .site-nav-mobile { display: none !important; } }

/* Compact header on phones so brand + Login + Apply Now + menu button all fit */
@media (max-width: 479.98px) {
  .site-navbar { padding-block: .6rem; }
  .site-navbar .navbar-brand { font-size: 1rem; }
  .navbar-logo-img { max-height: 34px; max-width: 110px; }
  .site-nav-actions { gap: .35rem; }
  .site-nav-actions .btn { padding: .45rem .55rem; font-size: .72rem; }
  .navbar-toggler { padding: .35rem .5rem; }
}
@media (min-width: 480px) and (max-width: 767.98px) {
  .navbar-logo-img { max-height: 46px; max-width: 150px; }
}

.hero {
  position: relative;
  background: radial-gradient(120% 140% at 100% 0%, var(--primary-600) 0%, var(--primary) 45%, var(--primary-dark) 100%);
  color: #fff;
  padding: 4.5rem 0 5.5rem;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: .5;
  pointer-events: none;
}
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono);
  font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent-tint);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  padding: .35rem .8rem;
  border-radius: var(--radius-pill);
  margin-bottom: 1.25rem;
}
.hero h1 { color: #fff; font-size: clamp(2.3rem, 4.4vw, 3.4rem); max-width: 16ch; }
.hero p.lead { color: rgba(255,255,255,.78); max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 1.75rem; }
.hero-rota { margin-top: 3rem; max-width: 480px; }
.hero-rota .rota-caption { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: .7rem; color: rgba(255,255,255,.5); margin-top: .5rem; }

/* ---- Hero photo variant (home page) + "Get In Touch" glass card ---- */
.hero-photo { background-color: var(--primary-dark); padding-bottom: 4.5rem; }
.hero-photo::before { display: none; }

.git-card {
  position: relative;
  margin-left: auto;
  width: 100%;
  max-width: 380px;
  background: rgba(20, 32, 56, .46);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 1.75rem 1.6rem;
  color: #fff;
}
.git-card-header { display: flex; align-items: center; gap: .85rem; margin-bottom: 1.3rem; }
.git-card-icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center;
}
.git-card-icon svg { width: 20px; height: 20px; }
.git-card-header h3 { font-size: 1.15rem; font-weight: 700; color: #fff; margin: 0; }
.git-card-header p { font-size: .82rem; color: rgba(255,255,255,.72); margin: .1rem 0 0; }

.git-form { display: flex; flex-direction: column; }
.git-field {
  position: relative;
  border-bottom: 1px solid rgba(255,255,255,.28);
  padding: .7rem .1rem .7rem 1.7rem;
  transition: border-color .15s ease;
}
.git-field:focus-within { border-color: var(--accent); }
.git-field-icon {
  position: absolute; left: 0; top: .95rem;
  width: 16px; height: 16px; color: rgba(255,255,255,.62);
  display: flex; pointer-events: none;
}
.git-field-icon svg { width: 16px; height: 16px; }
.git-field input,
.git-field textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--font-body);
  font-size: .92rem;
  padding: 0;
  resize: none;
}
.git-field input::placeholder,
.git-field textarea::placeholder { color: rgba(255,255,255,.62); }
.git-field-textarea { padding-top: .8rem; }
.git-field-textarea .git-field-icon { top: 1rem; }

.git-feedback { font-size: .82rem; margin-top: .9rem; min-height: 0; line-height: 1.4; }
.git-feedback.is-success { color: #B9F0C4; }
.git-feedback.is-error { color: #FFC4BC; }

.git-submit {
  width: 100%;
  margin-top: 1.25rem;
  display: flex; align-items: center; justify-content: center; gap: .55rem;
}
.git-submit-icon { width: 17px; height: 17px; }
.git-submit-spinner {
  display: none;
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: git-spin .7s linear infinite;
}
.git-submit.is-loading .git-submit-spinner { display: inline-block; }
.git-submit.is-loading .git-submit-icon { display: none; }
.git-submit:disabled { opacity: .75; cursor: not-allowed; transform: none; }
@keyframes git-spin { to { transform: rotate(360deg); } }

.git-field.has-error { border-color: #FF8A7A; }

@media (max-width: 991.98px) {
  .git-card { max-width: 100%; margin-top: 1rem; }
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent-dark);
  font-weight: 600;
  margin-bottom: .5rem;
  display: block;
}

.stat-strip { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat-item { text-align: center; padding: 2rem 1rem; }
.stat-item .stat-value { font-family: var(--font-mono); font-size: 2.1rem; font-weight: 600; color: var(--primary-dark); }
.stat-item .stat-label { font-size: .78rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; margin-top: .3rem; }

.service-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  height: 100%;
  padding: 1.9rem 1.6rem;
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--primary-tint); }
.service-card .service-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius-sm);
  background: var(--primary-tint);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.1rem;
}
.service-card .service-icon svg { width: 22px; height: 22px; }

.photo-card {
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line-soft);
  aspect-ratio: 4 / 3;
}
.photo-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-card.tall { aspect-ratio: 3 / 4; }

.site-footer { background: var(--primary-dark); color: rgba(255,255,255,.68); padding: 3.5rem 0 1.75rem; }
.site-footer h5, .site-footer h6 { color: #fff; font-family: var(--font-display); }
.site-footer h6 { font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; margin-bottom: .9rem; }
.site-footer a { color: rgba(255,255,255,.68); }
.site-footer a:hover { color: #fff; }
.site-footer ul li { margin-bottom: .5rem; }

/* ================= Auth: split screen ================= */
.auth-shell { min-height: 100vh; display: flex; }
.auth-side {
  display: none;
  position: relative;
  flex: 1 1 46%;
  background: radial-gradient(120% 120% at 0% 0%, var(--primary-600) 0%, var(--primary-dark) 70%);
  color: #fff;
  padding: 3rem;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.auth-side::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 24px 24px;
}
@media (min-width: 992px) { .auth-side { display: flex; } }
.auth-side .brand { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; position: relative; z-index: 1; }
.auth-side blockquote { position: relative; z-index: 1; font-size: 1.4rem; font-family: var(--font-display); line-height: 1.35; max-width: 30ch; }
.auth-side .quote-attr { font-size: .82rem; color: rgba(255,255,255,.6); margin-top: 1rem; }

.auth-form-side {
  flex: 1 1 54%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  background: var(--paper);
}
.auth-card { width: 100%; max-width: 400px; }
.auth-card.auth-card--wide { max-width: 640px; }
.auth-card .auth-title { font-size: 1.7rem; margin-bottom: .3rem; }
.auth-card .auth-sub { color: var(--ink-faint); margin-bottom: 1.75rem; font-size: .92rem; }

.reg-step-indicator { display: flex; align-items: center; gap: .5rem; font-size: .8rem; font-weight: 600; color: var(--ink-faint); }
.reg-step { padding: .2rem .6rem; border-radius: 999px; background: var(--surface-2); }
.reg-step.active { background: var(--primary); color: #fff; }
.reg-step-sep { color: var(--ink-faint); }

.doc-req-group { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.doc-req-group h6 { margin-bottom: .6rem; display: flex; align-items: center; gap: .4rem; }
.doc-req-group .req-asterisk { color: var(--danger); }
.doc-or-divider { display: flex; align-items: center; gap: .6rem; margin: .7rem 0; color: var(--ink-faint); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.doc-or-divider::before, .doc-or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.radio-pill-group { display: flex; gap: .6rem; }
.radio-pill { flex: 1; position: relative; }
.radio-pill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.radio-pill span {
  display: block; text-align: center; padding: .6rem .5rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); font-weight: 600; font-size: .88rem; color: var(--ink-soft);
  transition: all .15s ease;
}
.radio-pill input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.radio-pill input:focus-visible + span { box-shadow: 0 0 0 3px rgba(0,0,0,.08); }

.field-icon-wrap { position: relative; }
.field-icon-wrap .form-control { padding-left: 2.6rem; }
.field-icon-wrap svg.field-icon {
  position: absolute; left: .85rem; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--ink-faint); pointer-events: none;
}
.field-icon-wrap .pw-toggle {
  position: absolute; right: .7rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--ink-faint);
  padding: .3rem; display: flex;
}
.field-icon-wrap .pw-toggle:hover { color: var(--ink); }

/* ================= App shell: sidebar + topbar ================= */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
  width: 254px;
  flex-shrink: 0;
  background: var(--primary-dark);
  color: #cfe0da;
  display: flex;
  flex-direction: column;
  transition: margin-left .2s ease, width .2s ease;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.app-shell.collapsed .app-sidebar { margin-left: -254px; }

.sidebar-close {
  display: none;
  align-items: center; justify-content: center;
  position: absolute; top: .9rem; right: .9rem;
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  border: none;
  background: rgba(255,255,255,.08);
  color: #fff;
  cursor: pointer;
}
.sidebar-close svg { width: 16px; height: 16px; }
.sidebar-close:hover { background: rgba(255,255,255,.16); }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 16, 12, .5);
  z-index: 42;
  opacity: 0;
  transition: opacity .2s ease;
}

/* Below tablet width, the sidebar becomes a true off-canvas drawer: hidden
   by default, slid in over a dimming backdrop rather than squeezed in
   alongside the page content. This covers phones and portrait tablets. */
@media (max-width: 991.98px) {
  .app-sidebar {
    position: fixed;
    top: 0; left: 0;
    z-index: 45;
    width: min(300px, 84vw);
    height: 100dvh;
    margin-left: 0;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: var(--shadow-lg);
  }
  .app-shell.collapsed .app-sidebar { margin-left: 0; } /* neutralize the desktop rule at this width */
  .app-shell.sidebar-open .app-sidebar { transform: translateX(0); }
  .sidebar-close { display: flex; }
  .app-sidebar .brand { padding-right: 3rem; }
  .app-shell.sidebar-open .sidebar-backdrop { display: block; opacity: 1; }
  body.sidebar-locked { overflow: hidden; }
}

.app-sidebar .brand {
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.08rem;
  padding: 1.4rem 1.35rem 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; flex-direction: column; gap: .55rem;
}
.app-sidebar .brand:hover { color: #fff; }
.app-sidebar .brand .sub { font-family: var(--font-mono); font-size: .68rem; font-weight: 500; letter-spacing: .08em; color: rgba(255,255,255,.45); text-transform: uppercase; }
.auth-side .brand .sidebar-logo-img {
  height: auto;
  width: auto;
  max-height: 90px; /* 3x the original 30px */
  max-width: 260px;
  object-fit: contain;
  background: #fff;
  padding: .35rem .6rem;
  border-radius: var(--radius-sm);
  display: block;
}

.sidebar-group-label {
  font-family: var(--font-mono);
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: rgba(255,255,255,.35);
  padding: 1rem 1.35rem .35rem;
}
.app-sidebar nav.nav { padding: .4rem .7rem 1.5rem; display: flex; flex-direction: column; gap: .1rem; }
.app-sidebar a.nav-link {
  display: flex; align-items: center; gap: .7rem;
  color: #cfe0da;
  font-size: .88rem; font-weight: 500;
  border-radius: var(--radius-sm);
  padding: .58rem .75rem;
  position: relative;
  transition: background-color .15s ease, color .15s ease;
}
.app-sidebar a.nav-link svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .85; }
.app-sidebar a.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.app-sidebar a.nav-link.active { background: var(--primary-600); color: #fff; }
.app-sidebar a.nav-link.active::before {
  content: ''; position: absolute; left: -.7rem; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%; background: var(--accent); border-radius: 3px;
}
.sidebar-count { margin-left: auto; background: rgba(255,255,255,.14); color: #fff; font-size: .68rem; font-weight: 700; padding: .1rem .45rem; border-radius: var(--radius-pill); }

.app-main { flex: 1 1 auto; min-width: 0; }

.app-topbar {
  background: rgba(242,245,243,.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: .9rem 1.6rem;
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar-title { font-family: var(--font-display); font-weight: 600; color: var(--primary-dark); font-size: 1rem; }
.icon-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft);
  cursor: pointer; position: relative;
  transition: background-color .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.notif-dot {
  position: absolute; top: -4px; right: -4px;
  background: var(--danger); color: #fff;
  font-size: .6rem; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--paper);
}

.profile-chip { display: flex; align-items: center; gap: .6rem; position: relative; }
.profile-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary-tint); color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: .8rem;
  flex-shrink: 0;
}
.profile-avatar-img {
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.6);
  box-shadow: 0 0 0 1px var(--line);
}
.profile-meta { line-height: 1.2; }
.profile-meta .name { font-size: .84rem; font-weight: 600; color: var(--ink); }
.profile-meta .role { font-size: .7rem; color: var(--ink-faint); text-transform: capitalize; }

/* My Account page: larger avatar uploader */
.avatar-uploader { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.avatar-uploader-preview {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--primary-tint); color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.7rem;
  overflow: hidden; flex-shrink: 0;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}
.avatar-uploader-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

.profile-dropdown {
  display: none;
  position: absolute;
  right: 0; top: calc(100% + .6rem);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 190px;
  padding: .5rem;
  z-index: 50;
}
.profile-dropdown.open { display: block; }
.profile-dropdown a { display: block; padding: .5rem .7rem; border-radius: var(--radius-sm); font-size: .86rem; color: var(--ink-soft); }
.profile-dropdown a:hover { background: var(--surface-2); color: var(--ink); }
.profile-dropdown hr { margin: .4rem 0; }

@media (min-width: 768px) { .d-md-block { display: block !important; } }
@media (max-width: 767px) { .d-md-block { display: none !important; } }

.app-content { padding: 1.75rem; max-width: 1320px; }

/* ================= Skeleton / loading ================= */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, #f4f7f5 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: skeleton-wave 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes skeleton-wave { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ================= Fade-in on load ================= */
.fade-in-up { animation: fadeInUp .55s cubic-bezier(.2,.8,.2,1) both; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

/* ================= Misc ================= */
.divider-rota { display: flex; gap: 4px; height: 4px; margin: 2.5rem 0; }
.divider-rota span { flex: 1; background: var(--line); border-radius: 2px; }
.divider-rota span:nth-child(3n) { background: var(--accent-tint); }

@media (max-width: 767px) {
  .app-content { padding: 1.1rem; }
  .hero { padding: 3rem 0 3.5rem; }
}

/* ================= Site Settings (CMS) ================= */
.navbar-logo-img {
  height: auto;
  width: auto;
  object-fit: contain;
  display: block;
}
@media (min-width: 768px) {
  .navbar-logo-img { max-height: 102px; /* 3x the original 34px */ max-width: 320px; }
}

.footer-social-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .9rem;
  margin: 2rem 0 1.75rem;
}
.footer-social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  color: rgba(255,255,255,.85);
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.footer-social-icon svg { width: 17px; height: 17px; }
.footer-social-icon:hover {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.5);
  color: #fff;
  transform: translateY(-2px);
}

.settings-tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: .75rem;
}
.settings-tab-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: .45rem 1rem;
  border-radius: var(--radius-pill);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.settings-tab-btn:hover { background: var(--surface-2); color: var(--ink); }
.settings-tab-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.settings-tab-panel { display: none; }
.settings-tab-panel.active { display: block; }

.settings-image-preview {
  width: 100%;
  height: 140px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.settings-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.settings-image-placeholder { color: var(--ink-faint); font-size: .82rem; }

/* Logo preview only: unlike the background-image slots above (which fill
   and crop with object-fit: cover), the logo must never be cropped - it's
   shown at 3x size across the navbar, login sidebar, and error pages, so
   whatever aspect ratio gets uploaded needs to scale down to fit inside
   this box intact. */
.settings-image-preview.settings-logo-preview {
  height: 200px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 1.25rem;
}
.settings-image-preview.settings-logo-preview img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ---------------------------------------------------------
   Attendance: GPS status + supervisor clock-out confirmation
--------------------------------------------------------- */
#gpsStatus { display: flex; align-items: center; gap: .4rem; }
.gps-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--warning, #e0a800);
  display: inline-block;
  animation: gpsPulse 1.2s ease-in-out infinite;
}
#gpsStatus[data-state="found"] .gps-dot { background: var(--success, #1f9d55); animation: none; }
#gpsStatus[data-state="error"] .gps-dot { background: var(--danger, #d64545); animation: none; }
@keyframes gpsPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.signature-thumb {
  max-height: 40px;
  max-width: 110px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.modal-backdrop-custom {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 18, 32, 0.55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop-custom.open { display: flex; }

.modal-box {
  background: var(--surface, #fff);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
}
.modal-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .5rem;
}
.modal-box-header .icon-btn {
  background: none; border: none; font-size: 1.3rem; line-height: 1; cursor: pointer;
  color: var(--ink-faint);
}

.signature-pad-wrap {
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  touch-action: none;
}
.signature-pad-wrap canvas {
  width: 100%;
  height: 150px;
  display: block;
  cursor: crosshair;
  border-radius: var(--radius-sm);
}

/* Session-timeout countdown modal: circular SVG progress ring that
   drains from full to empty over the final 30s of the 3-minute idle
   timeout, with the seconds remaining shown in the middle. */
.session-timeout-box {
  max-width: 340px;
}
.session-timeout-ring-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
}
.session-timeout-ring-svg {
  width: 120px;
  height: 120px;
  transform: rotate(-90deg);
}
.session-timeout-ring-track,
.session-timeout-ring-progress {
  fill: none;
  stroke-width: 8;
}
.session-timeout-ring-track {
  stroke: var(--line-soft);
}
.session-timeout-ring-progress {
  stroke: var(--primary-600);
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear, stroke .3s ease;
}
.session-timeout-ring-progress.is-urgent {
  stroke: var(--danger);
}
.session-timeout-ring-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ink);
}

/* Clock-out confirmation modal on phones: tighter spacing and a shorter
   signature pad so "Confirm & Clock Out" is never squeezed or pushed
   off-screen after signing. */
@media (max-width: 480px) {
  .modal-box {
    max-width: 100%;
    max-height: 95vh;
    padding: 1rem;
    border-radius: var(--radius-sm);
  }
  .modal-box .mb-3 {
    margin-bottom: .65rem !important;
  }
  .modal-box p.small {
    margin-bottom: .65rem;
  }
  .signature-pad-wrap canvas {
    height: 110px;
  }
  .modal-box .d-flex.justify-content-end.gap-2 {
    flex-direction: column-reverse;
    gap: .5rem;
  }
  .modal-box .d-flex.justify-content-end.gap-2 .btn {
    width: 100%;
  }
}
