/* Switch SAMCOM — corporate theme. Plain system fonts, thin borders, small radii, no gradients or glows. */
:root {
  --bg: #eef1f5; --panel: #ffffff; --panel-2: #f7f9fb; --line: #d6dce4; --line-2: #e6eaf0;
  --text: #1b2430; --muted: #5d6b7c; --faint: #8a96a5;
  --bar: #0f2742; --bar-text: #e8eef6; --bar-muted: #9fb2c8;
  --accent: #1d5fa7; --accent-ink: #ffffff; --accent-soft: #e6eef8;
  --ok: #2f7d4f; --ok-soft: #e5f3ea; --warn: #a76512; --warn-soft: #fbf0df; --bad: #b42318; --bad-soft: #fbe9e7;
  --show: #1d5fa7; --travel: #a76512; --off: #2f7d4f; --rehearsal: #0f766e; --promo: #9d174d; --other: #64748b;
  --tab-h: calc(58px + env(safe-area-inset-bottom, 0px)); /* phone tab bar + the iPhone home-bar strip */
  --radius: 4px; --nav-w: 232px; --rail-w: 272px; --bar-h: 48px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
/* Graphite — the default dark-gray theme (neutral charcoal, not blue-black) */
[data-theme="graphite"] {
  --bg: #1c1d20; --panel: #25272b; --panel-2: #2b2e33; --line: #3a3e45; --line-2: #30333a;
  --text: #e7e8ea; --muted: #a6abb3; --faint: #7d838c;
  --bar: #141517; --bar-text: #eceef1; --bar-muted: #8e949d;
  --accent: #4f8fdb; --accent-ink: #ffffff; --accent-soft: #2a3442;
  --ok: #5fb47f; --ok-soft: #22332a; --warn: #d9a04a; --warn-soft: #3a3020; --bad: #ec6a5e; --bad-soft: #3d2422;
  --show: #4f8fdb; --travel: #d9a04a; --off: #5fb47f; --rehearsal: #3fb0a3; --promo: #d0669a; --other: #8b939e;
  color-scheme: dark;
}
[data-theme="graphite"] .search input { background: #23252a; border-color: #3a3e45; }
[data-theme="graphite"] .picker:hover, [data-theme="graphite"] .picker:focus, [data-theme="graphite"] .iconbtn:hover { border-color: #3a3e45; }
[data-theme="graphite"] .bar-sep { background: #3a3e45; }
[data-theme="graphite"] .topbar { border-bottom-color: #2b2e33; }
[data-theme="graphite"] .brand-mark { background: #e7e8ea; color: #141517; }
[data-theme="graphite"] .solo .brand-mark { background: #e7e8ea; color: #141517; }
[data-theme="graphite"] .modal-back { background: rgba(0, 0, 0, .55); }
[data-theme="graphite"] .chip.show { color: #8db8ec; } [data-theme="graphite"] .calgrid a.ev { color: var(--text); }
[data-theme="graphite"] ::-webkit-scrollbar { width: 10px; height: 10px; } [data-theme="graphite"] ::-webkit-scrollbar-thumb { background: #3a3e45; border-radius: 5px; border: 2px solid var(--panel); }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.45 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.005em; }
h1 { font-size: 20px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; } .nowrap { white-space: nowrap; }
.right { text-align: right; } .center { text-align: center; } .grow { flex: 1; } .mono { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ top bar */
.topbar { position: fixed; inset: 0 0 auto 0; height: var(--bar-h); background: var(--bar); color: var(--bar-text); display: flex; align-items: center; gap: 6px; padding: 0 12px; z-index: 30; border-bottom: 1px solid #000; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; letter-spacing: .02em; margin-right: 10px; color: var(--bar-text); }
.brand-mark { width: 26px; height: 26px; border-radius: 3px; background: #fff; color: var(--bar); display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.picker { appearance: none; background: transparent; color: var(--bar-text); border: 1px solid transparent; border-radius: var(--radius); padding: 6px 26px 6px 8px; font: inherit; font-weight: 600; max-width: 240px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--bar-muted) 50%), linear-gradient(135deg, var(--bar-muted) 50%, transparent 50%); background-position: right 12px center, right 7px center; background-size: 5px 5px; background-repeat: no-repeat; }
.picker:hover, .picker:focus { border-color: #2b4769; outline: none; }
.picker option { color: #111; }
.bar-sep { width: 1px; height: 22px; background: #2b4769; margin: 0 4px; }
.search { margin-left: auto; position: relative; }
.search input { width: 260px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); color: var(--bar-text); border-radius: var(--radius); padding: 6px 10px 6px 28px; font: inherit; }
.search input::placeholder { color: var(--bar-muted); }
.search::before { content: ""; position: absolute; left: 8px; top: 6px; font-size: 12px; opacity: .8; }
.search-results { position: absolute; right: 0; top: 36px; width: 380px; max-height: 60vh; overflow: auto; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.search-results a { display: block; padding: 8px 12px; border-bottom: 1px solid var(--line-2); color: var(--text); }
.search-results a:hover { background: var(--accent-soft); text-decoration: none; }
.iconbtn { position: relative; background: none; border: 1px solid transparent; color: var(--bar-text); border-radius: var(--radius); padding: 5px 8px; font: inherit; cursor: pointer; }
.iconbtn:hover { border-color: #2b4769; }
.badge { position: absolute; top: 0; right: 0; background: var(--bad); color: #fff; font-size: 10px; font-weight: 700; border-radius: 8px; padding: 0 5px; line-height: 15px; }
.menu { position: absolute; right: 8px; top: 44px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); min-width: 220px; box-shadow: 0 6px 18px rgba(0,0,0,.18); z-index: 40; padding: 4px 0; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 8px 14px; background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--accent-soft); text-decoration: none; }
.menu hr { border: 0; border-top: 1px solid var(--line-2); margin: 4px 0; }

/* ------------------------------------------------------------ three columns */
.shell { position: fixed; inset: var(--bar-h) 0 0 0; display: grid; grid-template-columns: var(--nav-w) 1fr var(--rail-w); }
.shell.no-rail { grid-template-columns: var(--nav-w) 1fr; }
.shell.no-rail .rail { display: none; }
.nav { background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; padding: 8px 0 24px; }
.nav-group { border-bottom: 1px solid var(--line-2); }
.nav-head { display: flex; align-items: center; width: 100%; background: none; border: 0; font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 12px 16px 6px; cursor: pointer; }
.nav-head::after { content: "▾"; margin-left: auto; font-size: 10px; transition: transform .2s; }
.nav-group.closed .nav-head::after { transform: rotate(-90deg); }
.nav-items { overflow: hidden; transition: max-height .25s ease; max-height: 800px; }
.nav-group.closed .nav-items { max-height: 0; }
.nav-sub { padding: 0 16px 6px; font-size: 12px; color: var(--muted); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 16px 7px 13px; color: var(--text); border-left: 3px solid transparent; }
.nav a:hover { background: var(--panel-2); text-decoration: none; }
.nav a.active { background: var(--accent-soft); border-left-color: var(--accent); font-weight: 600; }
.nav .emo { width: 20px; text-align: center; }
.nav .count { margin-left: auto; font-size: 11px; color: var(--muted); }
.main { overflow-y: auto; position: relative; }
.view { padding: 18px 22px 60px; max-width: 1240px; }
.wipe { animation: wipe .9s cubic-bezier(.22,.8,.2,1); }
@keyframes wipe { from { clip-path: inset(0 100% 0 0); opacity: .35; transform: translateX(-12px); } to { clip-path: inset(0 0 0 0); opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .wipe { animation: none; } .nav-items { transition: none; } }

/* right rail: dates */
.rail { background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; }
.rail-head { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; position: sticky; top: 0; background: var(--panel); z-index: 2; }
.rail-month { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--faint); padding: 10px 12px 4px; background: var(--panel-2); border-bottom: 1px solid var(--line-2); position: sticky; top: 45px; z-index: 1; }
.dayrow { display: grid; grid-template-columns: 42px 1fr auto; gap: 8px; padding: 7px 12px 7px 9px; border-left: 3px solid var(--other); border-bottom: 1px solid var(--line-2); color: var(--text); align-items: center; }
.dayrow:hover { background: var(--panel-2); text-decoration: none; }
.dayrow.active { background: var(--accent-soft); }
.dayrow.past { opacity: .62; }
.dayrow.today .dnum { color: var(--accent); }
.dayrow.today { box-shadow: inset 0 0 0 1px var(--accent); }
.dnum { text-align: center; line-height: 1.1; font-variant-numeric: tabular-nums; }
.dnum b { display: block; font-size: 15px; } .dnum span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; }
.dtitle { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-show { border-left-color: var(--show); } .t-travel { border-left-color: var(--travel); } .t-off { border-left-color: var(--off); }
.t-rehearsal { border-left-color: var(--rehearsal); } .t-promo { border-left-color: var(--promo); } .t-other { border-left-color: var(--other); }

/* ------------------------------------------------------------ building blocks */
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head .crumbs { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.page-head .actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); border-radius: var(--radius) var(--radius) 0 0; }
.panel-head h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.panel-head .actions { margin-left: auto; display: flex; gap: 6px; }
.panel-body { padding: 12px 14px; }
.panel-body.flush { padding: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px; }
.kv dt { color: var(--muted); font-size: 12.5px; } .kv dd { margin: 0; white-space: pre-wrap; }
.stat { padding: 12px 14px; } .stat .n { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; } .stat .l { font-size: 12px; color: var(--muted); }
.notes { white-space: pre-wrap; }
.empty { padding: 22px; text-align: center; color: var(--muted); }
.empty .e { font-size: 26px; display: block; margin-bottom: 6px; }

table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 7px 10px; border-bottom: 1px solid var(--line); background: var(--panel-2); white-space: nowrap; }
table.t td { padding: 7px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: var(--panel-2); }
table.t td.act { width: 1%; white-space: nowrap; text-align: right; }
table.t tr.done td { color: var(--faint); text-decoration: line-through; }
table.t tr.brk td { background: var(--panel-2); font-weight: 600; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 600; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--faint); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 3px 8px; font-size: 12px; font-weight: 500; }
.btn.ghost { border-color: transparent; background: none; }
.btn:disabled { opacity: .5; cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; background: var(--panel); padding: 5px 12px; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--text); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; } .seg button.on { background: var(--accent); color: #fff; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.show { background: var(--accent-soft); color: var(--show); border-color: transparent; }
.chip.travel, .chip.warn, .chip.pending, .chip.in_progress { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.off, .chip.ok, .chip.approved, .chip.done, .chip.paid { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.bad, .chip.declined, .chip.cancelled { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.new, .chip.not_started, .chip.open { background: var(--panel-2); }
.chip.rehearsal { color: var(--rehearsal); } .chip.promo { color: var(--promo); }

.dayhead { display: flex; gap: 16px; align-items: stretch; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--show); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.dayhead .cal { text-align: center; min-width: 54px; border-right: 1px solid var(--line-2); padding-right: 16px; }
.dayhead .cal .m { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--muted); }
.dayhead .cal .d { font-size: 28px; font-weight: 600; line-height: 1.1; }
.dayhead .cal .w { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--muted); }
.dayhead .info { flex: 1; min-width: 0; }
.dayhead .meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 4px; }
.dayhead .nav-arrows { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 14px; }

.sched-row { display: grid; grid-template-columns: 112px 1fr auto; gap: 10px; padding: 7px 14px; border-bottom: 1px solid var(--line-2); align-items: baseline; }
.sched-row:last-child { border-bottom: 0; }
.sched-row .tm { font-variant-numeric: tabular-nums; font-weight: 600; }
.sched-row.now { background: var(--accent-soft); }
.vis { font-size: 11px; color: var(--muted); }

.adv-section { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 12px 0 4px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.adv-field { display: grid; grid-template-columns: 200px 1fr auto; gap: 10px; padding: 4px 0; align-items: center; }

.gl-grid td, .gl-grid th { text-align: center; } .gl-grid td:first-child, .gl-grid th:first-child { text-align: left; }
.flight-live { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 8px; font-size: 13px; }
.bar-meter { height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; } .bar-meter > i { display: block; height: 100%; background: var(--accent); }

/* ------------------------------------------------------------ forms + dialogs */
label.f { display: block; margin-bottom: 10px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
label.f > input, label.f > select, label.f > textarea, .inp { display: block; width: 100%; margin-top: 3px; padding: 7px 9px; font: inherit; font-size: 14px; font-weight: 400; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
label.f > textarea { min-height: 80px; resize: vertical; }
label.f > input:focus, label.f > select:focus, label.f > textarea:focus, .inp:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
label.chk { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin: 6px 0; color: var(--text); font-weight: 400; }
.frow { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 12px; }
.pickgroup { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pickgroup label { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 12px; padding: 2px 10px; font-weight: 400; color: var(--text); cursor: pointer; font-size: 12.5px; }
.pickgroup input { margin: 0; }
.modal-back { position: fixed; inset: 0; background: rgba(10, 20, 35, .45); z-index: 50; display: grid; place-items: start center; padding: 6vh 16px; overflow-y: auto; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); width: min(620px, 100%); box-shadow: 0 12px 40px rgba(0,0,0,.25); animation: pop .16s ease-out; }
.modal.wide { width: min(900px, 100%); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.modal-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 16px; max-height: 70vh; overflow-y: auto; }
.modal-foot { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; background: var(--panel-2); }
.modal-foot .left { margin-right: auto; }
.err { color: var(--bad); font-size: 13px; min-height: 1.2em; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--bar); color: #fff; padding: 9px 16px; border-radius: var(--radius); z-index: 60; font-size: 13.5px; box-shadow: 0 6px 18px rgba(0,0,0,.25); animation: pop .16s ease-out; }
.toast.bad { background: var(--bad); }

/* sign-in / setup screens */
.solo { max-width: 420px; margin: 10vh auto; }
.solo .brand { color: var(--text); justify-content: center; font-size: 18px; margin: 0 0 16px; }
.solo .brand-mark { background: var(--bar); color: #fff; }
#totp-qr { display: block; max-width: 220px; background: #fff; padding: 8px; border: 1px solid var(--line); }

/* calendar */
.calgrid { display: grid; grid-template-columns: repeat(7, 1fr); border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.calgrid > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 92px; padding: 4px 6px; background: var(--panel); font-size: 12px; }
.calgrid > .dow { min-height: 0; background: var(--panel-2); font-weight: 700; color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: .05em; }
.calgrid > .outside { background: var(--panel-2); color: var(--faint); }
.calgrid .cnum { font-weight: 600; font-variant-numeric: tabular-nums; }
.calgrid a.ev { display: block; margin-top: 3px; padding: 2px 5px; border-left: 3px solid var(--show); background: var(--accent-soft); color: var(--text); border-radius: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------ phones and small screens */
.tabbar { display: none; }
@media (max-width: 1100px) { .shell { grid-template-columns: var(--nav-w) 1fr; } .rail { display: none; } .rail.open { display: flex; position: fixed; right: 0; top: var(--bar-h); bottom: 0; width: 300px; z-index: 25; box-shadow: -6px 0 18px rgba(0,0,0,.15); } }
@media (max-width: 800px) {
  :root { --bar-h: 50px; }
  .shell, .shell.no-rail { grid-template-columns: 1fr; bottom: var(--tab-h); }
  .nav { display: none; } .nav.open { display: block; position: fixed; left: 0; top: var(--bar-h); bottom: var(--tab-h); width: 82%; z-index: 26; box-shadow: 6px 0 18px rgba(0,0,0,.2); }
  .rail.open { width: 100%; bottom: var(--tab-h); }
  .search input { width: 140px; } .search-results { width: 92vw; right: -60px; }
  .picker { max-width: 120px; } .brand span:last-child, .bar-sep, #org-picker { display: none; }
  .view { padding: 12px 12px 40px; }
  .cols, .grid2, .grid3 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 110px 1fr; }
  .adv-field { grid-template-columns: 1fr; }
  table.t .hide-sm { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; height: var(--tab-h); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--panel); border-top: 1px solid var(--line); z-index: 30; }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 10.5px; color: var(--muted); }
  .tabbar a b { font-size: 18px; font-weight: 400; } .tabbar a.on { color: var(--accent); font-weight: 600; } .tabbar a:hover { text-decoration: none; }
  .dayhead { flex-wrap: wrap; } .sched-row { grid-template-columns: 92px 1fr; } .sched-row > :nth-child(3) { grid-column: 2; }
}
@media print { .topbar, .nav, .rail, .tabbar, .actions, .btn { display: none !important; } .shell { position: static; display: block; } body { background: #fff; } }
/* row actions appear on hover on a desktop; always visible on touch screens */
@media (hover: hover) { .sched-row .act, table.t td.act .ghost { opacity: 0; transition: opacity .12s; } .sched-row:hover .act, table.t tr:hover td.act .ghost { opacity: 1; } }

/* ------------------------------------------------------------ line icons (no emoji anywhere) */
.ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -3px; }
.nav a .ic { color: var(--muted); } .nav a.active .ic, .nav a:hover .ic { color: var(--accent); }
.iconbtn { display: inline-flex; align-items: center; gap: 6px; } .iconbtn .ic { vertical-align: 0; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; } .menu .ic { color: var(--muted); }
.tabbar a .ic { width: 20px; height: 20px; }
.search::before { content: ""; width: 14px; height: 14px; top: 9px; left: 9px; opacity: .7; border: 1.6px solid var(--bar-muted); border-radius: 50%; box-sizing: border-box; }
.search::after { content: ""; position: absolute; left: 20px; top: 21px; width: 5px; height: 1.6px; background: var(--bar-muted); transform: rotate(45deg); }
.search-results a.sr { display: flex; gap: 10px; align-items: flex-start; } .search-results a.sr .ic { margin-top: 2px; color: var(--muted); }
.empty .e:empty { display: none; }
/* day-type chips: a coloured dot instead of a picture */
.chip.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.dot.show { color: var(--show); } .chip.dot.travel { color: var(--travel); } .chip.dot.off { color: var(--off); } .chip.dot.rehearsal { color: var(--rehearsal); } .chip.dot.promo { color: var(--promo); } .chip.dot.other { color: var(--other); }
/* advance status in the dates rail */
.adv { width: 10px; height: 10px; border-radius: 50%; border: 1.6px solid var(--faint); display: inline-block; }
.adv.progress { border-color: var(--accent); background: linear-gradient(90deg, var(--accent) 50%, transparent 50%); }
.adv.done { border-color: var(--ok); background: var(--ok); }
/* file type tag */
.ftype { display: inline-block; min-width: 34px; text-align: center; font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 1px 4px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); }
.panel-head { flex-wrap: wrap; row-gap: 6px; } .panel-head .actions { flex-wrap: wrap; justify-content: flex-end; }
.seg button, .btn { white-space: nowrap; }
.panel-head select.inp { width: auto; display: inline-block; padding: 4px 8px; font-size: 12.5px; }
/* never scroll sideways; long words wrap */
.main { overflow-x: hidden; } .shell > *, .cols > *, .grid2 > *, .grid3 > * { min-width: 0; }
.panel-body, .dtitle, td { overflow-wrap: anywhere; }
.sched-row.edit { cursor: pointer; } .sched-row.edit:hover { background: var(--panel-2); }
@media (max-width: 800px) {
  .sched-row .act { display: none; }
  .dayhead h1 { font-size: 18px; } .dayhead .cal { min-width: 44px; padding-right: 12px; } .dayhead .cal .d { font-size: 24px; }
  .dayhead .nav-arrows { flex-direction: row; width: 100%; justify-content: flex-start; }
  .page-head .actions { margin-left: 0; }
  .search input { width: 110px; } .search input:focus { width: 180px; }
  table.t td, table.t th { padding: 7px 8px; }
}
.myroom { margin-top: 6px; padding: 6px 8px; border-left: 3px solid var(--ok); background: var(--ok-soft); border-radius: 2px; font-size: 13px; }
table.t tr.mine td { background: var(--ok-soft); }

/* ------------------------------------------------------------ page change animation
   1. View Transitions: old page drifts left and fades; new page sweeps in from the left with a feathered edge.
   2. Then each section rises into place, one after another. */
#view { view-transition-name: page; }
::view-transition-group(page) { animation-duration: 1s; }
::view-transition-old(page) { animation: tb-page-out .45s cubic-bezier(.4,0,.2,1) both; }
::view-transition-new(page) { animation: tb-page-in 1s cubic-bezier(.22,.8,.2,1) both;
  -webkit-mask-image: linear-gradient(90deg, #000 38%, transparent 62%); mask-image: linear-gradient(90deg, #000 38%, transparent 62%);
  -webkit-mask-size: 300% 100%; mask-size: 300% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }
@keyframes tb-page-out { to { opacity: 0; transform: translateX(-28px); filter: blur(1px); } }
@keyframes tb-page-in { from { -webkit-mask-position: 100% 0; mask-position: 100% 0; transform: translateX(18px); } to { -webkit-mask-position: 0 0; mask-position: 0 0; transform: none; } }
.rise { animation: tb-rise .55s cubic-bezier(.22,.8,.2,1) both; animation-delay: calc(.18s + var(--i, 0) * 60ms); }
@keyframes tb-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } .rise { animation: none; } }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photos figure { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel-2); }
.photos img { display: block; width: 100%; height: 110px; object-fit: cover; }
.photos figcaption { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 4px 6px; font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.btn .ic { width: 14px; height: 14px; }
/* bus bunk chart */
.bunkchart { border: 1px solid var(--line); border-radius: 18px 18px 6px 6px; padding: 10px; background: var(--panel-2); max-width: 620px; }
.bunkfront { text-align: center; font-size: 11px; letter-spacing: .08em; color: var(--faint); padding: 6px; border: 1px dashed var(--line); border-radius: var(--radius); margin: 6px 0; }
.bunkhead { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 8px 0 4px; }
.bunkcols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.bunkcol { display: grid; gap: 5px; }
.bunk { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; padding: 6px 9px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.bunk:disabled { cursor: default; }
.bunk.taken { border-left: 3px solid var(--accent); }
.bunk.me { background: var(--ok-soft); border-left-color: var(--ok); }
.offline-bar { position: fixed; top: var(--bar-h); left: 0; right: 0; z-index: 29; background: var(--warn); color: #1a1204; font-size: 13px; font-weight: 600; padding: 6px 14px; text-align: center; }
.offline-bar:not([hidden]) ~ .shell { top: calc(var(--bar-h) + 31px); }
table.t.wx td { overflow-wrap: normal; vertical-align: middle; } table.t.wx tr.wx-today td { background: var(--panel-2); }

/* Weather pictures (WxIcon in icons.js) — gentle motion; stops with "reduce motion" */
:root { --wx-sun: #e9a53a; --wx-moon: #8a9bb3; --wx-cloud: #e4e9ef; --wx-cloud-2: #cfd6df; --wx-edge: #93a0b0; --wx-dark: #9aa5b3; --wx-rain: #2f7fd6; --wx-snow: #ffffff; }
[data-theme="graphite"] { --wx-sun: #f0b54c; --wx-moon: #d7dbe2; --wx-cloud: #b9bfc8; --wx-cloud-2: #868d98; --wx-edge: #d4d8de; --wx-dark: #6f7782; --wx-rain: #63a8f0; --wx-snow: #eef1f5; }
.wx-i { display: block; flex: none; overflow: visible; }
.wx-i .sun circle { fill: var(--wx-sun); } .wx-i .sun line { stroke: var(--wx-sun); stroke-width: 3; stroke-linecap: round; }
.wx-i .moon path { fill: var(--wx-moon); }
.wx-i .cl { fill: var(--wx-cloud); stroke: var(--wx-edge); stroke-width: 1.5; stroke-linejoin: round; }
.wx-i .cl.back { fill: var(--wx-cloud-2); } .wx-i .cl.dark { fill: var(--wx-dark); }
.wx-i .drop { stroke: var(--wx-rain); stroke-width: 2.6; stroke-linecap: round; }
.wx-i .flake { fill: var(--wx-snow); stroke: var(--wx-edge); stroke-width: .8; }
.wx-i .fogl { stroke: var(--wx-edge); stroke-width: 3; stroke-linecap: round; }
.wx-i .bolt { fill: var(--wx-sun); }
.wx-i .sun { transform-box: fill-box; transform-origin: center; animation: wx-spin 30s linear infinite; }
.wx-i .moon { transform-box: fill-box; transform-origin: center; animation: wx-bob 6s ease-in-out infinite; }
.wx-i .cl-g { animation: wx-drift 7s ease-in-out infinite; }
.wx-i .drop { animation: wx-fall 1.1s linear infinite; }
.wx-drizzle .drop { animation-duration: 1.6s; }
.wx-i .flake { animation: wx-snow 3.2s linear infinite; }
.wx-i .bolt { animation: wx-flash 3.5s linear infinite; }
.wx-i .fogl { animation: wx-fog 5s ease-in-out infinite; } .wx-i .fogl.f1 { animation-delay: -1.7s; } .wx-i .fogl.f2 { animation-delay: -3.3s; }
.wx-i .d1 { animation-delay: -.22s; } .wx-i .d2 { animation-delay: -.44s; } .wx-i .d3 { animation-delay: -.66s; } .wx-i .d4 { animation-delay: -.88s; }
.wx-i .flake.d1 { animation-delay: -.64s; } .wx-i .flake.d2 { animation-delay: -1.28s; } .wx-i .flake.d3 { animation-delay: -1.92s; } .wx-i .flake.d4 { animation-delay: -2.56s; }
@keyframes wx-spin { to { transform: rotate(360deg); } }
@keyframes wx-bob { 0%, 100% { transform: translateY(-1px) rotate(-4deg); } 50% { transform: translateY(1px) rotate(4deg); } }
@keyframes wx-drift { 0%, 100% { transform: translateX(-1.5px); } 50% { transform: translateX(1.5px); } }
@keyframes wx-fall { 0% { transform: translate(1px, -5px); opacity: 0; } 20% { opacity: 1; } 85% { opacity: .9; } 100% { transform: translate(-3px, 13px); opacity: 0; } }
@keyframes wx-snow { 0% { transform: translate(0, -4px); opacity: 0; } 15% { opacity: 1; } 50% { transform: translate(2.5px, 5px); } 85% { opacity: 1; } 100% { transform: translate(-1px, 15px); opacity: 0; } }
@keyframes wx-flash { 0%, 70%, 75%, 79%, 100% { opacity: .2; } 72%, 77% { opacity: 1; } }
@keyframes wx-fog { 0%, 100% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }
.wx-still *, .wx-still { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .wx-i * { animation: none !important; } }
table.t.wx td.wx-ic { width: 56px; padding-right: 0; }
/* Weather card: 3-Day | Hourly switch and the hour-by-hour strip */
.wx-days { display: flex; gap: 6px; padding: 10px 14px 0; flex-wrap: wrap; }
.wx-hours { display: flex; overflow-x: auto; gap: 2px; padding: 10px 10px 12px; scroll-snap-type: x proximity; }
.wx-hour { flex: none; width: 58px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: var(--radius); scroll-snap-align: start; font-size: 12px; }
.wx-hour .tm { color: var(--muted); white-space: nowrap; } .wx-hour .tp { font-weight: 600; font-size: 13.5px; } .wx-hour .rn { color: var(--wx-rain); min-height: 1.2em; }
.wx-hour.now { background: var(--panel-2); outline: 1px solid var(--line); }
.wx-hour.show-time { box-shadow: inset 0 -2px 0 var(--accent); }

/* ------------------------------------------------------------ spreadsheets (sheets.js) */
@media (min-width: 1101px) { .shell:has(.view.sheet-view) { grid-template-columns: var(--nav-w) 1fr; } .shell:has(.view.sheet-view) .rail:not(.open) { display: none; } }
.main:has(.view.sheet-view) { overflow: hidden; }
.view.sheet-view { max-width: none; height: 100%; display: flex; flex-direction: column; padding: 10px 14px 10px; gap: 8px; }
.sg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sg-title { display: flex; align-items: center; gap: 10px; min-width: 0; } .sg-title h1 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-status { white-space: nowrap; } .sg-sum { color: var(--muted); white-space: nowrap; margin-left: 8px; }
.sg-tools { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 5px 6px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.sg-tb { min-width: 30px; justify-content: center; } .sg-tb.b { font-weight: 700; } .sg-tb.i { font-style: italic; } .sg-tb.u { text-decoration: underline; }
.sg-sep { width: 1px; align-self: stretch; background: var(--line); margin: 2px 4px; }
.sg-sel { font: inherit; font-size: 12.5px; padding: 4px 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); max-width: 170px; }
.sg-colorlab { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.sg-color { width: 26px; height: 24px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: none; cursor: pointer; }
.sg-fxbar { display: flex; gap: 6px; align-items: center; }
.sg-name { width: 96px; font: 12.5px ui-monospace, Menlo, Consolas, monospace; padding: 5px 7px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); }
.sg-fxlabel { font-style: italic; color: var(--faint); font-size: 13px; }
.sg-fx { flex: 1; min-width: 0; font: 13px ui-monospace, Menlo, Consolas, monospace; padding: 5px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); }
.sg-body { flex: 1; min-height: 0; display: flex; gap: 8px; }
.sg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.sg-wrap { flex: 1; min-height: 0; overflow: auto; position: relative; outline: none; }
table.sg { table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.sg th, table.sg td { height: 24px; padding: 0 6px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); white-space: nowrap; overflow: hidden; text-overflow: clip; line-height: 23px; }
table.sg td { cursor: cell; color: var(--text); }
table.sg td.n { text-align: right; } table.sg td.c { text-align: center; } table.sg td.l { text-align: left; } table.sg td.e { color: var(--bad); text-align: center; font-size: 12px; }
table.sg td.b { font-weight: 700; } table.sg td.i { font-style: italic; } table.sg td.u { text-decoration: underline; }
table.sg thead th { position: sticky; top: 0; z-index: 3; background: var(--panel-2); color: var(--muted); font-weight: 500; font-size: 11.5px; text-align: center; user-select: none; }
table.sg th.sg-ch { position: sticky; cursor: s-resize; } table.sg th.sg-ch.on, table.sg th.sg-rh.on { background: var(--accent-soft); color: var(--text); }
table.sg th.sg-rh { position: sticky; left: 0; z-index: 2; background: var(--panel-2); color: var(--muted); font-weight: 500; font-size: 11.5px; text-align: center; cursor: e-resize; user-select: none; }
table.sg th.sg-corner { left: 0; z-index: 4; cursor: pointer; }
table.sg tr.sg-frozen { position: sticky; z-index: 2; } table.sg tr.sg-frozen td { background: var(--panel); }
table.sg tr.sg-frozen + tr > * { border-top: 2px solid var(--line); }
table.sg tr.sg-spacer td { padding: 0; border: 0; background: transparent; }
table.sg td.sel { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--accent) 16%, transparent); }
table.sg td.cur { outline: 2px solid var(--accent); outline-offset: -2px; }
.sg-resize { position: absolute; right: -3px; top: 0; bottom: 0; width: 7px; cursor: col-resize; z-index: 5; }
.sg-editor { position: absolute; z-index: 6; margin: 0; padding: 2px 6px; font: 13px var(--font); line-height: 19px; border: 2px solid var(--accent); background: var(--panel); color: var(--text); resize: none; overflow: hidden; white-space: pre; box-shadow: 0 2px 10px rgba(0,0,0,.25); outline: none; }
.sg-tabs { display: flex; gap: 2px; padding: 4px 6px; border-top: 1px solid var(--line); background: var(--panel-2); overflow-x: auto; flex: none; }
.sg-tab { border: 1px solid transparent; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; padding: 3px 12px; border-radius: var(--radius); cursor: pointer; white-space: nowrap; }
.sg-tab.on { background: var(--panel); border-color: var(--line); color: var(--text); font-weight: 600; } .sg-tab.add { color: var(--faint); }
.sg-banner { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 7px 10px; border: 1px solid var(--warn); background: var(--warn-soft); border-radius: var(--radius); font-size: 13px; }
.sg-side { width: 300px; flex: none; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.sg-side-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.sg-versions { overflow-y: auto; flex: 1; }
.sg-ver { padding: 9px 12px; border-bottom: 1px solid var(--line-2); } .sg-ver.on { background: var(--warn-soft); }
.sg-ver-top { display: flex; justify-content: space-between; gap: 8px; } .sg-ver-act { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; }
.sg-changes { margin-top: 6px; font-size: 12px; display: grid; gap: 2px; max-height: 220px; overflow-y: auto; }
@media (max-width: 760px) {
  .view.sheet-view { padding: 6px; } .sg-side { position: fixed; inset: var(--bar-h) 0 var(--tab-h) 0; width: auto; z-index: 28; }
  .sg-tools { flex-wrap: nowrap; overflow-x: auto; } .sg-name { width: 70px; }
}
.sg-editor.idle { opacity: 0; pointer-events: none; box-shadow: none; border-color: transparent; z-index: -1; caret-color: transparent; }

/* ------------------------------------------------------------ Switch SAMCOM: dashboard, locations, inbox */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stats .stat { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); }
.stats a.stat:hover { text-decoration: none; border-color: var(--accent); }
.stat-v { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; } .stat-l { font-size: 12.5px; color: var(--muted); } .stat-s { font-size: 12px; color: var(--faint); margin-top: 2px; }
.loc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.loc-card { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); color: var(--text); }
.loc-card:hover { text-decoration: none; border-color: var(--accent); } .loc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; } .loc-top strong { font-size: 15px; }
.notice { padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel-2); font-size: 13px; margin: 0 0 12px; }
.notice.warn { border-color: var(--warn); background: var(--warn-soft); } .notice.bad { border-color: var(--bad); background: var(--bad-soft); }
.dropzone { border: 2px dashed var(--line); border-radius: 6px; padding: 22px; text-align: center; cursor: pointer; background: var(--panel); margin-bottom: 12px; display: grid; gap: 4px; }
.dropzone:hover, .dropzone.over, .dropzone:focus { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.inbox-queue { display: grid; gap: 2px; margin-bottom: 12px; }
.import-preview { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); margin-top: 8px; }
table.t tfoot tr.tab-total td { border-top: 2px solid var(--line); background: var(--panel-2); font-size: 14px; }
table.t.arrivals tr.grp td { background: var(--panel-2); } table.t.arrivals tr.me td { background: var(--accent-soft); }
.ok-t { color: var(--ok); }
