:root {
  --p: #662c6c; --pd: #3b1f63; --pdd: #24123f; --bg: #f4f1f8; --card: #fff; --txt: #22202a; --mut: #6b667a;
  --line: #e3dced; --acc: #f2b705; --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: Inter, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--txt); line-height: 1.45; }
a { color: var(--p); }

/* ------------------------------------------------------------------ header */
.top { background: var(--pdd); color: #fff; display: flex; justify-content: space-between; align-items: center; padding: 10px 24px; border-bottom: 3px solid var(--p); }
.top .brand img { height: 44px; display: block; }
.top nav { display: flex; gap: 12px; align-items: center; }
.who { color: #cfc4e0; font-size: 14px; }
.wrap { max-width: 1180px; margin: 0 auto 28px; padding: 0 16px; }

/* ------------------------------------------------------------------ login */
body.login-page { background: var(--pdd); color: #fff; overflow-x: hidden; }
.hero-bg { position: fixed; inset: 0; background: url("/static/brand/bg-dicom.jpg") center / cover no-repeat; z-index: 0; }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(36,18,63,.35) 0%, rgba(20,10,35,.75) 70%, rgba(12,6,20,.9) 100%); }
.login-wrap { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; }
.glass { width: 100%; max-width: 440px; background: rgba(28, 14, 48, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.14); border-radius: 20px; padding: 32px 36px 28px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.login-logo { width: 100%; max-width: 330px; display: block; margin: 0 auto 22px; }
.glass h1 { margin: 0 0 6px; font-size: 22px; font-weight: 700; color: #fff; letter-spacing: .2px; }
.glass .lead { margin: 0 0 14px; font-size: 14px; color: #e9e2f3; }
.glass .muted { color: #b9add0; }
.glass label { display: block; margin: 12px 0 5px; font-weight: 600; font-size: 13px; color: #e9e2f3; }
.glass input { width: 100%; padding: 11px 13px; border: 1px solid rgba(255,255,255,.22); border-radius: 10px; font-size: 15px; background: rgba(255,255,255,.08); color: #fff; outline: none; }
.glass input:focus { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(242,183,5,.25); }
.glass button.primary { width: 100%; margin-top: 18px; padding: 12px; font-size: 15px; background: linear-gradient(135deg, #7a3c8f, var(--p)); border: none; }
.glass .alert { background: rgba(255, 86, 86, .15); color: #ffd3d3; border-color: rgba(255,120,120,.4); }
.login-foot { position: relative; z-index: 1; color: #b9add0; font-size: 12px; margin-top: 18px; text-align: center; }

/* ------------------------------------------------------------------ dashboard hero */
.hero { margin: 0 -16px 22px; padding: 34px 16px; color: #fff; background: var(--pdd) url("/static/brand/bg-dicom.jpg") center / cover no-repeat; position: relative; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(36,18,63,.92) 0%, rgba(59,31,99,.80) 55%, rgba(102,44,108,.55) 100%); }
.hero-inner { position: relative; max-width: 1148px; margin: 0 auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.eyebrow { text-transform: uppercase; letter-spacing: 3px; font-size: 11px; color: var(--acc); font-weight: 700; margin-bottom: 6px; }
.hero h1 { margin: 0; font-size: 28px; font-weight: 700; color: #fff; }
.hero-note { margin: 8px 0 0; color: #e9e2f3; max-width: 640px; }
.hero-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.stat { background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.18); border-radius: 12px; padding: 10px 16px; min-width: 110px; backdrop-filter: blur(6px); }
.stat .n { font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat .n.small { font-size: 17px; }
.stat .l { font-size: 11px; color: #d9cfe6; text-transform: uppercase; letter-spacing: 1px; }

/* ------------------------------------------------------------------ cards / tables */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; box-shadow: 0 6px 24px rgba(59,31,99,.07); margin-top: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.card-head h2 { margin: 0; font-size: 18px; color: var(--pd); }
h1 { margin: 0 0 12px; color: var(--pd); font-size: 24px; }
label { display: block; margin: 12px 0 4px; font-weight: 600; font-size: 14px; }
input { width: 100%; padding: 10px 12px; border: 1px solid #c9bfd9; border-radius: 8px; font-size: 15px; }
form.inline { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; align-items: center; }
form.inline input { width: auto; flex: 1; min-width: 160px; }
button, .btn { display: inline-block; padding: 9px 14px; border-radius: 9px; border: 1px solid #c9bfd9; background: #faf8fd; color: var(--pd); font-weight: 600; text-decoration: none; cursor: pointer; font-size: 14px; line-height: 1.2; }
button:hover, .btn:hover { background: #f1ecf8; }
button.primary, .btn.primary { background: var(--p); color: #fff; border-color: var(--p); }
button.primary:hover, .btn.primary:hover { background: #7a3c8f; }
.btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.btn.ghost:hover { background: rgba(255,255,255,.1); }
button.small { padding: 4px 8px; font-size: 12px; }
button.danger { color: #a4262c; border-color: #e0b4b7; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #efeaf6; color: var(--pd); font-weight: 700; font-size: 12px; }
.muted { color: var(--mut); }
.small { font-size: 12px; }
.alert { background: #fdecea; color: #8a1c1c; border: 1px solid #f5c2c0; padding: 10px 12px; border-radius: 8px; margin: 10px 0; }
.alert.ok { background: #e8f6ea; color: #1d5b28; border-color: #bfe3c5; }
table.list { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
table.list th { text-align: left; color: var(--pd); background: #efeaf6; padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
table.list td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:hover td { background: #faf8fd; }
table.list tr.inactive td { color: #999; }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn { margin-left: 4px; }
.foot { text-align: center; color: var(--mut); font-size: 12px; padding: 20px 16px 28px; }
.foot .credits { margin-top: 4px; color: #9a92a8; }
@media (max-width: 760px) {
  .card { padding: 16px; }
  td.actions { white-space: normal; text-align: left; }
  td.actions .btn { display: block; margin: 4px 0; text-align: center; }
  .top { padding: 8px 12px; } .top .brand img { height: 36px; }
  .glass { padding: 24px 20px; }
}
