/* =========================================================
   DorkSec — design tokens
   A calm, technical recon-console aesthetic: slate base,
   amber signal accent, monospace for query/data content.
   ========================================================= */

:root {
  --bg:        #10141A;
  --panel:     #171C24;
  --panel-2:   #1D2430;
  --border:    #2A323F;
  --text:      #E7EAF0;
  --text-muted:#8C96A6;
  --text-dim:  #5C6577;

  --accent:    #E3A23D;   /* amber signal */
  --accent-dim:#3A2E1C;

  --critical:  #E15B5B;
  --high:      #E08A3E;
  --medium:    #E3C23D;
  --low:       #4FA98F;
  --info:      #6B8CB8;

  --radius: 5px;
  --font-ui:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
  --font-head: 'Space Grotesk', var(--font-ui);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; margin: 0 0 .4em; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; color: var(--text-muted); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--font-mono); }

::selection { background: var(--accent-dim); color: var(--accent); }

/* ---------- Layout shell ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px 20px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: .92rem;
  font-weight: 500;
}
.nav-link:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--accent-dim); color: var(--accent); }
.nav-section-label {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-dim); margin: 16px 10px 6px;
}

.sidebar-footer {
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: .82rem; color: var(--text-dim);
}

.main { flex: 1; min-width: 0; padding: 28px 34px 60px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.topbar .subtitle { color: var(--text-muted); font-size: .92rem; margin-top: 2px; }

/* ---------- Cards / panels ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.panel + .panel { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } }

.stat-card { padding: 16px 18px; }
.stat-card .value { font-family: var(--font-head); font-size: 1.8rem; font-weight: 700; }
.stat-card .label { color: var(--text-muted); font-size: .82rem; margin-top: 2px; }
.stat-card.critical .value { color: var(--critical); }
.stat-card.high .value { color: var(--high); }
.stat-card.accent .value { color: var(--accent); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; color: var(--text-dim); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--panel-2); }
.url-cell { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: .82rem; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: .72rem; font-weight: 600; letter-spacing: .02em;
  border: 1px solid transparent;
}
.badge-critical { color: var(--critical); background: rgba(225,91,91,.12); border-color: rgba(225,91,91,.3); }
.badge-high     { color: var(--high);     background: rgba(224,138,62,.12); border-color: rgba(224,138,62,.3); }
.badge-medium   { color: var(--medium);   background: rgba(227,194,61,.12); border-color: rgba(227,194,61,.3); }
.badge-low      { color: var(--low);      background: rgba(79,169,143,.12); border-color: rgba(79,169,143,.3); }
.badge-info     { color: var(--info);     background: rgba(107,140,184,.12); border-color: rgba(107,140,184,.3); }

/* ---------- Forms ---------- */
label { display: block; font-size: .85rem; color: var(--text-muted); margin-bottom: 5px; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 9px 11px; font-family: var(--font-ui); font-size: .92rem;
}
textarea { font-family: var(--font-mono); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim);
}
.field { margin-bottom: 14px; }
.form-row { display: flex; gap: 14px; }
.form-row > * { flex: 1; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #1A1300;
  border: none; border-radius: var(--radius);
  padding: 9px 16px; font-weight: 600; font-size: .88rem;
  cursor: pointer; font-family: var(--font-ui);
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn-secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: rgba(225,91,91,.15); color: var(--critical); border: 1px solid rgba(225,91,91,.35); }
.btn-sm { padding: 5px 10px; font-size: .78rem; }

/* ---------- Alerts / empty states ---------- */
.alert { padding: 11px 14px; border-radius: var(--radius); border: 1px solid; font-size: .88rem; margin-bottom: 16px; }
.alert-error { background: rgba(225,91,91,.08); border-color: rgba(225,91,91,.3); color: #F0A7A7; }
.alert-success { background: rgba(79,169,143,.08); border-color: rgba(79,169,143,.3); color: #9FD9C8; }
.alert-info { background: rgba(107,140,184,.08); border-color: rgba(107,140,184,.3); color: #AEC4E0; }

.empty-state { text-align: center; padding: 50px 20px; color: var(--text-dim); }
.empty-state h3 { color: var(--text-muted); }

/* ---------- Auth screens ---------- */
.auth-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 20%, #1B222C 0%, var(--bg) 60%);
}
.auth-box { width: 380px; }
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); margin-right: 8px; }
.auth-logo span { font-family: var(--font-head); font-size: 1.3rem; font-weight: 700; }

/* ---------- Query builder ---------- */
.dork-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px 15px; margin-bottom: 10px; background: var(--panel-2);
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
}
.dork-card .query { font-family: var(--font-mono); font-size: .82rem; color: var(--accent); margin-top: 4px; word-break: break-all; }
.dork-card .desc { font-size: .82rem; color: var(--text-muted); margin-top: 4px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-row input { width: auto; margin-top: 4px; }

.category-tab {
  display: inline-block; padding: 6px 13px; border-radius: 20px;
  border: 1px solid var(--border); color: var(--text-muted);
  font-size: .82rem; margin: 0 6px 6px 0; cursor: pointer;
}
.category-tab.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

footer.page-footer { margin-top: 40px; color: var(--text-dim); font-size: .78rem; text-align: center; }
