/* ═══════════════════════════════════════════════════════════
   EMET DESIGN SYSTEM — Single source of truth
   Import in every page: <link rel="stylesheet" href="emet.css">
   ═══════════════════════════════════════════════════════════ */

/* ── Palette ── */
:root {
  /* Phosphor green — the signature */
  --g: #20c040;           /* primary — bright phosphor */
  --gd: #1c9237;          /* secondary — labels on warm bg */
  --gg: #6a9a70;          /* tertiary — hints, dim but legible */
  --gb: #1e2420;          /* hover bg */
  --gx: #262c28;          /* active/pressed bg */
  --glow-g: 0 0 10px rgba(32,192,64,0.3);

  /* Signal colors */
  --r: #e03040;           /* red — alarm, danger, decrease */
  --glow-r: 0 0 10px rgba(224,48,64,0.3);
  --a: #cdb98e;           /* amber — money only (muted tan) */
  --ad: #3fe01f;          /* secondary signal — bright green */
  --glow-a: 0 0 10px rgba(205,185,142,0.25);
  --c: #00ccdd;           /* cyan — clickable, interactive */

  /* Surfaces */
  --bg: #494b49;          /* page / desk — warm grey */
  --sf: #e3c5a0;          /* panel headers — warm stone */
  --card: #cbc4be;        /* card / dialog — sandstone */
  --card-hi: #c83c3c;     /* elevated card — accent red */

  /* Borders */
  --border: #000000;      /* primary border — black on sand */
  --border-dim: #685e54;  /* subtle separator */

  /* Text */
  --text: #f2ede6;        /* primary text — warm white */
  --text-dim: #ffffff;    /* secondary text — white */

  /* Typography */
  --font-data: 'VT323', 'Courier New', monospace;
  --font-label: 'Oswald', Impact, sans-serif;

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 2px;

  /* CRT scanlines — use on dark desk surfaces, not on cards */
  --scan: repeating-linear-gradient(
    0deg,
    rgba(32,192,64,0.02) 0px,
    rgba(32,192,64,0.02) 1px,
    transparent 1px,
    transparent 3px
  );
}

/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=VT323&family=Oswald:wght@700&display=swap');

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-data);
  font-size: 16px;
}

/* ═══════════════════════════════════════════════════════════
   REUSABLE COMPONENTS
   ═══════════════════════════════════════════════════════════ */

/* ── Overlay ── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(2,4,3,0.85);
  display: none; align-items: center; justify-content: center;
  z-index: 100;
  animation: fadeIn 0.15s var(--ease);
}
.overlay.open { display: flex; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

/* ── Dialog ── */
.dialog {
  background: var(--card);
  border: 1px solid var(--border);
  width: 380px; max-width: 92vw;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  animation: slideUp 0.2s var(--ease);
}
@keyframes slideUp { from{transform:translateY(12px);opacity:0} to{transform:translateY(0);opacity:1} }

.dialog-head {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--sf);
  display: flex; align-items: center; justify-content: space-between;
}
.dialog-head .dh-title {
  font-family: var(--font-label);
  font-size: 18px; font-weight: 700;
  letter-spacing: 4px; color: var(--g);
  text-shadow: var(--glow-g);
}
.dialog-head .dh-close {
  color: var(--text-dim); cursor: pointer;
  font-size: 20px; padding: 0 4px;
  transition: color 0.1s;
}
.dialog-head .dh-close:hover { color: var(--text); }
.dialog-body { padding: 16px 14px; }
.dialog-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border-dim);
  display: flex; gap: 8px;
}

/* ── Buttons ── */
.btn {
  font-family: var(--font-label);
  font-size: 16px; font-weight: 700;
  letter-spacing: 3px; cursor: pointer;
  padding: 8px 16px; border: 1px solid;
  transition: all 0.12s var(--ease);
  text-align: center;
}
.btn-primary {
  background: var(--gb); color: var(--g);
  border-color: var(--g);
}
.btn-primary:hover {
  background: var(--g); color: var(--bg);
  box-shadow: var(--glow-g);
}
.btn-ghost {
  background: transparent; color: var(--text-dim);
  border-color: var(--border-dim);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border); }
.btn-danger {
  background: transparent; color: var(--r);
  border-color: #501018;
}
.btn-danger:hover { background: #1a0808; border-color: var(--r); box-shadow: var(--glow-r); }
.btn-fill { flex: 1; }

/* ── Confirm delta (before → after) ── */
.confirm-delta {
  display: flex; align-items: center;
  gap: 12px; justify-content: center;
  margin-bottom: 16px;
}
.confirm-val {
  font-family: var(--font-label);
  font-size: 36px; font-weight: 700;
  line-height: 1;
}
.confirm-val.old { color: var(--text-dim); text-decoration: line-through; }
.confirm-val.new { color: var(--g); text-shadow: var(--glow-g); }
.confirm-arrow { font-size: 24px; color: var(--text-dim); }
.confirm-label {
  text-align: center; font-size: 13px;
  color: var(--text-dim); letter-spacing: 2px;
  margin-bottom: 12px;
}

/* ── Action box (tappable status panel) ── */
.action-box {
  flex: 1; padding: 10px 14px;
  cursor: pointer;
  display: flex; flex-direction: column;
  justify-content: center;
  transition: background 0.15s var(--ease);
}
.action-box:hover { background: var(--gb); }
.action-box:active { background: var(--gx); }
.action-box + .action-box { border-left: 1px solid var(--border); }
.action-box .ab-label {
  font-size: 11px; color: var(--text-dim);
  letter-spacing: 3px; text-transform: uppercase;
}
.action-box .ab-value {
  font-family: var(--font-label);
  font-size: 36px; font-weight: 700;
  line-height: 1; color: var(--g);
  text-shadow: var(--glow-g);
  margin-top: 2px;
}
.action-box .ab-value.money { color: var(--a); text-shadow: var(--glow-a); }
.action-box .ab-hint {
  font-size: 12px; color: var(--text-dim);
  margin-top: 2px;
}

/* ── EMET header bar ── */
.emet-header {
  background: var(--sf);
  border-bottom: 1px solid var(--border);
  padding: 6px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.emet-logo {
  font-family: var(--font-label);
  color: var(--g); font-size: 18px; font-weight: 700;
  letter-spacing: 6px;
  text-shadow: var(--glow-g);
}
</style>
