/* ── Tema Delphos · Base compartilhada ──────────────────────────────────── */
:root {
  --bg:      #0d1017;
  --bg2:     #161b26;
  --bg3:     #1c2235;
  --border:  #2e3650;
  --text:    #f0f4ff;
  --text2:   #9aa5be;
  --text3:   #5c6a84;
  --brand:   #4f8ef7;
  --brand2:  #3a6fd4;
  --red:     #f87171;
  --orange:  #fb923c;
  --yellow:  #facc15;
  --green:   #4ade80;
  --purple:  #a78bfa;
  --radius:  10px;
  --mono:    'JetBrains Mono', 'Consolas', monospace;
  --header:  56px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Form fields ── */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 5px;
}
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
  transition: border-color .15s;
}
.field textarea {
  resize: vertical;
  min-height: 120px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); }
.field select { cursor: pointer; }

/* ── Buttons ── */
.btn {
  background: var(--brand); color: #fff; border: none;
  border-radius: 6px; padding: 9px 20px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .15s;
  font-family: 'Inter', sans-serif; white-space: nowrap;
}
.btn:hover { background: var(--brand2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-ghost {
  background: transparent; color: var(--text2);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 7px 14px; font-size: 12px; cursor: pointer;
  font-family: 'Inter', sans-serif; transition: all .12s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--text3); }
.btn-ghost.on { color: var(--brand); border-color: var(--brand); background: rgba(79,142,247,.08); }

.btn-danger {
  background: transparent; color: var(--red);
  border: 1px solid rgba(248,113,113,.3); border-radius: 6px;
  padding: 7px 14px; font-size: 12px; cursor: pointer;
  font-family: 'Inter', sans-serif; transition: all .12s;
}
.btn-danger:hover { background: rgba(248,113,113,.08); }

/* ── Header padrão ── */
.app-header {
  height: var(--header);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 20px; gap: 12px;
  flex-shrink: 0; z-index: 100;
}
.h-dot {
  width: 9px; height: 9px;
  background: var(--brand); border-radius: 50%;
  box-shadow: 0 0 7px var(--brand);
}
.h-title { font-size: 14px; font-weight: 600; }
.h-title span { color: var(--text2); font-size: 12px; font-weight: 400; margin-left: 4px; }
.h-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.h-user { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text2); }
.h-link { font-size: 12px; color: var(--text3); transition: color .12s; }
.h-link:hover { color: var(--brand); text-decoration: none; }

.avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  color: var(--text); flex-shrink: 0;
  text-transform: uppercase;
}

.kbd-hint {
  font-family: var(--mono); font-size: 10px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 3px; padding: 1px 5px;
  color: var(--text3);
}

/* ── Estados ── */
.empty { text-align: center; padding: 60px 20px; color: var(--text3); }
.empty-icon { font-size: 30px; margin-bottom: 10px; }
.loading {
  display: flex; align-items: center; gap: 8px;
  color: var(--text3); font-size: 13px; padding: 24px 0;
}
.spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Dialog ── */
#dialog {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  display: none;
  align-items: center; justify-content: center;
  z-index: 1000;
}
#dialog.on { display: flex; }
.dialog-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  min-width: 320px; max-width: 460px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.dialog-msg { font-size: 14px; color: var(--text); line-height: 1.5; }
.dialog-sub { font-size: 12px; color: var(--text3); margin-top: 6px; }
.dialog-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 20px;
}

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: 22px; right: 22px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 18px;
  font-size: 13px; color: var(--text);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .2s, transform .2s;
  z-index: 998;
  pointer-events: none;
  max-width: 300px;
}
#toast.on { opacity: 1; transform: translateY(0); }

/* ── Lightbox ── */
#lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.88);
  display: none;
  align-items: center; justify-content: center;
  z-index: 999; cursor: zoom-out;
}
#lightbox.on { display: flex; }
#lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 6px; }

/* ── Badges ── */
.badge {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  padding: 2px 7px; border-radius: 4px;
  white-space: nowrap;
}
