/* ═══════════════════════════════════════════════════════
   DESIGN TOKENS — Cashback Bitcoin Admin
   Paleta 100% alinhada com public-web/index.html
═══════════════════════════════════════════════════════ */
:root {
  /* Fundos — sólidos como na landing */
  --bg:          #001219;
  --bg-mid:      #0d2535;
  --panel:       #0d2535;
  --panel-strong:#112b40;

  /* Bordas — exatas da landing (s4-card) */
  --line:        rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);

  /* Texto */
  --text:        #e5e7eb;
  --muted:       #9ca3af;

  /* Brand — col-n / col-t / col-k da landing */
  --orange:      #e85d04;
  --orange-dark: #c94e02;
  --teal:        #0a9396;
  --gold:        #ee9b00;

  /* Semantic */
  --accent:        #0a9396;
  --accent-strong: #077d80;
  --accent-soft:   rgba(10, 147, 150, 0.15);
  --gold-soft:     rgba(238, 155, 0, 0.15);
  --danger:        #f87171;
  --danger-soft:   rgba(248, 113, 113, 0.14);
  --success:       #34d399;
  --success-soft:  rgba(52, 211, 153, 0.14);

  /* Shadows */
  --shadow-xl: 0 32px 80px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);

  /* Radii */
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;

  /* Fonts — mesmas da landing */
  --font-display: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body:    'Inter', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body, #app {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

body.drawer-open {
  overflow: hidden;
}

button, input, textarea, a {
  font: inherit;
}

button {
  color: inherit;
}

h1, h2, h3, p, dl, dt, dd {
  margin: 0;
}

/* ═══════════════════════════════════════
   LAYOUT
═══════════════════════════════════════ */
.admin-page {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 20px;
  gap: 16px;
}

.admin-shell {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  gap: 16px;
}

/* ═══════════════════════════════════════
   PAINÉIS — sólidos como na landing
═══════════════════════════════════════ */
.admin-header,
.queue-panel,
.case-panel,
.detail-panel,
.support-rail .detail-panel,
.action-drawer,
.login-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-xl);
  /* SEM backdrop-filter: landing não usa glassmorphism */
}

/* ═══════════════════════════════════════
   HEADER
═══════════════════════════════════════ */
.admin-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 14px 20px;
  border-radius: var(--radius-xl);
  /* S4 card header = #0d2535 com borda laranja */
  border-color: rgba(232, 93, 4, 0.18);
}

.brand-block {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Nome da marca — Oswald italic como na landing */
.brand-name {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 1.4rem;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--orange);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}

.eyebrow,
.queue-card__eyebrow {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.admin-header strong,
.case-panel h2,
.case-panel h3,
.queue-panel h2,
.detail-panel h3,
.metric-card strong,
.summary-card strong,
.login-panel h1 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

.header-copy,
.panel-copy,
.queue-card__meta,
.summary-card small,
.timeline-item small,
.metric-card small,
.feedback {
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.85rem;
}

/* ═══════════════════════════════════════
   LAYOUT PRINCIPAL
═══════════════════════════════════════ */
.admin-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 260px;
  gap: 16px;
  min-height: 0;
  height: 100%;
}

.queue-panel,
.case-panel,
.detail-panel,
.login-panel {
  border-radius: var(--radius-xl);
  padding: 18px;
}

.queue-panel,
.support-rail,
.case-panel {
  display: grid;
  gap: 14px;
  min-height: 0;
}

.support-rail {
  align-content: start;
}

.panel-head,
.action-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

/* ═══════════════════════════════════════
   CAMPOS
═══════════════════════════════════════ */
.field {
  display: grid;
  gap: 6px;
}

.field span {
  font-weight: 700;
  font-size: 0.82rem;
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: #001219;
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--teal);
}

.field--search input {
  background: #001219;
}

/* ═══════════════════════════════════════
   SEGMENTED CONTROL
═══════════════════════════════════════ */
.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.segment {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #001219;
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.segment--current {
  background: var(--accent-soft);
  border-color: rgba(10, 147, 150, 0.35);
  color: var(--teal);
}

/* ═══════════════════════════════════════
   LISTAS E STACKS
═══════════════════════════════════════ */
.queue-list,
.timeline,
.metric-stack,
.summary-grid,
.case-strip,
.case-lower,
.form-stack,
.button-row {
  display: grid;
  gap: 10px;
}

.queue-list,
.timeline {
  overflow: auto;
  min-height: 0;
}

/* ═══════════════════════════════════════
   CARDS
═══════════════════════════════════════ */
.queue-card,
.summary-card,
.check-card,
.metric-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: #001219;
}

.queue-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.queue-card:hover {
  border-color: var(--line-strong);
  background: rgba(10, 147, 150, 0.05);
}

/* Plano Normal = teal */
.queue-card--selected {
  border-color: rgba(10, 147, 150, 0.35);
  background: rgba(10, 147, 150, 0.10);
}

.queue-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  overflow-wrap: anywhere;
}

.summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-card,
.check-card,
.metric-card {
  padding: 14px;
}

.check-card {
  display: grid;
  gap: 4px;
}

.summary-card {
  display: grid;
  gap: 4px;
}

/* Check card positivo — verde teal */
.check-card[data-tone="positive"] {
  background: rgba(10, 147, 150, 0.10);
  border-color: rgba(10, 147, 150, 0.26);
}

.case-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ═══════════════════════════════════════
   ACTION BANNER
═══════════════════════════════════════ */
.action-banner {
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(232, 93, 4, 0.22);
  background: rgba(232, 93, 4, 0.06);
}

.case-lower {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

/* ═══════════════════════════════════════
   TIMELINE
═══════════════════════════════════════ */
.timeline-item {
  display: grid;
  gap: 3px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item:last-child {
  border-bottom: 0;
}

.metric-card {
  display: grid;
  gap: 4px;
}

.metric-card strong {
  font-size: 1.3rem;
  color: var(--orange);
}

/* ═══════════════════════════════════════
   BOTÕES
═══════════════════════════════════════ */
.button-row {
  display: flex;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  transition: opacity 150ms ease, background 150ms ease;
  text-decoration: none;
}

/* Primary = laranja como CTA da landing */
.button--primary {
  background: var(--orange);
  color: #fff;
}

.button--primary:hover {
  background: var(--orange-dark);
}

.button--ghost {
  background: #001219;
  border-color: var(--line-strong);
  color: var(--text);
}

.button--ghost:hover {
  border-color: var(--teal);
}

.button--quiet {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
  min-height: 42px;
  padding-inline: 12px;
}

.button--quiet:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.button:focus-visible,
.segment:focus-visible,
.queue-card:focus-visible,
.action-drawer:focus-visible,
.field input:focus-visible,
.field textarea:focus-visible {
  outline: 3px solid rgba(10, 147, 150, 0.4);
  outline-offset: 3px;
}

/* ═══════════════════════════════════════
   STATUS PILLS
═══════════════════════════════════════ */
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

/* positivo = teal (plano Normal) */
.status-pill[data-tone="positive"] {
  background: var(--success-soft);
  border-color: rgba(52, 211, 153, 0.25);
  color: var(--success);
}

/* attention = gold (plano Turbo) */
.status-pill[data-tone="attention"] {
  background: var(--gold-soft);
  border-color: rgba(238, 155, 0, 0.30);
  color: var(--gold);
}

/* critical = laranja (plano Nitro) */
.status-pill[data-tone="critical"] {
  background: var(--danger-soft);
  border-color: rgba(248, 113, 113, 0.25);
  color: var(--danger);
}

/* ═══════════════════════════════════════
   DRAWER
═══════════════════════════════════════ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 18, 25, 0.7);
}

.action-drawer {
  position: fixed;
  top: 20px;
  right: 20px;
  width: min(460px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: var(--radius-xl);
  z-index: 10;
  overflow: auto;
  border-color: rgba(232, 93, 4, 0.22);
}

/* ═══════════════════════════════════════
   FEEDBACK
═══════════════════════════════════════ */
.feedback[data-tone="critical"] {
  color: var(--danger);
}

.feedback[data-tone="positive"] {
  color: var(--success);
}

/* ═══════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════ */
.empty-state {
  display: grid;
  gap: 10px;
  place-items: center;
  text-align: center;
  min-height: 200px;
  color: var(--muted);
}

/* ═══════════════════════════════════════
   LOGIN PANEL
═══════════════════════════════════════ */
.login-panel {
  display: grid;
  gap: 18px;
  align-content: center;
  justify-self: center;
  width: min(560px, 100%);
  min-height: min(72vh, 600px);
  padding: 36px;
  border-radius: var(--radius-xl);
  border-color: rgba(232, 93, 4, 0.22);
}

.login-panel h1 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--orange);
  line-height: 1.1;
}

/* ═══════════════════════════════════════
   RESPONSIVO
═══════════════════════════════════════ */
@media (max-width: 1240px) {
  .admin-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .support-rail {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  html, body, #app {
    height: 100%;
    min-height: 100%;
  }

  body {
    overflow: hidden;
  }

  .admin-page {
    height: 100dvh;
    min-height: 100dvh;
    padding: 12px;
    overflow: hidden;
  }

  .admin-shell {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .admin-header,
  .summary-grid,
  .case-strip,
  .case-lower {
    grid-template-columns: 1fr;
  }

  .admin-layout {
    height: 100%;
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: clamp(16rem, 34vh, 20rem) minmax(0, 1fr);
    overflow: hidden;
  }

  .queue-panel,
  .case-panel,
  .detail-panel,
  .login-panel {
    padding: 16px;
  }

  .queue-panel {
    overflow: hidden;
  }

  .queue-list {
    max-height: none;
    min-height: 0;
    overflow: auto;
  }

  .case-panel {
    min-height: 0;
    overflow: auto;
  }

  .timeline {
    max-height: 16rem;
  }

  .support-rail {
    display: none;
  }

  .action-drawer {
    inset: 14px;
    width: auto;
    max-height: calc(100vh - 28px);
  }
}
