:root {
  --ink: #172033;
  --muted: #68758a;
  --line: #e3e8f0;
  --soft: #f4f7fb;
  --panel: #ffffff;
  --brand: #3157d5;
  --brand-deep: #253c9b;
  --accent: #2bb6a8;
  --danger: #c33e4b;
  --warning: #a86608;
  --shadow: 0 14px 34px rgba(25, 43, 76, .08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--soft);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--soft); }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 255px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 255px; padding: 24px 17px; background: #14213d; color: white; display: flex; flex-direction: column; z-index: 30; overflow-y: auto; }
.brand { color: white; display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 800; letter-spacing: -.3px; margin: 0 9px 24px; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(145deg, #4971f5, #2bb6a8); box-shadow: 0 8px 16px rgba(43,182,168,.18); }
.company-chip { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.11); border-radius: 12px; padding: 11px 13px; margin: 0 3px 18px; }
.company-chip small, .user-card small { display: block; color: #abb7cc; font-size: 11px; margin-bottom: 3px; }
.company-chip strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label { color: #8190aa; font-size: 10px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; margin: 18px 11px 5px; }
.nav-link { color: #cdd6e6; padding: 10px 11px; border-radius: 9px; font-size: 14px; display: flex; align-items: center; gap: 11px; transition: .15s ease; }
.nav-link:hover, .nav-link.active { color: white; background: rgba(255,255,255,.10); }
.nav-link.active { box-shadow: inset 3px 0 var(--accent); }
.nav-icon { width: 18px; text-align: center; opacity: .9; }
.admin-nav { margin-top: 4px; }
.sidebar-footer { margin-top: auto; padding-top: 22px; }
.user-card { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; color: white; }
.user-card strong { display: block; font-size: 13px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #31415f; font-weight: 800; }
.link-button { border: 0; background: none; color: #aebad0; padding: 7px 44px; font-size: 12px; }
.content-shell { grid-column: 2; min-width: 0; }
.topbar { min-height: 88px; padding: 20px clamp(22px, 4vw, 52px); background: rgba(255,255,255,.88); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 20px; backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.topbar h1 { font-size: clamp(22px, 3vw, 29px); margin: 1px 0 0; letter-spacing: -.6px; }
.eyebrow { color: var(--brand); font-size: 10px; text-transform: uppercase; font-weight: 800; letter-spacing: 1.4px; }
.timezone-pill { margin-left: auto; padding: 7px 11px; border-radius: 20px; color: var(--muted); background: var(--soft); font-size: 12px; }
.menu-button { display: none; border: 0; background: transparent; font-size: 22px; }
.main-content { width: min(1440px, 100%); margin: 0 auto; padding: 30px clamp(22px, 4vw, 52px) 125px; }
.digi-companion { position: fixed; right: 18px; bottom: 18px; z-index: 35; width: 88px; height: 88px; display: block; border: 3px solid white; border-radius: 20px; background: #050505; box-shadow: 0 14px 35px rgba(16,24,40,.25); transition: width .2s ease, height .2s ease, transform .2s ease, box-shadow .2s ease; }
.digi-companion:hover { transform: translateY(-3px); box-shadow: 0 18px 42px rgba(16,24,40,.32); }
.digi-companion:focus-visible { outline: 3px solid #ff8a1d; outline-offset: 3px; }
.digi-companion::after { content: '↗'; position: absolute; right: -6px; bottom: -6px; width: 24px; height: 24px; display: grid; place-items: center; border: 2px solid white; border-radius: 50%; background: #6f2bd9; color: white; font-size: 12px; font-weight: 900; }
.digi-companion img { width: 100%; height: 100%; display: block; border-radius: 16px; object-fit: cover; }
.digi-companion.is-dancing { width: 102px; height: 102px; box-shadow: 0 18px 46px rgba(111,43,217,.34); }
.page-actions { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 20px; }
.page-actions h2, .section-heading h2 { margin: 0; font-size: 19px; }
.page-actions p, .section-heading p { color: var(--muted); margin: 5px 0 0; font-size: 13px; }
.button { border: 1px solid transparent; border-radius: 9px; padding: 9px 15px; background: var(--brand); color: white; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; }
.button:hover { background: var(--brand-deep); }
.button.secondary { background: white; color: var(--ink); border-color: var(--line); }
.button.secondary:hover { border-color: #bfc9d9; background: #f9fbff; }
.button.danger { color: var(--danger); background: #fff; border-color: #efcbd0; }
.button.small { padding: 5px 9px; min-height: 30px; font-size: 12px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.stat-card { padding: 20px; position: relative; overflow: hidden; }
.stat-card::after { content: ''; position: absolute; width: 70px; height: 70px; border-radius: 50%; background: color-mix(in srgb, var(--brand) 8%, white); right: -22px; top: -24px; }
.stat-card small { color: var(--muted); display: block; font-size: 12px; font-weight: 600; }
.stat-card strong { font-size: 30px; display: block; margin-top: 8px; }
.panel { margin-bottom: 20px; overflow: hidden; }
.panel-header { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-header h2, .panel-header h3 { font-size: 16px; margin: 0; }
.panel-body { padding: 20px; }
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(290px, .8fr); gap: 20px; align-items: start; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { color: var(--muted); text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .65px; padding: 11px 14px; background: #fbfcfe; border-bottom: 1px solid var(--line); }
td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.row-title { font-weight: 750; color: var(--ink); }
.subtext { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.badge { display: inline-flex; align-items: center; border-radius: 20px; padding: 4px 8px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .45px; color: #176359; background: #dff8f1; }
.badge.inactive, .badge.cancelled { color: #7d3c43; background: #fdebed; }
.badge.role { color: #344fa4; background: #e9efff; }
.job-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.calendar-panel { overflow: hidden; }
.calendar-toolbar { min-height: 64px; padding: 13px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.calendar-navigation, .calendar-legend { display: flex; align-items: center; gap: 9px; }
.calendar-navigation h2 { width: 170px; margin: 0; text-align: center; font-size: 18px; letter-spacing: -.25px; }
.calendar-arrow { width: 34px; padding: 4px; font-size: 21px; line-height: 1; }
.calendar-legend { color: var(--muted); font-size: 11px; font-weight: 700; }
.calendar-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.legend-dot.linked { background: #7454d6; }
.legend-dot.people { background: var(--brand); }
.legend-dot.reservations { background: var(--accent); }
.calendar-scroll { width: 100%; overflow-x: auto; }
.month-calendar { min-width: 900px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--line); gap: 1px; }
.calendar-weekday { padding: 9px 10px; background: #f8faff; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .7px; text-align: center; text-transform: uppercase; }
.calendar-day { min-width: 0; min-height: 150px; padding: 9px; background: white; }
.calendar-day.other-month { background: #f8fafc; }
.calendar-day.today { background: #f5f8ff; box-shadow: inset 0 0 0 2px rgba(49,87,213,.28); }
.calendar-day-heading { min-height: 23px; margin-bottom: 5px; display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.calendar-day-number { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: #3d485c; font-size: 12px; font-weight: 800; }
.other-month .calendar-day-number { color: #9aa5b5; }
.today .calendar-day-number { background: var(--brand); color: white; }
.today-label { color: var(--brand); font-size: 9px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; }
.calendar-events { display: flex; flex-direction: column; gap: 5px; }
.calendar-event { min-width: 0; padding: 7px 8px; border-left: 3px solid; border-radius: 6px; display: block; color: var(--ink); }
.calendar-event:hover { filter: brightness(.975); box-shadow: 0 2px 7px rgba(31,50,85,.09); }
.calendar-event.people-event { border-color: var(--brand); background: #edf2ff; }
.calendar-event.reservation-event { border-color: #16998c; background: #eaf9f6; }
.calendar-event.linked-event { border-color: #7454d6; background: #f1edff; }
.calendar-event-top { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.calendar-event-time { color: #526077; font-size: 9px; font-weight: 800; white-space: nowrap; }
.calendar-event-kind { overflow: hidden; color: #53627a; font-size: 8px; font-weight: 850; letter-spacing: .35px; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.calendar-event strong { min-width: 0; margin: 3px 0 4px; display: block; overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event-detail { min-width: 0; margin-top: 2px; display: block; overflow: hidden; color: #68758a; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event-detail b { color: #44516a; font-weight: 800; }
.calendar-more { padding: 2px 7px; color: var(--brand); font-size: 10px; font-weight: 800; }
.calendar-stats { margin-top: 24px; }
.actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
form.inline { display: inline; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 750; color: #344054; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #ccd5e2; border-radius: 8px; padding: 9px 10px; background: white; color: var(--ink); outline: none; min-height: 39px; }
.field textarea { min-height: 86px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(49,87,213,.11); }
.field small { color: var(--muted); font-size: 11px; }
.checkbox { flex-direction: row; align-items: center; padding-top: 22px; }
.checkbox input { width: auto; min-height: auto; }
.form-actions { display: flex; gap: 9px; margin-top: 18px; align-items: center; }
.alert { padding: 12px 15px; border-radius: 10px; margin-bottom: 18px; border: 1px solid; font-size: 13px; }
.alert.success { color: #176359; border-color: #b8e7dc; background: #edfbf7; }
.alert.error { color: #8c2934; border-color: #efc5ca; background: #fff0f2; }
.alert.warning { color: #795011; border-color: #eed7a5; background: #fff8e8; }
.empty-state { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty-state h3 { color: var(--ink); margin: 10px 0 5px; }
.empty-state p { margin: 0; font-size: 13px; }
.empty-icon { font-size: 28px; color: var(--brand); }
.auth-shell { min-height: 100vh; padding: 40px 20px; display: grid; place-items: center; background: radial-gradient(circle at 15% 15%, #e2eaff, transparent 30%), radial-gradient(circle at 85% 80%, #dff9f3, transparent 28%), #f7f9fc; }
.auth-card { width: min(470px, 100%); background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 25px 70px rgba(28,43,74,.13); padding: 34px; }
.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth-logo .brand-mark { color: white; }
.auth-card h1 { margin: 0; font-size: 25px; }
.auth-card > p { color: var(--muted); margin: 8px 0 25px; font-size: 13px; line-height: 1.55; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .button { width: 100%; margin-top: 7px; }
.help-box { background: #f7f9fc; border-radius: 10px; padding: 12px 14px; color: var(--muted); font-size: 11px; margin-top: 16px; line-height: 1.5; }
dialog { border: 0; border-radius: 16px; width: min(620px, calc(100% - 24px)); max-height: 90vh; padding: 0; overflow: hidden; box-shadow: 0 35px 90px rgba(0,0,0,.24); }
dialog::backdrop { background: rgba(12,22,43,.55); backdrop-filter: blur(2px); }
.dialog-head { display: flex; justify-content: space-between; padding: 19px 22px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 18px; margin: 0; }
.dialog-close { border: 0; background: transparent; font-size: 22px; color: var(--muted); }
.dialog-body { padding: 22px; max-height: calc(90vh - 64px); overflow-y: auto; }
.color-input { min-height: 39px; padding: 4px !important; }
.filter-bar { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.filter-bar .field { min-width: 150px; }
.filter-bar .button { margin-bottom: 0; }
.schedule-item { display: grid; grid-template-columns: 120px minmax(180px, 1fr) minmax(150px, .7fr) auto; gap: 14px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.schedule-item:last-child { border-bottom: 0; }
.schedule-item.just-created { background: #eefbf7; box-shadow: inset 4px 0 var(--accent); }
.date-block strong { font-size: 13px; display: block; }.date-block span { color: var(--muted); font-size: 11px; }
.muted { color: var(--muted); }.text-danger { color: var(--danger); }.text-right { text-align: right; }
.settings-note { border-left: 3px solid var(--brand); padding: 10px 13px; background: #f1f5ff; color: #49566c; font-size: 12px; margin-bottom: 17px; }
code { background: #edf1f7; border-radius: 4px; padding: 2px 5px; }
@media (max-width: 1050px) { .cards { grid-template-columns: repeat(2, 1fr); } .split { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 20px 0 50px rgba(0,0,0,.2); }
  .sidebar.open { transform: translateX(0); }
  .content-shell { width: 100%; }
  .menu-button { display: inline-block; }
  .topbar { padding: 15px 18px; min-height: 76px; }
  .timezone-pill { display: none; }
  .main-content { padding: 22px 15px 105px; }
  .digi-companion { right: 12px; bottom: 12px; width: 72px; height: 72px; border-radius: 17px; }
  .digi-companion img { border-radius: 13px; }
  .digi-companion.is-dancing { width: 82px; height: 82px; }
  .cards, .two-column, .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .page-actions { align-items: flex-start; }
  .calendar-toolbar { align-items: flex-start; flex-direction: column; }
  .calendar-navigation { width: 100%; }
  .calendar-navigation h2 { width: auto; flex: 1; }
  .month-calendar { min-width: 760px; }
  .calendar-day { min-height: 130px; }
  .schedule-item { grid-template-columns: 95px 1fr; }
  .schedule-item > :last-child { grid-column: 2; }
}
@media (max-width: 470px) { .cards { grid-template-columns: 1fr; } .page-actions { flex-direction: column; } .auth-card { padding: 25px 20px; } }
@media (prefers-reduced-motion: reduce) { .digi-companion { transition: none; } }

