/* hub/ui/hub.css — Graystone OS shell · classic top-bar + sidebar.
 *
 * Layout:
 *   - Top bar (52px): wordmark · search · decision badge · user
 *   - Sidebar (240px): Home + four divisions, always visible
 *   - Workspace: fills remaining space, scrollable
 *
 * Brand values mirror base.css. No new color tokens defined here —
 * everything references the existing CSS variables.
 */

:root {
  --gs-topbar-height: 52px;
  --gs-sidebar-width: 240px;
  --gs-hairline: rgba(200, 160, 74, .15);
}

/* ── Body shell ─────────────────────────────────────────────── */

body.gs-shell {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--ink, #06060C);
  color: var(--white, #F2F0EA);
}

body.gs-shell #gs-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ── Top bar ────────────────────────────────────────────────── */

#gs-topbar {
  height: var(--gs-topbar-height);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  background: var(--ink, #06060C);
  border-bottom: 1px solid var(--gs-hairline);
  padding: 0 18px;
  gap: 14px;
  z-index: 10;
}

.gs-wordmark {
  font-family: var(--serif, 'Playfair Display', serif);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: .04em;
  color: var(--gold, #C8A04A);
  text-decoration: none;
  flex: 0 0 auto;
}

.gs-search {
  flex: 1 1 auto;
  max-width: 520px;
  margin: 0 auto;
  background: rgba(242, 240, 234, .04);
  border: 1px solid var(--gs-hairline);
  border-radius: 4px;
  padding: 7px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all .15s ease;
}
.gs-search:hover {
  background: rgba(242, 240, 234, .07);
  border-color: rgba(200, 160, 74, .35);
}
.gs-search .gs-search-icon {
  color: var(--gold, #C8A04A);
  font-size: 13px;
  font-family: var(--mono, 'DM Mono', monospace);
}
.gs-search .gs-search-placeholder {
  color: rgba(242, 240, 234, .55);
  font-family: var(--mono, 'DM Mono', monospace);
  font-size: 12px;
  letter-spacing: .04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gs-search .gs-search-shortcut {
  margin-left: auto;
  color: rgba(242, 240, 234, .35);
  font-family: var(--mono, monospace);
  font-size: 11px;
  background: rgba(242, 240, 234, .06);
  padding: 1px 6px;
  border-radius: 2px;
  flex: 0 0 auto;
}

.gs-decision-badge {
  background: #DC2626;
  color: white;
  border-radius: 50%;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-family: var(--mono, monospace);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: gs-pulse 2.4s ease-in-out infinite;
  flex: 0 0 auto;
}
.gs-decision-badge.hidden { display: none; }
@keyframes gs-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .55); }
  50%      { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}

.gs-user {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.gs-user-name {
  color: rgba(242, 240, 234, .8);
  font-family: var(--mono, monospace);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.gs-logout {
  background: transparent;
  border: 1px solid var(--gs-hairline);
  color: rgba(242, 240, 234, .65);
  padding: 5px 12px;
  border-radius: 3px;
  font-family: var(--mono, monospace);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .15s ease;
}
.gs-logout:hover {
  border-color: var(--gold, #C8A04A);
  color: var(--gold, #C8A04A);
}

.gs-mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--gs-hairline);
  color: var(--white, #F2F0EA);
  width: 34px;
  height: 34px;
  border-radius: 4px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex: 0 0 auto;
}

/* ── Main row · sidebar + workspace ────────────────────────── */

#gs-main {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
}

/* ── Sidebar ────────────────────────────────────────────────── */

#gs-sidebar {
  width: var(--gs-sidebar-width);
  flex: 0 0 var(--gs-sidebar-width);
  background: var(--ink-2, #0C0C14);
  border-right: 1px solid var(--gs-hairline);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 160, 74, .15) transparent;
}
#gs-sidebar::-webkit-scrollbar { width: 6px; }
#gs-sidebar::-webkit-scrollbar-thumb {
  background: rgba(200, 160, 74, .15);
  border-radius: 3px;
}

.gs-nav-section {
  margin-top: 18px;
}
.gs-nav-section:first-of-type {
  margin-top: 4px;
}

.gs-nav-header {
  font-family: var(--mono, monospace);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-3, #907030);
  padding: 6px 18px;
  margin-bottom: 4px;
}

.gs-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  cursor: pointer;
  color: rgba(242, 240, 234, .72);
  text-decoration: none;
  border-left: 2px solid transparent;
  font-family: var(--sans, 'DM Sans', sans-serif);
  font-size: 13px;
  font-weight: 400;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
  white-space: nowrap;
}
.gs-nav-item:hover {
  color: var(--white, #F2F0EA);
  background: rgba(200, 160, 74, .04);
}
.gs-nav-item.active {
  color: var(--gold, #C8A04A);
  background: rgba(200, 160, 74, .08);
  border-left-color: var(--gold, #C8A04A);
}
.gs-nav-item .gs-nav-icon {
  flex: 0 0 18px;
  text-align: center;
  font-size: 13px;
  opacity: .8;
}

.gs-nav-home {
  font-family: var(--mono, monospace);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold-2, #E0BC6C);
  padding: 12px 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--gs-hairline);
}
.gs-nav-home.active {
  background: rgba(200, 160, 74, .12);
  border-left-color: var(--gold, #C8A04A);
  color: var(--gold, #C8A04A);
}

/* ── Workspace ──────────────────────────────────────────────── */

#gs-workspace {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg, var(--ink, #06060C));
  padding: 20px 26px;
  min-width: 0;
}

/* ── Mobile · sidebar slides in over workspace ─────────────── */

@media (max-width: 768px) {
  .gs-mobile-toggle { display: flex; }

  #gs-sidebar {
    position: fixed;
    top: var(--gs-topbar-height);
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 50;
    box-shadow: 4px 0 24px rgba(0, 0, 0, .45);
  }
  body.gs-shell.gs-sidebar-open #gs-sidebar {
    transform: translateX(0);
  }

  .gs-search { display: none; }
  .gs-user-name { display: none; }
  #gs-workspace { padding: 14px 14px; }
}

/* ── Command palette overlay · / activates ─────────────────── */

#gs-palette {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 88px;
}
#gs-palette.palette-hidden { display: none; }

.palette-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 12, .82);
  backdrop-filter: blur(2px);
}

.palette-modal {
  position: relative;
  width: min(640px, 92vw);
  background: var(--ink-2, #0C0C14);
  border: 1px solid rgba(200, 160, 74, .25);
  border-radius: 6px;
  box-shadow: 0 16px 60px rgba(0, 0, 0, .6);
  overflow: hidden;
}

#gs-palette-input {
  width: 100%;
  background: transparent;
  border: none;
  padding: 18px 22px;
  font-family: var(--sans, 'DM Sans', sans-serif);
  font-size: 17px;
  color: var(--white, #F2F0EA);
  border-bottom: 1px solid var(--gs-hairline);
  outline: none;
  box-sizing: border-box;
}
#gs-palette-input::placeholder { color: rgba(242, 240, 234, .35); }

#gs-palette-results {
  max-height: 60vh;
  overflow-y: auto;
}
.palette-section { padding: 4px 0; }
.palette-section-label {
  padding: 8px 22px 4px;
  color: var(--gold, #C8A04A);
  font-family: var(--mono, monospace);
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.palette-result {
  padding: 9px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  color: rgba(242, 240, 234, .85);
  font-size: 14px;
}
.palette-result:hover, .palette-result.active {
  background: rgba(200, 160, 74, .08);
  color: var(--gold, #C8A04A);
}
.palette-result .result-icon {
  width: 22px;
  text-align: center;
  font-size: 14px;
  opacity: .8;
}
.palette-result .result-meta {
  margin-left: auto;
  color: rgba(242, 240, 234, .35);
  font-family: var(--mono, monospace);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.palette-empty {
  padding: 22px;
  color: rgba(242, 240, 234, .4);
  font-style: italic;
  font-size: 13px;
  text-align: center;
}
