body.admin { background: #f3f7f6; }
.admin-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px; background-color: #0a2f2c !important; color: #cfe9e3; flex-shrink: 0;
}
@media (min-width: 992px) { .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; } }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 22px 20px; font-weight: 800; color: #fff; }
.sb-nav { padding: 0 12px 20px; }
.sb-nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px;
  color: #b9dcd5; text-decoration: none; font-weight: 600; font-size: .93rem; margin-bottom: 2px;
}
.sb-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sb-nav a.active { background: var(--brand); color: #fff; }
.sb-nav hr { border-color: rgba(255,255,255,.15); }
.admin-main { flex: 1; min-width: 0; }
.admin-top {
  display: flex; align-items: center; gap: 10px; background: #fff; border-bottom: 1px solid var(--line);
  padding: 16px 26px; position: sticky; top: 0; z-index: 10;
}
.admin-body { padding: 26px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; height: 100%; }
.kpi .v { font-size: 1.9rem; font-weight: 800; color: var(--brand); }
.kpi .l { color: var(--muted); font-weight: 600; font-size: .85rem; }
.kpi i { font-size: 1.6rem; color: var(--brand); opacity: .35; }
.table-admin th { font-size: .75rem; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.table-admin td { vertical-align: middle; }
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(135deg, #0b4f4a, #0f766e 60%, #14b8a6);
}
.login-card { width: 100%; max-width: 420px; background: #fff; border-radius: 22px; padding: 36px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.4); }
@media (max-width: 991px) { .admin-body { padding: 16px; } .admin-top { padding: 12px 16px; } }

/* ---------- Multi-pharmacy portal ---------- */
.impersonate-bar {
  background: #312e81; color: #fff; text-align: center; padding: 8px 12px; font-size: .9rem;
  position: sticky; top: 0; z-index: 30;
}
body.super .sidebar { background-color: #1e1b4b !important; }
body.super .sb-nav a { color: #c7c4f2; }
body.super .sb-nav a.active { background: #4f46e5; color: #fff; }
.super-mark { background: linear-gradient(135deg, #4f46e5, #818cf8); }
a.kpi { color: inherit; transition: box-shadow .15s, transform .15s; }
a.kpi:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.sb-brand small { font-size: .75rem; }
.table-admin td, .table-admin th { padding-left: .6rem; padding-right: .6rem; }

/* ---------- Weekly update reminder + QR ---------- */
.due-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 26px; background: #f59e0b; color: #1f1300; font-size: .92rem; }
.due-bar.over { background: #dc2626; color: #fff; }
.due-bar i { font-size: 1.2rem; }
.sb-qr { margin: 14px 4px 4px; padding: 14px; border-radius: 14px; background: rgba(255,255,255,.07); text-align: center; color: #cfe9e3; }
.sb-qr-box { width: 132px; margin: 0 auto 8px; background: #fff; border-radius: 10px; padding: 6px; }
.sb-qr-box svg { display: block; width: 100%; height: auto; }
.weekly-card .due-ring {
  --c: #16a34a; width: 120px; height: 120px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), #e5efed 0);
}
.weekly-card.st-soon .due-ring { --c: #f59e0b; }
.weekly-card.st-overdue .due-ring { --c: #dc2626; }
.weekly-card .due-ring > div { width: 92px; height: 92px; border-radius: 50%; background: #fff; display: grid; place-content: center; text-align: center; }
.weekly-card .due-ring b { font-size: 2rem; line-height: 1; }
.weekly-card .due-ring span { font-size: .72rem; color: var(--muted); }
.weekly-card.st-overdue { border-color: #fecaca; background: #fff7f7; }
.drop-zone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 16px; border: 2px dashed #9fd8cc; border-radius: 16px;
  background: #f4fbf9; cursor: pointer; text-align: center; transition: all .2s; position: relative; }
.drop-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-zone > i { font-size: 2.6rem; color: var(--brand); }
.drop-zone.drag { background: #e0f5f0; border-color: var(--brand); transform: scale(1.01); }
.drop-zone.has-file { border-style: solid; border-color: #16a34a; background: #f0fdf4; }
.qr-big { width: 280px; max-width: 100%; background: #fff; padding: 12px; border-radius: 16px; border: 1px solid var(--line); }
.qr-big svg { width: 100%; height: auto; display: block; }
