/* ═══════════════════════════════════════════════════════════════════════════
   WorkBench — Neural HUD Design System
   Theme: Deep space control panel, 2045 aesthetic
   Fonts: Orbitron (brand) · Rajdhani (headings) · DM Sans (body) · JetBrains Mono
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Design tokens ──────────────────────────────────────────────────────── */
:root {
  /* Background */
  --bg-base:     #04040d;
  --bg-depth:    #08081a;
  --bg-sidebar:  #060610;
  --bg-surface:  rgba(255, 255, 255, 0.035);
  --bg-surface-2: rgba(255, 255, 255, 0.065);
  --bg-surface-3: rgba(255, 255, 255, 0.10);
  --bg-hover:    rgba(255, 255, 255, 0.05);

  /* Borders */
  --border-dim:    rgba(147, 197, 253, 0.07);
  --border-subtle: rgba(147, 197, 253, 0.13);
  --border-mid:    rgba(147, 197, 253, 0.22);
  --border-active: rgba(0, 212, 255, 0.55);

  /* Accent system */
  --cyan:        #00d4ff;
  --cyan-light:  #7ee8ff;
  --cyan-dim:    rgba(0, 212, 255, 0.12);
  --cyan-glow:   rgba(0, 212, 255, 0.25);
  --purple:      #8b5cf6;
  --purple-light: #c4b5fd;
  --purple-dim:  rgba(139, 92, 246, 0.12);
  --purple-glow: rgba(139, 92, 246, 0.25);
  --green:       #10d982;
  --green-dim:   rgba(16, 217, 130, 0.12);
  --green-glow:  rgba(16, 217, 130, 0.25);
  --orange:      #fb923c;
  --orange-dim:  rgba(251, 146, 60, 0.12);
  --red:         #f87171;
  --red-dim:     rgba(248, 113, 113, 0.12);

  /* Text */
  --text-primary:   #eef2ff;
  --text-secondary: #94a3b8;
  --text-muted:     #4a5568;
  --text-cyan:      var(--cyan);
  --text-purple:    var(--purple-light);

  /* Shadows / glows */
  --glow-cyan:   0 0 15px rgba(0, 212, 255, 0.3), 0 0 40px rgba(0, 212, 255, 0.1);
  --glow-purple: 0 0 15px rgba(139, 92, 246, 0.3), 0 0 40px rgba(139, 92, 246, 0.1);
  --glow-green:  0 0 15px rgba(16, 217, 130, 0.3), 0 0 40px rgba(16, 217, 130, 0.1);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255,255,255,0.04) inset;

  /* Typography */
  --font-brand:   'Orbitron', monospace;
  --font-display: 'Rajdhani', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* Layout */
  --sidebar-w: 248px;
  --radius-sm:  6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:  cubic-bezier(0.4, 0, 1, 1);
  --t-fast:   150ms;
  --t-base:   250ms;
  --t-slow:   400ms;
}

/* ── Reset & base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
  min-height: 100vh;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Animated grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  animation: gridScroll 40s linear infinite;
  pointer-events: none;
  z-index: 0;
}

/* Radial vignette — pulls focus to center */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, transparent 0%, rgba(4,4,13,0.7) 100%);
  pointer-events: none;
  z-index: 0;
}

@keyframes gridScroll {
  0%   { background-position: 0 0; }
  100% { background-position: 56px 56px; }
}

/* Ensure Blazor content sits above background */
#app, .wb-shell { position: relative; z-index: 1; }

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-mid); }

/* ── Shell layout ────────────────────────────────────────────────────────── */
.wb-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.wb-sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-dim);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  padding: 0;
  transition: transform var(--t-base) var(--ease-out);
}

.wb-sidebar-header {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border-dim);
}

.wb-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.wb-brand-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  box-shadow: var(--glow-cyan);
  flex-shrink: 0;
}

.wb-brand-name {
  font-family: var(--font-brand);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: linear-gradient(90deg, var(--cyan), var(--purple-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.wb-brand-tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: -2px;
}

.wb-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  overflow-y: auto;
}

.wb-nav-section {
  margin-bottom: 1.5rem;
}

.wb-nav-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 0.5rem;
  margin-bottom: 0.5rem;
}

.wb-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: all var(--t-fast) var(--ease-out);
  border: 1px solid transparent;
  position: relative;
  margin-bottom: 2px;
}

.wb-nav-item i {
  font-size: 1.05rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  transition: color var(--t-fast);
}

.wb-nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-color: var(--border-dim);
}

.wb-nav-item.active {
  color: var(--cyan);
  background: var(--cyan-dim);
  border-color: var(--border-active);
  box-shadow: inset 3px 0 0 var(--cyan);
}

.wb-nav-item.active i { color: var(--cyan); }

.wb-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--cyan);
  box-shadow: var(--glow-cyan);
}

.wb-sidebar-footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid var(--border-dim);
}

.wb-user-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
}

.wb-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-brand);
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.wb-user-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-logout-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 2px;
  transition: color var(--t-fast);
  line-height: 1;
}
.wb-logout-btn:hover { color: var(--red); }

/* ── Main content area ───────────────────────────────────────────────────── */
.wb-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wb-topbar {
  height: 56px;
  border-bottom: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 1rem;
  background: rgba(4, 4, 13, 0.6);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.wb-topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.wb-topbar-breadcrumb .current {
  color: var(--text-secondary);
}

.wb-topbar-spacer { flex: 1; }

.wb-topbar-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--green);
  letter-spacing: 0.05em;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.8); }
}

.wb-page {
  padding: 2rem;
  flex: 1;
}

/* ── Glass cards ─────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: border-color var(--t-base), box-shadow var(--t-base);
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg,
    rgba(0, 212, 255, 0.04) 0%,
    transparent 50%,
    rgba(139, 92, 246, 0.04) 100%);
  pointer-events: none;
}

.card:hover {
  border-color: var(--border-mid);
  box-shadow: var(--shadow-card), 0 0 30px rgba(0, 212, 255, 0.06);
}

.card-glow-cyan  { border-color: rgba(0, 212, 255, 0.25) !important; box-shadow: var(--shadow-card), var(--glow-cyan); }
.card-glow-purple { border-color: rgba(139, 92, 246, 0.25) !important; box-shadow: var(--shadow-card), var(--glow-purple); }
.card-glow-green  { border-color: rgba(16, 217, 130, 0.25) !important; box-shadow: var(--shadow-card), var(--glow-green); }

.card-header {
  padding: 1.25rem 1.5rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.card-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.card-icon-cyan   { background: var(--cyan-dim);   color: var(--cyan);   border: 1px solid rgba(0,212,255,0.2); }
.card-icon-purple { background: var(--purple-dim);  color: var(--purple); border: 1px solid rgba(139,92,246,0.2); }
.card-icon-green  { background: var(--green-dim);   color: var(--green);  border: 1px solid rgba(16,217,130,0.2); }
.card-icon-orange { background: var(--orange-dim);  color: var(--orange); border: 1px solid rgba(251,146,60,0.2); }

.card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.03em;
  line-height: 1.3;
}

.card-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-body { padding: 1.25rem 1.5rem 1.5rem; }

/* ── Tool hero cards (dashboard) ─────────────────────────────────────────── */
.tool-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: all var(--t-base) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.tool-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--tool-accent, var(--cyan));
  opacity: 0;
  transition: opacity var(--t-base);
}

.tool-card:hover {
  border-color: var(--tool-border, var(--border-active));
  background: var(--bg-surface-2);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 20px var(--tool-glow, var(--cyan-glow));
}

.tool-card:hover::after { opacity: 1; }

.tool-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
  background: var(--tool-bg, var(--cyan-dim));
  color: var(--tool-color, var(--cyan));
  border: 1px solid var(--tool-border-dim, rgba(0,212,255,0.15));
}

.tool-card-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.tool-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.tool-card-arrow {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: all var(--t-fast);
}

.tool-card:hover .tool-card-arrow {
  color: var(--tool-color, var(--cyan));
  transform: translate(2px, -2px);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--t-fast) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan) 0%, #0099cc 100%);
  color: #040414;
  border-color: rgba(0, 212, 255, 0.5);
  box-shadow: 0 2px 12px rgba(0,212,255,0.25);
}

.btn-primary:hover {
  box-shadow: 0 4px 20px rgba(0,212,255,0.45);
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.btn-primary:active { transform: none; filter: brightness(0.95); }

.btn-purple {
  background: linear-gradient(135deg, var(--purple) 0%, #6d28d9 100%);
  color: #fff;
  border-color: rgba(139,92,246,0.5);
  box-shadow: 0 2px 12px rgba(139,92,246,0.25);
}

.btn-purple:hover {
  box-shadow: 0 4px 20px rgba(139,92,246,0.45);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.btn-ghost:hover {
  background: var(--bg-surface-2);
  color: var(--text-primary);
  border-color: var(--border-mid);
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: rgba(248,113,113,0.3);
}

.btn-danger:hover {
  background: var(--red-dim);
  border-color: rgba(248,113,113,0.6);
}

.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.75rem; font-size: 1rem; }
.btn-icon { padding: 0.5rem; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.form-control {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.6rem 0.9rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
  -webkit-appearance: none;
}

.form-control::placeholder { color: var(--text-muted); }

.form-control:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
  background: rgba(255,255,255,0.06);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

select.form-control option {
  background: #0f172a;
  color: var(--text-primary);
}

/* ── File drop zone ──────────────────────────────────────────────────────── */
.drop-zone {
  border: 1.5px dashed var(--border-mid);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--t-base);
  background: var(--bg-surface);
  position: relative;
  animation: borderPulse 4s ease-in-out infinite;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--border-active);
  background: var(--cyan-dim);
  box-shadow: 0 0 20px rgba(0,212,255,0.1);
  animation: none;
}

@keyframes borderPulse {
  0%, 100% { border-color: var(--border-mid); }
  50%       { border-color: rgba(0, 212, 255, 0.3); }
}

.drop-zone-icon { font-size: 2rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.drop-zone-text { font-family: var(--font-display); font-size: 0.9rem; color: var(--text-secondary); }
.drop-zone-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.35rem; }

/* ── Status badges ───────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge-pending  { background: rgba(251,146,60,0.15); color: var(--orange); border: 1px solid rgba(251,146,60,0.3); }
.badge-running  { background: var(--cyan-dim);        color: var(--cyan);   border: 1px solid rgba(0,212,255,0.3); }
.badge-completed { background: var(--green-dim);      color: var(--green);  border: 1px solid rgba(16,217,130,0.3); }
.badge-failed   { background: var(--red-dim);         color: var(--red);    border: 1px solid rgba(248,113,113,0.3); }
.badge-focus    { background: rgba(239,68,68,0.15);   color: #fca5a5;       border: 1px solid rgba(239,68,68,0.3); }
.badge-today    { background: var(--orange-dim);      color: var(--orange); border: 1px solid rgba(251,146,60,0.3); }
.badge-week     { background: var(--cyan-dim);        color: var(--cyan);   border: 1px solid rgba(0,212,255,0.25); }
.badge-backlog  { background: var(--bg-surface-2);    color: var(--text-muted); border: 1px solid var(--border-subtle); }
.badge-blocked  { background: var(--red-dim);         color: var(--red);    border: 1px solid rgba(248,113,113,0.3); }

.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge-running .badge-dot { animation: pulse 1.5s ease-in-out infinite; }

/* ── Loading / spinner ───────────────────────────────────────────────────── */
.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 48px; height: 48px; border-width: 3px; }

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

/* Skeleton shimmer */
.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-surface-2) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* ── Page headers ────────────────────────────────────────────────────────── */
.page-header {
  margin-bottom: 2rem;
}

.page-header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.page-title span {
  background: linear-gradient(90deg, var(--cyan), var(--purple-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  max-width: 600px;
}

/* ── Grid utilities ──────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }

/* ── Output files grid ───────────────────────────────────────────────────── */
.output-files {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.output-file-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  transition: all var(--t-fast);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-decoration: none;
}

.output-file-card:hover {
  border-color: var(--border-active);
  background: var(--cyan-dim);
  box-shadow: var(--glow-cyan);
  transform: translateY(-1px);
}

.output-file-icon { font-size: 1.4rem; }
.output-file-name { font-size: 0.75rem; color: var(--text-secondary); word-break: break-all; line-height: 1.3; }
.output-file-size { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); }
.output-file-type { font-family: var(--font-mono); font-size: 0.6rem; color: var(--cyan); text-transform: uppercase; }

/* ── Task board (FocusBoard) ─────────────────────────────────────────────── */
.focus-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  align-items: start;
}

.focus-column-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-dim);
}

.focus-column-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.focus-column-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--bg-surface-2);
  color: var(--text-muted);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  margin-left: auto;
}

.task-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-bottom: 0.65rem;
  transition: all var(--t-fast);
  cursor: default;
}

.task-card:hover {
  border-color: var(--border-subtle);
  background: var(--bg-surface-2);
}

.task-card-id {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.task-card-title {
  font-size: 0.82rem;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.task-card-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.task-type-pill {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  background: var(--purple-dim);
  color: var(--purple-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Email result ────────────────────────────────────────────────────────── */
.email-preview {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.email-preview-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-dim);
  background: var(--bg-surface);
}

.email-preview-subject {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.email-preview-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.email-preview-body {
  padding: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  line-height: 1.7;
  font-family: var(--font-body);
}

/* ── Tone selector ───────────────────────────────────────────────────────── */
.tone-grid {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tone-btn {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  letter-spacing: 0.04em;
}

.tone-btn:hover { border-color: var(--border-mid); color: var(--text-primary); }

.tone-btn.selected {
  background: var(--purple-dim);
  border-color: rgba(139,92,246,0.45);
  color: var(--purple-light);
  box-shadow: 0 0 10px rgba(139,92,246,0.15);
}

/* ── Settings ────────────────────────────────────────────────────────────── */
.settings-section {
  margin-bottom: 2.5rem;
}

.settings-section-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-section-title i { color: var(--cyan); }

/* ── AI reasoning box ────────────────────────────────────────────────────── */
.ai-reasoning {
  background: rgba(139,92,246,0.05);
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1.5rem;
}

.ai-reasoning-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--purple-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ai-reasoning-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Stats row ───────────────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.stat-card-icon {
  font-size: 1.3rem;
  margin-top: 2px;
}

.stat-card-value {
  font-family: var(--font-brand);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-card-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  font-size: 0.85rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  line-height: 1.5;
}

.alert-error   { background: var(--red-dim);    border: 1px solid rgba(248,113,113,0.3); color: #fca5a5; }
.alert-success { background: var(--green-dim);  border: 1px solid rgba(16,217,130,0.3);  color: #6ee7b7; }
.alert-info    { background: var(--cyan-dim);   border: 1px solid rgba(0,212,255,0.25);  color: var(--cyan-light); }
.alert-warn    { background: var(--orange-dim); border: 1px solid rgba(251,146,60,0.3);  color: #fdba74; }

/* ── Divider ─────────────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border-dim);
  margin: 1.5rem 0;
}

/* ── Monospace output ────────────────────────────────────────────────────── */
.mono-output {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  padding: 1rem;
  white-space: pre-wrap;
  line-height: 1.6;
}

/* ── Upload file chip ────────────────────────────────────────────────────── */
.file-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.file-chip-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0;
  line-height: 1;
  transition: color var(--t-fast);
}

.file-chip-remove:hover { color: var(--red); }

/* ── Copy button ─────────────────────────────────────────────────────────── */
.copy-btn {
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  font-family: var(--font-display);
  transition: all var(--t-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.copy-btn:hover { border-color: var(--border-active); color: var(--cyan); }
.copy-btn.copied { border-color: rgba(16,217,130,0.4); color: var(--green); }

/* ── Login page ──────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
}

.login-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.35;
}

.login-orb-1 {
  width: 400px; height: 400px;
  background: var(--cyan);
  top: -10%; left: -5%;
  animation: orbFloat1 12s ease-in-out infinite alternate;
}

.login-orb-2 {
  width: 350px; height: 350px;
  background: var(--purple);
  bottom: -10%; right: -5%;
  animation: orbFloat2 15s ease-in-out infinite alternate;
}

@keyframes orbFloat1 { 0% { transform: translate(0,0); } 100% { transform: translate(30px, 40px); } }
@keyframes orbFloat2 { 0% { transform: translate(0,0); } 100% { transform: translate(-30px, -40px); } }

.login-card {
  background: rgba(8, 8, 26, 0.75);
  backdrop-filter: blur(40px);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04) inset;
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-brand {
  font-family: var(--font-brand);
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  background: linear-gradient(90deg, var(--cyan), var(--purple-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  letter-spacing: 0.08em;
}

/* ── Utility classes ─────────────────────────────────────────────────────── */
.text-cyan    { color: var(--cyan); }
.text-purple  { color: var(--purple-light); }
.text-green   { color: var(--green); }
.text-orange  { color: var(--orange); }
.text-red     { color: var(--red); }
.text-muted   { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-mono    { font-family: var(--font-mono); }
.text-display { font-family: var(--font-display); }
.text-brand   { font-family: var(--font-brand); }
.text-sm      { font-size: 0.8rem; }
.text-xs      { font-size: 0.7rem; }

.d-flex  { display: flex; }
.d-grid  { display: grid; }
.gap-1   { gap: 0.5rem; }
.gap-2   { gap: 1rem; }
.gap-3   { gap: 1.5rem; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.flex-1  { flex: 1; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.mt-1  { margin-top: 0.5rem; }
.mt-2  { margin-top: 1rem; }
.mt-3  { margin-top: 1.5rem; }
.mb-1  { margin-bottom: 0.5rem; }
.mb-2  { margin-bottom: 1rem; }
.mb-3  { margin-bottom: 1.5rem; }
.w-full { width: 100%; }

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.animate-fade-up  { animation: fadeUp 0.4s var(--ease-out) both; }
.animate-fade-in  { animation: fadeIn 0.3s ease both; }

.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.10s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.20s; }

/* ── Responsive (tablet) ─────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .focus-board  { grid-template-columns: repeat(2, 1fr); }
  .stats-row    { grid-template-columns: repeat(2, 1fr); }
  .grid-4       { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .wb-sidebar  { transform: translateX(-100%); }
  .wb-main     { margin-left: 0; }
  .wb-page     { padding: 1rem; }
  .focus-board { grid-template-columns: 1fr; }
  .stats-row   { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
