/* Workspace shell: hub + module workspaces. Uses the color tokens from styles.css (light / dark / auto). */
:root { --bar-h: 52px; --side-w: 236px; --ws-accent-ink: #fff; }
body.ws-body-root { background: var(--bg); }
.ws { min-height: 100vh; display: flex; flex-direction: column; }
.ws-bar { position: sticky; top: 0; z-index: 20; height: var(--bar-h); display: flex; align-items: center; gap: 12px;
  padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.ws-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 700; }
.ws-brand-name { letter-spacing: -0.01em; white-space: nowrap; }
.ws-icon-btn { border: 1px solid var(--line); background: var(--accent-soft); color: var(--accent); border-radius: 50%; width: 34px; height: 34px; cursor: pointer; font: 600 12px Inter, system-ui, sans-serif; }
.ws-menu.ws-icon-btn { border-radius: 8px; background: var(--panel); color: var(--text); }
.ws-menu { display: none; }
.ws-switch, .ws-user { position: relative; }
.ws-mod-btn { border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 8px; padding: 6px 12px; font: inherit; font-weight: 600; cursor: pointer; }
.ws-mod-btn:hover, .ws-search:hover { border-color: var(--accent); }
.ws-search { flex: 0 1 340px; display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--muted); border-radius: 8px; padding: 6px 10px; font: inherit; cursor: pointer; }
.ws-search kbd, .ws-pal-item kbd { font: 11px/1 Inter, system-ui, sans-serif; border: 1px solid var(--line); border-radius: 4px; padding: 3px 5px; color: var(--muted); }
.ws-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.ws-hotel { color: var(--muted); font-weight: 500; }
.ws-menu-pop { position: absolute; top: calc(100% + 6px); left: 0; min-width: 260px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 8px 28px rgba(16, 24, 40, .16); padding: 8px; display: flex; flex-direction: column; gap: 6px; z-index: 30; }
.ws-menu-right { left: auto; right: 0; min-width: 240px; padding: 12px; }
.ws-menu-pop a.ws-mod-item { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.ws-menu-pop a.ws-mod-item:hover, .ws-menu-pop a.ws-mod-item.active { background: var(--accent-soft); color: var(--accent); }
.ws-frame { flex: 1; display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 0; }
.ws-frame.hub { grid-template-columns: 1fr; }
.ws-frame.hub .ws-side { display: none; }
.ws-side { position: sticky; top: var(--bar-h); height: calc(100vh - var(--bar-h)); overflow-y: auto; padding: 14px 10px; border-right: 1px solid var(--line); background: var(--panel); }
.ws-side-title { display: flex; align-items: center; gap: 8px; font-weight: 700; padding: 4px 10px 12px; }
.ws-side .ws-group { margin: 10px 0 4px; padding: 0 10px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ws-side #nav a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 13.5px; }
.ws-side #nav a:hover { background: var(--bg); }
.ws-side #nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.ws-main { min-width: 0; }
.ws-crumbs { padding: 14px 24px 0; font-size: 12.5px; color: var(--muted); }
.ws-crumbs a { color: var(--muted); text-decoration: none; }
.ws-crumbs a:hover { color: var(--accent); }
.ws-head { display: flex; align-items: center; gap: 12px; padding: 4px 24px 4px; }
.ws-head h1 { font-size: 22px; margin: 0; letter-spacing: -0.01em; }
.ws-actions { margin-left: auto; display: flex; gap: 8px; }
.ws-main .page > .toolbar:first-child { position: sticky; top: var(--bar-h); z-index: 10; background: var(--bg); padding: 10px 0;
  border-bottom: 1px solid var(--line); margin-top: -4px; }
.ws-module-icon { width: 18px; height: 18px; flex: none; color: var(--accent); }

/* hub */
.hub { padding: 22px 28px 40px; display: flex; flex-direction: column; gap: 22px; max-width: 1280px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.hub-hello h2 { margin: 0; font-size: 24px; letter-spacing: -0.01em; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.hub-tile { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: border-color .12s, transform .12s; }
.hub-tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.hub-tile .ws-module-icon { width: 26px; height: 26px; }
.hub-tile strong { font-size: 15px; }
.hub-tile .small { color: var(--muted); }
.hub-row { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
.hub-widgets { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.widget { position: relative; }
.widget .w-tools { position: absolute; top: 8px; right: 8px; display: none; gap: 4px; }
.hub.editing .widget .w-tools { display: flex; }
.hub.editing .widget { outline: 2px dashed var(--line); outline-offset: 2px; }
.hub-attn a { color: var(--text); }
.hub-section-head { display: flex; align-items: center; gap: 10px; }
.hub-section-head h3 { margin: 0; font-size: 15px; }

/* tables: sort + tools */
.tbl-tools { display: flex; justify-content: flex-end; gap: 6px; margin: -4px 0 6px; }
.tbl-tools .btn { padding: 3px 8px; font-size: 12px; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--accent); }
th.sorted-asc::after { content: " ▲"; font-size: 9px; }
th.sorted-desc::after { content: " ▼"; font-size: 9px; }
.ws-main .table-wrap thead th { position: sticky; top: 0; background: var(--panel); }
.col-menu { position: absolute; z-index: 15; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .14); display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow: auto; }
.col-menu label { flex-direction: row; gap: 6px; color: var(--text); }

/* command search */
.ws-palette { position: fixed; inset: 0; z-index: 50; background: rgba(10, 14, 22, .45); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.ws-palette-box { width: min(620px, 92vw); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 50px rgba(0, 0, 0, .3); overflow: hidden; }
.ws-palette-box input { width: 100%; box-sizing: border-box; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 14px 16px; font-size: 16px; outline: none; background: var(--panel); }
.ws-pal-list { max-height: 50vh; overflow: auto; padding: 6px; }
.ws-pal-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--text); }
.ws-pal-item .small { color: var(--muted); margin-left: auto; }
.ws-pal-item.sel { background: var(--accent-soft); color: var(--accent); }

/* density */
body.compact .card { padding: 10px 12px; }
body.compact th, body.compact td { padding: 4px 8px; }
body.compact .page { gap: 10px; }
body.compact .tile { padding: 10px; }

@media (max-width: 900px) {
  .ws-menu { display: inline-block; }
  .ws-frame { grid-template-columns: 1fr; }
  .ws-side { position: fixed; z-index: 25; top: var(--bar-h); left: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .ws-side.open { transform: none; }
  .ws-search span, .ws-brand-name, .ws-hotel { display: none; }
  .ws-search { flex: 0 0 auto; }
  .hub-row { grid-template-columns: 1fr; }
  .hub, .ws-head, .ws-crumbs { padding-left: 16px; padding-right: 16px; }
}
@media print { .ws-bar, .ws-side, .ws-crumbs, .ws-actions, .tbl-tools { display: none !important; } .ws-frame { display: block; } }

/* ================= Aegis design standard: workspace ================= */
:root { --bar-h: 60px; --side-w: 264px; }
.ws-bar { height: var(--bar-h); }
.ws-brand { font-size: 18px; }
.ws-icon-btn { width: 40px; height: 40px; font-size: 14px; }
.ws-mod-btn, .ws-search { min-height: 44px; font-size: 16px; }
.ws-search kbd, .ws-pal-item kbd { font-size: 13px; }
.ws-hotel { color: var(--text); }
.ws-menu-pop a.ws-mod-item { min-height: 44px; font-size: 16px; }
/* sidebar: light gray in light mode, navy in dark; the current page is marked by a bar AND bold text, not colour alone */
.ws-side { background: var(--nav-bg); border-right: 1px solid var(--line); padding: 18px 12px; }
.ws-side-title { color: var(--nav-strong); font-size: 17px; }
.ws-side .ws-module-icon { color: var(--brass); }
.ws-side .ws-group { font-size: 14px; letter-spacing: .04em; color: var(--nav-dim); margin: 16px 0 6px; }
.ws-side #nav a { display: flex; align-items: center; min-height: 44px; padding: 0 14px; font-size: 16px; color: var(--nav-text); border-radius: 6px; }
.ws-side #nav a:hover { background: var(--nav-hover); color: var(--nav-strong); }
.ws-side #nav a.active { background: var(--nav-active); color: var(--nav-strong); font-weight: 700; box-shadow: inset 3px 0 0 var(--nav-bar); }
.ws-crumbs { font-size: 14px; padding-top: 18px; }
.ws-crumbs a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.ws-head h1 { font-size: 28px; color: var(--heading); }
.tbl-tools .btn { min-height: 36px; font-size: 14px; padding: 0 12px; }
th.sorted-asc::after, th.sorted-desc::after { font-size: 12px; }
.hub-tile { box-shadow: none; }
.hub-tile strong { font-size: 17px; }
.hub-hello h2 { font-size: 28px; color: var(--heading); }
.hub-section-head h3 { font-size: 18px; }
/* density: compact stays readable (never under 14 px) */
body.compact th, body.compact td { padding: 6px 10px; }

/* Bar costing: the bottles table is edited in place, so its fields stay compact and every column fits on a laptop */
.bar-tbl select, .bar-tbl input:not([type=checkbox]) { width: auto; min-width: 0; max-width: 8em; height: 34px; padding: 4px 8px; font-size: 14px; }
.bar-tbl td, .bar-tbl th { padding-left: 6px; padding-right: 6px; }
/* Payroll export: the Export Payroll dropdown and the list of checks */
.px-drop { position: relative; }
.px-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 340px; max-height: 70vh; overflow: auto; background: var(--panel, #fff);
  border: 1px solid var(--line, #ddd); border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .18); padding: 6px; }
.px-list.hidden { display: none; }
.px-opt { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px;
  background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.px-opt:hover, .px-opt.on { background: var(--surface, #f3f4f8); }
.px-issues { margin: 4px 0 8px; padding-left: 20px; } .px-issues li { margin-bottom: 6px; }

/* QuickBooks connection card (Export Payroll) */
.qbo-terms { border: 1px solid var(--line, #d8dde6); border-radius: 10px; padding: 12px 14px; margin: 10px 0; }
.qbo-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.qbo-cols h4 { margin: 4px 0 6px; }
.qbo-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.45; }
.qbo-list li { margin-bottom: 6px; }
.qbo-hint { background: var(--warn-bg, #fff6e0); border-left: 4px solid var(--warn, #d99a00); padding: 8px 12px; border-radius: 6px; }
.px-hint { display: block; margin-top: 3px; white-space: normal; }

/* ---- QuickBooks screens (js/qbo.js): glass buttons, gold for the main action ---- */
.qb { --qb-sheen: linear-gradient(180deg, rgba(255,255,255,.26) 0%, rgba(255,255,255,.08) 46%, rgba(255,255,255,0) 50%, rgba(0,0,0,.14) 100%);
      --qb-edge: inset 0 1px 0 rgba(255,255,255,.38), inset 0 -2px 0 rgba(0,0,0,.3), 0 6px 14px rgba(0,6,20,.28); }
.qb .btn { background-color: #16234a; background-image: var(--qb-sheen); color: #fff; border: 0; box-shadow: var(--qb-edge); padding: 8px 16px; border-radius: 10px; font-weight: 600; }
.qb .btn:hover { color: #fff; background-color: #1d2e60; background-image: var(--qb-sheen); box-shadow: var(--qb-edge); }
.qb .btn.primary, .qb .btn.primary:hover { background-image: var(--qb-sheen), linear-gradient(180deg, #f0ca72, #e2b654 45%, #b0832a); color: #1c1503; }
.qb .btn:active { transform: translateY(2px); box-shadow: inset 0 2px 6px rgba(0,0,0,.45), 0 0 10px rgba(226,182,84,.45); }
.qb .btn:disabled, .qb .btn:disabled:hover { opacity: .45; color: #fff; box-shadow: var(--qb-edge); }
.qb .btn.primary:disabled { color: #1c1503; }
.qb-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.qb-tabs.inline { margin: 0; }
.qb-tab { padding: 7px 14px; border-radius: 999px; background: #16234a; background-image: var(--qb-sheen); color: #dfe6f7; text-decoration: none; font-weight: 600; font-size: 13px; cursor: pointer; box-shadow: var(--qb-edge); }
.qb-tab.on { background-image: var(--qb-sheen), linear-gradient(180deg, #f0ca72, #e2b654 45%, #b0832a); color: #1c1503; }
.qb-src { font-size: 13px; color: var(--muted, #5b6474); margin: 4px 0 10px; }
.qb-alert { border-left: 4px solid #e2b654; }
.qb-tot { width: 100%; border-collapse: collapse; margin: 6px 0 12px; }
.qb-tot td, .qb-tot th { padding: 5px 4px; border-bottom: 1px solid var(--line, #d8dde6); text-align: left; }
.qb-tot .num { text-align: right; font-variant-numeric: tabular-nums; }
.qb-tot .qb-sum td { font-weight: 700; border-top: 2px solid var(--line-strong, #b9c0cd); }
.qb-un td:first-child { box-shadow: inset 3px 0 0 #e2b654; }
.qb-hint { border: 1px dashed #b0832a; background: transparent; color: #8a6414; border-radius: 999px; padding: 2px 9px; font-size: 12px; cursor: pointer; margin-left: 4px; }
.qb-rep .qb-section td { font-weight: 700; padding-top: 10px; }
.qb-rep .qb-total td { font-weight: 700; border-top: 1px solid var(--line-strong, #b9c0cd); }
.qb-map select { max-width: 100%; }
@media (max-width: 900px) { .qb .grid.two { grid-template-columns: 1fr; } }
.qb .tiles .tile .value { font-size: 20px; line-height: 1.25; }
.qb .toolbar { margin: 12px 0; align-items: center; }
.qb-map { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
.qb-map td, .qb-map th { padding-left: 8px; padding-right: 8px; }
.qb-map select[data-map] { width: 200px; }
.qb-tot .qb-head td { font-weight: 600; font-size: 12px; color: var(--muted, #5b6474); }
@media (max-width: 1100px) { .qb-map { grid-template-columns: 1fr; } }
.qb .card { min-width: 0; }
.qb-map > .card { overflow-x: auto; }

/* the location selector on a phone: keep the top bar inside the screen */
@media (max-width: 760px) { #hotel-switch label { font-size: 0; } #hotel-sel { font-size: 13px; max-width: 18vw; } }
