/* Rounded, softly lit cards inspired by the supplied dashboard reference. */
[data-theme="dark"] :is(.panel,.rp-panel,.login-card){border-radius:20px;border-color:#344155;box-shadow:inset 0 1px 0 #ffffff08,0 12px 30px #00000026}
[data-theme="dark"] :is(.stat,.rp-kpi){border-radius:17px;border:1px solid #40516b;background-color:#18202e;background-image:radial-gradient(ellipse at 100% 0%,#5784ca24,transparent 72%);box-shadow:inset 0 1px 0 #ffffff14,0 7px 18px #0003;overflow:hidden}
[data-theme="dark"] .stat{min-height:104px;padding:18px 20px;position:relative;text-align:left}
[data-theme="dark"] .stat strong{font-size:29px;letter-spacing:-.035em;color:#f2f6ff}
[data-theme="dark"] .stat span{color:#b6c4d9}
[data-theme="dark"] :is(.stat,.rp-kpi):nth-child(4n+2){background-image:radial-gradient(ellipse at 100% 0%,#9782d12b,transparent 72%)}
[data-theme="dark"] :is(.stat,.rp-kpi):nth-child(4n+3){background-image:radial-gradient(ellipse at 100% 0%,#4c9bbf2b,transparent 72%)}
[data-theme="dark"] :is(.stat,.rp-kpi):nth-child(4n){background-image:radial-gradient(ellipse at 100% 0%,#c69a6630,transparent 72%)}
[data-theme="dark"] :is(.stat-filter,.rp-kpi):hover{border-color:#7898c6;box-shadow:inset 0 1px 0 #ffffff1c,0 8px 22px #0004}
[data-theme="dark"] :is(.stat-filter,.rp-kpi).active{border-color:#91b5ef;box-shadow:inset 0 3px 0 #91b5ef,0 8px 22px #0004}
[data-theme="dark"] .rp-kpis{background:transparent}
[data-theme="dark"] .detail-grid section{border-radius:16px;background:linear-gradient(155deg,#1d2633,#181d25 65%);border-color:#344155;box-shadow:inset 0 1px 0 #ffffff08}
[data-theme="dark"] .detail-grid section h3{margin-top:4px;color:#e5edfa}
#detail{padding:0;overflow:hidden;max-height:92dvh}
#detail[open]{display:flex;flex-direction:column}
.detail-dialog-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-shrink:0;padding:12px 20px;background:var(--surface-raised);border-bottom:1px solid var(--border);color:var(--text-secondary);font-size:14px}
#detail #detail-close{position:static;font-size:15px;border:1px solid var(--border);min-height:44px;white-space:nowrap}
#detail-content{overflow:auto;overscroll-behavior:contain;min-height:0;padding:24px;scrollbar-gutter:stable}
#detail .detail-head{padding-right:0;gap:16px}
@media(max-width:650px){[data-theme="dark"] .stat{padding:14px;min-height:96px}[data-theme="dark"] .stat strong{font-size:25px}#detail-content{padding:16px}.detail-dialog-bar{padding:9px 14px}#detail .detail-head{flex-wrap:wrap}}
/* Final palette from the second reference: charcoal with muted petrol/teal. */
:root[data-theme="dark"]{--surface:#192b32;--surface-raised:#243b43;--surface-hover:#2a454d;--border:#36525c;--border-soft:#2b414b;--accent:#8bd9d6;--accent-fill:#347e85;--accent-wash:#284e55;--text:#e8f1f3;--text-secondary:#c0d3d9;--muted:#9bb5be}
[data-theme="dark"] :is(.panel,.rp-panel,.login-card){background-color:var(--surface);border-color:#38545e}
[data-theme="dark"] :is(.panel-head,.rp-subhead){background:linear-gradient(105deg,#2a5159,#1c333b);border-bottom-color:#36525c}
[data-theme="dark"] .panel-head{padding:16px 20px;border-radius:19px 19px 0 0}
[data-theme="dark"] :is(.stat,.rp-kpi){background-color:#1c343c;border-color:#42636e;background-image:radial-gradient(ellipse at 100% 0%,#5ba9b34d,transparent 80%)}
[data-theme="dark"] :is(.stat,.rp-kpi):nth-child(4n+2){background-image:radial-gradient(ellipse at 100% 0%,#7b91bc3b,transparent 80%)}
[data-theme="dark"] :is(.stat,.rp-kpi):nth-child(4n+3){background-image:radial-gradient(ellipse at 100% 0%,#58b5b34a,transparent 80%)}
[data-theme="dark"] :is(.stat,.rp-kpi):nth-child(4n){background-image:radial-gradient(ellipse at 100% 0%,#9fa68a38,transparent 80%)}
[data-theme="dark"] :is(.stat-filter,.rp-kpi).active{border-color:#86d1cf;box-shadow:inset 0 3px 0 #86d1cf,0 8px 22px #0004}
[data-theme="dark"] :is(.stat-filter,.rp-kpi):hover{border-color:#86d1cf}
[data-theme="dark"] .stat span{color:#bbd1d6}
[data-theme="dark"] .detail-grid section{background:linear-gradient(150deg,#203d45,#192b32 75%);border-color:#38545e}
[data-theme="dark"] .topbar{background:#15272e;border-color:#36525c}
