:root {
  color-scheme: dark;
  --bg: #070b16;
  --bg2: #0b1224;
  --panel: rgba(148, 163, 216, 0.055);
  --panel-solid: #101830;
  --border: rgba(148, 163, 216, 0.14);
  --border-strong: rgba(148, 163, 216, 0.28);
  --text: #e9edfb;
  --muted: #8e9bc0;
  --accent: #6d7cff;
  --accent-2: #22d3ee;
  --ok: #34d399;
  --ok-bg: rgba(52, 211, 153, 0.12);
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.12);
  --bad: #fb7185;
  --bad-bg: rgba(251, 113, 133, 0.13);
  --info: #60a5fa;
  --info-bg: rgba(96, 165, 250, 0.12);
  --radius: 20px;
  --shadow: 0 18px 50px rgba(2, 6, 20, 0.45);
  --grad: linear-gradient(135deg, #6d7cff 0%, #8b5cf6 55%, #22d3ee 130%);
}

html[data-theme="light"] {
  --bg: #eef1fa;
  --bg2: #e4eaf7;
  --panel: rgba(255, 255, 255, 0.75);
  --panel-solid: #ffffff;
  --border: rgba(38, 54, 110, 0.12);
  --border-strong: rgba(38, 54, 110, 0.25);
  --text: #17203a;
  --muted: #5a6684;
  --shadow: 0 16px 40px rgba(23, 32, 58, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(1200px 800px at 80% -10%, var(--bg2), var(--bg)); }
.bg i { position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.45; }
.bg i:nth-child(1) { width: 520px; height: 520px; background: #3730a3; top: -180px; left: -140px; animation: drift1 20s ease-in-out infinite alternate; }
.bg i:nth-child(2) { width: 420px; height: 420px; background: #0e7490; bottom: -160px; right: -120px; animation: drift2 24s ease-in-out infinite alternate; }
.bg i:nth-child(3) { width: 320px; height: 320px; background: #6d28d9; top: 40%; left: 55%; animation: drift3 28s ease-in-out infinite alternate; }
html[data-theme="light"] .bg i { opacity: 0.22; }

@keyframes drift1 { to { transform: translate(90px, 70px) scale(1.12); } }
@keyframes drift2 { to { transform: translate(-80px, -60px) scale(1.08); } }
@keyframes drift3 { to { transform: translate(-70px, 50px); } }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.txt-bad { color: var(--bad); }
.txt-warn { color: var(--warn); }
.sm-text { font-size: 12.5px; }

.ic { flex-shrink: 0; vertical-align: -3px; }

a { color: var(--accent-2); text-decoration: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--grad); color: #fff; border: 0; border-radius: 12px;
  padding: 11px 18px; font: 600 14px 'Inter', sans-serif; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 8px 22px rgba(109, 124, 255, 0.32);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(109, 124, 255, 0.42); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: transparent; border: 1px solid var(--border-strong); color: var(--text); box-shadow: none; }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); box-shadow: none; }
.btn.danger { background: linear-gradient(135deg, #f43f5e, #fb7185); box-shadow: 0 8px 22px rgba(244, 63, 94, 0.3); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }

.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--border);
  background: transparent; color: var(--text); cursor: pointer; transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn.danger:hover { border-color: var(--bad); color: var(--bad); }

.link-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--accent-2); padding: 6px 12px; border: 1px solid var(--border); border-radius: 10px; transition: border-color 0.15s; }
.link-btn:hover { border-color: var(--accent-2); }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); border: 1px solid var(--border); padding: 5px 11px; border-radius: 999px; white-space: nowrap; }
.chip b { color: var(--text); }
.chip.sm { padding: 3px 9px; font-size: 11.5px; }

.badge { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.muted { background: var(--panel); color: var(--muted); border: 1px solid var(--border); }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  padding: 22px;
}

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h3 { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 700; }
.card-head h3 .ic { color: var(--accent); }

.form { display: flex; flex-direction: column; gap: 14px; }
.form label, .field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }

input, select {
  background: rgba(148, 163, 216, 0.07);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 13px;
  color: var(--text);
  font: 500 14px 'Inter', sans-serif;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
html[data-theme="light"] input, html[data-theme="light"] select { background: #fff; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(109, 124, 255, 0.18); }
input::placeholder { color: var(--muted); opacity: 0.65; }
select option { background: var(--panel-solid); color: var(--text); }
input[type="date"] { color-scheme: dark; }
html[data-theme="light"] input[type="date"] { color-scheme: light; }

.form-error { color: var(--bad); font-size: 13px; font-weight: 600; min-height: 0; }
.form-error:empty { display: none; }

.tabs { display: flex; gap: 6px; background: var(--panel); border: 1px solid var(--border); border-radius: 13px; padding: 5px; margin-bottom: 20px; }
.tab { flex: 1; border: 0; background: transparent; color: var(--muted); font: 600 14px 'Inter', sans-serif; padding: 9px; border-radius: 9px; cursor: pointer; transition: all 0.2s; }
.tab.active { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(109, 124, 255, 0.35); }

.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 40px; max-width: 1150px; margin: 0 auto; padding: 40px 28px; }
.auth-brand { animation: fadeUp 0.5s ease both; }
.brand-row { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; letter-spacing: 0.2px; margin-bottom: 22px; }
.brand-row .ic { color: var(--accent-2); }
.auth-brand h1 { font-size: clamp(30px, 4vw, 46px); font-weight: 800; line-height: 1.12; letter-spacing: -0.5px; margin-bottom: 16px; }
.auth-brand .lead { color: var(--muted); font-size: 16.5px; max-width: 480px; margin-bottom: 26px; }
.feature-list { list-style: none; display: flex; flex-direction: column; gap: 13px; margin-bottom: 28px; }
.feature-list li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; font-weight: 500; }
.feature-list .ic { color: var(--accent-2); }
.auth-note { font-size: 13px; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 12px; padding: 12px 15px; width: fit-content; }
.auth-note code { color: var(--accent-2); font-weight: 600; }
.auth-card { max-width: 460px; width: 100%; justify-self: center; animation: fadeUp 0.55s 0.08s ease both; }
.auth-card .form .btn { margin-top: 4px; }

.topbar {
  position: sticky; top: var(--alert-h, 0px); z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 28px;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.topbar .brand-row { margin: 0; font-size: 18px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px; color: var(--muted); max-width: 200px; overflow: hidden; }
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bell-wrap { position: relative; }
.badge-dot {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px;
  background: linear-gradient(135deg, #f43f5e, #fb7185); color: #fff;
  font: 700 10.5px 'Inter', sans-serif; font-style: normal;
  border-radius: 999px; display: grid; place-items: center; padding: 0 5px;
  box-shadow: 0 4px 10px rgba(244, 63, 94, 0.45);
}
.bell-menu {
  position: absolute; right: 0; top: 46px; width: 360px; max-width: 88vw;
  background: var(--panel-solid); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); overflow: hidden; z-index: 50; animation: fadeUp 0.18s ease both;
}
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.bell-list { max-height: 340px; overflow-y: auto; }
.bell-item { padding: 11px 16px; border-bottom: 1px solid var(--border); }
.bell-item.unread { background: rgba(109, 124, 255, 0.07); }
.bell-item b { font-size: 13.5px; }
.bell-item p { font-size: 12.5px; color: var(--muted); margin: 3px 0; }
.bell-item time { font-size: 11.5px; color: var(--muted); }
.bell-all { display: block; text-align: center; padding: 11px; font-size: 13px; font-weight: 600; }

.page { max-width: 1180px; margin: 0 auto; padding: 26px 28px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.3px; }
.page-head .sub { color: var(--muted); font-size: 13.5px; }
.page-sub { margin: -8px 0 16px; font-size: 13.5px; max-width: 720px; }

.banner {
  display: flex; align-items: center; gap: 14px;
  border-radius: 16px; padding: 15px 18px; margin-bottom: 18px;
  border: 1px solid; animation: fadeUp 0.3s ease both;
}
.banner .ic { flex-shrink: 0; }
.banner div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.banner b { font-size: 14.5px; }
.banner span { font-size: 13px; opacity: 0.85; }
.banner.warn { background: var(--warn-bg); border-color: rgba(251, 191, 36, 0.35); color: var(--warn); }
.banner.warn b, .banner.warn span { color: var(--warn); }
.banner.bad { background: var(--bad-bg); border-color: rgba(251, 113, 133, 0.35); color: var(--bad); }
.banner.bad b, .banner.bad span { color: var(--bad); }
.banner.info { background: var(--info-bg); border-color: rgba(96, 165, 250, 0.35); color: var(--info); }
.banner.info b, .banner.info span { color: var(--info); }
.banner .btn { color: #fff; }

.grid { display: grid; gap: 18px; }
.cabinet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: 1 / -1; }
.two-col { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.hero { grid-column: 1 / -1; display: flex; align-items: center; gap: 30px; background: linear-gradient(120deg, rgba(109, 124, 255, 0.14), rgba(34, 211, 238, 0.06) 60%), var(--panel); }
.hero-info { flex: 1; min-width: 0; }
.hero-info h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.4px; margin: 10px 0 4px; }
.hero-info .sub { color: var(--muted); font-size: 14.5px; margin-bottom: 18px; }
.hero-meta { display: flex; gap: 30px; flex-wrap: wrap; }
.meta-item { display: flex; flex-direction: column; gap: 2px; }
.meta-item span { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
.meta-item b { font-size: 16px; }

.ring { position: relative; width: 148px; height: 148px; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 11; }
.ring-bg { stroke: var(--border); }
.ring-fg { stroke: var(--rc, var(--accent)); stroke-linecap: round; transition: stroke-dashoffset 0.7s ease; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-center b { font-size: 34px; font-weight: 800; line-height: 1; }
.ring-center span { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip-btn {
  border: 1px solid var(--border-strong); background: transparent; color: var(--text);
  font: 600 13.5px 'Inter', sans-serif; padding: 9px 15px; border-radius: 11px; cursor: pointer;
  transition: all 0.15s;
}
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }
.chip-btn.active { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 16px rgba(109, 124, 255, 0.35); }

.stepper { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.stepper button {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: transparent; color: var(--text); font-size: 18px; cursor: pointer; transition: all 0.15s;
}
.stepper button:hover { border-color: var(--accent); color: var(--accent); }
.stepper b { min-width: 84px; text-align: center; font-size: 15px; }
.stepper .muted { font-size: 12px; }

.pay-total { display: flex; align-items: center; justify-content: space-between; border-top: 1px dashed var(--border-strong); margin-top: 4px; padding-top: 14px; margin-bottom: 14px; }
.pay-total span { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.pay-total b { font-size: 24px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.hint { font-size: 12px; color: var(--muted); margin-top: 12px; }
.hint-list { list-style: none; display: flex; flex-direction: column; gap: 12px; color: var(--muted); font-size: 13.5px; }
.hint-list li { padding-left: 18px; position: relative; }
.hint-list li::before { content: ''; position: absolute; left: 0; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--grad); }

.notif-list { display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; }
.notif { display: flex; gap: 13px; padding: 13px 4px; border-bottom: 1px solid var(--border); border-radius: 10px; transition: background 0.2s; }
.notif:last-child { border-bottom: 0; }
.notif.unread { background: rgba(109, 124, 255, 0.06); }
.notif-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--info-bg); color: var(--info); flex-shrink: 0; }
.notif.type-warning .notif-ic, .notif-ic.warn { background: var(--warn-bg); color: var(--warn); }
.notif.type-danger .notif-ic, .notif-ic.bad { background: var(--bad-bg); color: var(--bad); }
.notif.type-success .notif-ic, .notif-ic.ok { background: var(--ok-bg); color: var(--ok); }
.notif-ic.muted { background: var(--panel); color: var(--muted); border: 1px solid var(--border); }
.notif-body { flex: 1; min-width: 0; }
.notif-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.notif-top b { font-size: 14px; }
.notif-top time { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.notif-body p { font-size: 13px; color: var(--muted); margin-top: 3px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 6px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--border);
  background: rgba(148, 163, 216, 0.05); white-space: nowrap;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: rgba(109, 124, 255, 0.05); }
.row-blocked { opacity: 0.55; }
.sub-name { display: flex; flex-direction: column; }
.sub-name span { font-size: 12px; }
.row-actions { display: flex; gap: 5px; }
.row-actions .icon-btn { width: 32px; height: 32px; border-radius: 9px; }

.empty { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); padding: 34px 16px; font-size: 14px; }
.empty .ic { opacity: 0.5; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; backdrop-filter: blur(10px); }
.stat span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); }
.stat b { display: block; font-size: 30px; font-weight: 800; margin-top: 4px; }
.stat.ok b { color: var(--ok); }
.stat.warn b { color: var(--warn); }
.stat.bad b { color: var(--bad); }
.stat.muted b { color: var(--muted); }

.chart { display: flex; gap: 16px; align-items: flex-end; height: 190px; padding-top: 12px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.chart-bar-wrap { flex: 1; width: 100%; max-width: 46px; display: flex; align-items: flex-end; }
.chart-bar { width: 100%; background: var(--grad); border-radius: 8px; min-height: 4px; transition: height 0.6s ease; opacity: 0.92; }
.chart-col span { font-size: 12px; color: var(--muted); font-weight: 600; }
.chart-col b { font-size: 11.5px; color: var(--text); font-weight: 700; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 9px; border: 1px solid var(--border); border-radius: 12px; padding: 9px 13px; background: var(--panel); min-width: 260px; }
.search input { border: 0; background: transparent; padding: 0; box-shadow: none; }
.search input:focus { box-shadow: none; }
.search .ic { color: var(--muted); }

.admin-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 242px; flex-shrink: 0; padding: 22px 16px;
  display: flex; flex-direction: column; gap: 24px;
  background: color-mix(in srgb, var(--bg2) 72%, transparent);
  border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand-row { font-size: 18px; margin: 0 8px; }
.side-nav { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.side-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 12px;
  color: var(--muted); font-size: 14px; font-weight: 600; transition: all 0.15s; border: 1px solid transparent;
}
.side-link:hover { color: var(--text); background: var(--panel); }
.side-link.active { color: #fff; background: var(--grad); box-shadow: 0 8px 20px rgba(109, 124, 255, 0.3); }
.side-foot { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--border); padding-top: 16px; }
.side-foot .side-link { flex: 1; }
.admin-main { flex: 1; padding: 26px 30px 60px; min-width: 0; max-width: 1220px; }

.admin-alert {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 22px;
  background: linear-gradient(115deg, #f59e0b 0%, #f43f5e 100%);
  color: #fff;
  box-shadow: 0 12px 34px rgba(244, 63, 94, 0.45);
  animation: alertIn 0.35s ease both;
}
.alert-ic {
  position: relative; width: 42px; height: 42px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.2); display: grid; place-items: center; flex-shrink: 0;
}
.alert-ic::after {
  content: ''; position: absolute; inset: 0; border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.55); animation: alertPulse 1.8s ease-out infinite;
}
.alert-body { flex: 1; min-width: 0; }
.alert-body b { font-size: 14.5px; }
.alert-body p { font-size: 13px; opacity: 0.95; margin-top: 1px; }
.alert-actions { display: flex; gap: 8px; flex-shrink: 0; }
.alert-actions .btn { background: rgba(255, 255, 255, 0.22); border: 1px solid rgba(255, 255, 255, 0.5); color: #fff; box-shadow: none; }
.alert-actions .btn:hover { background: rgba(255, 255, 255, 0.32); box-shadow: none; transform: none; }
body.has-admin-alert { padding-top: var(--alert-h, 64px); }
@keyframes alertIn { from { transform: translateY(-110%); } to { transform: none; } }
@keyframes alertPulse { 0% { transform: scale(1); opacity: 0.9; } 100% { transform: scale(1.5); opacity: 0; } }

.notif.type-admin .notif-ic { background: linear-gradient(135deg, #f59e0b, #f43f5e); color: #fff; }

#toasts { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 380px;
  background: var(--panel-solid); border: 1px solid var(--border); border-radius: 14px;
  padding: 13px 16px; font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow); animation: slideIn 0.25s ease both;
}
.toast.ok .ic { color: var(--ok); }
.toast.bad .ic { color: var(--bad); }
.toast.info .ic { color: var(--info); }
.toast.hide { animation: slideOut 0.3s ease both; }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideOut { to { transform: translateX(40px); opacity: 0; } }
@keyframes fadeUp { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

.overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(4, 8, 20, 0.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fadeUp 0.15s ease both; padding: 20px;
}
.modal {
  width: min(540px, 94vw); max-height: 90vh; overflow-y: auto;
  background: var(--panel-solid); border: 1px solid var(--border); border-radius: 20px;
  padding: 26px; box-shadow: var(--shadow); animation: fadeUp 0.2s ease both;
}
.modal h3 { font-size: 19px; font-weight: 800; margin-bottom: 14px; }
.modal-text { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.modal .pay-total { margin-top: 16px; }

.loading { padding: 60px; text-align: center; color: var(--muted); font-weight: 600; }

@media (max-width: 1000px) {
  .auth-wrap { grid-template-columns: 1fr; gap: 24px; padding-top: 20px; }
  .auth-card { justify-self: stretch; max-width: none; }
  .cabinet-grid { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items: flex-start; }
  .admin-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 12px; padding: 14px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar .brand-row { margin: 0; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { border-top: 0; padding-top: 0; margin-left: auto; }
  .topbar { padding: 10px 16px; }
  .page { padding: 20px 16px 50px; }
  .admin-main { padding: 20px 16px 50px; }
  .search { min-width: 0; flex: 1; }
  .admin-alert { flex-wrap: wrap; padding: 12px 16px; }
  .alert-actions { width: 100%; justify-content: flex-end; }
}
