/* ============================================================
   Graphite Dusk — SEO Operator Control Panel
   Copied from ~/.claude/coordinator/ui/index.html (WO-007)
   ============================================================ */

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design tokens ── */
:root {
  /* Graphite Dusk — WCAG 2.2 AA dark palette, warm-neutral, high surface differentiation */
  --ink: #0E0C0A;
  --panel: #161412;
  --surface: #1F1D1A;
  --surface2: #282420;
  --border: #3C3630;
  --border2: #504840;
  --gold: #D4AC6E;
  --gold-dim: #8A6C38;
  --gold-glow: rgba(212,172,110,.14);
  --red: #E06060;
  --red-glow: rgba(224,96,96,.15);
  --green: #44D890;
  --cyan: #40D0C0;
  --amber: #E09450;
  --text: #ECEAE4;
  --muted: #9E9688;
  --subtle: #8A8378;
  --fh: 'Syne', sans-serif;
  --fm: 'Space Mono', monospace;
}

/* ── Light mode overrides — Warm Linen ── */
[data-theme="light"] {
  --ink: #F6F4F0;
  --panel: #EBE8E2;
  --surface: #DDD9D2;
  --surface2: #CFCBC3;
  --border: #B8B2AA;
  --border2: #A09890;
  --text: #1E1A12;
  --muted: #52483C;
  --subtle: #706660;
  --gold: #8C6200;
  --gold-dim: #C09240;
  --gold-glow: rgba(140,98,0,.12);
  --red: #C03C3C;
  --red-glow: rgba(192,60,60,.12);
  --green: #186E38;
  --cyan: #0C7070;
  --amber: #A84800;
}

/* ── Base ── */
html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--fm);
  color: var(--text);
  background: var(--ink);
  font-size: 1rem;
  transition: color .2s, background .2s;
}

/* ── Scanline overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(0,0,0,.035) 2px,
    rgba(0,0,0,.035) 4px
  );
}

/* ── Scrollbars ── */
::-webkit-scrollbar { width: 0.286rem; height: 0.286rem; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 0.143rem; }

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100dvh;
  background: var(--ink);
}

.login-card {
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: 0.571rem;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 24rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 0 1px rgba(212,172,110,.06);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.login-wordmark {
  font-family: var(--fh);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
}

.login-sub {
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--subtle);
  text-align: center;
  margin-top: -.75rem;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.field-group label {
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--subtle);
}

.field-group input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 0.286rem;
  color: var(--text);
  font-family: var(--fm);
  font-size: .85rem;
  padding: .571rem .714rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.field-group input::placeholder {
  color: var(--subtle);
  opacity: .6;
}

.field-group input:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

.login-error {
  font-size: .78rem;
  color: var(--red);
  background: var(--red-glow);
  border: 1px solid rgba(224,96,96,.25);
  border-radius: 0.214rem;
  padding: .5rem .714rem;
}

.login-btn {
  background: var(--gold-glow);
  border: 1px solid rgba(212,172,110,.3);
  border-radius: 0.286rem;
  color: var(--gold);
  font-family: var(--fh);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .643rem 1rem;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
  margin-top: .25rem;
}

.login-btn:hover {
  background: rgba(212,172,110,.22);
  border-color: var(--gold);
  box-shadow: 0 0 10px var(--gold-glow);
}

.login-btn:active {
  background: rgba(212,172,110,.3);
}

/* ============================================================
   APP SHELL LAYOUT
   ============================================================ */
#app-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

/* ── Header ── */
#app-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  height: 3.286rem;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

#app-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), var(--gold), var(--gold-dim), transparent);
  opacity: .45;
}

.h-wordmark {
  font-family: var(--fh);
  font-weight: 800;
  font-size: .82rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 0 1.25rem;
  white-space: nowrap;
}

.h-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.571rem;
}

.hclock {
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--text);
  min-width: 5.5rem;
  text-align: center;
}

.h-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-right: 1rem;
}

.conn-badge {
  font-size: .66rem;
  padding: .214rem .5rem;
  border-radius: 0.143rem;
  cursor: default;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.conn-ok {
  background: rgba(68,216,144,.08);
  color: var(--green);
  border: 1px solid rgba(68,216,144,.22);
}

.conn-err {
  background: var(--red-glow);
  color: var(--red);
  border: 1px solid rgba(224,96,96,.25);
}

.theme-btn {
  width: 1.857rem;
  height: 1.857rem;
  border-radius: 0.214rem;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--muted);
  font-size: .9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s;
}

.theme-btn:hover {
  color: var(--text);
  background: var(--surface2);
}

.logout-btn {
  width: 1.857rem;
  height: 1.857rem;
  border-radius: 0.214rem;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--subtle);
  font-size: .9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s, border-color .15s;
}

.logout-btn:hover {
  color: var(--red);
  border-color: rgba(224,96,96,.4);
  background: var(--red-glow);
}

/* ── Tab nav ── */
#tab-nav {
  display: flex;
  align-items: stretch;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

#tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: 0 1.25rem;
  height: 2.571rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: var(--fh);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, background .15s, border-color .15s;
  position: relative;
}

.tab-btn .tab-icon {
  font-size: .85rem;
  line-height: 1;
}

.tab-btn:hover {
  color: var(--text);
  background: var(--surface2);
}

.tab-btn.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  background: var(--surface);
}

/* ── Tab content ── */
#tab-content {
  flex: 1;
  overflow-y: auto;
  background: var(--ink);
  min-height: 0;
}

/* ── View stub (placeholder for WO-008..WO-013) ── */
.view-stub {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  font-size: .85rem;
  font-family: var(--fm);
  letter-spacing: .05em;
  padding: 3rem;
  text-align: center;
}

.view-stub em {
  color: var(--gold);
  font-style: normal;
}

/* ── Utility ── */
.hidden { display: none !important; }
