/* Dark theme, accessible, responsive */
:root {
  --bg: #0b0f14;
  --panel: #121822;
  --muted: #93a4b8;
  --text: #e6eef7;
  --accent: #4ade80; /* green */
  --accent-600: #22c55e;
  --danger: #f87171;
  --warn: #facc15;
  --ok: #34d399;
  --border: #1f2a37;
  --focus: 0 0 0 3px rgba(74, 222, 128, 0.35);
  --shadow: 0 10px 25px rgba(0,0,0,0.35);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, sans-serif;
  color: var(--text); background: radial-gradient(1200px 600px at 10% -10%, #122233 0%, #0b0f14 50%) no-repeat, var(--bg);
}

.app-header { display: flex; align-items: center; justify-content: space-between; padding: 16px clamp(12px, 4vw, 28px); border-bottom: 1px solid var(--border); backdrop-filter: blur(4px); position: sticky; top: 0; background: rgba(11,15,20,0.75); }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { display: block; }
.titles h1 { margin: 0; font-size: 1.1rem; }
.subtitle { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }
.actions { display: flex; gap: 8px; }

.container { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card h2 { margin-top: 0; font-size: 1.05rem; }
.muted { color: var(--muted); }
.fineprint { font-size: 0.85rem; text-align: center; margin: 24px 0; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.col-span-2 { grid-column: span 2; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field.switch { justify-content: end; }
label { font-weight: 600; font-size: 0.95rem; }
input[type="text"], input[type="file"], select, textarea {
  width: 100%; background: #0d121a; border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-600); box-shadow: var(--focus); }
small { color: var(--muted); font-size: 0.85rem; }

.form-actions { display: flex; gap: 10px; margin-top: 8px; }
.btn { --bg: #1a2430; --fg: var(--text); --bd: var(--border); cursor: pointer; user-select: none; background: var(--bg); color: var(--fg); border: 1px solid var(--bd); border-radius: 10px; padding: 8px 12px; transition: background .2s, transform .02s, border-color .2s; }
.btn:hover { border-color: var(--accent-600); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, var(--accent), var(--accent-600)); color: #0b0f14; border: none; font-weight: 700; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 8px; font-size: 0.85rem; }

.alert { border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--border); }
.alert.ok { background: rgba(52, 211, 153, 0.08); border-color: rgba(52, 211, 153, 0.3); }
.alert.warn { background: rgba(250, 204, 21, 0.08); border-color: rgba(250, 204, 21, 0.3); }
.alert.error { background: rgba(248, 113, 113, 0.08); border-color: rgba(248, 113, 113, 0.3); }

.table-wrap { overflow: auto; border-radius: 10px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { border-bottom: 1px solid var(--border); padding: 10px; text-align: left; vertical-align: top; }
.table thead th { position: sticky; top: 0; background: #0f141c; z-index: 1; }
.table.compact th, .table.compact td { padding: 8px 10px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; font-size: 0.9rem; }
.text-clip { max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }

.warnings { margin-top: 12px; }
.warnings summary { cursor: pointer; }

.export-actions { display: flex; gap: 10px; margin-top: 12px; }

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: span 1; }
  .text-clip { max-width: 100%; }
  .actions { display:none; }
}

/* Focus outlines for accessibility */
:focus-visible { outline: none; box-shadow: var(--focus); }
