/* ─── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  line-height: 1.5;
}
a { color: #3b82f6; text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: 'Cascadia Code', 'Consolas', monospace; font-size: 0.9em; background: #f1f5f9; padding: 1px 5px; border-radius: 3px; }

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

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  width: 220px;
  background: #1e293b;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  border-bottom: 1px solid #334155;
}
.logo-icon { font-size: 24px; color: #38bdf8; line-height: 1; }
.logo-title { color: #f8fafc; font-size: 15px; font-weight: 700; }
.logo-sub   { color: #94a3b8; font-size: 11px; margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 8px 0; overflow-y: auto; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
  border-right: 3px solid transparent;
}
.nav-link:hover { background: #334155; color: #e2e8f0; text-decoration: none; }
.nav-link.active { background: #0f172a; color: #38bdf8; border-right-color: #38bdf8; }
.nav-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-footer { padding: 8px 0; border-top: 1px solid #334155; }

/* ─── Main ───────────────────────────────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.page-title { font-size: 17px; font-weight: 600; color: #1e293b; }
.topbar-actions { display: flex; gap: 8px; }

.content { padding: 24px 28px; overflow-y: auto; flex: 1; }

/* ─── Stats grid ─────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border-radius: 8px;
  padding: 16px 20px;
  border: 1px solid #e2e8f0;
}
.stat-card-warn { border-color: #fde68a; background: #fffbeb; }
.stat-value { font-size: 28px; font-weight: 700; color: #1e293b; line-height: 1; }
.stat-label { font-size: 12px; color: #64748b; margin-top: 4px; }

/* ─── Card ───────────────────────────────────────────────────────────────── */
.card { background: #fff; border-radius: 8px; border: 1px solid #e2e8f0; margin-bottom: 16px; }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 600;
  font-size: 13px;
}
.card-body { padding: 16px 20px; }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 9px 14px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; font-size: 13px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }
.text-muted { color: #64748b; }

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-active  { background: #dcfce7; color: #15803d; }
.badge-expired { background: #fee2e2; color: #b91c1c; }
.badge-revoked { background: #f1f5f9; color: #475569; }
.badge-outdated{ background: #fef3c7; color: #b45309; }
.badge-ok      { background: #dcfce7; color: #15803d; }
.badge-unknown { background: #f1f5f9; color: #64748b; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none !important;
  transition: background 0.12s, opacity 0.12s;
  white-space: nowrap;
}
.btn-primary   { background: #3b82f6; color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-danger    { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-secondary { background: #f1f5f9; color: #374151; border: 1px solid #d1d5db; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { display: block; font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 5px; }
.required { color: #ef4444; }
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  color: #1e293b;
  background: #fff;
  transition: border-color 0.12s, box-shadow 0.12s;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: #94a3b8; margin-top: 4px; }

/* ─── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 13px;
  border-width: 1px;
  border-style: solid;
}
.alert-success { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.alert-error   { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.alert-warning { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.alert-info    { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }

/* ─── Grid ───────────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ─── Info list (dl/dt/dd) ───────────────────────────────────────────────── */
.info-list { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 13px; }
.info-list dt { color: #64748b; font-weight: 600; align-self: start; padding-top: 1px; }
.info-list dd { color: #1e293b; }

/* ─── Empty state ────────────────────────────────────────────────────────── */
.empty-state {
  padding: 36px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

/* ─── Login page ─────────────────────────────────────────────────────────── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #f1f5f9;
}
.login-card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  padding: 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo h1 { font-size: 20px; font-weight: 700; margin-top: 8px; }
.login-logo p  { font-size: 12px; color: #64748b; margin-top: 2px; }
.logo-icon-lg  { font-size: 40px; color: #3b82f6; }

/* ─── Public download page ───────────────────────────────────────────────── */
.public-body {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  background: #f1f5f9;
  padding: 40px 16px;
}
.public-card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  width: 100%;
  max-width: 600px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  overflow: hidden;
}
.public-header {
  background: #1e293b;
  color: #f8fafc;
  text-align: center;
  padding: 28px;
}
.public-header h1 { font-size: 22px; margin-top: 8px; }
.public-info { padding: 28px; }
.public-info h2 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.public-client { color: #64748b; font-size: 13px; margin-bottom: 20px; }
.btn-download {
  display: block;
  text-align: center;
  justify-content: center;
  padding: 14px;
  font-size: 15px;
  margin: 20px 0;
  border-radius: 8px;
}
.release-notes {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 14px;
  margin-bottom: 16px;
}
.release-notes h3 { font-size: 12px; font-weight: 600; color: #64748b; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.release-notes pre { font-size: 13px; white-space: pre-wrap; font-family: inherit; color: #334155; }
.file-meta { font-size: 12px; color: #94a3b8; margin-bottom: 4px; }
.install-instructions { margin-top: 20px; }
.install-instructions h3 { font-size: 12px; font-weight: 600; color: #64748b; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.install-instructions ol { padding-left: 20px; color: #475569; font-size: 13px; }
.install-instructions li { margin-bottom: 4px; }
.powershell-box {
  margin-top: 20px;
  background: #0f172a;
  border-radius: 6px;
  padding: 14px;
}
.powershell-box h3 { font-size: 12px; font-weight: 600; color: #94a3b8; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.powershell-box code { background: transparent; color: #38bdf8; font-size: 12px; display: block; word-break: break-all; padding: 0; }

/* ─── Progress bar ───────────────────────────────────────────────────────── */
.progress-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: #3b82f6;
  border-radius: 9999px;
  transition: width 0.2s ease;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sidebar { display: none; }
  .content { padding: 16px; }
}
