@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;600;700;800;900&family=Barlow:wght@400;500;600&display=swap');

:root {
  --bg:         #0d1520;
  --surface:    #152035;
  --surface2:   #1a2840;
  --surface3:   #1f3050;
  --border:     #253045;
  --border2:    #2e3d58;
  --accent:     #f5c800;
  --accent-dim: #c9a400;
  --accent-bg:  #1a1500;
  --danger:     #e84040;
  --danger-bg:  #1f0a0a;
  --ok:         #3dbc6e;
  --ok-bg:      #0a1f12;
  --warn:       #f5c800;
  --warn-bg:    #1a1500;
  --blue:       #4a9eff;
  --blue-bg:    #081828;
  --text:       #e8edf5;
  --text-dim:   #c8d4e8;
  --text-muted: #8a9ab8;
  --radius:     6px;
  --radius-lg:  10px;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}

/* ── TYPOGRAPHY ── */
.font-display { font-family: 'Barlow Condensed', sans-serif; }
h1,h2,h3,h4 { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; letter-spacing: .5px; }

/* ── LAYOUT ── */
.screen { display: none; min-height: 100dvh; flex-direction: column; }
.screen.active { display: flex; }
.page-content { flex: 1; overflow-y: auto; padding-bottom: 80px; }

/* ── HEADER ── */
.app-header {
  background: var(--surface);
  border-bottom: 2px solid var(--accent);
  padding: 0 16px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 200;
  flex-shrink: 0;
}
.header-logo {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 1.5px;
  line-height: 1;
}
.header-divider { width: 1px; height: 24px; background: var(--border2); flex-shrink: 0; }
.header-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: .5px;
}
.header-badge {
  margin-left: auto;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 9px;
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'Barlow Condensed', sans-serif;
  letter-spacing: 1px;
  white-space: nowrap;
}
.header-back {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

/* ── BOTTOM BAR ── */
.bottom-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  gap: 10px;
  z-index: 200;
}

/* ── BUTTONS ── */
.btn {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .5px;
  border-radius: var(--radius);
  padding: 12px 16px;
  border: none;
  cursor: pointer;
  transition: filter .15s, opacity .15s;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:active { filter: brightness(.85); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn-primary   { background: var(--accent); color: #111; flex: 1; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1.5px solid var(--border2); flex: 1; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-ghost     { background: transparent; color: var(--text-dim); border: 1.5px solid var(--border); flex: 1; }
.btn-ok        { background: var(--ok); color: #fff; flex: 1; }
.btn-full      { width: 100%; }
.btn-lg        { font-size: 20px; padding: 15px 20px; }

/* ── FORM ELEMENTS ── */
.field-group { margin-bottom: 16px; }
.field-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
  display: block;
}
input[type="text"],
input[type="number"],
input[type="search"] {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 13px;
  color: var(--text);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px;
  letter-spacing: .5px;
  outline: none;
  transition: border-color .2s;
  -webkit-appearance: none;
}
input:focus { border-color: var(--accent); }
input.input-warn { border-color: var(--warn); color: var(--warn); }
input.input-error { border-color: var(--danger); }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  background: var(--surface2);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}
.card-body { padding: 14px; }

/* ── SECTION HEADER ── */
.section-header {
  background: var(--surface2);
  padding: 8px 16px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 52px;
  z-index: 100;
}

/* ── TAGS ── */
.tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  font-family: 'Barlow Condensed', sans-serif;
}
.tag-warn    { background: var(--warn-bg);   color: var(--warn);   border: 1px solid var(--warn); }
.tag-ok      { background: var(--ok-bg);     color: var(--ok);     border: 1px solid var(--ok); }
.tag-danger  { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
.tag-blue    { background: var(--blue-bg);   color: var(--blue);   border: 1px solid var(--blue); }
.tag-muted   { background: var(--surface2);  color: var(--text-muted); border: 1px solid var(--border); }

/* ── WARN BANNER ── */
.warn-banner {
  background: var(--warn-bg);
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  margin: 10px 16px;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
}
.warn-banner .wb-icon { font-size: 18px; flex-shrink: 0; line-height: 1.2; }
.warn-banner .wb-title { font-weight: 700; color: var(--warn); margin-bottom: 3px; }
.warn-banner .wb-body { color: var(--text); font-size: 12px; line-height: 1.6; }

/* ── SPINNER ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── UTILITY ── */
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.p-16  { padding: 16px; }
.text-muted { color: var(--text-muted); }
.text-dim   { color: var(--text-dim); }
.text-ok    { color: var(--ok); }
.text-warn  { color: var(--warn); }
.text-danger { color: var(--danger); }
.text-accent { color: var(--accent); }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.items-center { align-items: center; }

/* ── PRINT ── */
@media print {
  .app-header, .bottom-bar, .no-print { display: none !important; }
  body { background: white; color: black; }
  .card { border: 1px solid #ccc; }
  .section-header { background: #f0f0f0; color: #333; position: static; }
  .tag-warn { color: #c00; border-color: #c00; background: #fff0f0; }
}
