:root {
  --bg: #050a12; --sidebar: #07101d; --card: #0c1727;
  --line: rgba(126, 170, 220, .14); --text: #f5f8fc; --muted: #8294ab;
  --blue: #2583ff; --blue-light: #54a4ff; --ok: #28c68a;
  --danger: #e24b5b; --warn: #f2b94b; --radius: 18px;
  --shadow: 0 20px 55px rgba(0, 0, 0, .28); --sidebar-w: 282px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
html { background: var(--bg); }
body {
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text); font-size: 16px; line-height: 1.5;
  background: radial-gradient(900px 500px at 80% -20%, rgba(24,107,222,.15), transparent 65%), linear-gradient(145deg, #050a12 0%, #07101c 55%, #050a12 100%);
}
button, input, textarea, select { font: inherit; }
a { color: var(--blue-light); text-decoration: none; }
a:hover { color: #86c0ff; }
.app-shell { display: flex; width: 100%; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); height: 100vh; padding: 22px 16px 18px; position: sticky; top: 0;
  flex-shrink: 0; overflow-y: auto; display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(8,19,34,.98), rgba(5,12,22,.99));
  border-right: 1px solid var(--line); box-shadow: 16px 0 42px rgba(0,0,0,.16); z-index: 40;
}
.sidebar .brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 22px; margin-bottom: 7px; border-bottom: 1px solid var(--line); }
.sidebar .brand .logo, .login-brand .logo, .showcase-mark {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 13px; display: grid; place-items: center;
  font-weight: 900; font-size: 14px; letter-spacing: -.03em; color: #fff;
  background: linear-gradient(145deg, #2583ff, #074899); border: 1px solid rgba(125,187,255,.42);
  box-shadow: 0 10px 26px rgba(37,131,255,.3), inset 0 1px 0 rgba(255,255,255,.2);
}
.sidebar .brand strong { display: block; font-size: 16px; letter-spacing: .015em; }
.sidebar .brand strong em { color: var(--blue-light); font-style: normal; font-size: 12px; margin-left: 3px; }
.sidebar .brand span { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.nav { flex: 1; }
.nav .section { color: #5f728b; font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; padding: 18px 12px 8px; }
.nav a { min-height: 46px; padding: 9px 11px; margin-bottom: 4px; border: 1px solid transparent; border-radius: 12px; display: flex; align-items: center; gap: 11px; color: #b8c6d8; font-size: 14px; font-weight: 550; transition: .18s ease; }
.nav a:hover { color: #fff; background: rgba(37,131,255,.09); }
.nav a.active { color: #fff; background: linear-gradient(90deg, rgba(37,131,255,.23), rgba(37,131,255,.06)); border-color: rgba(67,153,255,.2); box-shadow: inset 3px 0 0 var(--blue); }
.nav-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: #7fb7fa; background: rgba(42,130,236,.09); font-size: 15px; }
.nav a.active .nav-icon { color: #fff; background: rgba(48,143,255,.27); }
.sidebar-foot { padding: 16px 8px 0; margin-top: 20px; border-top: 1px solid var(--line); }
.system-status { display: flex; align-items: center; gap: 10px; padding: 10px 8px 13px; }
.system-status > span, .live-pill span, .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 5px rgba(40,198,138,.1), 0 0 16px rgba(40,198,138,.35); }
.system-status strong, .system-status small { display: block; }
.system-status strong { color: #d4deeb; font-size: 12px; }
.system-status small { color: var(--muted); font-size: 11px; }
.logout-link { display: flex; align-items: center; justify-content: space-between; padding: 10px; color: #8496ad; font-size: 13px; }
.logout-link:hover { color: #fff; }
.main { flex: 1; min-width: 0; }
.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(5,12,22,.78); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 30; }
.topbar h2 { margin: 0; font-size: 20px; line-height: 1.25; letter-spacing: -.02em; }
.topbar .meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 7px 11px 7px 7px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.018); }
.user-chip > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(145deg, #217be9, #0a4c9d); font-weight: 800; font-size: 13px; }
.user-chip small, .user-chip strong { display: block; line-height: 1.3; }
.user-chip small { color: var(--muted); font-size: 10px; }
.user-chip strong { font-size: 12px; font-weight: 650; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { display: none; width: auto; background: var(--card); border: 1px solid var(--line); color: #fff; border-radius: 10px; padding: 8px 11px; }
.content { width: 100%; max-width: 1680px; margin: 0 auto; padding: 28px 30px 44px; }
.welcome-strip { min-height: 144px; padding: 28px 30px; margin-bottom: 20px; border: 1px solid rgba(53,143,255,.2); border-radius: 22px; display: flex; align-items: center; justify-content: space-between; gap: 25px; background: linear-gradient(90deg, rgba(18,55,99,.58), rgba(8,23,41,.72)), radial-gradient(500px 140px at 78% 50%, rgba(31,121,255,.19), transparent 70%); box-shadow: var(--shadow); overflow: hidden; }
.eyebrow { margin: 0 0 7px; color: #64aaff; font-size: 11px; font-weight: 800; letter-spacing: .17em; }
.welcome-strip h3 { margin: 0; font-size: clamp(22px,3vw,31px); letter-spacing: -.035em; }
.welcome-strip p:not(.eyebrow) { margin: 7px 0 0; color: #9cafc5; font-size: 14px; }
.live-pill { padding: 9px 13px; border: 1px solid rgba(40,198,138,.2); border-radius: 999px; color: #bcf3df; background: rgba(40,198,138,.07); display: flex; align-items: center; gap: 9px; font-size: 12px; white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 20px; }
.stat { min-height: 132px; padding: 20px; display: flex; align-items: center; gap: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(15,30,50,.96), rgba(9,20,35,.96)); box-shadow: 0 12px 34px rgba(0,0,0,.15); transition: transform .18s ease, border-color .18s ease; }
.stat:hover { transform: translateY(-2px); border-color: rgba(65,151,255,.28); }
.stat-icon { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 14px; display: grid; place-items: center; color: #a8d1ff; background: linear-gradient(145deg, rgba(39,132,242,.25), rgba(30,91,165,.08)); border: 1px solid rgba(64,153,255,.18); }
.stat .label { color: #96a8bd; font-size: 12px; font-weight: 650; }
.stat .value { margin-top: 1px; font-size: 29px; font-weight: 800; line-height: 1.05; letter-spacing: -.04em; }
.stat small { color: #61748d; font-size: 11px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(300px,1fr)); gap: 18px; }
.card { padding: 22px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(13,26,44,.97), rgba(8,18,31,.98)); box-shadow: 0 15px 38px rgba(0,0,0,.17); }
.grid > .card { margin-bottom: 0; }
.grid + .card, .card + .card, .grid + .grid { margin-top: 18px; }
.card h3 { margin: 0 0 15px; font-size: 17px; letter-spacing: -.015em; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.card-heading > div > span { color: #599de8; font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.card-heading h3 { margin: 3px 0 0; }
.heading-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(37,131,255,.11); color: #70b1ff; }
.quick-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.quick-grid a { padding: 15px; display: grid; grid-template-columns: 33px 1fr; column-gap: 10px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.018); color: #edf5ff; transition: .18s ease; }
.quick-grid a:hover { background: rgba(37,131,255,.08); border-color: rgba(68,153,255,.3); transform: translateY(-1px); }
.quick-grid a > span { grid-row: span 2; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: rgba(37,131,255,.12); color: #78b5fb; }
.quick-grid strong { font-size: 13px; }
.quick-grid small { color: var(--muted); font-size: 11px; }
.status-list > div { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 13px; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.status-list > div:last-child { border-bottom: 0; }
.status-list strong, .status-list small { display: block; }
.status-list strong { font-size: 13px; }
.status-list small { color: var(--muted); font-size: 11px; }
.status-list b, .status-list a { color: #56dca9; font-size: 11px; font-weight: 650; }
.status-list a { color: #71b3ff; }
.status-dot.blue { background: var(--blue); box-shadow: 0 0 0 5px rgba(37,131,255,.1), 0 0 16px rgba(37,131,255,.35); }
label { display: block; margin: 13px 0 6px; color: #9bacbf; font-size: 13px; font-weight: 600; }
input, textarea, select { width: 100%; min-height: 44px; padding: 11px 13px; border: 1px solid rgba(126,170,220,.18); border-radius: 11px; outline: none; background: rgba(3,10,19,.64); color: #f7faff; transition: border-color .17s ease, box-shadow .17s ease, background .17s ease; }
input::placeholder, textarea::placeholder { color: #50637b; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); background: rgba(5,15,28,.92); box-shadow: 0 0 0 3px rgba(37,131,255,.12); }
input[type="file"] { padding: 8px; }
textarea { min-height: 100px; resize: vertical; }
.input-shell { position: relative; display: flex; align-items: center; }
.input-shell > span { position: absolute; left: 13px; color: #6383a8; z-index: 1; }
.input-shell > span + input { padding-left: 40px; }
.input-shell .password-toggle { position: absolute; right: 7px; width: auto; min-height: 32px; padding: 5px 8px; border: 0; background: transparent; color: #71a9e8; font-size: 11px; box-shadow: none; }
.input-shell input { padding-right: 62px; }
button, .btn, a.btn-link { min-height: 41px; width: auto; padding: 9px 15px; border: 1px solid transparent; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; color: #fff; background: linear-gradient(135deg, var(--blue), #1464ca); box-shadow: 0 8px 20px rgba(20,100,202,.2); font-weight: 700; font-size: 13px; transition: .17s ease; }
button:hover, .btn:hover, a.btn-link:hover { color: #fff; filter: brightness(1.08); transform: translateY(-1px); }
button.danger, .btn.danger { background: rgba(226,75,91,.14); border-color: rgba(226,75,91,.28); color: #ff9aa5; box-shadow: none; }
button.ghost, .btn.ghost, a.btn-link.ghost { background: rgba(255,255,255,.025); border-color: var(--line); color: #b8c7d9; box-shadow: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th { color: #7589a2; background: rgba(255,255,255,.018); font-size: 11px; font-weight: 750; letter-spacing: .055em; text-transform: uppercase; }
table tr:not(:first-child):hover td { background: rgba(37,131,255,.025); }
td form { margin: 0; }
td .btn-row { margin-top: 0; flex-wrap: nowrap; }
.muted { color: var(--muted); font-size: 13px; }
.err, .ok { padding: 12px 14px; margin-bottom: 16px; border-radius: 11px; font-size: 13px; }
.err { color: #ffabb4; background: rgba(226,75,91,.11); border: 1px solid rgba(226,75,91,.28); }
.ok { color: #a4f0d1; background: rgba(40,198,138,.1); border: 1px solid rgba(40,198,138,.25); }
code, .mono { padding: 3px 7px; border-radius: 6px; color: #bcd9fa; background: rgba(2,8,15,.7); font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: 12px; }
.badge { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px; font-size: 10px; font-weight: 750; background: rgba(37,131,255,.13); color: #8ac1ff; }
.badge.warn { background: rgba(242,185,75,.12); color: #ffd988; }
.badge.ok { margin: 0; background: rgba(40,198,138,.12); border: 0; color: #83e9c3; }
.info-note { margin-top: 18px; padding: 13px; display: flex; align-items: flex-start; gap: 10px; border: 1px solid rgba(37,131,255,.17); border-radius: 12px; background: rgba(37,131,255,.055); }
.info-note > span { width: 21px; height: 21px; flex: 0 0 21px; display: grid; place-items: center; border-radius: 50%; background: rgba(37,131,255,.18); color: #86bfff; font-size: 11px; font-weight: 800; }
.info-note p { margin: 0; color: #91a6bd; font-size: 12px; }
.check-list p { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); color: #9eb0c4; font-size: 13px; }
.check-list p:last-child { border-bottom: 0; }
.check-list span { color: var(--ok); margin-right: 8px; }
.three-fields { grid-template-columns: repeat(2,minmax(250px,1fr)); }
.three-fields > div:nth-child(3) { display: none; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: 12px; margin-top: 8px; }
.theme-grid-visual { grid-template-columns: repeat(auto-fit,minmax(225px,1fr)); gap: 15px; }
.theme-option, .theme-card { border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: rgba(3,10,19,.58); cursor: pointer; transition: .17s ease; }
.theme-card { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.theme-card:hover { border-color: rgba(65,151,255,.35); transform: translateY(-2px); }
.theme-card.active { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue), 0 14px 32px rgba(37,131,255,.16); }
.theme-card input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.theme-thumb { position: relative; overflow: hidden; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: 10px; background: #030810; }
.theme-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.theme-badge { position: absolute; top: 8px; right: 8px; padding: 4px 8px; border-radius: 999px; color: #fff; background: var(--blue); font-size: 10px; font-weight: 800; }
.theme-meta { display: flex; flex-direction: column; gap: 2px; }
.theme-meta strong { font-size: 13px; }
.preview-box { min-height: 130px; padding: 11px; margin-bottom: 14px; display: grid; place-items: center; overflow: hidden; border: 1px dashed rgba(126,170,220,.22); border-radius: 13px; background: rgba(3,10,19,.56); }
.preview-box.tall { min-height: 190px; }
.preview-img { max-width: 100%; max-height: 165px; object-fit: contain; display: block; }
.preview-img.bg { width: 100%; max-height: 210px; object-fit: cover; }
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(420px,1.15fr) minmax(430px,.85fr); background: #050a12; }
.login-showcase { position: relative; min-height: 100vh; padding: 8vw; display: flex; align-items: center; overflow: hidden; background: radial-gradient(circle at 28% 25%, rgba(40,132,255,.27), transparent 28%), radial-gradient(circle at 70% 78%, rgba(7,73,156,.3), transparent 32%), linear-gradient(145deg,#071426,#030810); border-right: 1px solid rgba(73,149,239,.17); }
.login-showcase::before, .login-showcase::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(73,149,239,.11); }
.login-showcase::before { width: 520px; height: 520px; left: -80px; bottom: -190px; box-shadow: 0 0 0 70px rgba(37,131,255,.018), 0 0 0 140px rgba(37,131,255,.012); }
.login-showcase::after { width: 270px; height: 270px; right: -100px; top: -70px; box-shadow: 0 0 0 55px rgba(37,131,255,.022); }
.showcase-content { position: relative; z-index: 1; max-width: 630px; }
.showcase-mark { width: 62px; height: 62px; margin-bottom: 33px; border-radius: 18px; font-size: 18px; }
.showcase-content h2 { margin: 0; font-size: clamp(38px,4.5vw,68px); line-height: 1.04; letter-spacing: -.055em; }
.showcase-content h2 span { color: #5ba7ff; }
.showcase-content > p:not(.eyebrow) { max-width: 540px; color: #8ea4bd; font-size: 16px; }
.showcase-points { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 30px; color: #6f87a2; font-size: 12px; }
.login-card { width: min(470px,calc(100% - 48px)); margin: auto; padding: 40px 36px; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(145deg,rgba(13,27,46,.94),rgba(7,16,28,.98)); box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 28px; }
.login-brand h1 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.login-brand h1 span { color: var(--blue-light); font-size: 13px; }
.login-brand p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.login-card label { margin-top: 16px; }
.login-action { margin-top: 24px; }
.login-action button { width: 100%; min-height: 47px; justify-content: space-between; padding-inline: 18px; }
.login-security { margin-top: 19px; padding-top: 17px; border-top: 1px solid var(--line); color: #657991; text-align: center; font-size: 11px; }
.login-security span { color: var(--ok); margin-right: 5px; }
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.65); backdrop-filter: blur(3px); z-index: 35; }
.overlay.show { display: block; }
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .login-page { grid-template-columns: 1fr 1fr; }
  .login-showcase { padding: 6vw; }
}
@media (max-width: 920px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-105%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: inline-flex; }
  .topbar { height: 74px; padding: 0 18px; }
  .content { padding: 20px 18px 35px; }
  .login-page { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(circle at 10% 10%,rgba(37,131,255,.22),transparent 32%),#050a12; }
  .login-showcase { display: none; }
  .login-card { width: min(470px,100%); margin: 0; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .topbar { padding: 0 12px; }
  .topbar h2 { font-size: 17px; }
  .topbar .meta { display: none; }
  .user-chip { border: 0; padding: 0; background: transparent; }
  .user-chip > div { display: none; }
  .content { padding: 15px 12px 28px; }
  .welcome-strip { min-height: 0; padding: 22px; align-items: flex-start; flex-direction: column; }
  .welcome-strip p:not(.eyebrow) { font-size: 13px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { min-height: 126px; padding: 15px; align-items: flex-start; flex-direction: column; gap: 9px; }
  .stat-icon { width: 36px; height: 36px; flex-basis: 36px; border-radius: 10px; }
  .stat .value { font-size: 24px; }
  .grid, .three-fields { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr; }
  .card { padding: 17px; border-radius: 15px; }
  .theme-grid-visual { grid-template-columns: 1fr; }
}

.banner-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.banner-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(3,10,19,.58);
}
.banner-thumb {
  height: 120px;
  background-size: cover;
  background-position: center;
  background-color: #030810;
}
.banner-meta { padding: 12px; }
.banner-meta strong { display: block; margin-bottom: 6px; }
.banner-meta .danger { width: 100%; margin-top: 8px; }

@media (max-width: 390px) { .stats { grid-template-columns: 1fr; } }
  .login-page { padding: 14px; }
  .login-card { padding: 29px 21px; border-radius: 18px; }
  .btn-row { align-items: stretch; }
  .btn-row > button, .btn-row > .btn, .btn-row > .btn-link { flex: 1 1 auto; }
  td .btn-row { flex-wrap: wrap; }
}
@media (max-width: 390px) { .stats { grid-template-columns: 1fr; } }
