:root {
  --orange: #E8621A;
  --orange-light: #FF8A3D;
  --blue: #1B6FB5;
  --blue-light: #2A8FDB;
  --navy: #1B2A3F;
  --navy-dark: #141F30;
  --navy-light: #243650;
  --white: #FFFFFF;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --green: #22C55E;
  --red: #EF4444;
  --amber: #F59E0B;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 2px 14px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 28px rgba(0,0,0,0.10);
}

* , *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Nunito', sans-serif;
  background: var(--gray-100);
  color: var(--gray-700);
  -webkit-font-smoothing: antialiased;
}

/* ── LOGIN GATE ── */
.bo-login-screen {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(155deg, var(--navy) 0%, var(--navy-dark) 100%);
  padding: 20px;
}
.bo-login-card {
  background: var(--white); border-radius: 20px; padding: 44px 40px;
  width: 100%; max-width: 400px; box-shadow: 0 24px 70px rgba(0,0,0,0.4);
  text-align: center;
}
.bo-login-logo {
  width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--orange), var(--blue-light));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Baloo 2', cursive; font-weight: 800; font-size: 1.4rem; color: var(--white);
}
.bo-login-card h1 { font-family: 'Baloo 2', cursive; font-size: 1.5rem; color: var(--gray-800); margin-bottom: 6px; }
.bo-login-card .bo-sub { font-size: 0.9rem; color: var(--gray-500); margin-bottom: 28px; }
.bo-login-card .bo-field { text-align: left; margin-bottom: 16px; }
.bo-login-card label { display: block; font-weight: 700; font-size: 0.82rem; color: var(--gray-700); margin-bottom: 6px; }
.bo-login-card input {
  width: 100%; padding: 13px 16px; border-radius: var(--radius-sm);
  border: 2px solid var(--gray-200); font-family: 'Nunito', sans-serif;
  font-size: 0.95rem; outline: none; transition: border-color 0.2s;
}
.bo-login-card input:focus { border-color: var(--blue); }
.bo-login-error {
  display: none; background: #FEF2F2; color: var(--red);
  font-size: 0.84rem; font-weight: 700; padding: 10px; border-radius: 8px; margin-bottom: 14px;
}
.bo-login-btn {
  width: 100%; padding: 14px; border: none; border-radius: var(--radius-sm);
  background: var(--orange); color: var(--white);
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1rem; cursor: pointer;
  transition: all 0.2s; box-shadow: 0 4px 14px rgba(232,98,26,0.3);
}
.bo-login-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(232,98,26,0.4); }
.bo-login-note { font-size: 0.78rem; color: var(--gray-400); margin-top: 18px; line-height: 1.5; }
.bo-demo-badge {
  display: inline-block; background: #FEF3C7; color: #92400E;
  font-size: 0.72rem; font-weight: 800; padding: 4px 10px; border-radius: 50px; margin-bottom: 18px;
}

/* ── APP SHELL ── */
.bo-app { display: none; min-height: 100vh; }
.bo-app.active { display: grid; grid-template-columns: 250px 1fr; }

/* Sidebar */
.bo-sidebar {
  background: var(--navy); color: rgba(255,255,255,0.7);
  display: flex; flex-direction: column; min-height: 100vh;
  position: sticky; top: 0; height: 100vh;
}
.bo-sidebar-head {
  padding: 22px 24px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.bo-sidebar-logo {
  width: 42px; height: 42px; border-radius: 11px;
  background: linear-gradient(135deg, var(--orange), var(--blue-light));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Baloo 2', cursive; font-weight: 800; color: var(--white); font-size: 1rem; flex-shrink: 0;
}
.bo-sidebar-title { font-family: 'Baloo 2', cursive; font-weight: 700; color: var(--white); font-size: 1.05rem; line-height: 1.1; }
.bo-sidebar-title small { display: block; font-size: 0.68rem; font-weight: 600; color: rgba(255,255,255,0.45); font-family: 'Nunito',sans-serif; }
.bo-nav { padding: 16px 12px; flex: 1; }
.bo-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 4px;
  cursor: pointer; font-weight: 700; font-size: 0.92rem; color: rgba(255,255,255,0.65);
  transition: all 0.18s; border: none; background: none; width: 100%; text-align: left;
  font-family: 'Nunito', sans-serif;
}
.bo-nav-item:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.bo-nav-item.active { background: var(--orange); color: var(--white); box-shadow: 0 4px 14px rgba(232,98,26,0.35); }
.bo-nav-item .bo-nav-icon { font-size: 1.1rem; width: 22px; text-align: center; }
.bo-nav-item.admin-only { display: none; }
.bo-app.is-admin .bo-nav-item.admin-only { display: flex; }
.bo-sidebar-foot { padding: 16px; border-top: 1px solid rgba(255,255,255,0.08); }
.bo-user-chip {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.bo-user-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--orange), var(--blue-light));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.8rem; color: var(--white);
}
.bo-user-info .bo-user-name { color: var(--white); font-weight: 700; font-size: 0.85rem; line-height: 1.1; }
.bo-user-info .bo-user-role { color: rgba(255,255,255,0.45); font-size: 0.72rem; }
.bo-logout-btn {
  width: 100%; padding: 10px; border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius-sm);
  background: transparent; color: rgba(255,255,255,0.6); cursor: pointer;
  font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 0.84rem; transition: all 0.18s;
}
.bo-logout-btn:hover { background: rgba(239,68,68,0.15); color: #FCA5A5; border-color: transparent; }
.bo-back-link {
  display: block; text-align: center; margin-top: 8px;
  color: rgba(255,255,255,0.4); font-size: 0.78rem; text-decoration: none;
}
.bo-back-link:hover { color: rgba(255,255,255,0.7); }

/* Main */
.bo-main { padding: 28px 36px; max-width: 1200px; }
.bo-page { display: none; }
.bo-page.active { display: block; animation: boFade 0.3s ease; }
@keyframes boFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.bo-page-head { margin-bottom: 26px; }
.bo-page-head h1 { font-family: 'Baloo 2', cursive; font-size: 1.9rem; color: var(--gray-800); }
.bo-page-head p { color: var(--gray-500); font-size: 0.95rem; margin-top: 2px; }
.bo-accent-bar { width: 70px; height: 4px; border-radius: 4px; background: var(--blue); margin-top: 10px; }

/* KPI cards */
.bo-kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 28px; }
.bo-kpi {
  background: var(--white); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow-card); border: 1px solid var(--gray-200);
}
.bo-kpi-icon {
  width: 42px; height: 42px; border-radius: 11px; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.bo-kpi-icon.orange { background: #FFF0E6; }
.bo-kpi-icon.blue { background: #E8F4FD; }
.bo-kpi-icon.green { background: #DCFCE7; }
.bo-kpi-icon.amber { background: #FEF3C7; }
.bo-kpi-value { font-family: 'Baloo 2', cursive; font-size: 2rem; font-weight: 800; color: var(--gray-800); line-height: 1; }
.bo-kpi-label { font-size: 0.85rem; color: var(--gray-500); font-weight: 600; margin-top: 4px; }

/* Cards / panels */
.bo-card {
  background: var(--white); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-card); border: 1px solid var(--gray-200); margin-bottom: 22px;
}
.bo-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.bo-card-head h2 { font-family: 'Baloo 2', cursive; font-size: 1.2rem; color: var(--gray-800); }
.bo-card-head .bo-card-sub { font-size: 0.82rem; color: var(--gray-400); }
.bo-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

/* Activity feed */
.bo-activity-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--gray-100); }
.bo-activity-item:last-child { border-bottom: none; }
.bo-activity-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.bo-activity-text { font-size: 0.9rem; color: var(--gray-700); }
.bo-activity-time { font-size: 0.78rem; color: var(--gray-400); margin-top: 2px; }

/* Schedule grid */
.bo-schedule-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.bo-week-nav { display: flex; align-items: center; gap: 10px; }
.bo-week-nav button {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--gray-200);
  background: var(--white); cursor: pointer; font-size: 1rem; color: var(--gray-600); transition: all 0.18s;
}
.bo-week-nav button:hover { background: var(--gray-100); }
.bo-week-label { font-weight: 800; color: var(--gray-800); font-size: 0.95rem; min-width: 200px; text-align: center; }
.bo-btn {
  padding: 10px 18px; border: none; border-radius: var(--radius-sm); cursor: pointer;
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 0.88rem; transition: all 0.18s;
  display: inline-flex; align-items: center; gap: 7px;
}
.bo-btn.primary { background: var(--orange); color: var(--white); box-shadow: 0 4px 12px rgba(232,98,26,0.3); }
.bo-btn.primary:hover { transform: translateY(-1px); }
.bo-btn.ghost { background: var(--gray-100); color: var(--gray-700); }
.bo-btn.ghost:hover { background: var(--gray-200); }
.bo-spacer { flex: 1; }

.bo-schedule { overflow-x: auto; }
.bo-schedule-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 760px; }
.bo-schedule-table th {
  background: var(--gray-50); padding: 12px 10px; font-size: 0.78rem; font-weight: 800;
  color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 2px solid var(--gray-200); text-align: center;
}
.bo-schedule-table th:first-child { text-align: left; position: sticky; left: 0; background: var(--gray-50); z-index: 2; }
.bo-schedule-table td {
  padding: 8px; border-bottom: 1px solid var(--gray-100); vertical-align: top; height: 70px;
}
.bo-schedule-table td:first-child {
  font-weight: 700; color: var(--gray-700); font-size: 0.85rem; position: sticky; left: 0;
  background: var(--white); z-index: 1; white-space: nowrap;
}
.bo-staff-cell { display: flex; align-items: center; gap: 9px; }
.bo-staff-cell .bo-user-avatar { width: 30px; height: 30px; font-size: 0.7rem; }
.bo-day-cell { cursor: pointer; border-radius: 8px; transition: background 0.15s; }
.bo-day-cell:hover { background: var(--gray-50); }
.bo-shift {
  border-radius: 8px; padding: 6px 9px; font-size: 0.76rem; font-weight: 700;
  margin-bottom: 5px; line-height: 1.25; position: relative; cursor: pointer;
}
.bo-shift .bo-shift-time { font-size: 0.7rem; opacity: 0.85; font-weight: 600; }
.bo-shift.blue { background: #E8F4FD; color: var(--blue); border-left: 3px solid var(--blue); }
.bo-shift.orange { background: #FFF0E6; color: var(--orange); border-left: 3px solid var(--orange); }
.bo-shift.green { background: #DCFCE7; color: #15803D; border-left: 3px solid var(--green); }
.bo-shift.unavailable { background: #FEF2F2; color: var(--red); border-left: 3px solid var(--red); font-style: italic; }
.bo-shift-del {
  position: absolute; top: 3px; right: 4px; border: none; background: none; cursor: pointer;
  font-size: 0.7rem; color: inherit; opacity: 0; transition: opacity 0.15s;
}
.bo-shift:hover .bo-shift-del { opacity: 0.7; }

/* Stats tables */
.bo-table { width: 100%; border-collapse: collapse; }
.bo-table th {
  text-align: left; padding: 11px 14px; font-size: 0.76rem; font-weight: 800;
  color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 2px solid var(--gray-200);
}
.bo-table td { padding: 13px 14px; border-bottom: 1px solid var(--gray-100); font-size: 0.9rem; color: var(--gray-700); }
.bo-table tr:hover td { background: var(--gray-50); }
.bo-rank { font-family: 'Baloo 2', cursive; font-weight: 800; color: var(--gray-300); font-size: 1.1rem; width: 30px; }
.bo-bar-track { background: var(--gray-100); border-radius: 50px; height: 8px; overflow: hidden; margin-top: 6px; }
.bo-bar-fill { height: 100%; border-radius: 50px; background: linear-gradient(90deg, var(--orange), var(--orange-light)); }
.bo-pill { display: inline-block; padding: 3px 10px; border-radius: 50px; font-size: 0.74rem; font-weight: 800; }
.bo-pill.good { background: #DCFCE7; color: #15803D; }
.bo-pill.warn { background: #FEF3C7; color: #92400E; }
.bo-pill.over { background: #FEE2E2; color: #B91C1C; }

.bo-chart-wrap { position: relative; height: 300px; }

/* Insights */
.bo-insight {
  display: flex; gap: 14px; padding: 16px; border-radius: var(--radius-sm);
  background: var(--gray-50); border: 1px solid var(--gray-200); margin-bottom: 12px;
}
.bo-insight-icon {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
  background: #E8F4FD;
}
.bo-insight-body h4 { font-size: 0.92rem; color: var(--gray-800); font-weight: 800; margin-bottom: 3px; }
.bo-insight-body p { font-size: 0.85rem; color: var(--gray-600); line-height: 1.5; }

/* Modal */
.bo-modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 1100;
  background: rgba(20,31,48,0.55); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 20px;
}
.bo-modal-overlay.active { display: flex; }
.bo-modal {
  background: var(--white); border-radius: 18px; padding: 30px;
  width: 100%; max-width: 460px; box-shadow: var(--shadow-md); position: relative;
}
.bo-modal h3 { font-family: 'Baloo 2', cursive; font-size: 1.3rem; color: var(--gray-800); margin-bottom: 18px; }
.bo-modal .bo-field { margin-bottom: 14px; }
.bo-modal label { display: block; font-weight: 700; font-size: 0.82rem; color: var(--gray-700); margin-bottom: 6px; }
.bo-modal input, .bo-modal select {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
  border: 2px solid var(--gray-200); font-family: 'Nunito', sans-serif;
  font-size: 0.92rem; outline: none; transition: border-color 0.2s; background: var(--white);
}
.bo-modal input:focus, .bo-modal select:focus { border-color: var(--blue); }
.bo-modal-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bo-modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.bo-modal-actions .bo-btn { flex: 1; justify-content: center; }
.bo-modal-close {
  position: absolute; top: 16px; right: 16px; border: none; background: none; cursor: pointer;
  font-size: 1.2rem; color: var(--gray-400); width: 32px; height: 32px; border-radius: 50%;
}
.bo-modal-close:hover { background: var(--gray-100); }

.bo-empty { text-align: center; padding: 40px 20px; color: var(--gray-400); font-size: 0.92rem; }

@media (max-width: 900px) {
  .bo-app.active { grid-template-columns: 1fr; }
  .bo-sidebar { position: relative; height: auto; min-height: 0; flex-direction: row; flex-wrap: wrap; }
  .bo-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; flex: 1 1 100%; }
  .bo-nav-item { width: auto; }
  .bo-sidebar-foot { display: flex; gap: 10px; align-items: center; flex: 1 1 100%; }
  .bo-user-chip { margin-bottom: 0; }
  .bo-logout-btn { width: auto; }
  .bo-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .bo-grid-2 { grid-template-columns: 1fr; }
  .bo-main { padding: 20px; }
}
