:root {
  --navy: #00203f;
  --navy-2: #0b3157;
  --navy-3: #123a63;
  --teal: #00c0c0;
  --teal-dark: #00a0a0;
  --teal-soft: #e6f9f9;
  --bg: #f2f6fb;
  --card: #ffffff;
  --text: #16222f;
  --muted: #6b7a8a;
  --border: #e2e8f0;
  --red: #e5484d;
  --red-soft: #fdebec;
  --amber: #f5a623;
  --amber-soft: #fdf3e3;
  --green: #2eb872;
  --green-soft: #e8f8f0;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(0, 32, 63, 0.07);
  --shadow-lg: 0 10px 30px rgba(0, 32, 63, 0.15);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: 'Poppins', 'Inter', system-ui, sans-serif;
  margin: 0;
}

h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
}

h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
}

h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

p {
  margin: 0 0 8px;
}

a {
  color: var(--teal-dark);
  text-decoration: none;
}

button {
  font-family: inherit;
}

code {
  background: #eef2f7;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 12.5px;
  color: var(--navy);
}

.muted {
  color: var(--muted);
}

.pad {
  padding: 12px 16px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  background: transparent;
  color: var(--text);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--teal);
  color: #003c3c;
}

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

.btn-outline {
  border-color: var(--teal);
  color: var(--teal-dark);
  background: #fff;
}

.btn-outline:hover {
  background: var(--teal-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: #f1f5f9;
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-danger:hover {
  background: #cf383c;
}

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

.btn-danger-outline:hover {
  background: var(--red-soft);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 7px;
}

.btn-block {
  width: 100%;
}

.btn-logout {
  color: #cfe6ff;
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ---------- App shell / topbar ---------- */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: linear-gradient(90deg, var(--navy), var(--navy-2));
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-lg);
  padding-top: constant(safe-area-inset-top);
  padding-top: env(safe-area-inset-top);
}

.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  height: 40px;
  width: auto;
  border-radius: 8px;
}

.brand-name {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.5px;
  color: #fff;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.hamburger span {
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--teal);
  color: #003c3c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-weight: 600;
  font-size: 13.5px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role {
  font-size: 11.5px;
  color: #9fc3e8;
}

.navbar {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.navbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  gap: 4px;
  padding: 0 16px;
  overflow-x: auto;
}

.nav-link {
  color: #bfd4ea;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

.nav-link:hover {
  color: #fff;
}

.nav-link.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
  font-weight: 600;
}

.page {
  flex: 1;
}

.page-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.head-actions {
  display: flex;
  gap: 8px;
}

/* ---------- Cards / grid ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-foot {
  margin-top: 14px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

/* ---------- Stats ---------- */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: transform 0.15s ease;
  font-family: inherit;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-card strong {
  font-size: 30px;
  font-family: 'Poppins', sans-serif;
}

.stat-card span {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
}

.stat-card small {
  color: var(--muted);
  font-size: 12px;
}

.stat-card-teal {
  border-top: 4px solid var(--teal);
}

.stat-card-teal strong {
  color: var(--teal-dark);
}

.stat-card-navy {
  border-top: 4px solid var(--navy);
}

.stat-card-navy strong {
  color: var(--navy);
}

.stat-card-amber {
  border-top: 4px solid var(--amber);
}

.stat-card-amber strong {
  color: #b97e14;
}

.stat-card-red {
  border-top: 4px solid var(--red);
}

.stat-card-red strong {
  color: var(--red);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stat {
  background: #f7fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.stat svg {
  margin-bottom: 6px;
}

.stat strong {
  font-size: 22px;
  font-family: 'Poppins', sans-serif;
}

.stat span {
  font-size: 12px;
  color: var(--muted);
}

.stat-teal {
  color: var(--teal-dark);
}

.stat-navy {
  color: var(--navy);
}

.stat-amber {
  color: #b97e14;
}

.stat-red {
  color: var(--red);
}

.stat-teal strong {
  color: var(--teal-dark);
}

.stat-navy strong {
  color: var(--navy);
}

.stat-amber strong {
  color: #b97e14;
}

.stat-red strong {
  color: var(--red);
}

/* ---------- Forms ---------- */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.field input,
.field textarea,
.field select,
.search-input,
.select {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 9px 12px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s ease;
  width: 100%;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.search-input:focus,
.select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 192, 192, 0.12);
}

.field textarea {
  resize: vertical;
  min-height: 70px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.form-error {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid #f5c2c4;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
}

.evidence-ok {
  color: var(--green);
  font-size: 13px;
  font-weight: 500;
}

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-top: calc(constant(safe-area-inset-top) + 24px);
  padding-top: calc(env(safe-area-inset-top) + 24px);
  background:
    linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 90px, transparent 170px),
    radial-gradient(1000px 500px at 10% 0%, rgba(0, 192, 192, 0.14), transparent 60%),
    radial-gradient(900px 500px at 100% 100%, rgba(0, 32, 63, 0.12), transparent 60%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 34px 30px;
}

.login-brand {
  text-align: center;
  margin-bottom: 22px;
}

.login-logo {
  height: 90px;
  width: auto;
  margin-bottom: 8px;
  border-radius: 12px;
}

.login-brand h1 {
  font-size: 26px;
  color: var(--navy);
}

.login-brand p {
  color: var(--muted);
  font-size: 13px;
}

.demo-box {
  margin-top: 22px;
  border-top: 1px dashed var(--border);
  padding-top: 16px;
  font-size: 13px;
  color: var(--muted);
}

.demo-box p {
  margin-bottom: 8px;
}

.demo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

/* ---------- Toast ---------- */
.toaster {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 220px;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.25s ease;
}

.toast-success {
  background: var(--green);
}

.toast-error {
  background: var(--red);
}

.toast-info {
  background: var(--navy-2);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 20, 40, 0.55);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}

.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: pop 0.18s ease;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 17px;
}

.modal-close {
  border: none;
  background: none;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 20px;
}

/* ---------- Notification bell ---------- */
.bell-wrap {
  position: relative;
}

.bell {
  background: none;
  border: none;
  color: #cfe6ff;
  cursor: pointer;
  position: relative;
  display: flex;
  padding: 6px;
}

.bell:hover {
  color: #fff;
}

.bell-dot {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--teal);
  color: #003c3c;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.bell-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 340px;
  max-height: 420px;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.bell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--navy);
}

.link-btn {
  background: none;
  border: none;
  color: var(--teal-dark);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
}

.bell-list {
  overflow-y: auto;
}

.bell-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f4f8;
  cursor: pointer;
}

.bell-item.unread {
  background: var(--teal-soft);
}

.bell-item p {
  margin: 0 0 3px;
  font-size: 13px;
}

.bell-item span {
  font-size: 11.5px;
  color: var(--muted);
}

.bell-empty {
  padding: 22px;
  text-align: center;
  color: var(--muted);
}

.bell-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
}

/* ---------- Shift cards ---------- */
.shift-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shift-card {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 5px solid var(--teal);
  border-radius: var(--radius);
  display: flex;
  gap: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.shift-card.status-accepted {
  border-left-color: var(--green);
}

.shift-card.status-declined,
.shift-card.status-cancelled {
  border-left-color: var(--red);
  opacity: 0.82;
}

.shift-date-badge {
  min-width: 96px;
  background: var(--teal-soft);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  align-self: center;
}

.sd-day {
  font-weight: 700;
  font-size: 14px;
  color: var(--navy);
}

.sd-date {
  font-size: 12px;
  color: var(--muted);
}

.sd-daylong {
  font-size: 11px;
  color: var(--teal-dark);
  font-weight: 600;
}

.shift-body {
  flex: 1;
  min-width: 0;
}

.shift-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.shift-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0;
}

.shift-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 14px;
  color: var(--navy);
  font-weight: 600;
}

.shift-notes {
  background: #f7fafc;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--muted);
}

.shift-cancel-info {
  background: var(--red-soft);
  color: var(--red);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.evidence-attached {
  opacity: 0.8;
}

.shift-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}

.status-chip-allocated {
  background: var(--amber-soft);
  color: #b97e14;
}

.status-chip-accepted {
  background: var(--green-soft);
  color: #1c8a56;
}

.status-chip-declined,
.status-chip-cancelled {
  background: var(--red-soft);
  color: var(--red);
}

.dash-section {
  margin-bottom: 26px;
}

.dash-section h3 {
  margin-bottom: 12px;
}

.day-group {
  margin-bottom: 16px;
}

.day-label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 14px 0 8px;
}

.day-label strong {
  color: var(--navy);
}

.day-label span {
  color: var(--muted);
  font-size: 12.5px;
}

.empty-state {
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.empty-state strong {
  color: var(--navy);
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
}

.empty-state p {
  margin: 0;
  font-size: 13px;
}

.empty-compact {
  padding: 16px;
  background: transparent;
}

.empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

/* ---------- Week strip ---------- */
.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.week-strip-day {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.week-strip-day.today {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.ws-name {
  font-weight: 700;
  font-size: 12.5px;
  color: var(--navy);
}

.ws-date {
  font-size: 11px;
  color: var(--muted);
}

.ws-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--teal-dark);
}

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.search-input {
  max-width: 360px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chip:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.chip.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #003c3c;
  font-weight: 600;
}

.chip-sm {
  padding: 2px 9px;
  font-size: 11px;
}

.date-range {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.date-range input {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 13px;
}

/* ---------- Rota ---------- */
.rota-week-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--muted);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.rota-week-label svg {
  color: var(--teal-dark);
}

.rota-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
  font-size: 12.5px;
  color: var(--muted);
}

.rota-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rota-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  overflow-x: auto;
}

.rota-col {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

.rota-col.today {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(0, 192, 192, 0.15);
}

.rota-col-head {
  padding: 10px;
  background: var(--navy);
  color: #fff;
  border-radius: 11px 11px 0 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.rota-col.today .rota-col-head {
  background: var(--teal);
  color: #003c3c;
}

.rota-col-head span {
  font-size: 11.5px;
  opacity: 0.85;
}

.rota-slots {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rota-slot {
  border-left: 4px solid var(--amber);
  background: var(--amber-soft);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rota-slot.status-accepted {
  border-left-color: var(--green);
  background: var(--green-soft);
}

.rota-slot.status-declined,
.rota-slot.status-cancelled {
  border-left-color: var(--red);
  background: var(--red-soft);
}

.rota-time {
  font-weight: 700;
  font-size: 12.5px;
  color: var(--navy);
}

.rota-title {
  font-size: 12px;
  color: var(--text);
}

.rota-status {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.rota-status svg {
  opacity: 0.85;
}

.rota-slot.status-accepted .rota-status {
  color: #1c8a56;
}

.rota-slot.status-declined .rota-status,
.rota-slot.status-cancelled .rota-status {
  color: var(--red);
}

.rota-empty {
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  padding: 18px 4px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #fbfdff;
}

/* ---------- eLearning ---------- */
.progress-card {
  background:
    radial-gradient(500px 260px at 100% 0%, rgba(0, 192, 192, 0.2), transparent 60%),
    var(--navy);
  border-radius: var(--radius);
  padding: 20px;
  color: #fff;
  margin-bottom: 22px;
  box-shadow: var(--shadow-lg);
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.progress-head-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.progress-head-left strong {
  display: block;
  font-size: 15px;
}

.progress-head-left span {
  display: block;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.72);
}

.progress-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(0, 192, 192, 0.18);
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.progress-pct {
  font-family: 'Poppins', sans-serif;
  font-size: 26px;
  color: var(--teal);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 10px;
}

.progress-bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 8px;
  transition: width 0.4s ease;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.module-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  box-shadow: var(--shadow);
  transition: all 0.15s ease;
  position: relative;
}

.module-card:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
}

.module-card.done {
  background: var(--green-soft);
  border-color: #bfe8d4;
}

.module-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.module-icon.tone-navy {
  background: #e8eef6;
  color: var(--navy);
}

.module-icon.tone-amber {
  background: var(--amber-soft);
  color: #b97e14;
}

.module-icon.tone-teal {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.module-duration {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.module-empty {
  grid-column: 1 / -1;
}

.module-info h4 {
  margin-bottom: 4px;
}

.module-info p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.module-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

.done-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.lesson-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

.lesson-body {
  background: #f7fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
  font-size: 15.5px;
  line-height: 1.65;
  min-height: 120px;
}

.lesson-finish {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

/* ---------- Policies ---------- */
.policy-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.policy-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.policy-card:hover {
  border-color: var(--teal);
  transform: translateY(-1px);
}

.policy-card.done {
  border-color: #bfe8d4;
}

.policy-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.policy-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.policy-card.done .policy-icon {
  background: var(--green-soft);
  color: var(--green);
}

.policy-card p {
  color: var(--muted);
  font-size: 13.5px;
}

.policy-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.policy-title .muted {
  font-size: 12px;
}

.policy-arrow {
  color: var(--teal);
  display: flex;
  align-items: center;
  padding-top: 6px;
}

.policy-content {
  margin: 14px 0;
}

.policy-content p {
  position: relative;
  padding-left: 18px;
  margin-bottom: 10px;
}

.policy-content p::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
}

.ack-note {
  background: var(--teal-soft);
  border-radius: 9px;
  padding: 12px;
  font-size: 13px;
  color: var(--navy);
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.ack-note svg {
  color: var(--teal-dark);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ---------- Profile ---------- */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.profile-avatar {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.profile-hero-meta {
  flex: 1;
  min-width: 160px;
}

.profile-hero-meta h2 {
  font-size: 20px;
  color: var(--navy);
}

.profile-hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-lines {
  display: flex;
  flex-direction: column;
}

.profile-line {
  display: flex;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid #f0f4f8;
  font-size: 14px;
}

.pl-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
}

.pl-label {
  color: var(--muted);
  font-weight: 500;
  flex: 1;
}

/* ---------- Tables ---------- */
.table-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: var(--shadow);
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 13.5px;
}

.table th {
  text-align: left;
  padding: 12px 14px;
  background: #f7fafc;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 11px 14px;
  border-bottom: 1px solid #f0f4f8;
  vertical-align: middle;
}

.table tbody tr:hover {
  background: #fbfdff;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.cell-name {
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}

.cell-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.role-chip {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}

.role-worker {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.role-admin {
  background: var(--amber-soft);
  color: #b97e14;
}

.role-superadmin {
  background: #f0e6ff;
  color: #7a3dd0;
}

.role-gpa {
  background: var(--navy);
  color: #fff;
}

/* ---------- Mini list ---------- */
.mini-list {
  display: flex;
  flex-direction: column;
}

.mini-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f4f8;
}

.mini-item:last-child {
  border-bottom: none;
}

.mini-main {
  font-size: 13.5px;
}

.mini-sub {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Bar chart ---------- */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 34px;
  align-items: center;
  gap: 10px;
}

.bar-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}

.bar-track {
  height: 10px;
  background: #eef2f7;
  border-radius: 6px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 6px;
}

.bar-value {
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

/* ---------- Toggle ---------- */
.toggle-list {
  display: flex;
  flex-direction: column;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid #f0f4f8;
}

.toggle-row:last-child {
  border-bottom: none;
}

.toggle-row strong {
  font-size: 14px;
}

.toggle-row p {
  margin: 2px 0 0;
  font-size: 12.5px;
}

.switch {
  width: 46px;
  height: 26px;
  border-radius: 14px;
  background: #d7dee6;
  border: none;
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.switch.on {
  background: var(--teal);
}

.switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.switch.on .switch-knob {
  transform: translateX(20px);
}

.danger-card {
  border-color: #f5c2c4;
}

.module-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.admin-modules .module-card {
  cursor: default;
  flex-wrap: wrap;
}

.admin-policy {
  cursor: default;
}

/* ---------- Reports ---------- */
.report-week {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 18px;
}

.report-week strong {
  color: var(--teal);
}

.report-rate {
  color: var(--teal-dark);
  font-weight: 600;
  font-size: 13px;
}

.legend {
  display: flex;
  gap: 18px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-teal {
  background: var(--teal);
}

.dot-amber {
  background: var(--amber);
}

.dot-red {
  background: var(--red);
}

.rate-bar-wrap {
  display: inline-block;
  width: 90px;
  height: 8px;
  background: #eef2f7;
  border-radius: 5px;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 8px;
}

.rate-bar {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: 5px;
}

.rate-value {
  font-weight: 600;
  font-size: 13px;
  color: var(--navy);
}

/* ---------- Fatal error ---------- */
.fatal-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1000px 500px at 10% 0%, rgba(0, 192, 192, 0.14), transparent 60%),
    radial-gradient(900px 500px at 100% 100%, rgba(0, 32, 63, 0.12), transparent 60%),
    var(--bg);
}

.fatal-card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 30px;
  text-align: center;
}

.fatal-card h1 {
  margin: 8px 0;
}

.fatal-card p {
  color: var(--muted);
}

.fatal-card pre {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid #f5c2c4;
  border-radius: 9px;
  padding: 10px;
  font-size: 12px;
  text-align: left;
  overflow-x: auto;
  white-space: pre-wrap;
}

.fatal-actions {
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Dashboard at a glance ---------- */
.hero-card {
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(0, 192, 192, 0.22), transparent 60%),
    linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.hero-text h1 {
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-icon {
  color: var(--teal);
}

.hero-text .muted {
  color: rgba(255, 255, 255, 0.72);
}

.hero-weather {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 5px 13px;
  font-size: 12.5px;
  font-weight: 600;
  color: #d9f6f6;
  margin-top: 10px;
}

.hero-weather svg {
  color: var(--teal);
}

.hero-next {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.hero-next-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--teal);
  font-weight: 600;
}

.hero-next strong {
  font-size: 20px;
  font-family: 'Poppins', sans-serif;
}

.hero-card .next-shift-countdown {
  background: rgba(0, 192, 192, 0.18);
  color: #7fe6e6;
}

.hero-card .next-shift-countdown.urgent {
  background: var(--amber);
  color: #5c3d00;
}

.glance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.glance-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

a.glance-card {
  text-decoration: none;
  color: inherit;
  transition: all 0.15s ease;
}

a.glance-card:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
  box-shadow: var(--shadow-lg);
}

.glance-card h3 {
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.glance-card h3 svg {
  color: var(--teal-dark);
}

.glance-note {
  font-size: 12.5px;
}

.glance-next {
  justify-content: center;
}

.next-shift-date {
  font-family: 'Poppins', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
}

.next-shift-meta {
  color: var(--muted);
  font-size: 13px;
}

.next-shift-time {
  font-size: 17px;
  font-weight: 700;
  color: var(--teal-dark);
}

.next-shift-countdown {
  background: var(--navy);
  color: #fff;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
}

.next-shift-countdown.urgent {
  background: var(--amber);
  color: #5c3d00;
}

.week-stats-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  margin-bottom: 26px;
}

.week-stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.week-stats-head span {
  font-size: 12.5px;
}

.week-mini {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.week-mini-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.week-mini-item strong {
  font-family: 'Poppins', sans-serif;
  font-size: 17px;
  color: var(--navy);
  margin-right: 3px;
}

.wmi-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wmi-green {
  background: var(--green-soft);
  color: var(--green);
}

.wmi-amber {
  background: var(--amber-soft);
  color: #b97e14;
}

.wmi-red {
  background: var(--red-soft);
  color: var(--red);
}

.wmi-navy {
  background: var(--teal-soft);
  color: var(--navy);
}

.ring-wrap {
  position: relative;
  width: 96px;
  height: 96px;
}

.ring-track {
  opacity: 1;
}

.ring-fg {
  transition: stroke-dashoffset 0.6s ease;
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--navy);
}

.today-tomorrow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.ack-badge {
  display: inline-block;
  align-self: flex-start;
  background: var(--green-soft);
  color: #1c8a56;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.ack-confirmed {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--green-soft);
  color: #1c8a56;
  border-radius: 9px;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 14px;
}

.ack-confirmed span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

/* ---------- Manage Shifts ---------- */
.shifts-stats {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.view-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.view-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: -2px;
}

.view-tab:hover {
  color: var(--navy);
}

.view-tab.active {
  color: var(--teal-dark);
  border-bottom-color: var(--teal);
}

.view-count {
  background: var(--teal-soft);
  color: var(--teal-dark);
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 9px;
}

.view-tab.active .view-count {
  background: var(--teal);
  color: #003c3c;
}

.list-toolbar {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 220px 180px auto;
  gap: 10px;
  align-items: end;
}

.list-toolbar .date-range {
  align-self: end;
  padding-bottom: 0;
}

.worker-link {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.worker-link:hover {
  color: var(--teal-dark);
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.picker-actions {
  display: flex;
  gap: 14px;
  margin: 2px 0;
}

.worker-picker {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  max-height: 260px;
  overflow-y: auto;
  padding: 4px;
}

.picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
}

.picker-item:hover {
  background: #f7fafc;
}

.picker-item.picked {
  background: var(--teal-soft);
}

.picker-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.worker-stats {
  margin: 14px 0;
}

.worker-shift-list {
  display: flex;
  flex-direction: column;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.worker-shift-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f4f8;
  font-size: 13.5px;
}

.worker-shift-row:last-child {
  border-bottom: none;
}

.wsr-date {
  font-weight: 600;
  color: var(--navy);
}

.wsr-time {
  color: var(--muted);
}

/* ---------- Planner ---------- */
.planner-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
  font-size: 12.5px;
  color: var(--muted);
}

.planner-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.planner-wrap {
  overflow: auto;
  max-height: 70vh;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.planner-grid {
  display: grid;
  grid-template-columns: 190px repeat(7, minmax(96px, 1fr));
  min-width: 900px;
}

.planner-corner,
.planner-dayhead {
  position: sticky;
  top: 0;
  background: #f7fafc;
  border-bottom: 1px solid var(--border);
}

.planner-corner {
  z-index: 4;
  left: 0;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  display: flex;
  align-items: center;
  padding: 10px 12px;
}

.planner-dayhead {
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 4px;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--navy);
}

.planner-dayhead .planner-daynum {
  font-size: 11px;
  color: var(--muted);
}

.planner-dayhead.today {
  background: var(--teal);
  color: #003c3c;
}

.planner-dayhead.today .planner-daynum {
  color: #006060;
}

.planner-name {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid #f0f4f8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planner-cell {
  border: none;
  border-right: 1px solid #f0f4f8;
  border-bottom: 1px solid #f0f4f8;
  background: #fff;
  min-height: 52px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s ease;
}

.planner-cell:hover {
  background: var(--teal-soft);
}

.planner-cell.today {
  background: #fbfdfe;
}

.planner-add {
  color: #b9c6d4;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
}

.planner-cell:hover .planner-add {
  color: var(--teal-dark);
}

.planner-chip {
  display: inline-block;
  width: 100%;
  text-align: center;
  border-radius: 6px;
  padding: 2px 4px;
  font-size: 11px;
  font-weight: 600;
  color: #5c3d00;
  background: var(--amber-soft);
}

.planner-chip.p-accepted {
  background: var(--teal);
  color: #003c3c;
}

.planner-chip.p-declined,
.planner-chip.p-cancelled {
  background: var(--red-soft);
  color: var(--red);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .glance-grid {
    grid-template-columns: 1fr;
  }

  .hero-next {
    align-items: flex-start;
    width: 100%;
  }

  .week-mini {
    grid-template-columns: repeat(2, 1fr);
  }

  .today-tomorrow {
    grid-template-columns: 1fr;
  }

  .hamburger {
    display: flex;
  }

  .navbar {
    display: none;
  }

  .navbar.open {
    display: block;
  }

  .navbar-inner {
    flex-direction: column;
    padding: 6px 12px;
  }

  .nav-link {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid transparent;
  }

  .nav-link.active {
    border-bottom-color: rgba(255, 255, 255, 0.08);
    border-left-color: var(--teal);
  }

  .user-meta {
    display: none;
  }

  .rota-grid {
    grid-template-columns: repeat(7, 170px);
  }

  .week-strip {
    min-width: 560px;
  }

  .topbar-inner {
    flex-wrap: wrap;
  }

  .topbar-right {
    margin-left: auto;
  }

  .brand {
    margin-right: auto;
  }
}

@media (max-width: 560px) {
  .shift-card {
    flex-direction: column;
  }

  .shift-date-badge {
    align-self: flex-start;
  }

  .stat-cards {
    grid-template-columns: 1fr 1fr;
  }

  .search-input {
    max-width: 100%;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .bell-panel {
    width: min(340px, calc(100vw - 24px));
  }
}

/* ---------- Flights (worker planner) ---------- */
.spin {
  animation: zh-spin 0.9s linear infinite;
}

@keyframes zh-spin {
  to {
    transform: rotate(360deg);
  }
}

.flight-week-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 4px 0 10px;
  font-size: 13.5px;
  color: var(--navy);
}

.flight-week-label strong {
  color: var(--teal-dark);
}

.flight-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
  font-size: 12.5px;
  color: var(--muted);
}

.flight-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.flights-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.flight-col {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  min-width: 0;
}

.flight-col.today {
  border-color: var(--teal);
  box-shadow: 0 0 0 1px var(--teal);
}

.flight-col-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 4px;
  background: #f7fafc;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--navy);
}

.flight-col.today .flight-col-head {
  background: var(--teal);
  color: #003c3c;
}

.flight-col-head span {
  font-size: 11px;
  color: var(--muted);
}

.flight-col.today .flight-col-head span {
  color: #006060;
}

.flight-slots {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}

.flight-empty {
  padding: 18px 6px;
  text-align: center;
  font-size: 12px;
  color: #b9c6d4;
}

.flight-tile {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px;
  border-radius: 9px;
  background: #f7fafc;
  border-left: 3px solid var(--border);
  font-size: 12px;
}

.flight-tile.f-scheduled {
  border-left-color: var(--teal);
}

.flight-tile.f-enroute {
  border-left-color: var(--teal);
  box-shadow: 0 0 0 1px var(--teal-soft);
}

.flight-tile.f-delayed {
  border-left-color: var(--amber);
}

.flight-tile.f-cancelled {
  border-left-color: var(--red);
  opacity: 0.7;
}

.flight-tile.f-landed {
  border-left-color: var(--green);
}

.flight-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.flight-no {
  font-weight: 700;
  font-size: 13px;
  color: var(--navy);
  font-family: 'Poppins', sans-serif;
}

.flight-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
}

.flight-refresh:hover:not(:disabled) {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.flight-refresh:disabled {
  cursor: default;
  color: var(--teal-dark);
}

.flight-airline {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flight-route,
.flight-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text);
}

.flight-live {
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--teal-dark);
  background: var(--teal-soft);
  border-radius: 6px;
  padding: 2px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: default;
}

.live-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  animation: live-pulse 1.6s ease-in-out infinite;
}

@keyframes live-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(0, 192, 192, 0.45);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(0, 192, 192, 0);
  }
}

.flight-live.live-landed {
  background: var(--green-soft);
  color: #1d8a57;
}

.flight-live.live-landed .live-dot {
  background: var(--green);
  animation: none;
}

.flight-live.live-scheduled {
  background: #eef2f7;
  color: var(--muted);
}

.flight-live.live-scheduled .live-dot {
  background: #b9c6d4;
  animation: none;
}

.flight-live .live-eta {
  font-weight: 700;
  color: inherit;
}

.flight-live .live-dist {
  opacity: 0.85;
}

.flight-auto {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 12px;
  color: var(--teal-dark);
}

.f-chip {
  display: inline-block;
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.f-chip-scheduled {
  background: var(--teal-soft);
  color: #007070;
}

.f-chip-enroute {
  background: var(--teal);
  color: #003c3c;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.f-chip-enroute::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #003c3c;
  animation: live-pulse 1.6s ease-in-out infinite;
}

.f-chip-on-time {
  background: var(--green-soft);
  color: #1d8a57;
}

.f-chip-delayed {
  background: var(--amber-soft);
  color: #8a5a00;
}

.f-chip-cancelled {
  background: var(--red-soft);
  color: var(--red);
}

.f-chip-landed {
  background: var(--green-soft);
  color: #1d8a57;
}

.f-chip-past {
  background: #eef2f7;
  color: var(--muted);
}

.flight-tile.tile-past {
  opacity: 0.78;
}

/* ---------- Flights admin ---------- */
.days-chips {
  display: inline-flex;
  gap: 2px;
}

.day-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  color: #b9c6d4;
  background: #f0f4f8;
}

.day-chip.on {
  background: var(--teal);
  color: #003c3c;
}

.table-days {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
}

.table-live {
  margin-top: 2px;
  font-size: 11px;
  color: var(--teal-dark);
}

.days-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.day-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  background: #fff;
  transition: all 0.12s ease;
}

.day-toggle input {
  display: none;
}

.day-toggle.on {
  background: var(--teal);
  border-color: var(--teal);
  color: #003c3c;
}

/* ---------- Flights admin weekly override ---------- */
.week-override {
  border: 1.5px dashed var(--teal);
  border-radius: 12px;
  padding: 13px;
  background: var(--teal-soft);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.wo-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wo-head strong {
  font-size: 13.5px;
  color: var(--navy);
}

.wo-head .muted {
  font-size: 12px;
  font-weight: 500;
}

.wo-day-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.wo-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s ease;
}

.wo-day strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.wo-day span {
  font-size: 10.5px;
  color: var(--muted);
}

.wo-day.on {
  background: var(--teal);
  border-color: var(--teal);
}

.wo-day.on strong,
.wo-day.on span {
  color: #003c3c;
}

.wo-preview {
  font-size: 12.5px;
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 11px;
}

.wo-preview strong {
  color: var(--teal-dark);
}

@media (max-width: 560px) {
  .wo-day-strip {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1200px) {
  .flights-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 760px) {
  .flights-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Flights live summary strip ---------- */
.flight-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.fs-card {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow);
}

.fs-card-teal {
  border-left-color: var(--teal);
}

.fs-card-amber {
  border-left-color: var(--amber);
}

.fs-card-navy {
  border-left-color: var(--navy);
}

.fs-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.fs-value {
  font-family: 'Poppins', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
}

.fs-card-teal .fs-value {
  color: var(--teal-dark);
}

.fs-card-amber .fs-value {
  color: #b07600;
}

.fs-sub {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Flights live block (worker tiles) ---------- */
.flight-live-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 2px;
}

.flight-live-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.flight-live {
  min-width: 0;
}

.flight-countdown {
  flex: none;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--navy);
  background: #eef2f7;
  border-radius: 6px;
  padding: 2px 6px;
  white-space: nowrap;
}

.flight-progress {
  position: relative;
  height: 5px;
  background: #e8eef5;
  border-radius: 5px;
  overflow: hidden;
}

.flight-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--teal-dark), var(--teal));
  transition: width 0.6s ease;
}

.flight-live-meta {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Flights admin form + table ---------- */
.days-quick {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.form-error {
  background: var(--red-soft);
  color: var(--red);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
}

.nowrap-cell {
  white-space: nowrap;
}

/* ===== ZillaHub PHP port additions ===== */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-hint { font-size: 12px; color: #7b8794; margin-top: 2px; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #52606d; cursor: pointer; }
.btn-icon:hover { background: #eef2f7; color: #00203F; }
.btn-icon.danger:hover { background: #fee2e2; color: #b91c1c; }
.role-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #eef2f7; color: #52606d; }
.role-badge.role-admin, .role-badge.role-superadmin { background: #00203F; color: #fff; }
.role-badge.role-gpa { background: #dcfce7; color: #166534; }
.role-badge.role-worker { background: #e0f2fe; color: #075985; }
.progress-summary { display: flex; align-items: center; gap: 20px; background: #fff; border: 1px solid #e3e8ef; border-radius: 14px; padding: 18px 22px; margin-bottom: 24px; }
.progress-summary strong { display: block; font-size: 17px; }
.cat-title { margin: 28px 0 12px; font-size: 15px; color: #52606d; }
.cat-section { margin-top: 8px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 22px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.settings-form { display: flex; flex-direction: column; gap: 18px; }
.setting-list { display: flex; flex-direction: column; gap: 4px; }
.setting-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; cursor: pointer; }
.setting-row input[type="checkbox"] { margin-top: 4px; width: 18px; height: 18px; accent-color: #00A0A0; }
.setting-row strong { display: block; font-size: 14px; }
.setting-row .muted { display: block; font-size: 13px; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.danger-zone { margin-top: 22px; border-color: #fecaca; }
.report-actions { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .account-grid { grid-template-columns: 1fr; } }
.mini-shift-list, .mini-user-list { display: flex; flex-direction: column; gap: 10px; }
.mini-shift { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #eef2f7; }
.mini-shift:last-child { border-bottom: 0; }
.mini-shift-time { font-variant-numeric: tabular-nums; font-size: 13px; color: #52606d; min-width: 92px; }
.mini-user { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #eef2f7; }
.mini-user:last-child { border-bottom: 0; }
.mini-user strong { display: block; }
.mini-user .muted { font-size: 12px; }
.day-dot { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; font-style: normal; font-size: 11px; font-weight: 700; color: #c3ccd6; background: #f1f5f9; margin-right: 3px; }
.day-dot.on { background: #00C0C0; color: #fff; }
.days-chip { display: inline-flex; }
.ov-chip { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: #fef3c7; color: #92400e; }
.admin-rota-wrap { overflow-x: auto; background: #fff; border: 1px solid #e3e8ef; border-radius: 14px; }
.admin-rota { min-width: 860px; }
.ar-row { display: grid; grid-template-columns: 190px repeat(7, 1fr); border-bottom: 1px solid #eef2f7; }
.ar-row:last-child { border-bottom: 0; }
.ar-head { background: #f8fafc; font-weight: 700; font-size: 13px; position: sticky; top: 0; }
.ar-worker { padding: 10px; font-size: 13px; display: flex; align-items: center; border-right: 1px solid #eef2f7; }
.ar-col { padding: 6px; min-height: 64px; border-right: 1px solid #eef2f7; }
.ar-col:last-child { border-right: 0; }
.ar-col.today { background: #f0fdfa; }
.ar-head .ar-col { min-height: 0; text-align: center; font-size: 12px; color: #52606d; }
.ar-head .ar-col small { color: #9aa5b1; }
.ar-chip { position: relative; display: flex; flex-direction: column; gap: 2px; background: #fef3c7; border: 1px solid #fde68a; border-radius: 8px; padding: 5px 20px 5px 8px; margin-bottom: 5px; font-size: 12px; }
.ar-chip.status-accepted { background: #ccfbf1; border-color: #5eead4; }
.ar-chip.status-declined, .ar-chip.status-cancelled { background: #fee2e2; border-color: #fecaca; }
.ar-chip-x { position: absolute; top: 3px; right: 3px; background: transparent; border: 0; color: #52606d; cursor: pointer; padding: 0; }
.ar-chip-x:hover { color: #b91c1c; }
.ar-empty { padding: 24px; }
.module-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.module-minutes { font-size: 12px; font-weight: 600; color: #00A0A0; }
.module-done-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: #166534; background: #dcfce7; padding: 3px 8px; border-radius: 999px; }
.policy-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: #166534; background: #dcfce7; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.policy-badge.warn { color: #92400e; background: #fef3c7; }
.policy-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.policy-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.policy-acked-note { font-size: 12px; color: #7b8794; }
.policy-summary { margin-top: 8px; color: #3c4a57; font-size: 14px; }
.policy-body { line-height: 1.7; color: #3c4a57; }
.policy-body p { margin: 0 0 10px; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.f-moved { font-size: 12px; color: #92400e; background: #fef3c7; padding: 2px 8px; border-radius: 6px; display: inline-block; }
.f-note { font-size: 12px; color: #52606d; font-style: italic; }
.day-groups { display: flex; flex-direction: column; gap: 18px; margin-top: 18px; }
.day-label { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.day-label span { font-size: 12px; color: #9aa5b1; }
.inline-form { display: inline-flex; }
.link-btn { background: none; border: 0; color: #00A0A0; cursor: pointer; font-size: 13px; font-weight: 600; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.btn-logout { padding: 6px 10px; }
.modal-foot-inner { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.module-content { line-height: 1.7; color: #3c4a57; }
.module-content p { margin: 0 0 10px; }
.module-complete-form { margin-top: 14px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.muted { color: #7b8794; }
.card { background: #fff; border: 1px solid #e3e8ef; border-radius: 14px; padding: 20px 22px; }
.card h3 { margin-bottom: 14px; }
.evidence-file { font-size: 13px; }
.evidence-ok { color: #166534; font-size: 13px; font-weight: 600; }
