/* ========================================================================
   PHANTOM UNIT — DESIGN SYSTEM (Code Night)
   Canonical tokens & shared components.
   All pages import this file. Page-specific overrides go inline.
   ======================================================================== */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --bg: #09090b;
  --card: #141417;
  --border: #27272a;
  --border-bright: #3f3f46;
  --green: #a3e635;
  --green-dim: #4d7c0f;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --danger: #ef4444;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', Courier, monospace;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

/* ── Scrollbar (Webkit) ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Header ─────────────────────────────────────────────────────────────── */
.phantom-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 5vw;
  border-bottom: 1px solid var(--border);
  background: rgba(9,9,11,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.phantom-brand {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text);
}
.phantom-brand b,
.phantom-brand strong { color: var(--green); }

/* Header with spaced items (brand left, actions right) */
.phantom-header--spaced {
  justify-content: space-between;
}

/* ── Cards ──────────────────────────────────────────────────────────────── */
.phantom-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
}

/* Card with floating label */
.phantom-card--labeled {
  position: relative;
  margin-top: 20px;
}
.phantom-card--labeled::before {
  content: attr(data-label);
  position: absolute;
  top: -10px;
  left: 16px;
  background: var(--bg);
  padding: 2px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--green);
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

/* Primary — solid white, black text */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  background: #ffffff;
  color: #09090b;
  border: 1px solid #ffffff;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-primary:hover { background: #e4e4e7; border-color: #e4e4e7; }
.btn-primary:disabled,
.btn-primary.disabled {
  background: #22222a;
  color: #555566;
  border-color: var(--border);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Outline — transparent bg, border */
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border-bright);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-outline:hover {
  color: #ffffff;
  border-color: #ffffff;
  background: rgba(255,255,255,0.06);
}
.btn-outline:disabled {
  color: #52525b;
  border-color: var(--border);
  cursor: not-allowed;
}

/* Ghost — no border, just text */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-bright);
}

/* Green accent button */
.btn-green {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--green);
  color: #09090b;
  border: none;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-green:hover { opacity: 0.88; }

/* Danger button */
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-danger:hover { background: rgba(239,68,68,0.1); }

/* Small button */
.btn-sm {
  padding: 5px 10px;
  font-size: 10px;
}

/* ── Forms ──────────────────────────────────────────────────────────────── */
.phantom-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.phantom-label .required { color: var(--green); }

.phantom-input,
.phantom-select,
.phantom-textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease;
}
.phantom-input:focus,
.phantom-select:focus,
.phantom-textarea:focus {
  border-color: var(--green);
}
.phantom-input::placeholder,
.phantom-textarea::placeholder {
  color: var(--border-bright);
}
.phantom-select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.phantom-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Radio cards */
.phantom-radio-card {
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.phantom-radio-card:hover {
  border-color: var(--border-bright);
}
.phantom-radio-card.selected {
  border-color: var(--green);
  background: rgba(163,230,53,0.05);
  color: var(--green);
}

/* Field hint */
.phantom-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.phantom-hint.invalid { color: #f87171; }
.phantom-hint.valid { color: var(--green); }

/* ── Status Dots (Macbook LED) ──────────────────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transition: all 0.2s ease;
}
.status-dot--pending {
  background: #ff5f56;
  border: 1px solid #e0443e;
  box-shadow: 0 0 5px rgba(255,95,86,0.45);
}
.status-dot--waiting {
  background: #ffbd2e;
  border: 1px solid #dea123;
  box-shadow: 0 0 5px rgba(255,189,46,0.45);
}
.status-dot--approved {
  background: #27c93f;
  border: 1px solid #1aab29;
  box-shadow: 0 0 5px rgba(39,201,63,0.45);
}

/* ── Badges ─────────────────────────────────────────────────────────────── */
.phantom-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.phantom-badge--green {
  background: rgba(163,230,53,0.12);
  color: var(--green);
  border: 1px solid rgba(163,230,53,0.2);
}
.phantom-badge--yellow {
  background: rgba(255,189,46,0.12);
  color: #ffbd2e;
  border: 1px solid rgba(255,189,46,0.2);
}
.phantom-badge--red {
  background: rgba(239,68,68,0.12);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.2);
}
.phantom-badge--muted {
  background: rgba(161,161,170,0.1);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* ── Tables ─────────────────────────────────────────────────────────────── */
.phantom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.phantom-table th {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.phantom-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.phantom-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

/* ── Typography Utilities ───────────────────────────────────────────────── */
.text-mono {
  font-family: var(--font-mono);
}
.text-muted {
  color: var(--muted);
}
.text-green {
  color: var(--green);
}
.text-danger {
  color: var(--danger);
}
.text-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.text-xs {
  font-size: 11px;
}
.text-sm {
  font-size: 13px;
}

/* ── Layout Utilities ───────────────────────────────────────────────────── */
.phantom-container {
  max-width: 1140px;
  margin: 32px auto 60px;
  padding: 0 20px;
}
.phantom-container--narrow {
  max-width: 860px;
}
.phantom-container--mid {
  max-width: 960px;
}

/* ── Meta Row ───────────────────────────────────────────────────────────── */
.phantom-meta {
  display: flex;
  gap: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  flex-wrap: wrap;
}
.phantom-meta b,
.phantom-meta strong {
  color: var(--text);
  font-weight: 600;
}

/* ── Dropzone ───────────────────────────────────────────────────────────── */
.phantom-dropzone {
  border: 1px dashed var(--border-bright);
  border-radius: 4px;
  padding: 24px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.phantom-dropzone:hover {
  border-color: var(--green);
  color: var(--text);
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.phantom-footer {
  text-align: center;
  padding: 40px 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* ── Animations ─────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-in {
  animation: fadeIn 0.3s ease forwards;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .phantom-container { padding: 0 14px; margin: 20px auto 40px; }
  .phantom-card { padding: 18px; }
}
@media (max-width: 640px) {
  .phantom-header { padding: 14px 16px; }
}
