/* Renewal Radar — modern dark theme */
:root {
  color-scheme: dark;
  --bg: #080d1a;
  --bg-soft: #0d1424;
  --card: rgba(15, 23, 42, 0.72);
  --card-solid: #0f172a;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #e2e8f0;
  --muted: #8b98b0;
  --accent: #6366f1;
  --accent-2: #22d3ee;
  --red: #f87171;
  --orange: #fb923c;
  --yellow: #facc15;
  --green: #34d399;
  --radius: 14px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  line-height: 1.55;
  background:
    radial-gradient(1100px 550px at 8% -12%, rgba(99, 102, 241, 0.22), transparent 60%),
    radial-gradient(900px 450px at 105% -5%, rgba(34, 211, 238, 0.14), transparent 55%),
    radial-gradient(700px 500px at 50% 115%, rgba(139, 92, 246, 0.10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
}

.container { max-width: 1100px; margin: 0 auto; padding: 28px 18px 72px; }

::selection { background: rgba(99, 102, 241, 0.45); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #334155; }

/* ---------- Nav ---------- */
.topnav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  padding: 12px 24px;
  background: rgba(8, 13, 26, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topnav .brand {
  font-weight: 800; font-size: 19px; text-decoration: none; letter-spacing: 0.2px;
  background: linear-gradient(120deg, #a5b4fc, #22d3ee);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.navlinks { display: flex; gap: 4px; flex-wrap: wrap; }
.navlinks a {
  color: var(--muted); text-decoration: none; padding: 7px 14px;
  border-radius: 9px; font-size: 14px; font-weight: 600;
  transition: color .15s, background .15s, box-shadow .15s;
}
.navlinks a:hover { color: var(--text); background: rgba(148, 163, 184, 0.10); }
.navlinks a.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(34, 211, 238, 0.75));
  box-shadow: 0 2px 14px rgba(79, 70, 229, 0.45);
}
.pill {
  background: linear-gradient(135deg, #ef4444, #f97316); color: #fff;
  border-radius: 999px; padding: 1px 7px; font-size: 11px; margin-left: 5px;
}

/* ---------- Layout ---------- */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 6px 0 18px; flex-wrap: wrap;
}
.page-head h2 { margin: 0; font-size: 26px; letter-spacing: -0.3px; }
h3 { margin-top: 0; letter-spacing: -0.2px; }
.muted { color: var(--muted); font-weight: 400; font-size: 13px; }
.center { text-align: center; }

.card {
  background: var(--card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

.banner {
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  border-radius: 12px; padding: 13px 17px; margin: 14px 0 22px;
}
.banner a { color: #fde68a; }
.banner-verify {
  background: rgba(96, 165, 250, 0.10);
  border-color: rgba(96, 165, 250, 0.4);
  color: #93c5fd;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.banner-verify a { color: #bfdbfe; }

/* ---------- Stat cards ---------- */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px; margin-bottom: 22px;
}
.stat {
  background: var(--card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-left: 4px solid var(--muted);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease;
}
.stat:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.stat-num { font-size: 34px; font-weight: 800; letter-spacing: -1px; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 2px; }
.stat-red { border-left-color: var(--red); }      .stat-red .stat-num { color: var(--red); }
.stat-amber { border-left-color: var(--orange); } .stat-amber .stat-num { color: var(--orange); }
.stat-yellow { border-left-color: var(--yellow); }.stat-yellow .stat-num { color: var(--yellow); }
.stat-green { border-left-color: var(--green); }  .stat-green .stat-num { color: var(--green); }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; padding: 9px 12px; color: var(--muted);
  border-bottom: 1px solid var(--border-strong);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: rgba(148, 163, 184, 0.06); }
.table a { color: #93c5fd; text-decoration: none; }
.table a:hover { text-decoration: underline; }
.subrow td { background: rgba(2, 6, 17, 0.5); }
.subrow pre { margin: 0; white-space: pre-wrap; font-size: 12px; color: var(--muted); }
.actions { white-space: nowrap; }
.empty { color: var(--muted); padding: 12px 0; }
.empty-state { text-align: center; padding: 44px 20px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
  border: 1px solid transparent;
}
.badge-expired { background: rgba(248, 113, 113, 0.14); color: #fca5a5; border-color: rgba(248, 113, 113, 0.35); }
.badge-critical { background: rgba(251, 146, 60, 0.14); color: #fdba74; border-color: rgba(251, 146, 60, 0.35); }
.badge-warning { background: rgba(250, 204, 21, 0.12); color: #fde047; border-color: rgba(250, 204, 21, 0.30); }
.badge-ok { background: rgba(52, 211, 153, 0.14); color: #6ee7b7; border-color: rgba(52, 211, 153, 0.35); }

/* ---------- Forms ---------- */
label { display: block; margin-bottom: 15px; font-weight: 600; font-size: 14px; }
input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="number"], input[type="search"],
input[type="file"], select, textarea {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px;
  border: 1px solid var(--border-strong); border-radius: 9px;
  font-size: 14px; font-family: inherit;
  background: rgba(2, 6, 17, 0.6); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18);
}
input::placeholder, textarea::placeholder { color: #475569; }
select option { background: var(--card-solid); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.checkbox { display: flex; align-items: center; gap: 9px; font-weight: 500; }
.checkbox input { width: auto; accent-color: var(--accent); }
.checkbox-row { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 15px; }
.field-label { font-weight: 600; font-size: 14px; margin-bottom: 7px; }
.form-actions { display: flex; gap: 10px; margin-top: 10px; }
.inline-form { margin-top: 12px; }
form.inline { display: inline; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 10px 17px; border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: rgba(148, 163, 184, 0.08); color: var(--text);
  font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: transform .12s, box-shadow .15s, background .15s, border-color .15s;
}
.btn:hover { background: rgba(148, 163, 184, 0.16); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 55%, #0ea5e9 100%);
  border: none; color: #fff;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.40);
}
.btn-primary:hover { box-shadow: 0 6px 22px rgba(79, 70, 229, 0.55); background: linear-gradient(135deg, #6d70f5 0%, #564ff0 55%, #18b0f5 100%); }
.btn-danger { background: transparent; border-color: rgba(248, 113, 113, 0.45); color: var(--red); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.12); border-color: var(--red); }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- Auth ---------- */
.auth-card {
  max-width: 430px; margin: 52px auto;
  background: var(--card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 18px; padding: 36px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}
.auth-card h1 {
  margin: 0 0 4px; font-size: 25px; letter-spacing: -0.4px;
  background: linear-gradient(120deg, #a5b4fc, #22d3ee);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-card a { color: #93c5fd; }

/* ---------- Flash ---------- */
.flash { border-radius: 10px; padding: 12px 16px; margin: 12px 0; font-size: 14px; border: 1px solid; }
.flash-success { background: rgba(52, 211, 153, 0.12); color: #6ee7b7; border-color: rgba(52, 211, 153, 0.35); }
.flash-error { background: rgba(248, 113, 113, 0.12); color: #fca5a5; border-color: rgba(248, 113, 113, 0.35); }
.flash-info { background: rgba(96, 165, 250, 0.12); color: #93c5fd; border-color: rgba(96, 165, 250, 0.35); }

/* ---------- Filters ---------- */
.filter-bar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-bar input[type="search"] { flex: 1; min-width: 220px; margin-top: 0; }
.filter-bar select { width: auto; margin-top: 0; }
.filter-bar .btn { align-self: center; }

/* ---------- Notifications ---------- */
.note-list { list-style: none; padding: 0; margin: 0; }
.note {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 13px 15px; border-radius: 10px; margin-bottom: 9px;
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid var(--border);
  border-left: 4px solid var(--muted);
  font-size: 14px;
}
.note-info { border-left-color: #60a5fa; }
.note-warning { border-left-color: var(--yellow); background: rgba(250, 204, 21, 0.06); }
.note-danger { border-left-color: var(--red); background: rgba(248, 113, 113, 0.07); }
.note.unread { font-weight: 650; }
.note.unread::before { content: "\25CF"; color: var(--accent-2); margin-right: 5px; }

code {
  background: rgba(148, 163, 184, 0.12); padding: 2px 7px;
  border-radius: 6px; font-size: 13px; color: #a5b4fc;
}
