:root{
  --bg:#000000;
  --panel:#0b0b0c;
  --panel2:#121214;
  --text:#ffffff;
  --muted:#8d8d93;
  --line:rgba(255,255,255,.08);
  --ok:#22c55e;
  --warn:#f59e0b;
  --bad:#ef4444;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family:Inter,"Segoe UI",sans-serif;
  background:var(--bg);
  color:var(--text);
}

a{ color:inherit; text-decoration:none; }

/* Top nav, shared across admin pages */
.nav{
  position:sticky;
  top:0;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:20px 32px;
  border-bottom:1px solid var(--line);
  background:rgba(0,0,0,.9);
  backdrop-filter:blur(12px);
  z-index:100;
}

.nav-left{ display:flex; align-items:center; gap:18px; }

.logo{
  display:grid;
  grid-template-columns:repeat(3,7px);
  gap:6px;
}

.logo span{
  width:7px;
  height:7px;
  background:#fff;
  border-radius:999px;
}

.nav-links{ display:flex; gap:6px; }

.nav-links a{
  padding:8px 16px;
  border-radius:999px;
  font-size:14px;
  color:var(--muted);
}

.nav-links a:hover,
.nav-links a.active{
  color:#fff;
  background:var(--panel2);
}

main{
  max-width:1100px;
  margin:0 auto;
  padding:40px 24px 80px;
}

.eyebrow{
  color:var(--muted);
  letter-spacing:.14em;
  text-transform:uppercase;
  font-size:12px;
  margin-bottom:14px;
}

h1{
  margin:0 0 8px;
  font-size:clamp(30px,4vw,42px);
  letter-spacing:-.04em;
}

.lead{
  color:var(--muted);
  font-size:15px;
  line-height:1.5;
  margin:0 0 32px;
}

.page-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:16px;
  margin-bottom:28px;
  flex-wrap:wrap;
}

/* Cards */
.panel{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:28px;
  padding:28px;
}

.panel + .panel{ margin-top:20px; }

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

.stat-card{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:22px;
  padding:22px;
}

.stat-card .stat-label{
  color:var(--muted);
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.1em;
  margin-bottom:10px;
}

.stat-card .stat-value{
  font-size:30px;
  letter-spacing:-.03em;
  font-weight:700;
}

/* Table */
table{
  width:100%;
  border-collapse:collapse;
  font-size:14px;
}

th{
  text-align:left;
  color:var(--muted);
  font-weight:600;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.08em;
  padding:0 14px 12px;
  border-bottom:1px solid var(--line);
}

td{
  padding:16px 14px;
  border-bottom:1px solid var(--line);
  vertical-align:middle;
}

tr:last-child td{ border-bottom:0; }

td .sub{
  display:block;
  color:var(--muted);
  font-size:12px;
  margin-top:3px;
}

.row-actions{ display:flex; gap:8px; }

/* Status pills */
.status{
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:5px 12px;
  border-radius:999px;
  background:var(--panel2);
  font-size:13px;
  border:1px solid var(--line);
}

.status::before{
  content:"";
  width:7px;
  height:7px;
  border-radius:999px;
  background:var(--muted);
}

.status-ok::before{ background:var(--ok); box-shadow:0 0 8px var(--ok); }
.status-warn::before{ background:var(--warn); box-shadow:0 0 8px var(--warn); }
.status-bad::before{ background:var(--bad); box-shadow:0 0 8px var(--bad); }

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:42px;
  border-radius:999px;
  padding:0 20px;
  cursor:pointer;
  font-weight:700;
  font-size:14px;
  border:0;
  font-family:inherit;
}

.btn-primary{ background:#fff; color:#000; }
.btn-primary:hover{ background:#e8e8e8; }

.btn-secondary{
  background:var(--panel2);
  color:#fff;
  border:1px solid var(--line);
}
.btn-secondary:hover{ border-color:rgba(255,255,255,.24); }

.btn-danger{
  background:rgba(239,68,68,.12);
  color:#fca5a5;
  border:1px solid rgba(239,68,68,.3);
}
.btn-danger:hover{ background:rgba(239,68,68,.2); }

.btn-sm{ height:34px; padding:0 14px; font-size:13px; }

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

.form-group label{
  display:block;
  margin-bottom:8px;
  font-size:14px;
  color:#fff;
}

.form-group .hint{
  color:var(--muted);
  font-size:12px;
  margin-top:6px;
}

input[type=text],
input[type=password],
input[type=number],
input[type=date],
input[type=file],
textarea,
select{
  width:100%;
  min-height:48px;
  border-radius:16px;
  border:1px solid var(--line);
  background:#111;
  color:#fff;
  padding:0 14px;
  outline:none;
  font-size:14px;
  font-family:inherit;
}

textarea{ padding:12px 14px; min-height:100px; resize:vertical; }

input:focus, textarea:focus, select:focus{
  border-color:rgba(255,255,255,.24);
}

.form-row{ display:flex; gap:14px; flex-wrap:wrap; }
.form-row > *{ flex:1; min-width:180px; }

.key-display{
  font-family:ui-monospace,Consolas,monospace;
  background:#111;
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px 14px;
  word-break:break-all;
  font-size:14px;
}

/* Auth / login */
.auth-wrap{
  min-height:100vh;
  display:flex;
  justify-content:center;
  align-items:center;
  padding:24px;
}

.auth-modal{
  width:100%;
  max-width:400px;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:28px;
  padding:32px;
  box-shadow:0 20px 80px rgba(0,0,0,.5);
}

.auth-modal h1{ font-size:26px; }

.auth-error{
  background:rgba(239,68,68,.12);
  border:1px solid rgba(239,68,68,.3);
  color:#fca5a5;
  padding:12px 14px;
  border-radius:14px;
  font-size:13px;
  margin-bottom:18px;
}

.flash-ok{
  background:rgba(34,197,94,.12);
  border:1px solid rgba(34,197,94,.3);
  color:#86efac;
  padding:12px 16px;
  border-radius:16px;
  font-size:14px;
  margin-bottom:20px;
}

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