/* 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; }
.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; }
