/* The application shell: the purple sidebar, the top bar and the account menu, shared by every
   screen (the hub, each workspace, the Day Book pages). It also holds the hub colour tokens.

   Every class here starts with "hs-", and every token with "--hub-", "--side-" or a tone name.
   The Day Book's original pages style bare elements (button, aside, main, nav, h2, table...)
   and use short token names (--good, --accent...); prefixing keeps the shell out of their way. */
:root {
  --hub-bg:#f5f4fb; --hub-surface:#ffffff; --hub-sunk:#f0eef9; --hub-line:#e4e1f2; --hub-line-strong:#cfcae6;
  --hub-ink:#1d1840; --hub-ink-2:#4a4566; --hub-muted:#6f6a8a;
  --hub-accent:#5b3fd6; --hub-accent-hover:#4a30bd; --hub-accent-soft:#ece8fd; --hub-on-accent:#ffffff;
  --side-bg:#271d5e; --side-bg-2:#1c1546; --side-ink:#d9d4f7; --side-ink-strong:#ffffff;
  --side-active:#4d3bb0; --side-hover:rgba(255,255,255,.07); --side-line:rgba(255,255,255,.1);
  --hub-good:#17804f; --hub-good-soft:#e3f5ec; --hub-bad:#c0353b; --hub-bad-soft:#fde8e9;
  --hub-warn:#9a5b0c; --hub-warn-soft:#fdf0dc;
  --hub-shadow:0 1px 2px rgba(29,24,64,.05), 0 6px 24px rgba(29,24,64,.06);
  --hub-shadow-lift:0 2px 4px rgba(29,24,64,.06), 0 14px 34px rgba(29,24,64,.12);
  --hub-radius:14px;
  --hub-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hub-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  /* tones: background, border, icon */
  --violet-bg:#f1edff; --violet-line:#ddd3ff; --violet-ico:#5b3fd6;
  --green-bg:#e8f7f0;  --green-line:#c9ecdb;  --green-ico:#17905a;
  --blue-bg:#e9f1fe;   --blue-line:#cfe0fb;   --blue-ico:#2563d9;
  --orange-bg:#fff1e6; --orange-line:#fbdcc3; --orange-ico:#e0701b;
  --teal-bg:#e5f6f6;   --teal-line:#c3e9e8;   --teal-ico:#139090;
  --pink-bg:#fdedf2;   --pink-line:#f8d2de;   --pink-ico:#d63d6c;
  --red-bg:#fdeced;    --red-line:#f7cfd1;    --red-ico:#c0353b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --hub-bg:#100d22; --hub-surface:#18142f; --hub-sunk:#1d1838; --hub-line:#2c2650; --hub-line-strong:#3d3570;
    --hub-ink:#ecebf8; --hub-ink-2:#c3bfdc; --hub-muted:#9792b6;
    --hub-accent:#8c74ff; --hub-accent-hover:#a08cff; --hub-accent-soft:#2a2156; --hub-on-accent:#120d2c;
    --side-bg:#17113a; --side-bg-2:#0e0a25; --side-active:#3b2e8c;
    --hub-good:#4fcb8c; --hub-good-soft:#12301f; --hub-bad:#f07b80; --hub-bad-soft:#3a1719;
    --hub-warn:#e5b257; --hub-warn-soft:#352610;
    --hub-shadow:0 1px 2px rgba(0,0,0,.4); --hub-shadow-lift:0 10px 30px rgba(0,0,0,.45);
    --violet-bg:#211a45; --violet-line:#382d74; --violet-ico:#a593ff;
    --green-bg:#13281f;  --green-line:#1f4636;  --green-ico:#4fcb8c;
    --blue-bg:#141f3a;   --blue-line:#22355f;   --blue-ico:#6f9ff5;
    --orange-bg:#2c1d12; --orange-line:#4e321c; --orange-ico:#f0a060;
    --teal-bg:#10282a;   --teal-line:#1b4547;   --teal-ico:#4fc8c6;
    --pink-bg:#2d1520;   --pink-line:#4f2436;   --pink-ico:#f17aa0;
    --red-bg:#2e1416;    --red-line:#532326;    --red-ico:#f07b80;
  }
}
:root[data-theme="dark"] {
  --hub-bg:#100d22; --hub-surface:#18142f; --hub-sunk:#1d1838; --hub-line:#2c2650; --hub-line-strong:#3d3570;
  --hub-ink:#ecebf8; --hub-ink-2:#c3bfdc; --hub-muted:#9792b6;
  --hub-accent:#8c74ff; --hub-accent-hover:#a08cff; --hub-accent-soft:#2a2156; --hub-on-accent:#120d2c;
  --side-bg:#17113a; --side-bg-2:#0e0a25; --side-active:#3b2e8c;
  --hub-good:#4fcb8c; --hub-good-soft:#12301f; --hub-bad:#f07b80; --hub-bad-soft:#3a1719;
  --hub-warn:#e5b257; --hub-warn-soft:#352610;
  --hub-shadow:0 1px 2px rgba(0,0,0,.4); --hub-shadow-lift:0 10px 30px rgba(0,0,0,.45);
  --violet-bg:#211a45; --violet-line:#382d74; --violet-ico:#a593ff;
  --green-bg:#13281f;  --green-line:#1f4636;  --green-ico:#4fcb8c;
  --blue-bg:#141f3a;   --blue-line:#22355f;   --blue-ico:#6f9ff5;
  --orange-bg:#2c1d12; --orange-line:#4e321c; --orange-ico:#f0a060;
  --teal-bg:#10282a;   --teal-line:#1b4547;   --teal-ico:#4fc8c6;
  --pink-bg:#2d1520;   --pink-line:#4f2436;   --pink-ico:#f17aa0;
  --red-bg:#2e1416;    --red-line:#532326;    --red-ico:#f07b80;
}

html.hs-pending body { visibility: hidden; }
[hidden] { display: none !important; }

.hs-ico { display: inline-flex; width: 20px; height: 20px; flex: none; }
.hs-ico svg { width: 100%; height: 100%; }

/* ------------------------------------------------------------------ frame */
.hs-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh;
            font-family: var(--hub-sans); }
.hs-main { min-width: 0; display: flex; flex-direction: column; }
.hs-content { min-width: 0; flex: 1; outline: none; }
.hs-skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 8px;
           background: var(--hub-accent); color: var(--hub-on-accent); font: 600 14px var(--hub-sans);
           text-decoration: none; }
.hs-skip:focus { top: 12px; }

/* ------------------------------------------------------------------ sidebar */
.hs-side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex;
           flex-direction: column; gap: 2px; padding: 22px 14px 18px; z-index: 40;
           background: linear-gradient(180deg, var(--side-bg), var(--side-bg-2)); color: var(--side-ink);
           font: 14px/1.4 var(--hub-sans); }
.hs-side .hs-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px;
                     color: var(--side-ink-strong); text-decoration: none; }
.hs-brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
                 background: linear-gradient(135deg, #8c6dff, #5b3fd6); color: #fff; flex: none; }
.hs-brand-mark .hs-ico { width: 22px; height: 22px; }
.hs-brand b { display: block; font-size: 16px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.hs-brand small { display: block; font-size: 12px; color: var(--side-ink); opacity: .85; }
.hs-label { margin: 14px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .09em;
            text-transform: uppercase; color: var(--side-ink); opacity: .6; }
/* Explicit on every property: the original pages give bare buttons and links their own look. */
.hs-side .hs-link { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 0; margin: 0;
        padding: 9px 12px; border: 0; border-radius: 10px; background: none; box-shadow: none;
        color: var(--side-ink); font: 500 14px/1.35 var(--hub-sans); letter-spacing: normal;
        text-transform: none; text-align: left; text-decoration: none; cursor: pointer; }
.hs-side .hs-link:hover { background: var(--side-hover); color: var(--side-ink-strong); text-decoration: none; }
.hs-side .hs-link[aria-current="page"] { background: var(--side-active); color: var(--side-ink-strong); font-weight: 600; }
.hs-side .hs-link.hs-open:not([aria-current]) { color: var(--side-ink-strong); font-weight: 600; }
.hs-side .hs-link:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.hs-link .hs-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* listed, does not open (on hold / coming soon / not linked) */
.hs-side .hs-link.is-closed { opacity: .62; cursor: default; }
.hs-side .hs-link.is-closed:hover { background: none; color: inherit; }
.hs-soon { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 1px 7px;
           border-radius: 999px; background: rgba(255,255,255,.12); color: var(--side-ink); }
.hs-sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 21px; padding-left: 10px;
          border-left: 1px solid var(--side-line); }
.hs-side .hs-sub .hs-link { padding: 7px 10px; font-size: 13.5px; gap: 10px; }
.hs-sub .hs-ico { width: 17px; height: 17px; opacity: .85; }
.hs-sub-label { margin: 8px 10px 2px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
                text-transform: uppercase; color: var(--side-ink); opacity: .5; }
.hs-sep { border: 0; border-top: 1px solid var(--side-line); margin: 10px 4px; }
.hs-foot { margin-top: auto; padding: 18px 10px 0; text-align: center; font-size: 12px; opacity: .7; }
.hs-foot svg { display: block; width: 120px; height: 34px; margin: 0 auto 8px; }

/* ------------------------------------------------------------------ top bar */
.hs-topbar { display: flex; align-items: center; gap: 12px; padding: 16px 32px 6px; font: 14px/1.4 var(--hub-sans);
             color: var(--hub-ink-2); }
.hs-crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.hs-crumbs a { color: var(--hub-ink-2); text-decoration: none; font-weight: 500; }
.hs-crumbs a:hover { color: var(--hub-accent); text-decoration: underline; }
.hs-crumbs .hs-ico { width: 14px; height: 14px; color: var(--hub-muted); }
.hs-crumbs [aria-current] { color: var(--hub-ink); font-weight: 650; }
.hs-topbar .hs-menu-wrap { margin-left: auto; }

/* ------------------------------------------------------------------ account menu */
.hs-menu-wrap { position: relative; }
.hs-main button.hs-avatar-btn { display: flex; align-items: center; gap: 8px; min-height: 0; margin: 0; padding: 3px 10px 3px 3px;
        border-radius: 999px; border: 1px solid var(--hub-line); background: var(--hub-surface); color: var(--hub-ink);
        font: 600 13px var(--hub-sans); box-shadow: none; cursor: pointer; }
.hs-main button.hs-avatar-btn:hover { border-color: var(--hub-accent); }
.hs-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
             background: linear-gradient(135deg, #a28bff, #6b4ee6); color: #fff; font-weight: 700; font-size: 13.5px; }
.hs-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 250px; padding: 8px;
           border-radius: 12px; background: var(--hub-surface); border: 1px solid var(--hub-line);
           box-shadow: var(--hub-shadow-lift); font: 14px/1.4 var(--hub-sans); }
.hs-menu .hs-who { padding: 8px 10px 10px; border-bottom: 1px solid var(--hub-line); margin-bottom: 6px; }
.hs-menu .hs-who b { display: block; color: var(--hub-ink); }
.hs-menu .hs-who small { display: block; color: var(--hub-muted); font-size: 12.5px; margin-top: 2px; }
.hs-menu .hs-item { display: flex; width: 100%; align-items: center; gap: 10px; min-height: 0; margin: 0;
        padding: 9px 10px; border: 0; border-radius: 8px; background: none; box-shadow: none; color: var(--hub-ink);
        font: 500 14px var(--hub-sans); text-decoration: none; text-transform: none; letter-spacing: normal;
        cursor: pointer; text-align: left; }
.hs-menu .hs-item:hover { background: var(--hub-sunk); }
.hs-menu .hs-ico { width: 18px; height: 18px; color: var(--hub-muted); }

/* ------------------------------------------------------------------ small screens */
.hs-main button.hs-toggle { display: none; }
.hs-scrim { display: none; }
@media (max-width: 860px) {
  .hs-shell { grid-template-columns: minmax(0, 1fr); }
  .hs-side { position: fixed; inset: 0 auto 0 0; width: 264px; transform: translateX(-100%);
             transition: transform .2s ease; box-shadow: var(--hub-shadow-lift); }
  html.hs-nav-open .hs-side { transform: none; }
  html.hs-nav-open .hs-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(10,8,25,.45); }
  .hs-main button.hs-toggle { display: grid; place-items: center; width: 42px; height: 42px; min-height: 0; margin: 0; padding: 0;
        flex: none; border-radius: 10px; border: 1px solid var(--hub-line); background: var(--hub-surface);
        color: var(--hub-ink); box-shadow: none; cursor: pointer; }
  .hs-topbar { padding: 12px 16px 4px; }
}
@media (prefers-reduced-motion: reduce) { .hs-side { transition: none; } }
@media print { .hs-side, .hs-topbar, .hs-skip { display: none !important; } .hs-shell { display: block; } }
