/* Trydon Radius™ System Styles — Antimetal / Anti-AI-Slop Architectural Protocol */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&family=Space+Grotesk:wght@600;700&display=swap');

:root {
  /* 60-30-10 Monochromatic Carbon & Slate Foundation */
  --bg-primary: #08090b;
  --bg-surface: #0e1116;
  --bg-surface-elevated: #15181f;
  --bg-Elevated: #15181f;
  --bg-surface-hover: #1c212b;

  /* 1px Structural Borders */
  --border: #1e242d;
  --border-muted: #1e242d;
  --border-accent: #2e3846;
  --border-highlight: #3d4a5c;

  /* High-Contrast Typography Hierarchy */
  --text-main: #f3f5f8;
  --text-primary: #f3f5f8;
  --text-secondary: #9aa4b2;
  --text-muted: #7c8798;
  --text-subtle: #5e6878;

  /* Intentional High-Contrast Tactical Accents */
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-blue: #3b82f6;
  --accent-rose: #f43f5e;
  --danger: #f43f5e;

  /* Typographic Scale & Pairing */
  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  color: var(--text-primary);
  font-weight: 700;
}

/* Monospace & Microcopy */
.mono,
.font-mono {
  font-family: var(--font-mono);
}

.label-micro {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* Structural Crisp Borders & Cards */
.tactile-border {
  border: 1px solid var(--border-muted);
}

.tactile-card,
.panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-muted);
  border-radius: 2px;
  box-shadow: 2px 2px 0px #000000;
}

.tactile-card-elevated {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-accent);
  border-radius: 2px;
  box-shadow: 3px 3px 0px #000000;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border-muted);
  background-color: #0b0d12;
  flex-wrap: wrap;
}

.panel-header h3 {
  font-size: 0.925rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-body {
  padding: 1.15rem;
}

/* Operator Console Layout (Sidebar + Main Content) */
.console-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background-color: var(--bg-primary);
}

.sidebar {
  width: 248px;
  background-color: #0a0c10;
  border-right: 1px solid var(--border-muted);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  height: 56px;
  padding: 0 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-bottom: 1px solid var(--border-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.brand-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-emerald);
  display: inline-block;
  flex-shrink: 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 0.65rem 0;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.62rem 1.15rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  border-left: 2px solid transparent;
  transition: background-color 0.1s ease, color 0.1s ease, border-color 0.1s ease;
  cursor: pointer;
}

.nav-item:hover {
  background-color: #11151d;
  color: var(--text-primary);
}

.nav-item.active {
  background-color: var(--bg-surface-elevated);
  color: #ffffff;
  font-weight: 600;
  border-left-color: var(--accent-emerald);
}

.nav-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.08rem 0.42rem;
  border-radius: 2px;
  background-color: #08090b;
  color: var(--text-secondary);
  border: 1px solid var(--border-muted);
}

.nav-item.active .nav-badge {
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--accent-emerald);
}

.sidebar-footer {
  padding: 1rem 1.15rem;
  border-top: 1px solid var(--border-muted);
  background-color: #08090b;
}

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-x: hidden;
}

.topbar {
  min-height: 56px;
  padding: 0.65rem 1.5rem;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 20;
}

.content {
  padding: 1.5rem;
  flex: 1;
  max-width: 1600px;
  width: 100%;
}

/* KPI Strip — Crisp 1px Structural Grid (No Bento Slop) */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  background-color: var(--border-muted);
  border: 1px solid var(--border-muted);
  gap: 1px;
  margin-bottom: 1.5rem;
  box-shadow: 2px 2px 0px #000000;
}

.kpi-cell {
  background-color: var(--bg-surface);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kpi-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.kpi-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.5rem;
  border-radius: 2px;
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-active {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

.badge-expired {
  background: rgba(244, 63, 94, 0.12);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.35);
}

.badge-paused {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}

.badge-neutral {
  background: #15181f;
  color: #cbd5e1;
  border-color: var(--border-muted);
}

/* Tactile Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.52rem 0.95rem;
  border-radius: 2px;
  cursor: pointer;
  transition: background-color 0.1s ease, border-color 0.1s ease, transform 0.05s ease;
  user-select: none;
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn:focus-visible {
  outline: 2px solid var(--accent-amber);
  outline-offset: 2px;
}

.btn-primary {
  background-color: #f3f5f8;
  color: #08090b;
  border: 1px solid #f3f5f8;
  box-shadow: 2px 2px 0px #000000;
}
.btn-primary:hover {
  background-color: #ffffff;
  border-color: #ffffff;
}

.btn-emerald {
  background-color: var(--accent-emerald);
  color: #051b11;
  border: 1px solid var(--accent-emerald);
  box-shadow: 2px 2px 0px #000000;
}
.btn-emerald:hover {
  background-color: #34d399;
  border-color: #34d399;
}

.btn-amber {
  background-color: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
}
.btn-amber:hover {
  background-color: rgba(245, 158, 11, 0.24);
  border-color: var(--accent-amber);
  color: #fde68a;
}

.btn-secondary {
  background-color: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-accent);
}
.btn-secondary:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--border-highlight);
  color: #ffffff;
}

.btn-danger {
  background-color: rgba(244, 63, 94, 0.12);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.35);
}
.btn-danger:hover {
  background-color: rgba(244, 63, 94, 0.22);
  border-color: rgba(244, 63, 94, 0.55);
}

.btn-xs {
  padding: 0.28rem 0.6rem;
  font-size: 0.72rem;
  border-radius: 2px;
}

/* Forms & Tactile Inputs */
.form-group {
  margin-bottom: 0.95rem;
}

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

.input-tactile,
.form-input,
.form-select,
.form-textarea {
  background-color: #08090b;
  border: 1px solid var(--border-accent);
  color: var(--text-primary);
  border-radius: 2px;
  padding: 0.55rem 0.75rem;
  font-size: 0.84rem;
  outline: none;
  width: 100%;
  font-family: inherit;
  transition: border-color 0.1s ease, box-shadow 0.1s ease;
}

.input-tactile::placeholder,
.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-subtle);
}

.input-tactile:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 1px var(--accent-emerald);
}

select.input-tactile,
.form-select {
  cursor: pointer;
}

/* Data Tables */
.table-container,
.table-wrap {
  overflow-x: auto;
  width: 100%;
  background-color: var(--bg-surface);
}

table,
table.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8125rem;
}

table th,
table.data-table th {
  background-color: #0a0c10;
  padding: 0.7rem 1rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-muted);
  white-space: nowrap;
}

table td,
table.data-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #141820;
  color: var(--text-primary);
  vertical-align: middle;
}

table tbody tr:hover td,
table.data-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.025);
}

/* Modals & Overlays */
.modal-overlay,
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 8, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.25rem;
}

.modal-dialog,
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: 2px;
  width: 100%;
  max-width: 600px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 4px 4px 0px #000000;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-muted);
  background-color: #0b0d12;
}

.modal-body {
  padding: 1.25rem;
}

.modal-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-muted);
  background-color: #0b0d12;
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

/* Code Block */
.code-block {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.55;
  background-color: #060709;
  border: 1px solid var(--border-muted);
  color: #34d399;
  padding: 1rem;
  border-radius: 2px;
  overflow-x: auto;
  white-space: pre;
}

/* Responsive Mobile / Tablet Adjustments */
@media (max-width: 900px) {
  .console-layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border-muted);
  }
  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 0.35rem 0.5rem;
    gap: 0.25rem;
  }
  .nav-item {
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
  }
  .nav-item.active {
    border-left-color: transparent;
    border-bottom-color: var(--accent-emerald);
  }
  .sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
  }
}

/* Printable Voucher Styles */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .no-print {
    display: none !important;
  }
}
