/*
 * ARC-356 — FlowGrid-inspired ArcheYo theme layer
 *
 * Source of truth: ARC-355 FlowGrid-to-ArcheYo Design Token Mapping.
 * This file intentionally overrides only design tokens / low-risk base styling.
 * It is loaded after archeyo.css so the theme remains isolated and revertable.
 */

:root {
  --bg: #0a0a0b;
  --surface: #111113;
  --surface2: #18181b;
  --surface3: #1f1f23;
  --surface-ink: #0f0f12;
  --surface-table: #141416;

  --border: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);

  --text: #ededef;
  --text-dim: #8b8b8e;
  --text-muted: #5c5c5f;

  --accent: #c87a3c;
  --accent-light: #e09550;
  --accent-bg: rgba(200, 122, 60, 0.12);
  --accent-bg-soft: rgba(200, 122, 60, 0.1);
  --accent-glow: rgba(200, 122, 60, 0.22);
  --accent-border-subtle: rgba(200, 122, 60, 0.24);
  --accent-border: rgba(200, 122, 60, 0.32);
  --accent-border-strong: rgba(200, 122, 60, 0.42);
  --focus-ring: rgba(200, 122, 60, 0.12);
  --white-contrast: #fff;
  --hover-surface: rgba(255, 255, 255, 0.035);

  --flowgrid-accent: #5e6ad2;
  --flowgrid-accent-light: #6c78e0;
  --flowgrid-accent-bg: rgba(94, 106, 210, 0.12);

  --green: #4ade80;
  --green-bg: rgba(74, 222, 128, 0.12);
  --red: #f87171;
  --red-bg: rgba(248, 113, 113, 0.12);
  --yellow: #fbbf24;
  --yellow-bg: rgba(251, 191, 36, 0.1);
  --orange: #fb923c;
  --orange-bg: rgba(251, 146, 60, 0.12);
  --blue: #a5b4fc;
  --blue-bg: rgba(94, 106, 210, 0.15);
  --purple: #a5b4fc;
  --purple-bg: rgba(94, 106, 210, 0.15);

  --shadow: 0 16px 48px rgba(0, 0, 0, 0.32);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
}

html,
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

body {
  background:
    radial-gradient(circle at top left, var(--accent-bg-soft), transparent 24%),
    radial-gradient(circle at right, rgba(94, 106, 210, 0.04), transparent 22%),
    var(--bg);
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* ARC-357 — shell, navigation, and reusable core component alignment. */
.app-shell {
  background: var(--bg);
}

.sidebar {
  background: var(--surface-ink);
  border-right: 1px solid var(--border-subtle);
  box-shadow: none;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.nav-item {
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.nav-item:hover {
  background: var(--hover-surface);
  border-color: var(--border-subtle);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-bg);
  border-color: var(--accent-border);
  color: var(--accent-light);
  box-shadow: none;
}

.content-card,
.table-card,
.info-card,
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
}

.button.primary,
.btn-primary {
  background: var(--accent);
  border-color: var(--accent-border-strong);
  color: var(--white-contrast);
  box-shadow: 0 0 0 1px var(--focus-ring), 0 8px 22px rgba(0, 0, 0, 0.26);
}

.btn-secondary,
.button.secondary {
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
}

.button,
.btn,
.nav-button {
  border-radius: var(--radius-sm);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.nav-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--accent-bg);
}

input,
select,
textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  color: var(--text);
}

table,
.data-table,
.afas-projects-table {
  background: var(--surface);
  border-collapse: collapse;
}

th,
.data-table th,
.afas-projects-table th {
  padding: 8px 10px;
  background: var(--surface-table);
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}

td,
.data-table td,
.afas-projects-table td {
  padding: 8px 10px;
  border-top: 1px solid var(--border-subtle);
}

.badge {
  padding: 4px 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  box-shadow: none;
}

.badge.accent {
  background: var(--accent-bg);
  border-color: var(--accent-border-subtle);
  color: var(--accent-light);
}

.template-modal-card,
.project-emergency-modal-card,
.gemeente-modal-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.toast {
  background: var(--surface2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/*
 * ARC-358 — representative screen tuning.
 * Rollback stays simple: remove this stylesheet import from index.html or revert this
 * additive block; no base archeyo.css selectors are edited here.
 */
.dashboard-hero,
.panel.hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  box-shadow: none;
  padding: 18px;
}

.dashboard-hero h3,
.panel.hero h3 {
  color: var(--text);
}

.stats-grid .stat-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
  padding: 14px;
}

.stats-grid .stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
  opacity: 0.72;
}

.quick-action {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
  padding: 14px;
}

.quick-action:hover {
  background: var(--surface2);
  border-color: var(--accent-border);
  box-shadow: none;
  transform: translateY(-1px);
}

.beheer-grid {
  gap: 12px;
  margin-top: 14px;
}

.beheer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  box-shadow: none;
  padding: 16px;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}

.beheer-card:hover:not(.disabled) {
  background: var(--surface2);
  border-color: var(--accent-border);
  box-shadow: none;
  transform: translateY(-1px);
}

.beheer-card-icon {
  margin-bottom: 10px;
  font-size: 1.55rem;
  filter: saturate(0.92);
}

.beheer-card-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.beheer-tab-content .panel,
#section-projectenadministratie .panel {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: none;
}

.integrations-layout {
  gap: 12px;
}

.integration-status,
#section-dashboard .empty,
#section-beheer .empty,
#section-projectenadministratie .empty,
#section-printen .empty {
  background: var(--surface2);
  border: 1px solid var(--border-subtle);
}

#beheerBillingSummary.stats-grid .stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
}

#beheerBillingSummary.stats-grid .stat-card::before {
  background: var(--accent);
}

#beheerBillingUsage.data-table-wrap {
  max-height: min(58vh, 520px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
}

#printTabs .button[aria-selected="true"],
#printTabs .button.active {
  background: var(--accent-bg);
  border-color: var(--accent-border);
  color: var(--accent-light);
}

#section-printen .panel,
.export-grid .panel {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: none;
}

#section-printen .section-stack {
  gap: 12px;
}

#boxStickerPreview {
  background: var(--surface2);
  border: 1px dashed var(--accent-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

@media (max-width: 900px) {
  .dashboard-hero,
  .panel.hero,
  #section-beheer .toolbar,
  #section-projectenadministratie .toolbar,
  #section-printen .toolbar {
    align-items: flex-start;
    gap: 12px;
  }

  .beheer-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .integrations-layout {
    grid-template-columns: 1fr;
  }
}
