:root {
  --bg: #eaf3ff;
  --bg-deep: #dcecff;
  --card: rgba(255, 255, 255, 0.9);
  --card-strong: #ffffff;
  --text: #0b1f3a;
  --muted: #58718e;
  --line: rgba(94, 133, 176, 0.2);
  --primary: #0b63ce;
  --primary-dark: #0a4b9d;
  --primary-soft: #dcecff;
  --primary-glow: rgba(11, 99, 206, 0.16);
  --info: #1976d2;
  --success: #0e8f6a;
  --warn: #d28a13;
  --danger: #c54a52;
  --shadow: 0 18px 40px rgba(12, 43, 84, 0.12);
  --radius: 22px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Aptos", "Segoe UI Variable Text", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(74, 144, 226, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(17, 103, 177, 0.14), transparent 22%),
    linear-gradient(180deg, #f7fbff 0%, var(--bg) 52%, var(--bg-deep) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.16) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.3), transparent 78%);
}

button, input, select, textarea { font: inherit; }

input, select, textarea {
  width: 100%;
  border: 1px solid rgba(103, 141, 182, 0.35);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.96);
  color: var(--text);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
  transform: translateY(-1px);
}

textarea { min-height: 110px; resize: vertical; }

button.btn {
  border: 0;
  border-radius: 14px;
  padding: 11px 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

button.btn:hover { transform: translateY(-1px); }
button.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn.primary {
  background: linear-gradient(135deg, var(--primary), #2f8bff);
  color: white;
  box-shadow: 0 10px 20px rgba(11, 99, 206, 0.24);
}
.btn.light {
  background: rgba(255,255,255,0.9);
  color: var(--text);
  border: 1px solid rgba(103, 141, 182, 0.24);
}
.btn.success { background: #e8fbf4; color: #0a7a59; }
.btn.danger { background: #fff0f2; color: #a23744; }

.card, .panel, .topbar {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.65);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.section-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  margin-bottom: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.b-primary { background: var(--primary-soft); color: var(--primary-dark); }
.b-info { background: #e4f1ff; color: #0e5eb7; }
.b-success { background: #dcf8ef; color: #087859; }
.b-warn { background: #fff3da; color: #a56500; }
.b-danger { background: #ffe9ec; color: #a23a47; }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-shell {
  width: min(1024px, 100%);
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  gap: 24px;
}

.login-brand {
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 640px;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.22), transparent 28%),
    linear-gradient(145deg, #083a7f 0%, #0b63ce 48%, #31a4ff 100%);
  color: white;
  border-radius: var(--radius);
}

.login-brand h1 { font-size: 40px; margin: 0 0 12px; letter-spacing: -.03em; }
.login-brand p { color: rgba(255,255,255,.86); line-height: 1.65; }

.brand-badge {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: rgba(255,255,255,.16);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 22px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
}

.feature-list { display: grid; gap: 12px; }
.feature-item { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); padding: 14px; border-radius: 18px; }
.login-card { padding: 32px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.login-card h2 { margin: 0 0 8px; font-size: 30px; letter-spacing: -.02em; }
.login-form { display: grid; gap: 14px; margin-top: 24px; }
.login-actions { display: grid; gap: 10px; margin-top: 8px; }
.demo-note { margin-top: 18px; background: #f7fbff; border: 1px dashed rgba(90, 136, 190, 0.35); padding: 14px; border-radius: 16px; }

.app { max-width: 1420px; margin: 0 auto; padding: 24px; }

.dashboard-shell {
  display: grid;
  gap: 20px;
}

.topbar {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 18px 20px 22px;
  background: rgba(255, 255, 255, 0.82);
}

.topbar-brand {
  display: grid;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
}

.topbar-app {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

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

.brand .brand-badge {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0b63ce, #47a7ff);
  color: white;
  font-size: 18px;
}

.brand h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.brand p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }

.topbar-copy h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
}

.topbar-copy p {
  margin: 0;
  max-width: 640px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.workspace-strip {
  display: grid;
  gap: 8px;
}

.topbar-meta {
  position: absolute;
  top: 18px;
  right: 20px;
  display: grid;
  gap: 10px;
  justify-items: end;
  align-content: start;
  margin-left: 0;
  align-self: start;
}

.topbar-account {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(94, 133, 176, 0.14);
  border-radius: 14px;
  background: rgba(247, 251, 255, 0.9);
}

.topbar-user {
  display: grid;
  gap: 1px;
  justify-items: start;
  text-align: left;
}

.topbar-user strong {
  font-size: 14px;
  line-height: 1.1;
}

.topbar-user .small {
  font-size: 12px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.utility-rail {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 24px;
}

.rail-panel {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-horizontal {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-pills button {
  border: 0;
  background: rgba(255,255,255,0.7);
  text-align: left;
  padding: 13px 14px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 15px;
  color: #28405f;
  transition: .18s ease;
}

.nav-pills button.active,
.nav-pills button:hover {
  background: linear-gradient(135deg, rgba(11, 99, 206, 0.14), rgba(74, 157, 255, 0.22));
  color: var(--primary-dark);
  font-weight: 700;
}

.nav-horizontal button {
  text-align: center;
  white-space: nowrap;
}

.chip-stack {
  display: grid;
  gap: 10px;
}

.chip {
  border: 1px solid rgba(11, 99, 206, 0.16);
  background: rgba(255,255,255,0.78);
  color: var(--primary-dark);
  border-radius: 16px;
  padding: 11px 14px;
  cursor: pointer;
  font-weight: 700;
  text-align: left;
}

.chip.active {
  background: linear-gradient(135deg, var(--primary), #3c99ff);
  color: white;
  box-shadow: 0 10px 20px rgba(11, 99, 206, 0.18);
}

.rail-actions {
  display: grid;
}

.rail-actions .btn {
  width: 100%;
  justify-content: center;
}

.user-summary {
  display: grid;
  gap: 4px;
}

.workspace-main,
.view-stack {
  display: grid;
  gap: 18px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stat-card {
  min-height: 132px;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(240, 248, 255, 0.94));
}

.stat-title { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.stat-value { font-size: 32px; font-weight: 800; letter-spacing: -.03em; }

.overview-grid {
  display: grid;
  grid-template-columns: 1.2fr .95fr .95fr;
  gap: 16px;
}

.feature-panel,
.schedule-stage,
.admin-form-card {
  min-height: 100%;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(94, 133, 176, 0.12);
}

.section-head h3,
.card h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
}

.card h3 + p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.feature-panel > h3,
.admin-form-card > h3,
#adminLocked > h3 {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(94, 133, 176, 0.12);
}

.list {
  display: grid;
  gap: 12px;
}

.item {
  border: 1px solid rgba(94, 133, 176, 0.16);
  border-radius: 16px;
  padding: 14px;
  background: rgba(252, 254, 255, 0.92);
}

.item.compact { padding: 12px; }

.item-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.actions .btn { min-height: 42px; }

.schedule-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid rgba(94, 133, 176, 0.16);
  border-radius: 18px;
  background: rgba(241, 248, 255, 0.82);
}

.toolbar-block {
  display: grid;
  gap: 4px;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.day-col {
  border: 1px solid rgba(94, 133, 176, 0.16);
  border-radius: 18px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(242, 248, 255, 0.92));
  min-height: 240px;
}

.day-head {
  border-bottom: 1px solid rgba(94, 133, 176, 0.16);
  padding-bottom: 8px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.shift-card {
  background: white;
  border: 1px solid rgba(40, 118, 199, 0.14);
  border-left: 4px solid var(--primary);
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 10px;
  box-shadow: 0 6px 18px rgba(24, 71, 127, 0.06);
}

.shift-card.open { border-left-color: var(--danger); }
.shift-card.pending { border-left-color: var(--warn); }

.schedule-admin-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 16px;
}

.grid-2, .grid-3 {
  display: grid;
  gap: 14px;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

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

.tabset.compact { margin-left: auto; }

.tabset button {
  border: 1px solid rgba(94, 133, 176, 0.16);
  background: rgba(255,255,255,0.88);
  color: #294664;
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 700;
}

.tabset button.active {
  background: linear-gradient(135deg, var(--primary), #3a96ff);
  border-color: transparent;
  color: white;
}

.request-builder {
  padding: 16px;
  border-radius: 18px;
  background: rgba(238, 247, 255, 0.9);
  border: 1px solid rgba(94, 133, 176, 0.18);
  display: grid;
  gap: 14px;
}

.recurring-row {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid rgba(94, 133, 176, 0.14);
  border-radius: 16px;
  background: rgba(247, 251, 255, 0.74);
}

.recurring-weeks { width: 120px; }

.shift-roster-item {
  display: grid;
  gap: 10px;
}

.table-shell {
  overflow: auto;
  border: 1px solid rgba(94, 133, 176, 0.14);
  border-radius: 18px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: rgba(255,255,255,0.7);
}

.table th,
.table td {
  text-align: left;
  border-bottom: 1px solid rgba(94, 133, 176, 0.14);
  padding: 12px 10px;
  vertical-align: top;
}

.table thead th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  background: rgba(241, 248, 255, 0.9);
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.checkbox-row input { width: auto; }

.inline-message {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
}

.inline-message.error {
  background: #fff0f2;
  color: #a23a47;
  border: 1px solid rgba(197, 74, 82, 0.2);
}

.empty-state {
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed rgba(94, 133, 176, 0.24);
  background: rgba(245, 250, 255, 0.88);
  color: var(--muted);
  text-align: center;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.report-lines { margin-top: 8px; line-height: 1.65; }

.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 10px;
  z-index: 1000;
}

.toast {
  min-width: 240px;
  max-width: 320px;
  padding: 12px 14px;
  border-radius: 16px;
  color: white;
  box-shadow: 0 16px 32px rgba(12, 43, 84, 0.18);
  animation: toast-in .24s ease;
}

.toast-info { background: linear-gradient(135deg, #2c7be4, #0b63ce); }
.toast-success { background: linear-gradient(135deg, #0e8f6a, #18a67c); }
.toast-warn { background: linear-gradient(135deg, #c48711, #e0a01e); }
.toast-danger { background: linear-gradient(135deg, #b34149, #d85a62); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1220px) {
  .workspace-grid,
  .schedule-admin-grid,
  .overview-grid,
  .admin-grid,
  .stats,
  .login-shell {
    grid-template-columns: 1fr;
  }

  .utility-rail {
    position: static;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-meta {
    position: static;
    margin-left: 0;
    justify-items: start;
  }
}

@media (max-width: 980px) {
  .calendar {
    display: flex;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
  }

  .day-col {
    min-width: 260px;
    scroll-snap-align: start;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .app { padding: 14px; }
  .topbar { padding: 18px; }
  .topbar-copy h2 { font-size: 21px; }
  .topbar-meta {
    justify-items: start;
  }
  .topbar-user {
    justify-items: start;
    text-align: left;
  }
  .section-head { flex-direction: column; align-items: stretch; }
  .schedule-toolbar { align-items: stretch; }
  .actions { width: 100%; }
  .actions .btn { flex: 1 1 180px; }
  .toast-root { left: 14px; right: 14px; bottom: 14px; }
  .toast { max-width: none; min-width: 0; }
}
