/* ═══════════════════════════════════════════════════════════════════════════
   FaceCheck Platform — Application Shell v2
   Sidebar + Topbar + Content layout.
   Requires tokens.css to be loaded first.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Shell variables (all reference design tokens) ────────────────────────── */
:root {
  --shell-sidebar-w:   var(--sidebar-width,   220px);
  --shell-topbar-h:    var(--topbar-height,    52px);
  --shell-sidebar-bg:  var(--ob-1000, #0d0f0c);
  --shell-topbar-bg:   var(--ob-1000, #0d0f0c);
  --shell-item-radius: 0;
  --shell-transition:  var(--duration-base, 150ms) var(--ease-out, cubic-bezier(0,0,.2,1));
}

/* ── App root ─────────────────────────────────────────────────────────────── */
body { overflow: hidden; }

.fc-app {
  display: grid;
  grid-template-columns: var(--shell-sidebar-w) 1fr;
  height: 100vh;
  width: 100vw;
  background: var(--bg, #09090b);
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.fc-sidebar {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--shell-sidebar-bg);
  border-right: 1px solid var(--color-border-subtle);
  overflow: hidden;
  position: relative;
  z-index: var(--z-sticky, 200);
}

/* Brand / wordmark */
.fc-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  height: var(--shell-topbar-h);
  border-bottom: 1px solid var(--color-border-subtle);
  flex-shrink: 0;
  text-decoration: none;
  color: var(--text, #f4f4f5);
  letter-spacing: -0.01em;
}

.fc-brand:hover { text-decoration: none; }

.fc-brand-icon {
  width: 22px;
  height: 22px;
  color: var(--accent, #6366f1);
  flex-shrink: 0;
  opacity: 0.9;
}

.fc-brand-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 0;
  flex-shrink: 0;
}

.fc-brand-name {
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  white-space: nowrap;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* Nav */
.fc-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  scrollbar-width: none;
}
.fc-nav::-webkit-scrollbar { display: none; }

.fc-nav-divider {
  height: 1px;
  background: var(--color-border-subtle);
  margin: 5px 12px;
}

/* Nav item */
.fc-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  margin: 1px 6px;
  border-radius: var(--shell-item-radius);
  color: rgba(161,161,170,0.8);
  text-decoration: none;
  font-size: .84rem;
  font-weight: 500;
  transition: background var(--shell-transition), color var(--shell-transition);
  white-space: nowrap;
  position: relative;
  cursor: pointer;
  user-select: none;
}

.fc-nav-item:hover {
  background: var(--color-border-subtle);
  color: var(--text, #f4f4f5);
  text-decoration: none;
}

.fc-nav-item--active {
  background: var(--color-brand-subtle);
  color: var(--color-brand-text);
  font-weight: 600;
}

.fc-nav-item--active::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 62%;
  border-radius: 0;
  background: var(--color-brand);
}

.fc-nav-item--disabled {
  opacity: .3;
  pointer-events: none;
  cursor: default;
}

.fc-nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity var(--shell-transition);
}

.fc-nav-item--active .fc-nav-icon { opacity: 1; }
.fc-nav-item:hover    .fc-nav-icon { opacity: 0.85; }

.fc-nav-label { flex: 1; }

.fc-nav-pill {
  font-size: .58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--color-bg-overlay);
  color: rgba(161,161,170,0.6);
  padding: .12rem .4rem;
  border-radius: 0;
}

/* Collapsible "Developer tools" group — kept reachable, visually recessed */
.fc-nav-group {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid var(--color-border-subtle);
}
.fc-nav-group-label {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  margin: 1px 6px;
  border-radius: var(--shell-item-radius);
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: rgba(161,161,170,0.55);
  cursor: pointer;
  user-select: none;
  transition: color var(--shell-transition), background var(--shell-transition);
}
.fc-nav-group-label::-webkit-details-marker { display: none; }
.fc-nav-group-label::after {
  content: '';
  width: 5px; height: 5px;
  margin-left: auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--shell-transition);
}
.fc-nav-group[open] > .fc-nav-group-label::after { transform: rotate(45deg); }
.fc-nav-group-label:hover { color: rgba(161,161,170,0.9); background: var(--color-bg-overlay); }
.fc-nav-group-items { display: flex; flex-direction: column; gap: 1px; padding-bottom: 4px; }

/* Sidebar footer */
.fc-sidebar-footer {
  flex-shrink: 0;
  padding: 10px 14px;
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .72rem;
  color: rgba(113,113,122,0.8);
  font-family: var(--mono, monospace);
}

.fc-sidebar-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--error, #ef4444);
  transition: background var(--duration-slow, 250ms);
}

.fc-sidebar-dot--online {
  background: var(--success, #22c55e);
  box-shadow: 0 0 0 3px var(--color-success-subtle);
}

/* ── Body (topbar + content) ──────────────────────────────────────────────── */
.fc-body {
  grid-column: 2;
  display: grid;
  grid-template-rows: var(--shell-topbar-h) 1fr;
  height: 100vh;
  min-width: 0;
  overflow: hidden;
}

/* ── Topbar ───────────────────────────────────────────────────────────────── */
.fc-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px;
  height: var(--shell-topbar-h);
  background: var(--shell-topbar-bg);
  border-bottom: 1px solid var(--color-border-subtle);
  position: sticky;
  top: 0;
  z-index: var(--z-raised, 10);
}

.fc-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.fc-topbar-title {
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 600;
  color: var(--text, #f4f4f5);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Theme toggle */
.fc-theme-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md, 6px);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: color var(--duration-base, 150ms) var(--ease-out),
              border-color var(--duration-base, 150ms) var(--ease-out),
              background var(--duration-base, 150ms) var(--ease-out);
}
.fc-theme-btn:hover { color: var(--color-text-primary); border-color: var(--color-border-strong); }
.fc-theme-btn:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; }
.fc-theme-ic { width: 17px; height: 17px; }
.fc-theme-ic--moon { display: none; }
:root[data-theme="light"] .fc-theme-ic--sun  { display: none; }
:root[data-theme="light"] .fc-theme-ic--moon { display: block; }

.fc-topbar-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  color: rgba(113,113,122,0.8);
  font-family: var(--mono, monospace);
}

.fc-topbar-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--error, #ef4444);
  flex-shrink: 0;
  transition: background var(--duration-slow, 250ms);
}

.fc-topbar-dot--online {
  background: var(--success, #22c55e);
}

/* Hamburger */
.fc-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  flex-shrink: 0;
  transition: background var(--shell-transition);
}
.fc-hamburger:hover { background: var(--color-bg-overlay); }
.fc-hamburger span {
  display: block;
  height: 1.5px;
  width: 100%;
  background: rgba(161,161,170,0.8);
  border-radius: 2px;
  transition: background var(--shell-transition);
}
.fc-hamburger:hover span { background: var(--text, #f4f4f5); }

/* ── Main content area ────────────────────────────────────────────────────── */
main.fc-main,
.fc-main {
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  display: block;
  gap: 0;
  background: var(--bg, #09090b);
}

/* Page content container */
.fc-main .container {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Mobile overlay ───────────────────────────────────────────────────────── */
.fc-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: var(--z-overlay, 250);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .fc-app { grid-template-columns: 1fr; }
  .fc-body { grid-column: 1; }
  .fc-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--shell-sidebar-w);
    transform: translateX(-100%);
    transition: transform var(--duration-slow, 250ms) var(--ease-out);
    z-index: var(--z-drawer, 300);
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  .fc-app--open .fc-sidebar { transform: translateX(0); }
  .fc-app--open .fc-overlay { display: block; }
  .fc-hamburger { display: flex; }
  .fc-main .container { padding: 20px 16px; }
}

@media (max-width: 480px) {
  .fc-main .container { padding: 16px 12px; gap: 14px; }
}

/* ── Stub / coming-soon pages ─────────────────────────────────────────────── */
.fc-stub {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 32px;
  text-align: center;
  color: var(--text-muted, #a1a1aa);
  min-height: 60vh;
}
.fc-stub-icon { color: var(--text-muted, #a1a1aa); opacity: .4; }
.fc-stub-icon svg { display: block; }
.fc-stub h1  { font-size: 1.2rem; font-weight: 700; color: var(--text, #f4f4f5); margin: 0; }
.fc-stub p   { font-size: .88rem; max-width: 360px; line-height: 1.65; }
.fc-stub-badge {
  display: inline-flex;
  padding: .3rem .9rem;
  border-radius: 0;
  font-size: .7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: var(--color-brand-subtle);
  color: var(--color-brand-text);
  border: 1px solid var(--color-brand-ring);
  font-family: var(--font-mono);
}

/* ── Topbar version badge ─────────────────────────────────────────────────── */
.fc-topbar-version {
  font-size: .68rem;
  font-weight: 600;
  color: rgba(113,113,122,0.6);
  font-family: var(--mono, monospace);
  margin-left: -4px;
}
