/* Null Security — Internal Operations Dashboard */

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

:root {
  --bg-base:      #0d1117;
  --bg-surface:   #161b22;
  --bg-card:      #1c2230;
  --border:       #30363d;
  --accent:       #238636;
  --accent-hover: #2ea043;
  --danger:       #da3633;
  --warning:      #d29922;
  --text-primary: #e6edf3;
  --text-muted:   #8b949e;
  --link:         #58a6ff;
  --sidebar-w:    240px;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
}

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

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-brand {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.sidebar-brand .logo-icon {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.sidebar-brand .logo-text {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  line-height: 1.2;
}

.sidebar-brand .logo-sub {
  font-size: 11px; color: var(--text-muted);
}

.sidebar-nav { padding: 12px 8px; flex: 1; }

.nav-section-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted);
  padding: 8px 8px 4px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px;
  color: var(--text-muted); text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: background .15s, color .15s;
  margin-bottom: 2px;
}

.nav-item:hover, .nav-item.active {
  background: var(--bg-card); color: var(--text-primary);
}

.nav-item .icon { font-size: 15px; width: 18px; text-align: center; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
}

.sidebar-footer .user-row {
  display: flex; align-items: center; gap: 8px;
}

.sidebar-footer .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-primary);
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 52px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}

.topbar-title { font-size: 15px; font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 12px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.badge-admin   { background: rgba(35,134,54,.2);  color: #3fb950; }
.badge-user    { background: rgba(88,166,255,.15); color: var(--link); }
.badge-danger  { background: rgba(218,54,51,.2);   color: #f85149; }
.badge-warning { background: rgba(210,153,34,.2);  color: #e3b341; }

.page-body { padding: 28px 32px; flex: 1; }

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.card-header h2 { font-size: 14px; font-weight: 600; }

.card-body { padding: 20px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
}

.stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-primary); }
.stat-sub   { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Tables ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th {
  text-align: left; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text-primary);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.03); }

.mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; }

/* ── Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-muted); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .04em;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="file"],
select, textarea {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 9px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--link);
}

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 6px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; border: none;
  text-decoration: none; transition: background .15s;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-outline {
  background: transparent; color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg-card); }

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
  padding: 10px 14px; border-radius: 6px;
  font-size: 13px; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 8px;
}
.alert-error   { background: rgba(218,54,51,.15); border: 1px solid rgba(218,54,51,.4); color: #f85149; }
.alert-success { background: rgba(35,134,54,.15);  border: 1px solid rgba(35,134,54,.4);  color: #3fb950; }
.alert-info    { background: rgba(88,166,255,.1);  border: 1px solid rgba(88,166,255,.3); color: var(--link); }

/* ── Auth pages (login) ──────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-base);
}

.auth-box {
  width: 380px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 36px 32px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo .icon-wrap {
  width: 48px; height: 48px;
  background: var(--accent);
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 24px; margin-bottom: 10px;
}

.auth-logo h1 { font-size: 18px; font-weight: 700; }
.auth-logo p  { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ── Search bar ─────────────────────────────────────────── */
.search-bar {
  display: flex; gap: 8px; align-items: center;
  margin-bottom: 20px;
}

.search-bar input { flex: 1; }

/* ── Upload zone ─────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  transition: border-color .15s;
}

.upload-zone:hover { border-color: var(--link); }
.upload-zone .icon { font-size: 32px; margin-bottom: 10px; }
.upload-zone p { font-size: 13px; }
.upload-zone small { font-size: 11px; color: var(--text-muted); }

/* ── Utility ─────────────────────────────────────────────── */
.text-muted  { color: var(--text-muted); }
.text-danger { color: #f85149; }
.text-right  { text-align: right; }
.mb-0  { margin-bottom: 0; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex  { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
