/* ════════════════════════════════════════════════════
   LiteSpec Layout Tokens
   Single source of truth for layout dimensions and
   structural CSS classes. Loaded globally via base.html.
   ════════════════════════════════════════════════════ */

:root {
  --topbar-height: 84px;
  --sidebar-width: 220px;
  --sidebar-width-collapsed: 52px;
  --secondary-sidebar-width: 300px;
  --secondary-sidebar-width-collapsed: 42px;
  --sidebar-bg: linear-gradient(180deg, #3a1f6e 0%, #2e1860 50%, #271357 100%);
  --secondary-sidebar-bg: #f8f7f7;
  --secondary-sidebar-border: #ddd6f0;
}

/* ── Theme: Light mode (default) ── */
:root:not([data-theme="dark"]) {
  --topbar-bg: #f8f7f7;
  --topbar-shadow: 0 2px 20px rgba(0, 0, 0, .08);
  --sidebar-bg: linear-gradient(180deg, #3a1f6e 0%, #2e1860 50%, #271357 100%);
  --sidebar-text-primary: #2e1860;
  --sidebar-text-secondary: #2e1860;
  --sidebar-hover-bg: rgba(255, 255, 255, 0.1);
  --secondary-sidebar-bg: #f7f7f7;
  --secondary-sidebar-text: #262626;
  --secondary-sidebar-border: #ebebeb;
  --body-bg: #f5f3ff;
}

/* ── Theme: Dark mode ── */
:root[data-theme="dark"] {
  --topbar-bg: linear-gradient(135deg, #221248 0%, #371b7a 100%);
  --topbar-shadow: 0 4px 12px rgba(0, 0, 0, .4);
  --sidebar-bg: linear-gradient(180deg, #1a0f3a 0%, #140925 50%, #0f0820 100%);
  --sidebar-text-primary: #e5e7eb;
  --sidebar-text-secondary: rgba(229, 231, 235, 0.6);
  --sidebar-hover-bg: rgba(255, 255, 255, 0.08);
  --secondary-sidebar-bg: #131826;
  --secondary-sidebar-text: #ffffff;
  --secondary-sidebar-border: #2d3748;
  --body-bg: #111827;
  color-scheme: dark;
}

/* ── App shell layout ── */
.ls-app-body {
  display: flex;
  flex: 1;
  min-height: calc(100vh - var(--topbar-offset, var(--topbar-height)));
}

/* ── Topbar ── */
.ls-topbar {
  height: auto;
  min-height: var(--topbar-height);
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  background: var(--topbar-bg);
  box-shadow: var(--topbar-shadow);
}

.ls-topbar--plain {
  background: var(--topbar-bg);
  box-shadow: var(--topbar-shadow);
}

/* ── Primary sidebar outer wrapper (Alpine :class controlled) ── */
.ls-sidebar-outer {
  flex-shrink: 0;
  transition: width .2s ease;
  position: sticky;
  top: var(--topbar-offset, var(--topbar-height));
  align-self: flex-start;
  height: calc(100vh - var(--topbar-offset, var(--topbar-height)));
  z-index: 35;
  width: var(--sidebar-width);
}

.ls-sidebar-outer.ls-sidebar-collapsed {
  width: var(--sidebar-width-collapsed);
}

/* ── Primary sidebar inner panel ── */
.ls-sidebar-inner {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
}

/* ── primary-table column resize handle ── */
.ws-col-resizer {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: col-resize;
  z-index: 1;
  border-right: 2px solid #c9b8e8;
  transition: border-color .15s;
}
.ws-col-resizer:hover,
.ws-col-resizer:active {
  border-right-color: #764ba2;
  border-right-width: 3px;
}
