/* Riyaz CBT — Admin Panel styles */
:root {
  --bg:#0f172a; --panel:#fff; --ink:#1e293b; --muted:#64748b; --line:#e2e8f0;
  --brand:#2563eb; --brand-d:#1d4ed8; --ok:#16a34a; --bad:#dc2626; --warn:#d97706;
  --soft:#f1f5f9;
}
* { box-sizing: border-box; }
body { margin:0; font-family: system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  background:#f1f5f9; color:var(--ink); }

/* Login */
.login-wrap { min-height:100vh; display:grid; place-items:center; padding:20px;
  background: linear-gradient(135deg,#1e3a8a,#2563eb); }
.login-box { background:#fff; padding:32px; border-radius:16px; width:100%; max-width:380px;
  box-shadow:0 20px 60px rgba(0,0,0,.25); }
.login-box h1 { margin:0 0 4px; font-size:22px; }
.login-box .sub { color:var(--muted); margin:0 0 20px; font-size:14px; }

label { display:block; font-size:13px; font-weight:600; margin:12px 0 6px; }
input, select, textarea { width:100%; padding:10px 12px; border:1px solid var(--line);
  border-radius:8px; font-size:14px; font-family:inherit; background:#fff; color:var(--ink); }
input:focus, select:focus, textarea:focus { outline:none; border-color:var(--brand); }
textarea { min-height:120px; resize:vertical; }

.btn { display:inline-flex; align-items:center; gap:6px; border:none; border-radius:8px;
  padding:10px 16px; font-size:14px; font-weight:600; cursor:pointer; }
.btn-primary { background:var(--brand); color:#fff; } .btn-primary:hover { background:var(--brand-d); }
.btn-ghost { background:var(--soft); color:var(--ink); } .btn-ghost:hover { background:#e2e8f0; }
.btn-danger { background:var(--bad); color:#fff; }
.btn-ok { background:var(--ok); color:#fff; }
.btn-sm { padding:6px 10px; font-size:13px; }
.btn[disabled] { opacity:.6; cursor:not-allowed; }

.err { color:var(--bad); font-size:13px; margin:10px 0 0; min-height:18px; }

/* Shell */
.topbar { background:#0f172a; color:#fff; padding:12px 22px; display:flex;
  align-items:center; justify-content:space-between; }
.topbar .brand { display:flex; align-items:center; gap:10px; font-weight:700; }
.topbar .mark { background:var(--brand); width:34px; height:34px; border-radius:8px;
  display:grid; place-items:center; font-size:13px; }
.topbar .right { display:flex; align-items:center; gap:14px; font-size:14px; }
.topbar a, .topbar button { color:#cbd5e1; }

.layout { display:flex; min-height:calc(100vh - 58px); }
.side { width:210px; background:#fff; border-right:1px solid var(--line); padding:14px 10px; }
.side button { display:block; width:100%; text-align:left; background:none; border:none;
  padding:11px 14px; border-radius:8px; font-size:14px; font-weight:600; color:var(--muted);
  cursor:pointer; margin-bottom:4px; }
.side button:hover { background:var(--soft); color:var(--ink); }
.side button.active { background:#eff6ff; color:var(--brand); }
.main { flex:1; padding:24px 28px; max-width:100%; overflow-x:auto; }
.main h2 { margin:0 0 18px; }

.cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:14px; margin-bottom:24px; }
.card { background:#fff; border:1px solid var(--line); border-radius:12px; padding:18px; }
.card .k { color:var(--muted); font-size:13px; } .card .v { font-size:28px; font-weight:800; margin-top:6px; }

.panel { background:#fff; border:1px solid var(--line); border-radius:12px; padding:18px; margin-bottom:20px; }
.panel h3 { margin:0 0 14px; font-size:16px; }
.row { display:flex; gap:12px; flex-wrap:wrap; align-items:flex-end; }
.row > div { flex:1; min-width:140px; }
.bar { display:flex; gap:10px; align-items:center; justify-content:space-between; margin-bottom:14px; flex-wrap:wrap; }

table { width:100%; border-collapse:collapse; font-size:14px; }
th, td { text-align:left; padding:10px 12px; border-bottom:1px solid var(--line); vertical-align:top; }
th { color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.04em; }
tr:hover td { background:#fafbfc; }
.tag { display:inline-block; padding:2px 9px; border-radius:999px; font-size:12px; font-weight:700; }
.tag.pass { background:#dcfce7; color:#15803d; } .tag.fail { background:#fee2e2; color:#b91c1c; }
.tag.on { background:#dcfce7; color:#15803d; } .tag.off { background:#f1f5f9; color:#64748b; }
.actions-cell { white-space:nowrap; display:flex; gap:6px; }

/* Modal */
.modal { position:fixed; inset:0; background:rgba(15,23,42,.55); display:none;
  place-items:center; padding:20px; z-index:50; }
.modal.open { display:grid; }
.modal-box { background:#fff; border-radius:14px; padding:24px; width:100%; max-width:560px;
  max-height:90vh; overflow:auto; }
.modal-box h3 { margin:0 0 14px; }
.modal-foot { display:flex; justify-content:flex-end; gap:10px; margin-top:18px; }
.hidden { display:none !important; }
.muted { color:var(--muted); font-size:13px; }
.hint { font-size:12px; color:var(--muted); margin-top:4px; }
.toast { position:fixed; bottom:22px; right:22px; background:#0f172a; color:#fff;
  padding:12px 18px; border-radius:10px; font-size:14px; opacity:0; transform:translateY(10px);
  transition:.25s; z-index:60; }
.toast.show { opacity:1; transform:none; }
.toast.bad { background:var(--bad); }
@media (max-width:760px){ .side{ width:64px; } .side button{ font-size:0; padding:12px 0; text-align:center; } }
