/* ============================================
   UG-TEAM SCHEDULE — REFINED EXECUTIVE
   Fonts: Instrument Serif (display) + Plus Jakarta Sans (body)
   Palette: Warm white · Cream · Deep Navy · Amber accent
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --ink:          #0F1923;
  --ink-2:        #2C3E50;
  --ink-3:        #5A6A7A;
  --ink-4:        #8B9DB0;
  --ink-5:        #B8C7D4;
  --cream:        #FAF8F5;
  --cream-2:      #F3F0EB;
  --cream-3:      #E8E3DB;
  --cream-4:      #D9D2C8;
  --surface:      #FFFFFF;
  --surface-2:    #FDFCFA;
  --navy:         #1B2E4B;
  --navy-2:       #243D63;
  --navy-light:   #EBF0F7;
  --navy-muted:   rgba(27,46,75,.08);
  --amber:        #D97706;
  --amber-light:  #FFFBEB;
  --amber-border: #FCD34D;
  --indigo:       #4338CA;
  --indigo-light: #EEF2FF;
  --indigo-border:#C7D2FE;
  --green:        #059669;
  --green-light:  #ECFDF5;
  --red:          #DC2626;
  --red-light:    #FEF2F2;
  --sidebar-w:    260px;
  --r:            14px;
  --r-sm:         8px;
  --r-xs:         6px;
  --s-xs: 0 1px 2px rgba(15,25,35,.04);
  --s-sm: 0 1px 3px rgba(15,25,35,.06), 0 2px 8px rgba(15,25,35,.04);
  --s-md: 0 4px 12px rgba(15,25,35,.08), 0 1px 3px rgba(15,25,35,.04);
  --s-lg: 0 8px 32px rgba(15,25,35,.12), 0 2px 6px rgba(15,25,35,.06);
  --s-xl: 0 20px 60px rgba(15,25,35,.16), 0 4px 12px rgba(15,25,35,.08);
  --sidebar-bg: linear-gradient(180deg, #0F1923 0%, #1B2E4B 60%, #1a2d48 100%);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.sidebar::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  position: relative;
}
.logo-mark {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--amber) 0%, #F59E0B 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Instrument Serif', serif;
  font-size: 1.1rem; color: #fff; flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(217,119,6,.45);
}
.logo-text { display: flex; flex-direction: column; }
.logo-main { font-weight: 800; font-size: .88rem; color: #fff; line-height: 1.1; letter-spacing: .3px; }
.logo-sub { font-size: .67rem; color: rgba(255,255,255,.38); text-transform: uppercase; letter-spacing: 1.2px; margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; position: relative; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: rgba(255,255,255,.45); font-weight: 500; font-size: .88rem;
  cursor: pointer; transition: all .15s ease; text-decoration: none; position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.8); }
.nav-item.active { background: rgba(255,255,255,.1); color: #fff; font-weight: 600; }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; background: var(--amber); border-radius: 0 2px 2px 0;
}
.nav-item svg { flex-shrink: 0; }

.sidebar-bottom {
  padding: 16px; border-top: 1px solid rgba(255,255,255,.08);
  display: flex; flex-direction: column; gap: 10px; position: relative;
}
.btn-add {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; padding: 10px 16px;
  background: linear-gradient(135deg, var(--amber) 0%, #F59E0B 100%);
  color: #fff; border: none; border-radius: var(--r-sm);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700; font-size: .84rem; cursor: pointer;
  transition: all .15s ease; box-shadow: 0 2px 8px rgba(217,119,6,.35); letter-spacing: .2px;
}
.btn-add:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(217,119,6,.45); }
.btn-add:active { transform: translateY(0); }

.auth-status { display: flex; align-items: center; gap: 7px; font-size: .78rem; color: rgba(255,255,255,.35); padding: 0 2px; }
.auth-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.auth-dot.viewer { background: rgba(255,255,255,.25); }
.auth-dot.admin { background: #34D399; box-shadow: 0 0 7px rgba(52,211,153,.6); }

.btn-auth {
  display: flex; align-items: center; gap: 7px; width: 100%; padding: 9px 12px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-sm); color: rgba(255,255,255,.45);
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: .82rem; font-weight: 500;
  cursor: pointer; transition: all .15s ease;
}
.btn-auth:hover { background: rgba(255,255,255,.1); color: rgba(255,255,255,.8); border-color: rgba(255,255,255,.2); }
.btn-auth.logout { color: #FCA5A5; border-color: rgba(252,165,165,.2); }
.btn-auth.logout:hover { background: rgba(220,38,38,.15); }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; min-width: 0; background: var(--cream); }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; height: 62px;
  background: var(--surface); border-bottom: 1px solid var(--cream-3);
  position: sticky; top: 0; z-index: 50; gap: 16px; box-shadow: var(--s-xs);
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--ink-3); padding: 6px; border-radius: var(--r-xs); transition: all .12s; }
.menu-toggle:hover { background: var(--cream-2); color: var(--ink); }
.page-title { font-family: 'Instrument Serif', serif; font-size: 1.25rem; color: var(--ink); letter-spacing: -.2px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.live-time { font-size: .75rem; color: var(--ink-4); font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.month-nav { display: flex; align-items: center; background: var(--cream-2); border: 1px solid var(--cream-3); border-radius: 10px; padding: 3px; gap: 2px; }
.month-nav span { font-weight: 700; font-size: .82rem; padding: 4px 10px; color: var(--ink); white-space: nowrap; min-width: 110px; text-align: center; }
.month-nav button { background: none; border: none; cursor: pointer; color: var(--ink-3); font-size: 1.1rem; width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; transition: all .12s; font-weight: 500; }
.month-nav button:hover { background: var(--surface); color: var(--ink); box-shadow: var(--s-xs); }

.view { display: none; padding: 24px 28px; flex-direction: column; gap: 16px; }
.view.active { display: flex; }

.roster-card {
  background: var(--surface); border: 1px solid var(--cream-3);
  border-radius: var(--r); padding: 18px 22px;
  box-shadow: var(--s-sm); position: relative; overflow: hidden;
}
.roster-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--amber) 0%, var(--indigo) 100%);
}
.roster-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.roster-divider { height: 1px; background: var(--cream-3); margin: 14px 0; }
.roster-label { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: .68rem; text-transform: uppercase; letter-spacing: 1px; white-space: nowrap; flex-shrink: 0; width: 106px; }
.roster-label.day { color: var(--amber); }
.roster-label.night { color: var(--indigo); }
.roster-bubbles { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.bubble { padding: 4px 13px; border-radius: 20px; font-size: .78rem; font-weight: 600; border: 1.5px solid transparent; transition: all .15s; cursor: default; letter-spacing: .1px; }
.bubble.day { background: var(--amber-light); border-color: var(--amber-border); color: #92400E; }
.bubble.night { background: var(--indigo-light); border-color: var(--indigo-border); color: #3730A3; }
.bubble.day:hover { background: #FEF3C7; }
.bubble.night:hover { background: #E0E7FF; }
.bubble-empty { font-size: .75rem; color: var(--ink-4); font-style: italic; padding: 4px 0; }

.search-bar { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1.5px solid var(--cream-3); border-radius: var(--r); padding: 11px 18px; box-shadow: var(--s-xs); transition: border-color .15s, box-shadow .15s; }
.search-bar:focus-within { border-color: var(--navy-2); box-shadow: 0 0 0 3px var(--navy-muted), var(--s-xs); }
.search-bar svg { color: var(--ink-4); flex-shrink: 0; }
.search-bar input { flex: 1; border: none; outline: none; background: none; font-family: 'Plus Jakarta Sans', sans-serif; font-size: .9rem; color: var(--ink); }
.search-bar input::placeholder { color: var(--ink-4); }
.search-clear { background: none; border: none; cursor: pointer; color: var(--ink-4); font-size: .8rem; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: all .12s; }
.search-clear:hover { background: var(--cream-2); color: var(--ink); }

.search-results-panel { background: var(--surface); border: 1.5px solid var(--cream-3); border-radius: var(--r); overflow: hidden; box-shadow: var(--s-md); }
.search-results-header { padding: 12px 18px; border-bottom: 1px solid var(--cream-3); display: flex; align-items: center; justify-content: space-between; background: var(--cream-2); }
.search-results-header h4 { font-weight: 700; font-size: .85rem; color: var(--ink); }
.search-results-count { font-size: .75rem; color: var(--ink-3); background: var(--surface); border: 1px solid var(--cream-3); border-radius: 20px; padding: 2px 8px; font-weight: 600; }
.search-results-list { max-height: 300px; overflow-y: auto; }
.search-result-row { display: grid; grid-template-columns: 1fr 150px 90px 1fr; gap: 12px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--cream-3); transition: background .1s; font-size: .84rem; }
.search-result-row:last-child { border-bottom: none; }
.search-result-row:hover { background: var(--cream-2); }
.sr-name { font-weight: 700; color: var(--ink); }
.sr-date { color: var(--ink-3); font-size: .82rem; }
.sr-shift { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .2px; width: fit-content; }
.sr-shift.morning { background: var(--amber-light); color: #92400E; border: 1px solid var(--amber-border); }
.sr-shift.evening { background: var(--indigo-light); color: #3730A3; border: 1px solid var(--indigo-border); }
.sr-website { color: var(--ink-4); font-size: .8rem; }

.table-card { background: var(--surface); border: 1px solid var(--cream-3); border-radius: var(--r); overflow: hidden; box-shadow: var(--s-sm); }
.table-header-row { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--cream-3); background: var(--surface-2); }
.table-title { font-family: 'Instrument Serif', serif; font-size: 1.05rem; color: var(--ink); letter-spacing: -.1px; }
.table-legend { display: flex; gap: 14px; align-items: center; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: .73rem; color: var(--ink-4); font-weight: 500; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.legend-dot.day { background: var(--amber); }
.legend-dot.night { background: var(--indigo); }
.legend-dot.off { background: var(--red); }
.table-scroll { overflow-x: auto; }

.schedule-table { width: 100%; border-collapse: collapse; font-size: .83rem; min-width: 820px; }
.schedule-table thead tr { background: linear-gradient(180deg, var(--cream) 0%, var(--cream-2) 100%); }
.schedule-table th { padding: 11px 12px; text-align: center; font-weight: 800; font-size: .67rem; text-transform: uppercase; letter-spacing: .8px; color: var(--ink-3); border-bottom: 2px solid var(--cream-3); white-space: nowrap; }
.schedule-table th.col-date { text-align: left; padding-left: 20px; width: 105px; }
.schedule-table th.col-shift { width: 76px; }
.schedule-table th.col-off { width: 130px; }
.schedule-table th.col-action { width: 90px; }

.schedule-table td { padding: 9px 12px; text-align: center; border-bottom: 1px solid var(--cream-3); color: var(--ink-2); font-weight: 500; vertical-align: middle; transition: background .1s; font-size: .84rem; }
.schedule-table .day-row td { border-top: 2px solid var(--cream-3); background: #FDFCFA; }
.schedule-table .day-row:first-child td { border-top: none; }
.schedule-table .night-row td { background: var(--surface); }
.schedule-table tr:hover td { background: #F0EDE8 !important; }

td.date-cell { text-align: left; padding-left: 20px; background: var(--cream-2) !important; border-right: 2px solid var(--cream-3); white-space: nowrap; vertical-align: middle; }
.schedule-table tr:hover td.date-cell { background: #E8E3DB !important; }
.date-cell .date-day { font-weight: 800; font-size: .65rem; color: var(--ink-4); text-transform: uppercase; letter-spacing: .7px; }
.date-cell .date-num { font-size: .9rem; font-weight: 700; color: var(--ink); margin-top: 1px; }

.shift-badge { display: inline-flex; align-items: center; gap: 3px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: 3px 7px; border-radius: 5px; }
.shift-badge.day { background: var(--amber-light); color: #92400E; border: 1px solid rgba(217,119,6,.2); }
.shift-badge.night { background: var(--indigo-light); color: #3730A3; border: 1px solid rgba(67,56,202,.2); }

.staff-cell { color: var(--ink); font-weight: 600; font-size: .83rem; }
.staff-cell.empty { color: var(--ink-5); font-weight: 400; }
td.offday-cell { color: var(--red); font-size: .78rem; font-weight: 600; max-width: 130px; }
td.action-cell { white-space: nowrap; }

.btn-edit, .btn-del { border: none; cursor: pointer; border-radius: var(--r-xs); font-size: .7rem; font-weight: 700; padding: 4px 9px; transition: all .12s; font-family: 'Plus Jakarta Sans', sans-serif; letter-spacing: .1px; }
.btn-edit { background: var(--navy-light); color: var(--navy); border: 1px solid rgba(27,46,75,.12); }
.btn-edit:hover { background: var(--navy); color: #fff; }
.btn-del { background: var(--red-light); color: var(--red); margin-left: 4px; border: 1px solid rgba(220,38,38,.15); }
.btn-del:hover { background: var(--red); color: #fff; }

.loading-row, .empty-row { text-align: center !important; padding: 48px !important; color: var(--ink-4); font-style: italic; font-size: .88rem; }
.spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid var(--cream-3); border-top-color: var(--navy); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

.staff-view-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.staff-grid { display: flex; flex-direction: column; align-items: center; width: 100%; }
.staff-card { background: var(--surface); border: 1px solid var(--cream-3); border-radius: var(--r); padding: 18px; box-shadow: var(--s-xs); transition: all .18s ease; }
.staff-card:hover { border-color: var(--cream-4); box-shadow: var(--s-md); transform: translateY(-2px); }
.staff-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.staff-avatar { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem; color: #fff; flex-shrink: 0; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.staff-name { font-weight: 700; font-size: .9rem; color: var(--ink); margin-bottom: 3px; }
.staff-shift-badge { font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; letter-spacing: .3px; }
.staff-shift-badge.day { background: var(--amber-light); color: #92400E; border: 1px solid rgba(217,119,6,.25); }
.staff-shift-badge.night { background: var(--indigo-light); color: #3730A3; border: 1px solid rgba(67,56,202,.2); }
.staff-card-actions { display: flex; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--cream-3); }

.modal-overlay { position: fixed; inset: 0; z-index: 999; background: rgba(15,25,35,.5); backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border-radius: 18px; padding: 28px; width: 100%; max-width: 420px; box-shadow: var(--s-xl); border: 1px solid var(--cream-3); animation: modalIn .22s cubic-bezier(.34,1.56,.64,1); }
.modal-wide { max-width: 660px; }
.modal-sm { max-width: 380px; text-align: center; }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

.modal-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.modal-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--navy-light); color: var(--navy); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 800; margin: 0 auto 16px; }
.modal-icon-danger { background: var(--red-light); color: var(--red); }
.modal-title { font-family: 'Instrument Serif', serif; font-size: 1.2rem; color: var(--ink); letter-spacing: -.2px; }
.modal-sub { font-size: .85rem; color: var(--ink-3); margin-bottom: 22px; line-height: 1.5; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--ink-4); font-size: .9rem; width: 30px; height: 30px; border-radius: var(--r-xs); display: flex; align-items: center; justify-content: center; transition: all .12s; }
.modal-close:hover { background: var(--cream-2); color: var(--ink); }

.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-group label { font-size: .72rem; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .6px; }
.form-group input, .form-group select { padding: 9px 13px; border: 1.5px solid var(--cream-3); border-radius: var(--r-sm); font-family: 'Plus Jakarta Sans', sans-serif; font-size: .88rem; color: var(--ink); background: var(--surface); outline: none; transition: border-color .12s, box-shadow .12s; }
.form-group input:focus, .form-group select:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px var(--navy-muted); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-divider { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; font-size: .68rem; font-weight: 800; color: var(--ink-4); text-transform: uppercase; letter-spacing: .8px; }
.form-divider::before, .form-divider::after { content: ''; flex: 1; height: 1px; background: var(--cream-3); }
.modal-error { color: var(--red); font-size: .8rem; min-height: 16px; margin-bottom: 6px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

.btn-primary { padding: 10px 22px; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; border: none; border-radius: var(--r-sm); font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: .88rem; cursor: pointer; width: 100%; transition: all .15s ease; box-shadow: 0 2px 8px rgba(27,46,75,.3); letter-spacing: .1px; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(27,46,75,.4); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-ghost { padding: 10px 22px; background: transparent; color: var(--ink-2); border: 1.5px solid var(--cream-3); border-radius: var(--r-sm); font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 600; font-size: .88rem; cursor: pointer; width: 100%; margin-top: 8px; transition: all .12s; }
.btn-ghost:hover { background: var(--cream-2); border-color: var(--cream-4); }
.modal-actions .btn-ghost { width: auto; margin-top: 0; }
.modal-actions .btn-primary { width: auto; }
.btn-danger { padding: 10px 22px; background: var(--red); color: #fff; border: none; border-radius: var(--r-sm); font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: .88rem; cursor: pointer; transition: all .12s; box-shadow: 0 2px 6px rgba(220,38,38,.3); }
.btn-danger:hover { opacity: .9; transform: translateY(-1px); }

.range-preview { font-size: .8rem; border-radius: var(--r-sm); padding: 7px 12px; margin-bottom: 4px; font-weight: 600; }

.toast { position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: .84rem; font-weight: 600; box-shadow: var(--s-lg); z-index: 9999; animation: toastIn .2s cubic-bezier(.34,1.56,.64,1); letter-spacing: .1px; border: 1px solid rgba(255,255,255,.08); }
.toast.success { background: #065F46; border-color: rgba(52,211,153,.2); }
.toast.error { background: var(--red); border-color: rgba(255,255,255,.1); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--cream-2); }
::-webkit-scrollbar-thumb { background: var(--cream-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-5); }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--s-xl); }
  .main { margin-left: 0; }
  .menu-toggle { display: flex; }
  .view { padding: 16px; }
  .topbar { padding: 0 16px; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
  .search-result-row { grid-template-columns: 1fr 1fr; }
  .sr-website { display: none; }
  .table-legend { display: none; }
  .live-time { display: none; }
}
@media (max-width: 480px) {
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
}

/* ============================================ BULK TOOLBAR */
.bulk-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: var(--cream-2);
  border-bottom: 1px solid var(--cream-3);
  gap: 12px; flex-wrap: wrap;
}
.bulk-toolbar-left { display: flex; align-items: center; gap: 10px; }
.bulk-toolbar-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bulk-count { font-size: .8rem; font-weight: 700; color: var(--ink-3); }

.bulk-divider { width: 1px; height: 20px; background: var(--cream-4); margin: 0 2px; }

.btn-bulk {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: var(--r-xs);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: .75rem; font-weight: 700;
  cursor: pointer; transition: all .12s;
  border: none; white-space: nowrap;
}
.btn-bulk:disabled { opacity: .4; cursor: not-allowed; }
.btn-bulk { background: var(--red); color: #fff; box-shadow: 0 1px 4px rgba(220,38,38,.25); }
.btn-bulk:not(:disabled):hover { background: #B91C1C; transform: translateY(-1px); }

.btn-bulk-outline {
  background: var(--surface) !important;
  color: var(--ink-2) !important;
  border: 1.5px solid var(--cream-3) !important;
  box-shadow: var(--s-xs) !important;
}
.btn-bulk-outline:hover { background: var(--cream-2) !important; border-color: var(--cream-4) !important; transform: translateY(-1px); }

.btn-bulk-danger {
  background: var(--red) !important;
  color: #fff !important;
  border: none !important;
}
.btn-bulk-danger:hover { background: #B91C1C !important; }

/* ============================================ CHECKBOX */
.checkbox-wrap {
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative;
  width: 18px; height: 18px;
}
.checkbox-wrap input[type="checkbox"] {
  opacity: 0; position: absolute; width: 0; height: 0;
}
.checkmark {
  width: 16px; height: 16px;
  border: 2px solid var(--cream-4);
  border-radius: 4px;
  background: var(--surface);
  transition: all .12s;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.checkbox-wrap input:checked ~ .checkmark {
  background: var(--navy);
  border-color: var(--navy);
}
.checkbox-wrap input:checked ~ .checkmark::after {
  content: '';
  width: 4px; height: 7px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
  display: block;
}
.checkbox-wrap input:indeterminate ~ .checkmark {
  background: var(--navy-2);
  border-color: var(--navy-2);
}
.checkbox-wrap input:indeterminate ~ .checkmark::after {
  content: '';
  width: 8px; height: 2px;
  background: #fff;
  display: block;
  margin: auto;
}

.col-check { width: 40px; text-align: center !important; padding: 0 8px !important; }
td.check-cell { text-align: center; padding: 0 8px !important; }

/* Highlight checked rows */
.schedule-table tr:has(.row-check:checked) td {
  background: var(--navy-light) !important;
}
.schedule-table tr:has(.row-check:checked) td.date-cell {
  background: #D8E4F0 !important;
}
/* ============================================ ROSTER EDIT */
.btn-roster-edit {
  display: flex; align-items: center; gap: 6px;
  position: absolute; top: 14px; right: 16px;
  padding: 5px 12px; border-radius: var(--r-xs);
  background: var(--cream-2); border: 1.5px solid var(--cream-3);
  color: var(--ink-3); font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: .72rem; font-weight: 700; cursor: pointer;
  transition: all .12s; letter-spacing: .2px;
}
.btn-roster-edit:hover { background: var(--navy-light); color: var(--navy); border-color: var(--indigo-border); }

.roster-staff-picker {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px; background: var(--cream-2);
  border: 1.5px solid var(--cream-3); border-radius: var(--r-sm);
  max-height: 160px; overflow-y: auto;
}
.roster-check-item {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px; background: var(--surface);
  border: 1.5px solid var(--cream-3); border-radius: 20px;
  font-size: .78rem; font-weight: 600; color: var(--ink-2);
  cursor: pointer; transition: all .12s; white-space: nowrap;
}
.roster-check-item:hover { border-color: var(--navy-2); background: var(--navy-light); }
.roster-check-item input[type="checkbox"] { display: none; }
.roster-check-item:has(input:checked) {
  background: var(--navy); border-color: var(--navy);
  color: #fff;
}
/* ============================================ PYRAMID STAFF */
.pyramid-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 16px 0 24px;
  width: 100%;
}

.pyr-tier-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.pyr-tier-label {
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 4px 16px;
  border-radius: 20px;
  margin-bottom: 14px;
}
.pyr-label-leader    { background: #FEF3C7; color: #92400E; }
.pyr-label-assistant { background: #E0E7FF; color: #3730A3; }
.pyr-label-staff     { background: #F0FDF4; color: #166534; }

.pyr-tier {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  width: 100%;
}

.pyr-connector {
  width: 2px;
  height: 28px;
  background: linear-gradient(to bottom, #d1d5db, transparent);
  margin: 8px auto;
}

/* CARDS */
.pyr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 20px 16px 14px;
  border-radius: 16px;
  transition: transform .15s, box-shadow .15s;
  cursor: default;
  position: relative;
}
.pyr-card-leader { padding-top: 28px; }
.pyr-card:hover { transform: translateY(-4px); }

.pyr-card-leader {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 2px solid #fbbf24;
  box-shadow: 0 4px 20px rgba(251,191,36,.18);
  min-width: 120px;
}
.pyr-card-assistant {
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  border: 2px solid #a5b4fc;
  box-shadow: 0 4px 16px rgba(165,180,252,.18);
  min-width: 110px;
}
.pyr-card-staff {
  background: #fafafa;
  border: 1.5px solid #e5e7eb;
  min-width: 90px;
}
.pyr-card-staff:hover { box-shadow: 0 4px 12px rgba(0,0,0,.06); }

/* AVATAR - Bottts Robot */
.pyr-crown-wrap {
  position: absolute;
  top: -14px; left: 50%;
  transform: translateX(-50%);
  font-size: 1rem;
  line-height: 1;
  z-index: 2;
}
.pyr-avatar-bot {
  border-radius: 16px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.pyr-avatar-bot img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: auto;
}
.pyr-avatar-fallback {
  width: 100%; height: 100%;
  align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: 1rem;
  background: #6366f1;
}
.pyr-avatar-leader {
  width: 80px; height: 80px;
  border-radius: 20px;
  border: 3px solid #fbbf24;
  box-shadow: 0 4px 20px rgba(251,191,36,.25);
}
.pyr-avatar-assistant {
  width: 68px; height: 68px;
  border-radius: 17px;
  border: 2px solid #a5b4fc;
  box-shadow: 0 4px 14px rgba(165,180,252,.2);
}
.pyr-avatar-staff {
  width: 56px; height: 56px;
  border-radius: 14px;
  border: 2px solid #e2e8f0;
}

/* NAME */
.pyr-name {
  font-size: .78rem;
  font-weight: 700;
  color: #1a1a2e;
  text-align: center;
}
.pyr-card-leader .pyr-name { font-size: .85rem; }

/* ROLE BADGE */
.pyr-role-badge {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .4px;
  padding: 2px 9px;
  border-radius: 10px;
}
.pyr-badge-leader    { background: #fbbf24; color: #78350f; }
.pyr-badge-assistant { background: #a5b4fc; color: #312e81; }

/* CARD ACTIONS */
.pyr-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.pyr-card-actions .btn-edit,
.pyr-card-actions .btn-del {
  font-size: .65rem;
  padding: 3px 10px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
}
.pyr-card-actions .btn-edit { background: #e0e7ff; color: #3730a3; }
.pyr-card-actions .btn-del  { background: #fee2e2; color: #991b1b; }
.pyr-card-actions .btn-edit:hover { background: #c7d2fe; }
.pyr-card-actions .btn-del:hover  { background: #fecaca; }