@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

/* ============================================================================
   MORSA · Euronet Privacy Operations Portal
   Shared Design System · morsa.css
   ----------------------------------------------------------------------------
   Single source of truth for all MORSA platform tools.
   Two themes: Euronet Light (default) · Euronet Dark
   ----------------------------------------------------------------------------
   Usage:
     <link rel="stylesheet" href="/morsa.css">
     <body data-theme="light">   or   <body data-theme="dark">
   ----------------------------------------------------------------------------
   Version : 1.0
   Owner   : Global Privacy Operations · Euronet Worldwide
============================================================================ */


/* ============================================================================
   DESIGN TOKENS — constants that never change between themes
============================================================================ */
:root {
  /* Text */
  --ink:          #1f2937;
  --ink-mute:     #4b5563;
  --ink-dim:      #6b7280;
  --ink-faint:    #9ca3af;

  /* Status — stay constant across themes */
  --status-critical: #b14a3a;
  --status-warning:  #b88324;
  --status-info:     #5a6b80;
  --status-ok:       #4a7a3a;

  /* Info — warm amber for explanatory/help affordances */
  --info:        #e89240;
  --info-deep:   #b96a17;
  --info-soft:   #fdf4e8;
  --info-border: #e8a85c;

  /* Typography */
  --serif: 'Fraunces', Georgia, serif;
  --sans:  'Inter', -apple-system, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(31, 41, 55, 0.04);
  --shadow-md: 0 6px 16px rgba(31, 41, 55, 0.06);
  --shadow-lg: 0 20px 48px rgba(31, 41, 55, 0.14);

  /* Radii */
  --r-sm: 3px;
  --r-md: 5px;

  /* Euronet corporate blue — brand chrome, help bubbles, headers */
  --euronet-blue: #1f3d6e;
}


/* ============================================================================
   THEME: EURONET LIGHT (default)
   Confident teal on cool grey — the Euronet corporate palette
============================================================================ */
[data-theme="light"] {
  --bg:           #f4f5f7;
  --surface:      #ffffff;
  --surface-2:    #fafbfc;
  --line:         #e2e6eb;
  --line-strong:  #c9d0d8;
  --accent:       #00B6AE;
  --accent-deep:  #008f88;
  --accent-soft:  rgba(0, 182, 174, 0.10);
  --accent-glow:  rgba(0, 182, 174, 0.18);
  --contrast:       #f0793c;
  --contrast-deep:  #c95a1f;
  --contrast-soft:  rgba(240, 121, 60, 0.10);
  /* Entity risk tiers — company-wide concept (PERA, Case Manager, risk register).
     1A/1B/II/III preserve the original dashboard palette; IV is neutral grey
     because Tier IV is unscored (no PII), not low-risk. */
  --tier-1a: #c0392b;
  --tier-1b: #d35400;
  --tier-2:  #c08000;
  --tier-3:  #5ABFA3;
  --tier-4:  #9ca3af;
}


/* ============================================================================
   THEME: EURONET DARK
   Low-light mode — same brand feel, dark surfaces
============================================================================ */
[data-theme="dark"] {
  --bg:           #0d1117;
  --surface:      #161b22;
  --surface-2:    #1c2129;
  --line:         #2d333b;
  --line-strong:  #444c56;
  --ink:          #e6edf3;
  --ink-mute:     #b1bac4;
  --ink-dim:      #8b949e;
  --ink-faint:    #6e7681;
  --shadow-sm:    0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md:    0 6px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg:    0 20px 48px rgba(0, 0, 0, 0.6);
  --accent:       #4dd9d2;
  --accent-deep:  #6fece5;
  --accent-soft:  rgba(77, 217, 210, 0.16);
  --accent-glow:  rgba(77, 217, 210, 0.30);
  --contrast:       #f0793c;
  --contrast-deep:  #ff8c4f;
  --contrast-soft:  rgba(240, 121, 60, 0.18);
  /* Entity risk tiers — lifted for dark surfaces */
  --tier-1a: #e0584a;
  --tier-1b: #f0773a;
  --tier-2:  #e0a83a;
  --tier-3:  #6fd9bd;
  --tier-4:  #6e7681;
}

/* Dark mode — component overrides */
[data-theme="dark"] .modal-bg {
  background: rgba(0, 0, 0, 0.65);
}
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--line-strong);
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--ink-faint);
}
[data-theme="dark"] .status-bar {
  background: rgba(22, 27, 34, 0.96);
}


/* ============================================================================
   THEME: TERMINAL
   Phosphor green on near-black — a deliberate, contained alternate palette.
   Defines the full variable set so nothing falls back to defaults.
============================================================================ */
[data-theme="terminal"] {
  /* 1980s green-phosphor CRT — monochrome; every hue is green */
  --bg:           #001b0a;
  --surface:      #04230f;
  --surface-2:    #062c14;
  --line:         #0e4a24;
  --line-strong:  #1c6e38;
  --ink:          #4dff8f;
  --ink-mute:     #36cb73;
  --ink-dim:      #2a9d5a;
  --ink-faint:    #1e7a44;
  --shadow-sm:    0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md:    0 6px 16px rgba(0, 0, 0, 0.6);
  --shadow-lg:    0 20px 48px rgba(0, 0, 0, 0.7);
  --accent:       #5dff9f;
  --accent-deep:  #8affc0;
  --accent-soft:  rgba(77, 255, 143, 0.12);
  --accent-glow:  rgba(77, 255, 143, 0.30);
  /* contrast stays green too — a brighter lime, never orange */
  --contrast:       #9dff5c;
  --contrast-deep:  #b8ff7e;
  --contrast-soft:  rgba(157, 255, 92, 0.16);
  /* risk tiers as a green brightness gradient — a monochrome tube had no other colour */
  --tier-1a: #6dffa0;
  --tier-1b: #4de084;
  --tier-2:  #36b863;
  --tier-3:  #259349;
  --tier-4:  #176e35;
  /* a monochrome terminal drew everything in one bitmap font */
  --serif: 'Share Tech Mono', 'Courier New', monospace;
  --sans:  'Share Tech Mono', 'Courier New', monospace;
  --mono:  'Share Tech Mono', 'Courier New', monospace;
}
[data-theme="terminal"] .modal-bg {
  background: rgba(0, 0, 0, 0.7);
}
[data-theme="terminal"] input,
[data-theme="terminal"] textarea,
[data-theme="terminal"] select {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--line-strong);
}
[data-theme="terminal"] input::placeholder,
[data-theme="terminal"] textarea::placeholder {
  color: var(--ink-faint);
}
[data-theme="terminal"] .status-bar {
  background: rgba(0, 27, 10, 0.96);
}

/* CRT phosphor glow + scanlines + edge vignette — terminal theme only */
[data-theme="terminal"] body {
  text-shadow: 0 0 1.5px rgba(93, 255, 159, 0.45);
  letter-spacing: 0.01em;
}
[data-theme="terminal"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 99998;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0) 0px,
      rgba(0, 0, 0, 0) 2px,
      rgba(0, 0, 0, 0.18) 2px,
      rgba(0, 0, 0, 0.18) 3px
    ),
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 58%, rgba(0, 0, 0, 0.38) 100%);
}


/* ============================================================================
   BASE RESET
============================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent); color: white; }


/* ============================================================================
   LAYOUT
============================================================================ */
.app { display: grid; grid-template-rows: auto 1fr auto; min-height: 100vh; }
main { padding: 40px 32px 80px; max-width: 1320px; width: 100%; margin: 0 auto; }


/* ============================================================================
   HEADER
============================================================================ */
header.brand {
  position: sticky; top: 0; z-index: 100;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 14px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.brand-mark { display: flex; align-items: center; gap: 14px; }
.brand-mark img.logo {
  width: 42px; height: 42px;
  display: block;
  border-radius: var(--r-md);
}
.brand-mark .name { display: flex; flex-direction: column; line-height: 1.1; }
.brand-mark .name .org {
  font-family: var(--serif);
  font-size: 15px; font-weight: 600;
  color: var(--euronet-blue);
  letter-spacing: -0.01em;
}
.brand-mark .name .sub {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.brand-title { text-align: center; }
.brand-title h1 {
  font-family: var(--serif);
  font-size: 20px; font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand-title .v {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.brand-controls { display: flex; align-items: center; gap: 8px; }


/* ============================================================================
   NAVIGATION — top-level tabs
============================================================================ */
nav.top-nav {
  display: flex;
  gap: 2px;
  padding: 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  text-decoration: none;
}
.nav-item:hover { color: var(--ink); }
.nav-item.active {
  color: var(--accent-deep);
  border-bottom-color: var(--accent);
}
.nav-item .nav-count {
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
}
.nav-item.active .nav-count {
  background: var(--accent);
  color: white;
}


/* ============================================================================
   PORTAL TOOL CARDS — home page grid
============================================================================ */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 32px;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 28px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tool-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.tool-card .tool-icon {
  width: 44px; height: 44px;
  background: var(--accent-soft);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.tool-card .tool-name {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}
.tool-card .tool-desc {
  font-size: 13px;
  color: var(--ink-mute);
  line-height: 1.5;
}
.tool-card .tool-meta {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}
.tool-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}


/* ============================================================================
   PAGE HEADER (inside tools)
============================================================================ */
.page-head {
  margin-bottom: 32px;
}
.page-head .crumb {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
  margin-bottom: 8px;
}
.page-head .crumb a {
  color: var(--ink-dim);
  text-decoration: none;
}
.page-head .crumb a:hover { color: var(--accent-deep); }
.page-head h1 {
  font-family: var(--serif);
  font-size: 28px; font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.2;
}
.page-head .id-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-dim);
}


/* ============================================================================
   PANELS — content containers
============================================================================ */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.panel-header h2 {
  font-family: var(--serif);
  font-size: 16px; font-weight: 600;
  color: var(--ink);
}
.panel-header .meta {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.panel-body { padding: 20px 24px; }
.panel-body.tight { padding: 0; }
.panel-body p.intro {
  font-size: 13.5px;
  color: var(--ink-mute);
  margin-bottom: 20px;
  line-height: 1.6;
}


/* ============================================================================
   SETTINGS LAYOUT
============================================================================ */
.settings-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: start;
}
.settings-sidebar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  position: sticky;
  top: 80px;
}
.settings-sidebar-head {
  padding: 14px 16px 12px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
  border-bottom: 1px solid var(--line);
}
.settings-side-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-mute);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.settings-side-item:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.settings-side-item.active {
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-left-color: var(--accent);
  font-weight: 600;
}
.ssi-label { flex: 1; }
.ssi-count {
  font-family: var(--mono);
  font-size: 10px;
  background: var(--line);
  color: var(--ink-dim);
  padding: 1px 6px;
  border-radius: 10px;
}
.settings-side-item.active .ssi-count {
  background: var(--accent-soft);
  color: var(--accent-deep);
}


/* ============================================================================
   FORMS — inputs, selects, labels, textareas
============================================================================ */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
}
.field label {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  font-weight: 500;
}
.field input[type=text],
.field input[type=email],
.field input[type=password],
.field input[type=url],
.field input[type=date],
.field input[type=number],
.field select,
.field textarea {
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.field .hint {
  font-size: 12px;
  color: var(--ink-faint);
  line-height: 1.4;
}
.row { display: grid; gap: 16px; }
.row.cols-2 { grid-template-columns: 1fr 1fr; }
.row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.section-title {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}


/* ============================================================================
   BUTTONS
============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, box-shadow 0.15s;
  text-decoration: none;
}
.btn:hover { background: var(--accent-deep); }
.btn.ghost {
  background: transparent;
  color: var(--ink-mute);
  border: 1px solid var(--line-strong);
}
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.contrast {
  background: var(--contrast);
  color: white;
}
.btn.contrast:hover { background: var(--contrast-deep); }
.btn.danger {
  background: var(--status-critical);
  color: white;
}
.btn.danger:hover { background: #8b2e20; }
.btn.btn-sm { padding: 5px 10px; font-size: 10px; }
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.icon-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink-dim);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--line-strong);
}


/* ============================================================================
   BADGES
============================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  white-space: nowrap;
}
.badge.draft     { background: var(--line); color: var(--ink-dim); }
.badge.published { background: rgba(74,122,58,0.12); color: var(--status-ok); }
.badge.approved  { background: rgba(74,122,58,0.12); color: var(--status-ok); }
.badge.review    { background: rgba(90,107,128,0.12); color: var(--status-info); }
.badge.warn      { background: rgba(184,131,36,0.12); color: var(--status-warning); }
.badge.denied    { background: rgba(177,74,58,0.12); color: var(--status-critical); }
.badge.retired   { background: var(--line); color: var(--ink-faint); }
.audience-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-radius: 10px;
  font-size: 12px;
  font-family: var(--mono);
  margin: 2px;
}


/* ============================================================================
   DATA TABLES
============================================================================ */
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data th {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  font-weight: 500;
  padding: 10px 16px;
  border-bottom: 2px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
table.data td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  vertical-align: middle;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--surface-2); }
table.data .mono-text { font-family: var(--mono); font-size: 12px; }
table.data a { color: var(--accent-deep); text-decoration: none; }
table.data a:hover { text-decoration: underline; }


/* ============================================================================
   KV LIST (definition list)
============================================================================ */
dl.kv {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px 20px;
  font-size: 13.5px;
  align-items: baseline;
}
dl.kv dt {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  padding-top: 2px;
}
dl.kv dd { color: var(--ink); }


/* ============================================================================
   KPI GRID — dashboard metrics
============================================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.kpi.ok    { border-left: 3px solid var(--status-ok); }
.kpi.warn  { border-left: 3px solid var(--status-warning); }
.kpi.info  { border-left: 3px solid var(--status-info); }
.kpi.crit  { border-left: 3px solid var(--status-critical); }
.kpi-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
  margin-bottom: 6px;
}
.kpi-value {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
}
.kpi-meta {
  font-size: 11.5px;
  color: var(--ink-faint);
  margin-top: 4px;
}


/* ============================================================================
   BANNERS — info, warn, danger, locked
============================================================================ */
.banner {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  margin-bottom: 16px;
  border-left: 3px solid transparent;
}
.banner.info  { background: rgba(90,107,128,0.08);  border-color: var(--status-info);     color: var(--ink); }
.banner.warn  { background: rgba(184,131,36,0.08);  border-color: var(--status-warning);  color: var(--ink); }
.banner.danger{ background: rgba(177,74,58,0.08);   border-color: var(--status-critical); color: var(--ink); }
.banner.ok    { background: rgba(74,122,58,0.08);   border-color: var(--status-ok);       color: var(--ink); }
.banner.locked{ background: rgba(107,114,128,0.08); border-color: var(--ink-faint);       color: var(--ink-mute); }
.banner-tag {
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}


/* ============================================================================
   MODALS
============================================================================ */
.modal-bg {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(31, 41, 55, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--surface);
  width: 100%; max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.modal-h {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0;
  background: var(--surface);
  z-index: 1;
}
.modal-h h3 {
  font-family: var(--serif);
  font-size: 20px; font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.modal-h .modal-sub {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  margin-top: 2px;
}
.modal-h button.close-btn {
  background: transparent; border: none;
  color: var(--ink-dim); font-size: 20px; cursor: pointer; line-height: 1;
  padding: 2px 6px;
}
.modal-h button.close-btn:hover { color: var(--ink); }
.modal-b { padding: 24px; }
.modal-f {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 var(--r-md) var(--r-md);
}
.modal-error {
  color: var(--status-critical);
  font-size: 13px;
  margin-top: 8px;
  display: none;
}


/* ============================================================================
   AUTH GATE — login screen
============================================================================ */
#auth-gate {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.auth-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 48px 52px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.auth-logo {
  font-family: var(--serif);
  font-size: 22px; font-weight: 600;
  color: var(--euronet-blue);
  margin-bottom: 4px;
}
.auth-sub {
  font-family: var(--mono);
  font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--ink-dim);
  margin-bottom: 32px;
}
.auth-label {
  font-family: var(--mono);
  font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--ink-dim);
  display: block; text-align: left; margin-bottom: 6px;
}
.auth-box input[type=email],
.auth-box input[type=password] {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  font-size: 14px; color: var(--ink);
  background: var(--surface);
  outline: none; margin-bottom: 14px;
  font-family: var(--sans);
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.auth-btn {
  width: 100%; padding: 11px;
  background: var(--accent); color: white;
  border: none; border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.12em; cursor: pointer;
  transition: background 0.15s;
}
.auth-btn:hover { background: var(--accent-deep); }
.auth-btn:disabled { background: var(--ink-faint); cursor: not-allowed; }
.auth-error {
  color: var(--status-critical); font-size: 12.5px;
  margin-top: 10px; display: none;
  font-family: var(--sans); text-align: left;
}
.auth-msg {
  color: var(--status-ok); font-size: 12.5px;
  margin-top: 10px; display: none;
  font-family: var(--sans); text-align: left;
}
.auth-remember {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px; text-align: left;
}
.auth-remember input { width: auto; margin: 0; cursor: pointer; }
.auth-remember label {
  font-family: var(--sans); font-size: 13px;
  color: var(--ink-mute); cursor: pointer; margin: 0;
  text-transform: none; letter-spacing: 0;
}
.auth-forgot {
  background: none; border: none; cursor: pointer;
  font-family: var(--sans); font-size: 13px;
  color: var(--accent-deep); text-decoration: underline;
  margin-top: 12px; display: block; text-align: center;
}


/* ============================================================================
   THEME TOGGLE — light/dark switch in header
============================================================================ */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 6px;
  cursor: pointer;
}
.theme-toggle-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  color: var(--ink-dim);
}
.theme-toggle-btn.active {
  background: var(--accent);
  color: white;
}


/* ============================================================================
   USER PILL — header identity display
============================================================================ */
.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
}
.user-pill .dot {
  width: 8px; height: 8px;
  background: var(--status-ok);
  border-radius: 50%;
  flex-shrink: 0;
}


/* ============================================================================
   TOASTS — temporary notifications
============================================================================ */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 18px;
  background: var(--ink);
  color: white;
  border-radius: var(--r-md);
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  max-width: 360px;
  animation: toast-in 0.2s ease;
  pointer-events: auto;
}
.toast.success { background: var(--status-ok); }
.toast.danger  { background: var(--status-critical); }
.toast.info    { background: var(--status-info); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ============================================================================
   STATUS BAR — sticky bottom info strip
============================================================================ */
.status-bar {
  position: sticky; bottom: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 10px 32px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
}
.status-bar .seg { display: flex; gap: 6px; align-items: center; color: var(--ink-mute); }
.status-bar .seg .k { font-size: 10px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.1em; }
.status-bar .seg .v { color: var(--ink); font-weight: 600; }
.status-bar .grow { flex: 1; }


/* ============================================================================
   FOOTER
============================================================================ */
footer {
  padding: 20px 32px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}
footer .v { color: var(--accent-deep); }
footer .internal { color: var(--ink-faint); }


/* ============================================================================
   EMPTY STATES
============================================================================ */
.empty {
  text-align: center;
  padding: 48px 32px;
  color: var(--ink-dim);
  font-size: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  margin: 16px 0;
}
.empty strong { display: block; font-size: 16px; margin-bottom: 8px; color: var(--ink); }


/* ============================================================================
   HELP TIPS — ⓘ icon with hover popover
============================================================================ */
.help-tip {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 16px; height: 16px;
  margin-left: 5px;
  border-radius: 50%;
  background: var(--info);
  color: white;
  font-family: var(--serif);
  font-size: 11px; font-weight: 600; font-style: italic;
  cursor: help;
  transition: background 0.15s, transform 0.15s;
  vertical-align: middle;
  flex-shrink: 0;
}
.help-tip:hover { background: var(--euronet-blue); transform: scale(1.1); }
.help-tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 130%; left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--euronet-blue);
  color: white;
  font-family: var(--sans); font-style: normal;
  font-size: 12px; font-weight: 400;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 6px;
  width: max-content; max-width: 280px;
  white-space: normal; text-align: left;
  pointer-events: none;
  opacity: 0; visibility: hidden;
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
  box-shadow: var(--shadow-md);
  z-index: 200;
}
.help-tip:hover::after {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(0);
}
body.help-tips-off .help-tip { display: none !important; }


/* ============================================================================
   UTILITIES
============================================================================ */
.muted     { color: var(--ink-mute); }
.dim       { color: var(--ink-dim); }
.mono-text { font-family: var(--mono); font-size: 12px; }
.serif-it  { font-family: var(--serif); font-style: italic; }
.sr-only   { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }


/* ============================================================================
   RESPONSIVE
============================================================================ */
@media (max-width: 900px) {
  header.brand { grid-template-columns: 1fr; gap: 12px; padding: 14px 18px; }
  main { padding: 24px 16px 60px; }
  .row.cols-2, .row.cols-3 { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .auth-box { padding: 32px 24px; }
}
