/* ============================================================
   Wren Design System — shared across all editions
   Colours: LADN blue #4a9abf | orange #e07820 | navy #0f172a | green #2d5016
   ============================================================ */

:root {
  --c-blue:       #4a9abf;
  --c-blue-dark:  #357a9a;
  --c-blue-light: #d0eaf5;
  --c-orange:     #e07820;
  --c-orange-dark:#b85e10;
  --c-orange-light:#fef3e2;
  --c-navy:       #0f172a;
  --c-navy-mid:   #1e293b;
  --c-navy-light: #334155;
  --c-green:      #2d5016;
  --c-green-light:#dcfce7;
  --c-red:        #dc2626;
  --c-red-light:  #fee2e2;
  --c-amber:      #d97706;
  --c-amber-light:#fef3c7;
  --c-purple:     #7c3aed;
  --c-purple-light:#ede9fe;

  --sidebar-w:     220px;
  --sidebar-collapsed: 56px;
  --topbar-h:      56px;
  --radius:        10px;
  --radius-sm:     6px;
  --shadow:        0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
  --shadow-md:     0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg:     0 10px 15px -3px rgba(0,0,0,.1);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --transition: .2s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: #f1f5f9;
  color: #1e293b;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--c-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ── Layout ── */
#wren-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--c-navy);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  z-index: 200;
  box-shadow: var(--shadow-md);
}
#wren-topbar .topbar-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
#wren-topbar .topbar-logo span { color: var(--c-blue); }
#wren-topbar .topbar-edition {
  font-size: .75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .08em;
}
#wren-topbar .topbar-spacer { flex: 1; }
#wren-topbar .topbar-user {
  font-size: .85rem;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 8px;
}
#wren-topbar .topbar-user .user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--c-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
  color: #fff;
  cursor: pointer;
}
#wren-topbar .topbar-demo-badge {
  background: var(--c-orange);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
#sidebar-toggle {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
#sidebar-toggle:hover { background: rgba(255,255,255,.1); color: #fff; }

#wren-sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--c-navy-mid);
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--transition);
  z-index: 150;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
#wren-sidebar.collapsed { width: var(--sidebar-collapsed); }
#wren-sidebar::-webkit-scrollbar { width: 4px; }
#wren-sidebar::-webkit-scrollbar-track { background: transparent; }
#wren-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

.nav-section {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.nav-section-label {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #64748b;
  padding: 6px 16px 2px;
  white-space: nowrap;
  overflow: hidden;
}
.collapsed .nav-section-label { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: #94a3b8;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  border-radius: 0;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #e2e8f0; text-decoration: none; }
.nav-item.active { background: rgba(74,154,191,.15); color: var(--c-blue); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--c-blue);
  border-radius: 0 2px 2px 0;
}
.nav-item .nav-icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.nav-item .nav-label {
  font-size: .875rem;
  font-weight: 500;
  transition: opacity var(--transition);
}
.collapsed .nav-label { opacity: 0; pointer-events: none; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--c-orange);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.collapsed .nav-badge { display: none; }

#wren-main {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 24px;
  min-height: calc(100vh - var(--topbar-h));
  transition: margin-left var(--transition);
}
body.sidebar-collapsed #wren-main { margin-left: var(--sidebar-collapsed); }

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--c-navy);
  flex: 1;
}
.page-subtitle {
  font-size: .875rem;
  color: #64748b;
  margin-top: 2px;
}

/* ── Cards ── */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-navy);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ── Stat cards ── */
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--c-navy);
  line-height: 1;
}
.stat-label {
  font-size: .8rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.stat-card.blue { border-left: 4px solid var(--c-blue); }
.stat-card.orange { border-left: 4px solid var(--c-orange); }
.stat-card.green { border-left: 4px solid var(--c-green); }
.stat-card.red { border-left: 4px solid var(--c-red); }
.stat-card.amber { border-left: 4px solid var(--c-amber); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity var(--transition), transform var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { opacity: .88; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--c-blue); color: #fff; }
.btn-primary:hover { background: var(--c-blue-dark); opacity: 1; }
.btn-orange { background: var(--c-orange); color: #fff; }
.btn-orange:hover { background: var(--c-orange-dark); opacity: 1; }
.btn-navy { background: var(--c-navy); color: #fff; }
.btn-green { background: var(--c-green); color: #fff; }
.btn-danger { background: var(--c-red); color: #fff; }
.btn-ghost { background: transparent; color: var(--c-navy-light); border: 1.5px solid #e2e8f0; }
.btn-ghost:hover { background: #f8fafc; }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-icon { padding: 9px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--c-navy);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: var(--c-navy);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--c-blue);
  box-shadow: 0 0 0 3px rgba(74,154,191,.15);
}
.form-control::placeholder { color: #94a3b8; }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: .78rem; color: #64748b; margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Tables ── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
thead th {
  background: #f8fafc;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: #475569;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background var(--transition);
}
tbody tr:hover { background: #f8fafc; }
tbody td { padding: 11px 14px; color: var(--c-navy); vertical-align: middle; }
tbody tr:last-child { border-bottom: none; }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  gap: 4px;
}
.badge-blue { background: var(--c-blue-light); color: var(--c-blue-dark); }
.badge-orange { background: var(--c-orange-light); color: var(--c-orange-dark); }
.badge-green { background: var(--c-green-light); color: var(--c-green); }
.badge-red { background: var(--c-red-light); color: var(--c-red); }
.badge-amber { background: var(--c-amber-light); color: var(--c-amber); }
.badge-purple { background: var(--c-purple-light); color: var(--c-purple); }
.badge-grey { background: #f1f5f9; color: #64748b; }

/* ── Child / Staff chips ── */
.child-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
  border: 2px solid transparent;
}
.child-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.child-card.selected { border-color: var(--c-blue); }
.child-card.absent { opacity: .5; }
.child-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--c-blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--c-blue-dark);
  flex-shrink: 0;
  overflow: hidden;
}
.child-avatar img { width: 100%; height: 100%; object-fit: cover; }
.child-info { flex: 1; min-width: 0; }
.child-name {
  font-weight: 700;
  color: var(--c-navy);
  font-size: .95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.child-meta { font-size: .78rem; color: #64748b; }

/* ── PIN keypad ── */
.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 260px;
  margin: 0 auto;
}
.pin-key {
  aspect-ratio: 1;
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius);
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-navy);
}
.pin-key:hover { background: var(--c-blue-light); border-color: var(--c-blue); }
.pin-key:active { background: var(--c-blue); color: #fff; }
.pin-dots {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 20px 0;
}
.pin-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  transition: background var(--transition), border-color var(--transition);
}
.pin-dot.filled { background: var(--c-blue); border-color: var(--c-blue); }

/* ── Toast notifications ── */
#wren-toasts {
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom, 0));
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.wren-toast {
  background: var(--c-navy);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: .875rem;
  font-weight: 500;
  max-width: 320px;
  pointer-events: all;
  animation: toastIn .25s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
.wren-toast.success { background: var(--c-green); }
.wren-toast.error   { background: var(--c-red); }
.wren-toast.warning { background: var(--c-amber); color: var(--c-navy); }
.wren-toast.info    { background: var(--c-blue); }
@keyframes toastIn { from { opacity:0; transform: translateY(12px) scale(.95); } to { opacity:1; transform:none; } }

/* ── Modal ── */
.wren-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
  animation: fadeIn .2s ease;
}
.wren-modal {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 560px;
  width: 100%;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  animation: slideUp .2s ease;
}
.modal-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-title { font-weight: 700; font-size: 1.05rem; color: var(--c-navy); flex: 1; }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: #94a3b8; font-size: 1.2rem; padding: 4px;
  border-radius: var(--radius-sm);
}
.modal-close:hover { background: #f1f5f9; color: var(--c-navy); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes slideUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:none; } }

/* ── Loading / Empty states ── */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: #94a3b8;
  gap: 12px;
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--c-blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #94a3b8;
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state .empty-title { font-size: 1.1rem; font-weight: 600; color: #475569; margin-bottom: 6px; }
.empty-state .empty-body { font-size: .875rem; }

/* ── Alert bar ── */
.alert {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: .875rem;
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.alert-info { background: var(--c-blue-light); color: var(--c-blue-dark); border-left: 4px solid var(--c-blue); }
.alert-success { background: var(--c-green-light); color: var(--c-green); border-left: 4px solid var(--c-green); }
.alert-warning { background: var(--c-amber-light); color: var(--c-amber); border-left: 4px solid var(--c-amber); }
.alert-danger { background: var(--c-red-light); color: var(--c-red); border-left: 4px solid var(--c-red); }

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 20px;
  overflow-x: auto;
}
.tab-btn {
  padding: 10px 18px;
  border: none;
  background: none;
  font-size: .875rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
}
.tab-btn:hover { color: var(--c-blue); }
.tab-btn.active { color: var(--c-blue); border-bottom-color: var(--c-blue); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Search / filter bar ── */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}
.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-box input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  outline: none;
}
.search-box input:focus { border-color: var(--c-blue); box-shadow: 0 0 0 3px rgba(74,154,191,.15); }
.search-box .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1rem;
}

/* ── Session timeout bar ── */
#wren-session-warning {
  position: fixed;
  top: var(--topbar-h);
  left: 0; right: 0;
  background: var(--c-amber);
  color: var(--c-navy);
  text-align: center;
  padding: 8px;
  font-size: .875rem;
  font-weight: 600;
  z-index: 198;
  display: none;
}

/* ── EYFS area tags ── */
.eyfs-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 700;
  margin: 2px;
}
.eyfs-PSED  { background: #fce7f3; color: #be185d; }
.eyfs-CL    { background: #dbeafe; color: #1d4ed8; }
.eyfs-PD    { background: #dcfce7; color: #15803d; }
.eyfs-Literacy   { background: #ede9fe; color: #6d28d9; }
.eyfs-Mathematics { background: #fef3c7; color: #92400e; }
.eyfs-UW    { background: #ffedd5; color: #c2410c; }
.eyfs-EA    { background: #f0fdf4; color: #166534; }

/* ── Sleep check grid ── */
.sleep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.sleep-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
}
.sleep-card.sleeping { border-color: var(--c-green); background: var(--c-green-light); }
.sleep-card.awake { border-color: var(--c-blue); background: var(--c-blue-light); }
.sleep-name { font-weight: 700; font-size: .9rem; color: var(--c-navy); margin-bottom: 4px; }
.sleep-time { font-size: .75rem; color: #64748b; }
.sleep-status { font-size: 1.4rem; margin-bottom: 6px; }

/* ── Observation card ── */
.obs-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
  border-left: 4px solid var(--c-blue);
}
.obs-card.milestone { border-left-color: var(--c-orange); }
.obs-card.note { border-left-color: #94a3b8; }
.obs-header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.obs-child-name { font-weight: 700; color: var(--c-navy); }
.obs-meta { font-size: .78rem; color: #64748b; }
.obs-text { font-size: .9rem; color: #374151; line-height: 1.6; }
.obs-photos { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.obs-photos img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius-sm); cursor: pointer; }

/* ── Mobile bottom nav (hidden on desktop) ── */
#wren-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--c-navy);
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 150;
  border-top: 1px solid rgba(255,255,255,.1);
}
.bottom-nav-inner {
  display: grid;
  height: 56px;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #64748b;
  text-decoration: none;
  font-size: .65rem;
  font-weight: 600;
  padding: 4px;
  transition: color var(--transition);
}
.bottom-nav-item.active { color: var(--c-blue); }
.bottom-nav-item:hover { color: #94a3b8; text-decoration: none; }
.bottom-nav-item .nav-icon { font-size: 1.3rem; }

/* ── Utility ── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.text-muted { color: #64748b; }
.text-danger { color: var(--c-red); }
.text-success { color: var(--c-green); }
.font-bold { font-weight: 700; }
.hidden { display: none !important; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
.divider { border: none; border-top: 1px solid #e2e8f0; margin: 16px 0; }
.ellipsis { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* ── Login page ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--c-navy) 0%, var(--c-navy-mid) 100%);
  padding: 16px;
}
.login-box {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--c-navy);
  letter-spacing: -1px;
}
.login-logo h1 span { color: var(--c-blue); }
.login-logo p { color: #64748b; font-size: .875rem; margin-top: 4px; }

/* Staff grid for PIN login */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
  max-height: 300px;
  overflow-y: auto;
}
.staff-select-card {
  padding: 14px 10px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
}
.staff-select-card:hover { border-color: var(--c-blue); background: var(--c-blue-light); }
.staff-select-card.selected { border-color: var(--c-blue); background: var(--c-blue-light); }
.staff-select-initial {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--c-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  margin: 0 auto 8px;
}
.staff-select-name { font-weight: 700; font-size: .8rem; color: var(--c-navy); }
.staff-select-role { font-size: .7rem; color: #64748b; }

/* ── Responsive ── */
@media (max-width: 768px) {
  #wren-sidebar { transform: translateX(-100%); transition: transform var(--transition); }
  #wren-sidebar.mobile-open { transform: translateX(0); }
  #wren-main { margin-left: 0; padding: 16px; padding-bottom: 72px; }
  body.sidebar-collapsed #wren-main { margin-left: 0; }
  #wren-bottom-nav { display: block; }
  .form-row { grid-template-columns: 1fr; }
  .page-title { font-size: 1.25rem; }
  .card-grid { grid-template-columns: 1fr; }
}
@media (min-width: 769px) {
  #wren-sidebar { transform: none !important; }
}
@media (max-width: 480px) {
  .staff-grid { grid-template-columns: repeat(3, 1fr); }
  .pin-pad { max-width: 220px; }
}

/* ── Print ── */
@media print {
  #wren-sidebar, #wren-topbar, #wren-bottom-nav,
  #wren-toasts, .btn, .filter-bar { display: none !important; }
  #wren-main { margin: 0 !important; padding: 0 !important; }
  .card { box-shadow: none; border: 1px solid #e2e8f0; }
  @page { margin: 1.5cm; }
}
