@font-face { font-family: 'Archivo'; src: url('/fonts/archivo.woff2') format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
:root { --navy: #142034; --navy-2: #1d2c47; --signal: #24498F; --heat: #B72923; --ember: #D44E1F; --frost: #EEF1F4; --frost-2: #E2E7ED; --rule: #D3DAE3; --ink-2: #546174; --ok: #1E6B45; --warn: #8A5A00; --focus: 0 0 0 2px #fff, 0 0 0 4px var(--signal); }
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Archivo', system-ui, sans-serif; font-size: 15px; line-height: 1.5; color: var(--navy); background: var(--frost); }
a { color: var(--signal); }
:focus-visible { outline: none; box-shadow: var(--focus); }
h1 { font-size: 26px; font-stretch: 115%; font-weight: 760; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 17px; font-stretch: 108%; font-weight: 720; margin: 0 0 12px; }
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #C9D2DE; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { display: block; padding: 4px 8px 18px; } .side .logo img { height: 34px; width: auto; }
.side nav { display: grid; gap: 1px; }
.side nav a { color: #C9D2DE; text-decoration: none; padding: 8px 10px; border-radius: 2px; display: flex; justify-content: space-between; align-items: center; }
.side nav a:hover { background: var(--navy-2); color: #fff; }
.side nav a[aria-current] { background: #fff; color: var(--navy); font-weight: 650; }
.side nav .grp { margin: 14px 10px 4px; font-size: 12px; color: #8C9AB0; }
.side .badge { background: var(--heat); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px; }
.side .me { margin-top: 18px; padding: 12px 10px; border-top: 1px solid rgba(255,255,255,.12); font-size: 13px; }
.side .me button { background: none; border: 0; color: #fff; text-decoration: underline; padding: 0; font: inherit; cursor: pointer; }
.main { padding: 24px 32px 64px; min-width: 0; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--ink-2); margin-bottom: 4px; } .crumbs a { color: var(--ink-2); }
.demo-flag { background: #FFF4D6; border-bottom: 1px solid #E8C66A; padding: 6px 32px; font-size: 13px; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: 10px; }
  .side nav { display: flex; overflow-x: auto; gap: 4px; } .side nav .grp, .side .me { display: none; }
  .side nav a { white-space: nowrap; }
  .main { padding: 16px 14px 80px; }
}
.btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; font: inherit; font-weight: 650; background: var(--navy); color: #fff; border: 1.5px solid var(--navy); border-radius: 2px; cursor: pointer; text-decoration: none; }
.btn.sec { background: #fff; color: var(--navy); } .btn.danger { background: #fff; color: var(--heat); border-color: var(--heat); } .btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn.big { min-height: 52px; font-size: 16px; padding: 0 22px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.panel { background: #fff; border: 1px solid var(--rule); padding: 18px 20px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); } .g4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi { background: #fff; border: 1px solid var(--rule); padding: 14px 16px; text-decoration: none; color: var(--navy); display: block; }
.kpi b { display: block; font-size: 30px; font-stretch: 118%; font-weight: 780; line-height: 1.1; }
.kpi span { font-size: 13px; color: var(--ink-2); }
.kpi.alert { border-left: 4px solid var(--heat); } .kpi.attn { border-left: 4px solid var(--ember); }
table.t { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
table.t th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--ink-2); padding: 9px 10px; border-bottom: 1.5px solid var(--navy); white-space: nowrap; }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.t tr:hover td { background: #F7F9FB; }
.tw { overflow-x: auto; border: 1px solid var(--rule); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; font-size: 12px; font-weight: 700; background: var(--frost); white-space: nowrap; }
.pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st-CONFIRMED, .st-COMPLETED, .st-DELIVERED, .st-SENT, .st-READY, .st-ACCEPTED, .st-FINAL, .st-ACTIVE { color: var(--ok); }
.st-PENDING, .st-AWAITING_SCHEDULE, .st-RESCHEDULE_PROPOSED, .st-QUEUED, .st-DELAYED, .st-DRAFT, .st-INVITED, .st-SUBMITTED, .st-OPEN { color: var(--warn); }
.st-REJECTED, .st-CANCELLED, .st-NO_SHOW, .st-FAILED, .st-BOUNCED, .st-COMPLAINED, .st-DEACTIVATED, .st-DECLINED { color: var(--heat); }
.st-IN_PROGRESS, .st-CAPTURED, .st-SENDING { color: var(--signal); } .st-OBSOLETE, .st-SUPERSEDED { color: #8C9AB0; }
.urgent { color: #fff; background: var(--heat); font-size: 11px; font-weight: 800; padding: 2px 6px; letter-spacing: .02em; }
form.inline { display: inline; }
.f { display: grid; gap: 4px; margin-bottom: 12px; } .f label, .lbl { font-size: 13px; font-weight: 600; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date], input[type=time], input[type=number], input[type=datetime-local], input[type=search], select, textarea { font: inherit; color: var(--navy); background: #fff; border: 1.5px solid #9AA6B5; border-radius: 2px; min-height: 40px; padding: 7px 10px; width: 100%; }
textarea { min-height: 90px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 12px; } .filters .f { margin: 0; min-width: 140px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; } dl.kv dt { color: var(--ink-2); font-size: 13px; } dl.kv dd { margin: 0; }
.note { background: var(--frost-2); border-left: 4px solid var(--signal); padding: 10px 12px; font-size: 14px; margin: 10px 0; }
.note.warn { border-color: var(--heat); background: #FBEDEB; } .note.ok { border-color: var(--ok); background: #E8F3EC; }
.flash { padding: 10px 14px; margin-bottom: 14px; font-weight: 600; } .flash.ok { background: #E8F3EC; color: var(--ok); } .flash.err { background: #FBEDEB; color: var(--heat); }
/* Employee selector */
.emp-list { display: grid; gap: 8px; }
.emp { display: grid; grid-template-columns: 24px 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1.5px solid var(--rule); background: #fff; cursor: pointer; }
.emp.bad { background: #FAFBFC; } .emp.bad .nm { color: var(--ink-2); }
.emp input { width: 20px; height: 20px; accent-color: var(--navy); }
.emp:has(input:checked) { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.emp .av { width: 40px; height: 40px; border-radius: 50%; background: var(--frost-2); display: grid; place-items: center; font-weight: 750; font-stretch: 115%; }
.emp .nm { font-weight: 650; } .emp .why { font-size: 12.5px; color: var(--heat); } .emp .ok { font-size: 12.5px; color: var(--ok); }
.emp .load { font-size: 12px; color: var(--ink-2); text-align: right; }
.load-bar { width: 80px; height: 6px; background: var(--frost-2); margin-top: 4px; } .load-bar i { display: block; height: 100%; background: var(--signal); }
.team-status { padding: 10px 12px; margin: 10px 0; font-weight: 600; font-size: 14px; }
/* Resource timeline */
.tl { position: relative; background: #fff; border: 1px solid var(--rule); overflow-x: auto; }
.tl-grid { display: grid; min-width: 900px; }
.tl-row { display: grid; grid-template-columns: 170px 1fr; border-bottom: 1px solid var(--rule); min-height: 64px; }
.tl-name { padding: 10px 12px; font-weight: 650; border-right: 1px solid var(--rule); font-size: 14px; }
.tl-name small { display: block; color: var(--ink-2); font-weight: 400; }
.tl-lane { position: relative; background-image: repeating-linear-gradient(90deg, transparent 0, transparent calc(100% / 12 - 1px), var(--frost-2) calc(100% / 12 - 1px), var(--frost-2) calc(100% / 12)); }
.tl-off { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, #F1F3F6 0 6px, #E6EAEF 6px 7px); }
.tl-ev { position: absolute; top: 8px; bottom: 8px; background: var(--navy); color: #fff; font-size: 12px; padding: 4px 6px; overflow: hidden; text-decoration: none; border-left: 4px solid var(--signal); line-height: 1.25; }
.tl-ev.urg { border-left-color: var(--heat); } .tl-ev.ip { background: var(--signal); }
.tl-ev .buf { position: absolute; right: 0; top: 0; bottom: 0; background: rgba(255,255,255,.18); }
.tl-head { display: grid; grid-template-columns: 170px 1fr; border-bottom: 1.5px solid var(--navy); font-size: 12px; color: var(--ink-2); }
.tl-hours { display: grid; grid-template-columns: repeat(12, 1fr); } .tl-hours span { padding: 6px 4px; }
/* Employee mobile job view */
.job-hero { background: var(--navy); color: #fff; padding: 18px; margin: -16px -14px 16px; }
@media (min-width: 901px) { .job-hero { margin: 0 0 16px; } }
.job-hero a { color: #fff; }
.check-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.check-item input[type=checkbox] { width: 24px; height: 24px; flex: none; accent-color: var(--navy); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; } .photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--rule); }
.sig-pad { border: 1.5px dashed #9AA6B5; background: #fff; touch-action: none; width: 100%; height: 180px; display: block; }
.upl-progress { height: 6px; background: var(--frost-2); margin-top: 6px; } .upl-progress i { display: block; height: 100%; width: 0; background: var(--signal); transition: width .2s; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .box { background: #fff; width: 100%; max-width: 400px; padding: 32px; border-top: 6px solid var(--navy); }
.login img { height: 44px; margin-bottom: 20px; }
.muted { color: var(--ink-2); font-size: 13px; }
.empty { padding: 28px; text-align: center; color: var(--ink-2); background: #fff; border: 1px dashed var(--rule); }
.mail-frame { width: 100%; height: 640px; border: 1px solid var(--rule); background: #fff; }

/* ── Phase 2 ── */
.g3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1.5px solid var(--navy); background: #fff; margin: 0 8px 12px 0; }
.seg a { padding: 7px 12px; text-decoration: none; color: var(--navy); font-weight: 600; font-size: 13.5px; border-right: 1px solid var(--rule); }
.seg a:last-child { border-right: 0; } .seg a[aria-current] { background: var(--navy); color: #fff; } .seg a:hover:not([aria-current]) { background: var(--frost); }
.seg.tabs { display: flex; width: fit-content; max-width: 100%; }
.cal-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.cal-filters .chk { display: flex; gap: 6px; align-items: center; min-width: 0; font-weight: 600; font-size: 13px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin-top: 8px; }
.lg { display: inline-block; width: 14px; height: 10px; margin-right: 4px; vertical-align: middle; }
.lg.free { background: #DDEFE3; } .lg.off { background: repeating-linear-gradient(135deg, #E2E7ED 0 4px, #F4F6F8 4px 8px); } .lg.buf { background: #9DB0CC; } .lg.cf { border: 2px solid var(--heat); }
.tl-free { position: absolute; top: 0; bottom: 0; background: #DDEFE3; }
.tl-off.prot { background: repeating-linear-gradient(135deg, #F0D5D2 0 4px, #FBEDEB 4px 8px); }
.tl-ev, .chip-ev { --c: var(--signal); }
.tl-ev { border-left: 4px solid var(--c) !important; }
.tl-ev.cf, .chip-ev.cf { outline: 2px solid var(--heat); outline-offset: -2px; }
.tl-ev[draggable="true"], .chip-ev[draggable="true"] { cursor: grab; }
.tl-lane.drop, .wk-cell.drop { background: #E7EEF8; box-shadow: inset 0 0 0 2px var(--signal); }
.tl-lane { cursor: copy; }
.chip-ev { display: block; font-size: 12.5px; padding: 3px 6px; margin: 3px 0; background: #fff; border: 1px solid var(--rule); border-left: 4px solid var(--c); color: var(--navy); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-ev.urg { background: #FBEDEB; } .chip-ev.st-COMPLETED { opacity: .7; } .chip-ev.st-CANCELLED, .chip-ev.st-NO_SHOW { text-decoration: line-through; opacity: .6; }
table.wk th.today, .m-cell.today .m-day { color: #fff; background: var(--navy); }
table.wk td.wk-cell { min-width: 120px; height: 72px; } table.wk td.off { background: repeating-linear-gradient(135deg, #F2F4F7 0 4px, #fff 4px 8px); }
.wk-meta { font-size: 11.5px; }
.month { background: #fff; border: 1px solid var(--rule); }
.m-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.m-head div { padding: 6px 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); border-bottom: 1.5px solid var(--navy); }
.m-cell { min-height: 108px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 4px 6px; position: relative; min-width: 0; }
.m-cell.out { background: #FAFBFC; color: #8C9AB0; }
.m-day { display: inline-block; min-width: 26px; text-align: center; font-weight: 700; text-decoration: none; color: inherit; padding: 1px 4px; }
.m-hol { font-size: 11px; color: var(--heat); } .m-more { font-size: 12px; } .m-cf { position: absolute; top: 4px; right: 6px; color: var(--heat); font-size: 12px; font-weight: 700; }
@media (max-width: 760px) { .m-cell { min-height: 72px; } .m-cell .chip-ev { display: none; } .m-cell .chip-ev:first-of-type { display: block; } }
dialog { border: 0; padding: 24px; max-width: 560px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(20, 32, 52, .35); }
dialog::backdrop { background: rgba(20, 32, 52, .45); }
.lb { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 5px; margin-right: 3px; border: 1px solid; }
.lb.ok { color: var(--ok); border-color: #B5D5C1; background: #E8F3EC; } .lb.miss { color: var(--heat); border-color: #EBC1BC; background: #FBEDEB; }
.sw { display: inline-block; width: 12px; height: 12px; vertical-align: middle; }
.row-form { display: grid; grid-template-columns: 1fr 2fr 2fr 2fr 60px auto; gap: 6px; align-items: center; padding: 6px 10px; }
.row-form.r7 { grid-template-columns: 1fr 2fr 2fr 2fr 60px 60px auto; }
@media (max-width: 900px) { .row-form, .row-form.r7 { grid-template-columns: 1fr 1fr; } }
.lang-col { border: 1px solid var(--rule); padding: 12px; min-width: 0; } .lang-col legend { font-weight: 700; padding: 0 6px; }
.radio { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; font-weight: 400 !important; }
.radio input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--navy); }
.consent { border: 1.5px solid var(--ember); background: #FFF8F2; padding: 12px; margin-top: 8px; }
.sticky-actions { position: sticky; bottom: 0; background: var(--frost); padding: 10px 0; display: flex; gap: 8px; flex-wrap: wrap; z-index: 2; border-top: 1px solid var(--rule); margin-bottom: 16px; }
.text-row { margin-bottom: 10px; } .text-row legend { font-weight: 600; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 12px 0; }
.media-grid figure { margin: 0; background: #fff; border: 1px solid var(--rule); } .media-grid figure.ok { border-color: var(--ok); }
.media-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--frost-2); }
.media-grid figcaption { padding: 8px; font-size: 12.5px; display: grid; gap: 4px; }
.load-bar.wide { width: 100%; height: 10px; }
.stack { display: grid; gap: 4px; margin-bottom: 6px; }
.why { color: var(--heat); font-size: 12.5px; }
.panel { min-width: 0; overflow-x: auto; }
table.wk th.today a, table.wk th.today .muted { color: #fff; }

/* ═══ Phase 4 — calendar workspace (scoped to .cal-page). Deep navy workspace, lighter panels, quiet grid lines,
   status-coloured rounded blocks (blue = confirmed, violet = in progress, green = completed, grey = cancelled/no-show,
   red outline = conflict) and a light detail panel. ═══ */
.cal-page { --cx-bg: #0b1220; --cx-panel: #111b2d; --cx-panel-2: #16233a; --cx-line: rgba(255,255,255,.07); --cx-line-2: rgba(255,255,255,.12);
  --cx-text: #e6edf5; --cx-dim: #9fb0c3; --cx-faint: #8194aa; --cx-blue: #4f93d8; --cx-violet: #8b7cf6; --cx-green: #3fae7d; --cx-red: #e5604f; --cx-grey: #74859a; }
.cal-page .main { background: var(--cx-bg); color: var(--cx-text); }
.cal-page .top h1 { color: #fff; font-weight: 500; font-stretch: 100%; letter-spacing: -.02em; font-size: 22px; }
.cal-page .top .crumbs, .cal-page .top .crumbs a { color: var(--cx-dim); }
.cal-page .flash { border-radius: 10px; }
.cal-page a { color: #9fcaf5; }
.cal-page .muted { color: var(--cx-dim) !important; }
.cal-page .small { font-size: 12px; }
.cal-page :focus-visible { outline: 2px solid #8fc1f2; outline-offset: 2px; box-shadow: none; }
.calx { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 18px; align-items: start; }
.cx-side { display: grid; gap: 14px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; scrollbar-width: thin; }
.cx-box, .mini, .cx-filters { background: var(--cx-panel); border: 1px solid var(--cx-line); border-radius: 14px; padding: 14px; }
.cx-box h2, .cx-filters h2 { font-size: 13px; font-weight: 600; font-stretch: 100%; color: #fff; margin: 0 0 10px; display: flex; justify-content: space-between; align-items: baseline; }
.cx-box h2 small { color: var(--cx-dim); font-weight: 400; }
/* mini month */
.mini-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 14px; }
.mini-head span { display: flex; gap: 4px; } .mini-head a { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--cx-dim); text-decoration: none; }
.mini-head a:hover { background: var(--cx-panel-2); color: #fff; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: 12px; }
.mini-wd { color: var(--cx-faint); padding: 4px 0; text-transform: uppercase; font-size: 10.5px; }
.mini-grid a { position: relative; display: grid; place-items: center; height: 30px; border-radius: 8px; color: var(--cx-text); text-decoration: none; }
.mini-grid a.out { color: var(--cx-faint); }
.mini-grid a.rng { background: rgba(79, 147, 216, .12); }
.mini-grid a:hover { background: var(--cx-panel-2); }
.mini-grid a.today { color: #8fc1f2; font-weight: 700; }
.mini-grid a.sel { background: #2b6cb0; color: #fff; font-weight: 600; }
.mini-grid a.busy::after { content: ''; position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: #8fc1f2; }
.mini-grid a.sel.busy::after { background: #fff; }
/* today list */
.today-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.today-list a { display: grid; grid-template-columns: 46px 1fr; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--cx-panel-2); color: var(--cx-text); text-decoration: none; border-left: 3px solid var(--cx-blue); font-size: 13px; }
.today-list a.st-IN_PROGRESS { border-left-color: var(--cx-violet); } .today-list a.st-COMPLETED { border-left-color: var(--cx-green); }
.today-list .tt { color: var(--cx-dim); font-variant-numeric: tabular-nums; } .today-list small { display: block; color: var(--cx-dim); font-size: 11.5px; }
/* filters */
.cx-filters .f { margin-bottom: 10px; } .cx-filters label { color: var(--cx-dim); font-weight: 500; font-size: 12px; }
.cal-page select, .cal-page input[type=date], .cal-page input[type=time] { background: var(--cx-panel-2); color: var(--cx-text); border: 1px solid var(--cx-line-2); border-radius: 10px; min-height: 38px; }
.cx-filters .chk { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--cx-text); margin: 4px 0 12px; }
.cx-filter-actions { display: flex; gap: 8px; }
.cx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--cx-line-2); background: var(--cx-panel-2); color: var(--cx-text) !important; font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; transition: background .2s, border-color .2s; }
.cx-btn:hover { background: #1d2e49; border-color: rgba(255,255,255,.2); }
.cx-btn.primary { background: #2b6cb0; border-color: #2b6cb0; color: #fff !important; }
.cx-btn.primary:hover { background: #3f80c4; }
.cx-btn.icon { min-width: 36px; padding: 0 10px; font-size: 16px; }
/* workload */
.load { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 12.5px; }
.load li { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; } .load .ln { color: var(--cx-text); } .load .lv { color: var(--cx-dim); font-variant-numeric: tabular-nums; }
.load .bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--cx-panel-2); overflow: hidden; } .load .bar i { display: block; height: 100%; background: var(--cx-blue); border-radius: 4px; }
/* pending requests: dashed, visibly not on the calendar */
.cx-box.pending ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cx-box.pending a { display: grid; gap: 2px; padding: 8px 10px; border: 1px dashed rgba(255,255,255,.22); border-radius: 10px; color: var(--cx-text); text-decoration: none; font-size: 12.5px; }
.cx-box.pending a:hover { border-color: #8fc1f2; }
.cx-box.pending b { font-weight: 600; } .cx-box.pending em { font-style: normal; color: #ffb4a8; font-size: 11px; margin-left: 6px; }
.cx-box.pending span { color: var(--cx-dim); } .cx-box.pending .req { font-size: 11.5px; }
.cx-box.pending .more { display: inline-block; margin-top: 8px; font-size: 12.5px; }
/* legend */
.legend ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: 12.5px; color: var(--cx-text); }
.legend li { display: flex; align-items: center; gap: 8px; }
.lg { width: 14px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.lg.st-CONFIRMED { background: var(--cx-blue); } .lg.st-IN_PROGRESS { background: var(--cx-violet); } .lg.st-COMPLETED { background: var(--cx-green); } .lg.st-CANCELLED { background: var(--cx-grey); }
.lg.cf { border: 2px solid var(--cx-red); } .lg.ghost { border: 1px dashed #c8d6e6; } .lg.off { background: repeating-linear-gradient(135deg, rgba(255,255,255,.1) 0 2px, transparent 2px 5px); border: 1px solid var(--cx-line-2); }
.lg.prot { background: rgba(229, 96, 79, .35); } .lg.flex { background: rgba(255, 196, 92, .28); }

/* main column */
.cx-main { background: var(--cx-panel); border: 1px solid var(--cx-line); border-radius: 16px; padding: 14px; min-width: 0; }
.cx-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.cx-title { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.mini-head b { display: inline-block; } .cx-range::first-letter, .mini-head b::first-letter { text-transform: uppercase; }
.cx-range { margin: 0; font-size: 20px; font-weight: 500; font-stretch: 100%; letter-spacing: -.02em; color: #fff; }
.cx-nav { display: flex; gap: 6px; }
.cx-views { display: inline-flex; background: var(--cx-bg); border: 1px solid var(--cx-line); border-radius: 12px; padding: 3px; }
.cx-views a { padding: 7px 12px; border-radius: 9px; color: var(--cx-dim); text-decoration: none; font-size: 13px; }
.cx-views a:hover { color: #fff; } .cx-views a[aria-current] { background: var(--cx-panel-2); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.06) inset; }
.cx-hint { color: var(--cx-dim); font-size: 12.5px; margin: 12px 2px 0; }
.cx-note { color: var(--cx-text); background: var(--cx-panel-2); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.cx-empty { color: var(--cx-dim); padding: 24px 6px; }

/* week / day time grid */
.wg { --hour: 52px; --tcol: 54px; overflow-x: auto; }
.wg-head { display: grid; grid-template-columns: var(--tcol) repeat(var(--n, 7), minmax(110px, 1fr)); position: sticky; top: 0; z-index: 3; background: var(--cx-panel); border-bottom: 1px solid var(--cx-line-2); }
.wg[data-cols='1'] { --n: 1; } .wg[data-cols='7'] { --n: 7; }
.wg-corner { color: var(--cx-faint); font-size: 11px; padding: 10px 6px; text-transform: uppercase; }
.wg-day { padding: 6px 4px 8px; text-align: center; border-left: 1px solid var(--cx-line); }
.wg-day a { display: inline-grid; justify-items: center; gap: 2px; color: var(--cx-dim); text-decoration: none; padding: 4px 10px; border-radius: 10px; }
.wg-day a span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; } .wg-day a b { font-size: 18px; font-weight: 500; color: var(--cx-text); }
.wg-day a:hover { background: var(--cx-panel-2); }
.wg-day.sel a { background: rgba(79, 147, 216, .16); } .wg-day.today a b { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #2b6cb0; color: #fff; }
.wg-hol { display: block; color: #ffc9bf; font-size: 11px; margin-top: 2px; }
.wg-body { display: grid; grid-template-columns: var(--tcol) repeat(var(--n, 7), minmax(110px, 1fr)); height: calc(var(--rows) * var(--hour)); position: relative; }
.wg-times { position: relative; display: grid; grid-template-rows: repeat(var(--rows), 1fr); }
.wg-times span { font-size: 11px; color: var(--cx-faint); text-align: right; padding-right: 8px; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.wg-times span:first-child { visibility: hidden; }
.wg-col { position: relative; border-left: 1px solid var(--cx-line); background-image: repeating-linear-gradient(180deg, var(--cx-line) 0 1px, transparent 1px var(--hour)), repeating-linear-gradient(180deg, transparent 0 calc(var(--hour) / 2), rgba(255,255,255,.025) calc(var(--hour) / 2) calc(var(--hour) / 2 + 1px), transparent calc(var(--hour) / 2 + 1px) var(--hour)); }
.wg-col.sel { background-color: rgba(79, 147, 216, .045); }
.wg-col.drop { box-shadow: inset 0 0 0 2px var(--cx-blue); background-color: rgba(79, 147, 216, .1); }
.sh { position: absolute; left: 0; right: 0; pointer-events: none; }
.sh.off, .sh.away { background: repeating-linear-gradient(135deg, rgba(255,255,255,.045) 0 2px, transparent 2px 7px); background-color: rgba(0,0,0,.18); }
.sh.closed { background: repeating-linear-gradient(135deg, rgba(229,96,79,.12) 0 2px, transparent 2px 8px); background-color: rgba(0,0,0,.22); }
.sh.brk.prot { background: rgba(229, 96, 79, .16); border-top: 1px dashed rgba(229,96,79,.5); border-bottom: 1px dashed rgba(229,96,79,.5); }
.sh.brk.flex { background: rgba(255, 196, 92, .1); border-top: 1px dashed rgba(255,196,92,.35); border-bottom: 1px dashed rgba(255,196,92,.35); }
/* appointment blocks */
.ev, .ghost { position: absolute; z-index: 1; display: flex; flex-direction: column; gap: 1px; overflow: hidden; padding: 6px 8px; border-radius: 10px; text-decoration: none; font-size: 12px; line-height: 1.3;
  --c: var(--cx-blue); color: #eef5fc !important; background: color-mix(in srgb, var(--c) 22%, var(--cx-panel)); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); border-left: 3px solid var(--c);
  transition: transform .15s ease, box-shadow .2s ease, background .2s; }
.ev:hover, .ev:focus-visible { z-index: 2; background: color-mix(in srgb, var(--c) 32%, var(--cx-panel)); box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.ev.st-IN_PROGRESS { --c: var(--cx-violet); } .ev.st-COMPLETED { --c: var(--cx-green); }
.ev.st-CANCELLED, .ev.st-NO_SHOW { --c: var(--cx-grey); opacity: .75; } .ev.st-CANCELLED .ev-title, .ev.st-NO_SHOW .ev-title { text-decoration: line-through; }
.ev.cf { box-shadow: 0 0 0 2px var(--cx-red); }
.ev.dragging { opacity: .5; }
.ev[draggable='true'] { cursor: grab; }
.ev-time { font-variant-numeric: tabular-nums; color: #c5d6ea; font-size: 11px; }
.ev-title { font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-meta { color: #b9c9db; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.ev-foot { display: flex; align-items: center; gap: 6px; margin-top: auto; flex-wrap: wrap; }
.ev-status { font-size: 10.5px; padding: 1px 6px; border-radius: 6px; background: rgba(255,255,255,.1); }
.ev.cf .ev-status { background: rgba(229,96,79,.3); }
.ev-urg { font-size: 10.5px; padding: 1px 6px; border-radius: 6px; background: rgba(229,96,79,.28); color: #ffd7d0; }
.ev-who { margin-left: auto; font-size: 10.5px; letter-spacing: .04em; color: #d9e6f4; }
.ev.compact { flex-direction: row; align-items: center; gap: 6px; padding: 2px 8px; }
.ev.compact .ev-meta, .ev.compact .ev-foot .ev-who, .ev.compact .ev-foot .ev-urg { display: none; } .ev.compact .ev-foot { margin: 0 0 0 auto; flex-wrap: nowrap; }
.ghost { left: 3px; right: 3px; z-index: 0; background: transparent; border: 1px dashed rgba(200,214,230,.55); border-left: 1px dashed rgba(200,214,230,.55); color: #cbd8e6 !important; }
.ghost .ev-title { color: #dfe8f2; font-weight: 500; }
.now { position: absolute; left: -1px; right: 0; height: 0; border-top: 2px solid var(--cx-red); z-index: 3; pointer-events: none; }
.now::before { content: ''; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--cx-red); }
.now span { position: absolute; right: 4px; top: -18px; font-size: 10.5px; color: #ffb4a8; font-variant-numeric: tabular-nums; }

/* agenda / mobile list */
.cx-list { display: grid; gap: 10px; }
.cx-day h3 { font-size: 13px; font-weight: 500; color: var(--cx-dim); margin: 6px 0 8px; } .cx-day h3 b { color: #fff; font-weight: 600; } .cx-day.today h3 b { color: #8fc1f2; }
.cx-day ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.row-ev { display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; align-items: start; padding: 10px 12px; background: var(--cx-panel-2); border-radius: 12px; border-left: 3px solid var(--cx-blue); color: var(--cx-text) !important; text-decoration: none; font-size: 13px; }
.row-ev.st-IN_PROGRESS { border-left-color: var(--cx-violet); } .row-ev.st-COMPLETED { border-left-color: var(--cx-green); } .row-ev.st-CANCELLED, .row-ev.st-NO_SHOW { border-left-color: var(--cx-grey); opacity: .8; }
.row-ev.cf { box-shadow: inset 0 0 0 1px var(--cx-red); }
.row-ev .rt { font-variant-numeric: tabular-nums; color: #fff; } .row-ev .rt small { display: block; color: var(--cx-dim); }
.row-ev .rm b { display: block; font-weight: 600; } .row-ev .rm span { display: block; color: var(--cx-dim); font-size: 12px; } .row-ev .why { color: #ffb4a8 !important; }
.row-ev .rs { font-size: 11.5px; color: var(--cx-dim); text-align: right; } .row-ev .rs em { display: block; font-style: normal; color: #ffb4a8; }
.mobile-only { display: none; }

/* month */
.cal-page .month { background: transparent; border: 0; display: grid; gap: 0; }
.cal-page .m-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-page .m-head div { color: var(--cx-faint); font-size: 11.5px; text-transform: uppercase; padding: 6px 8px; border: 0; background: none; }
.cal-page .m-cell { min-height: 108px; border: 0; border-top: 1px solid var(--cx-line); border-left: 1px solid var(--cx-line); padding: 6px; background: transparent; }
.cal-page .m-cell.out { background: rgba(0,0,0,.14); } .cal-page .m-cell.out .m-day { color: var(--cx-faint); }
.cal-page .m-cell.closed { background: repeating-linear-gradient(135deg, rgba(229,96,79,.07) 0 2px, transparent 2px 8px); }
.cal-page .m-day { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 50%; color: var(--cx-text); text-decoration: none; font-size: 12.5px; }
.cal-page .m-cell.today .m-day { background: #2b6cb0; color: #fff; } .cal-page .m-cell.sel .m-day { box-shadow: 0 0 0 1px #8fc1f2; }
.cal-page .m-hol { font-size: 11px; color: #ffc9bf; }
.cal-page .chip-ev { display: block; margin: 3px 0; padding: 3px 7px; font-size: 11.5px; border-radius: 7px; background: color-mix(in srgb, var(--c, var(--cx-blue)) 22%, var(--cx-panel)); border: 0; border-left: 3px solid var(--c, var(--cx-blue)); color: #eef5fc !important; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-page .chip-ev.st-IN_PROGRESS { --c: var(--cx-violet); } .cal-page .chip-ev.st-COMPLETED { --c: var(--cx-green); } .cal-page .chip-ev.st-CANCELLED, .cal-page .chip-ev.st-NO_SHOW { --c: var(--cx-grey); text-decoration: line-through; }
.cal-page .chip-ev.cf { box-shadow: inset 0 0 0 1px var(--cx-red); outline: 0; }
.cal-page .m-more { font-size: 11.5px; color: var(--cx-dim); }

/* team (resource) timeline */
.cal-page .tl { background: transparent; border: 0; overflow-x: auto; }
.cal-page .tl-grid { min-width: 860px; }
.cal-page .tl-head { grid-template-columns: 200px 1fr; border-bottom: 1px solid var(--cx-line-2); color: var(--cx-faint); font-size: 11px; }
.cal-page .tl-head > span { padding: 8px 10px; }
.cal-page .tl-hours span { padding: 8px 4px; border-left: 1px solid var(--cx-line); }
.cal-page .tl-row { grid-template-columns: 200px 1fr; border-bottom: 1px solid var(--cx-line); min-height: 70px; }
.cal-page .tl-name { display: flex; gap: 10px; align-items: flex-start; border-right: 1px solid var(--cx-line); color: var(--cx-text); font-weight: 500; font-size: 13px; padding: 10px; }
.cal-page .tl-name small { color: var(--cx-dim); font-size: 11.5px; }
.cal-page .av { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--cx-panel-2); border: 1px solid var(--cx-line-2); font-size: 10.5px; color: #cfe0f2; flex: none; }
.cal-page .tl-lane { background-image: repeating-linear-gradient(90deg, transparent 0, transparent calc(100% / 12 - 1px), var(--cx-line) calc(100% / 12 - 1px), var(--cx-line) calc(100% / 12)); }
.cal-page .tl-off { background: repeating-linear-gradient(135deg, rgba(255,255,255,.045) 0 2px, transparent 2px 7px); background-color: rgba(0,0,0,.18); }
.cal-page .tl-off.prot { background: rgba(229, 96, 79, .16); } .cal-page .tl-off.flex { background: rgba(255, 196, 92, .1); }
.cal-page .tl-free { background: rgba(63, 174, 125, .1); }
.cal-page .tl-ev { top: 8px; bottom: 8px; border-radius: 10px; padding: 5px 8px; font-size: 11.5px; --c: var(--cx-blue); background: color-mix(in srgb, var(--c) 24%, var(--cx-panel)); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); border-left: 3px solid var(--c) !important; color: #eef5fc !important; display: flex; flex-direction: column; }
.cal-page .tl-ev.st-IN_PROGRESS { --c: var(--cx-violet); } .cal-page .tl-ev.st-COMPLETED { --c: var(--cx-green); } .cal-page .tl-ev.cf { box-shadow: 0 0 0 2px var(--cx-red); outline: 0; }
.cal-page .tl-ev span { color: #b9c9db; } .cal-page .tl-ev .buf { background: rgba(255,255,255,.08); border-radius: 0 10px 10px 0; }
.cal-page .tl-lane.drop { background-color: rgba(79,147,216,.12); box-shadow: inset 0 0 0 2px var(--cx-blue); }

/* detail panel: light, high-contrast side panel (sheet on mobile) */
.ev-panel { border: 0; padding: 22px 22px 20px; width: min(420px, 100%); max-width: none; height: 100dvh; max-height: none; margin: 0 0 0 auto; background: #fff; color: #142034; box-shadow: -24px 0 70px rgba(0,0,0,.45); }
.ev-panel[open] { animation: cx-in .28s cubic-bezier(.22,.61,.36,1); }
.ev-panel::backdrop, .cx-dlg::backdrop { background: rgba(5, 10, 20, .55); backdrop-filter: blur(3px); }
.evp-head { display: flex; justify-content: space-between; align-items: center; }
.evp-ref { margin: 0; color: #546174; font-size: 13px; font-variant-numeric: tabular-nums; }
.ev-panel .cx-btn { background: #f1f4f8; color: #142034 !important; border-color: #dbe2ea; } .ev-panel .cx-btn:hover { background: #e7edf4; }
.ev-panel .cx-btn.primary { background: #2b6cb0; border-color: #2b6cb0; color: #fff !important; }
.ev-panel h2 { font-size: 22px; font-weight: 550; font-stretch: 100%; line-height: 1.2; margin: 14px 0 10px; letter-spacing: -.01em; }
.evp-status { display: flex; gap: 6px; margin: 0 0 16px; }
.pillx { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: 12px; background: #eaf2fb; color: #1f5a96; }
.pillx::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pillx.st-IN_PROGRESS { background: #efecff; color: #5b47d6; } .pillx.st-COMPLETED { background: #e6f5ee; color: #1e6b45; } .pillx.st-CANCELLED, .pillx.st-NO_SHOW { background: #eef1f4; color: #4b5b6d; }
.pillx.urg { background: #fdeceb; color: #a8281c; }
.evp-dl { display: grid; grid-template-columns: 84px 1fr; gap: 10px 14px; margin: 0 0 16px; font-size: 14px; }
.evp-dl dt { color: #546174; font-size: 12.5px; padding-top: 1px; } .evp-dl dd { margin: 0; }
.evp-dl a { color: #255f9c; }
.evp-dl .tm { display: inline-block; background: #f1f4f8; border-radius: 6px; padding: 1px 8px; margin: 0 4px 4px 0; font-size: 13px; }
.evp-warn { background: #fdeceb; color: #8a2016; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }
.evp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cx-dlg { border: 0; border-radius: 16px; padding: 22px; width: min(520px, calc(100% - 24px)); background: #fff; color: #142034; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.cx-dlg h2 { font-weight: 550; font-stretch: 100%; font-size: 20px; }
.cx-dlg .cx-btn { background: #f1f4f8; color: #142034 !important; border-color: #dbe2ea; } .cx-dlg .cx-btn.primary { background: #2b6cb0; border-color: #2b6cb0; color: #fff !important; }
.cx-dlg input, .cx-dlg select { background: #fff !important; color: #142034 !important; border: 1px solid #b8c4d1 !important; }
.cx-dlg .radio { display: inline-flex; gap: 6px; align-items: center; margin: 0 14px 6px 0; font-size: 14px; }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
@keyframes cx-in { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }

/* responsive: sidebar becomes a drawer; week grid becomes a readable list on phones */
@media (max-width: 1180px) { .calx { grid-template-columns: 236px minmax(0, 1fr); } }
@media (max-width: 900px) {
  .calx { grid-template-columns: 1fr; }
  .cx-side.drawer { position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(320px, 88vw); max-height: none; height: 100dvh; padding: 14px; background: var(--cx-bg); box-shadow: 20px 0 60px rgba(0,0,0,.5); transform: translateX(-105%); transition: transform .28s cubic-bezier(.22,.61,.36,1); visibility: hidden; }
  .cx-side.drawer.open { transform: none; visibility: visible; }
  .cx-main { padding: 10px; border-radius: 14px; }
  .cx-range { font-size: 17px; }
  .cx-views { width: 100%; overflow-x: auto; } .cx-views a { flex: 1; text-align: center; padding: 7px 8px; }
}
@media (max-width: 760px) {
  .view-week .wg { display: none; } .view-week .mobile-only { display: grid; }
  .wg { --tcol: 44px; }
  .ev-panel { height: auto; max-height: 88dvh; margin: auto 0 0 0; width: 100%; border-radius: 18px 18px 0 0; }
  .ev-panel[open] { animation: cx-up .28s cubic-bezier(.22,.61,.36,1); }
  .cal-page .m-cell { min-height: 64px; padding: 3px; } .cal-page .m-cell .chip-ev { display: none; } .cal-page .m-cell .chip-ev:first-of-type { display: block; font-size: 10.5px; padding: 2px 4px; }
}
@keyframes cx-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cal-page *, .cal-page *::before { animation: none !important; transition: none !important; } }
.cal-page [hidden] { display: none !important; }
.cal-page .tl-ev strong, .cal-page .tl-ev span:not(.buf) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
@media (max-width: 760px) { .cx-hint { display: none; } }
/* Phase 4 fix: on narrow screens the grid rows no longer stretch the top navigation when a page is short. */
@media (max-width: 900px) { .app { align-content: start; } }
body.cal-page { background: #0b1220; }
