/* Admin Panel Styles */
:root {
  --bg:       #f4f6fb;
  --surface:  #ffffff;
  --border:   #e2e8f0;
  --text:     #111827;
  --text2:    #374151;
  --muted:    #6b7280;
  --accent:   #2563eb;
  --accent-h: #1d4ed8;
  --green:    #059669;
  --red:      #dc2626;
  --amber:    #d97706;
  --sidebar-w: 220px;
  --r: 8px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Instrument Sans', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }

/* ── Login page ──────────────────────────────────────────────── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2.5rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}
.login-logo {
  display: flex; align-items: center; gap: .6rem;
  color: var(--accent); font-weight: 700; font-size: 1rem;
  margin-bottom: 1.25rem;
}
.login-card h1 { font-size: 1.35rem; font-weight: 700; margin-bottom: 1.25rem; }
.login-back { margin-top: 1.25rem; text-align: center; font-size: .85rem; }
.login-back a { color: var(--accent); text-decoration: none; }

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

.adm-sidebar {
  width: var(--sidebar-w);
  background: var(--text);
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  flex-shrink: 0;
}
.adm-logo {
  display: flex; align-items: center; gap: .6rem;
  padding: 1.25rem 1rem;
  font-weight: 700;
  font-size: 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: #fff;
}
.adm-nav { list-style: none; padding: .75rem 0; flex: 1; }
.adm-nav li a {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem 1rem;
  color: #9ca3af;
  text-decoration: none;
  border-radius: 6px;
  margin: .1rem .5rem;
  font-weight: 500;
  transition: all .15s;
}
.adm-nav li a:hover { background: rgba(255,255,255,.07); color: #fff; }
.adm-nav li.active a { background: var(--accent); color: #fff; }
.adm-badge {
  margin-left: auto;
  background: rgba(255,255,255,.12);
  color: #d1d5db;
  font-size: .7rem;
  padding: 1px 6px;
  border-radius: 100px;
}
.adm-sidebar-bottom {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; flex-direction: column; gap: .5rem;
}
.adm-link-sm { color: #9ca3af; text-decoration: none; font-size: .82rem; }
.adm-link-sm:hover { color: #fff; }

.adm-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  padding: 1.5rem 2rem;
}
.adm-topbar { margin-bottom: 1.5rem; }
.adm-title { font-size: 1.35rem; font-weight: 700; }

/* ── Stats grid ──────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.25rem;
  text-align: center;
}
.stat-val { font-size: 2rem; font-weight: 800; color: var(--accent); line-height: 1.1; }
.stat-val small { font-size: 1rem; color: var(--muted); font-weight: 600; }
.stat-lbl { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: .35rem; }

/* ── Section ─────────────────────────────────────────────────── */
.adm-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.adm-section h2 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.adm-section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem;
}
.adm-section-head h2 { margin-bottom: 0; }
.adm-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }

/* ── Table ───────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.adm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
.adm-table th, .adm-table td {
  text-align: left;
  padding: .55rem .75rem;
  border-bottom: 1px solid var(--border);
}
.adm-table th { font-weight: 600; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.adm-table tr:last-child td { border-bottom: none; }
.adm-table tbody tr:hover { background: var(--bg); }
.row-inactive { opacity: .5; }
.row-actions { display: flex; gap: .4rem; align-items: center; white-space: nowrap; }
.feed-url-tiny { font-size: .72rem; color: var(--muted); margin-top: .15rem; }

/* ── Forms ───────────────────────────────────────────────────── */
.adm-form { display: grid; gap: .75rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem; }
.form-group { display: flex; flex-direction: column; gap: .3rem; }
.form-group label { font-size: .8rem; font-weight: 600; color: var(--text2); }
.form-actions { display: flex; gap: .5rem; margin-top: .25rem; }
.inline-form { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }

input[type=text], input[type=url], input[type=number], input[type=password], select {
  height: 36px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 0 .75rem;
  font-family: inherit;
  font-size: .85rem;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color .15s;
  width: 100%;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.input-sm { height: 32px; width: 200px; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  height: 36px; padding: 0 1rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text2);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-h); border-color: var(--accent-h); color: #fff; }
.btn-ghost { background: transparent; }
.btn-danger { background: #fef2f2; border-color: #fca5a5; color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn-sm { height: 28px; padding: 0 .65rem; font-size: .78rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
  padding: .75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.25rem;
  font-size: .875rem;
  font-weight: 500;
}
.alert-success { background: #ecfdf5; border: 1px solid #6ee7b7; color: #065f46; }
.alert-error   { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }

/* ── Misc ────────────────────────────────────────────────────── */
.status-dot {
  display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; margin-right: 3px;
}
.status-dot.ok   { background: var(--green); }
.status-dot.err  { background: var(--red); }
.status-dot.pend { background: var(--amber); }
.badge-region {
  background: #e5e7eb; color: var(--text2);
  font-size: .72rem; padding: 1px 6px;
  border-radius: 100px; font-weight: 600;
}
.muted-text { color: var(--muted); margin-bottom: .75rem; font-size: .875rem; }

@media (max-width: 768px) {
  .adm-sidebar { display: none; }
  .adm-main    { margin-left: 0; padding: 1rem; }
  .adm-two-col { grid-template-columns: 1fr; }
}
