:root {
  --bg: #05070d;
  --panel: #0d1220;
  --panel-2: #121a2d;
  --line: #1f2a44;
  --text: #e8ecf6;
  --muted: #8b96b3;
  --blue: #3d6bff;
  --blue-2: #5b8cff;
  --green: #2fbf71;
  --red: #ff5d6c;
  --amber: #f2b33d;
  --radius: 12px;
  font-family: Inter, Segoe UI, Roboto, system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  background-image: radial-gradient(rgba(61, 107, 255, 0.18) 1px, transparent 1px),
    radial-gradient(ellipse at 70% 110%, rgba(61, 107, 255, 0.28), transparent 60%);
  background-size: 18px 18px, 100% 100%;
  background-attachment: fixed;
  color: var(--text);
  font-size: 14px;
}
[hidden] { display: none !important; }
a { color: var(--blue-2); }
h1, h2, h3 { margin: 0; font-weight: 600; }

/* Brand */
.brand { display: flex; gap: 10px; align-items: center; }
.brand b { display: block; font-size: 18px; letter-spacing: 0.5px; }
.brand small { display: block; color: var(--muted); font-size: 11px; }
.logo {
  width: 36px; height: 36px; border-radius: 9px; display: block; flex: none;
  border: 1px solid #2b3245; box-shadow: 0 0 18px rgba(61, 107, 255, 0.18);
}
.brand.big .logo { width: 56px; height: 56px; border-radius: 13px; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-panel {
  width: 100%; max-width: 940px; display: grid; grid-template-columns: 1.05fr 1fr;
  border: 1px solid var(--line); border-radius: 24px; overflow: hidden;
  background: rgba(9, 13, 24, 0.9); backdrop-filter: blur(6px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(91, 140, 255, 0.04) inset;
}
.login-hero {
  position: relative; overflow: hidden; padding: 44px 40px; display: flex; flex-direction: column; gap: 26px;
  background: linear-gradient(160deg, #0b1124 0%, #060912 60%);
  border-right: 1px solid var(--line);
}
.login-hero::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(91, 140, 255, 0.35) 1px, transparent 1px);
  background-size: 16px 16px;
  mask-image: radial-gradient(ellipse at 50% 100%, #000 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 100%, #000 10%, transparent 70%);
}
.hero-glow {
  position: absolute; width: 420px; height: 420px; left: 50%; bottom: -230px; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(61, 107, 255, 0.55), rgba(61, 107, 255, 0) 65%); filter: blur(10px);
}
.hero-logo {
  position: relative; width: 150px; height: 150px; object-fit: contain; margin-top: 8px;
  filter: drop-shadow(0 12px 30px rgba(91, 140, 255, 0.35)) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.6));
}
.hero-text { position: relative; }
.hero-title { font-size: 44px; font-weight: 700; letter-spacing: -1px; line-height: 1; }
.hero-tag { margin: 8px 0 0; color: var(--muted); font-size: 14px; letter-spacing: 0.3px; }
.hero-points { position: relative; list-style: none; padding: 0; margin: auto 0 0; display: grid; gap: 12px; color: #c6cee2; font-size: 13.5px; }
.hero-points li { display: flex; gap: 10px; align-items: center; }
.hero-points .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue-2); box-shadow: 0 0 10px var(--blue-2); flex: none; }

.login-form { padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; gap: 20px; }
.login-mobile-brand { display: none; align-items: center; gap: 10px; font-size: 20px; }
.login-mobile-brand img { width: 40px; height: 40px; border-radius: 10px; }
.eyebrow { margin: 0 0 6px; color: var(--blue-2); font-size: 12px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; }
.login-title { font-size: 28px; font-weight: 650; letter-spacing: -0.4px; }
.login-sub { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.field { gap: 8px; color: #b9c2d8; font-size: 13px; font-weight: 500; }
.input-wrap { position: relative; display: block; }
.input-wrap svg { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-wrap input { height: 48px; padding-left: 42px; border-radius: 12px; background: #0f1628; font-size: 14.5px; transition: border-color 0.15s, box-shadow 0.15s; }
.input-wrap input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(61, 107, 255, 0.18); }
.input-wrap input:focus ~ svg, .input-wrap:focus-within svg { color: var(--blue-2); }
.input-wrap input[name='password'] { padding-right: 70px; }
.pw-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: transparent; border: 0;
  color: var(--blue-2); font: 600 12.5px inherit; font-family: inherit; padding: 6px 8px; border-radius: 6px; cursor: pointer;
}
.pw-toggle:hover { background: rgba(91, 140, 255, 0.12); }
.login-btn {
  height: 50px; border-radius: 12px; font-size: 15px; margin-top: 4px;
  background: linear-gradient(180deg, #5b8cff, #3d6bff); box-shadow: 0 10px 26px rgba(61, 107, 255, 0.35);
}
.login-btn:hover { filter: brightness(1.08); }
.login-form .form-error { background: rgba(255, 93, 108, 0.1); border: 1px solid rgba(255, 93, 108, 0.35); padding: 10px 12px; border-radius: 10px; }
.login-foot { margin: 6px 0 0; color: #5f6a86; font-size: 11.5px; text-align: center; }

@media (max-width: 820px) {
  .login-panel { grid-template-columns: minmax(0, 1fr); max-width: 440px; }
  .login-hero { display: none; }
  .login-form { padding: 32px 24px; }
  .login-mobile-brand { display: flex; }
}

/* Shell */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.sidebar {
  background: rgba(10, 14, 26, 0.95); border-right: 1px solid var(--line); padding: 18px 14px;
  display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh;
}
#nav { display: grid; gap: 2px; }
#nav a {
  color: var(--muted); text-decoration: none; padding: 9px 12px; border-radius: 8px;
  display: flex; justify-content: space-between; align-items: center;
}
#nav a:hover { color: var(--text); background: var(--panel-2); }
#nav a.active { color: #fff; background: rgba(61, 107, 255, 0.18); box-shadow: inset 3px 0 0 var(--blue); }
.sidebar-foot { margin-top: auto; display: grid; gap: 8px; color: var(--muted); font-size: 12px; }
main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 28px 6px; }
.topbar h2 { font-size: 20px; }
.menu-btn { display: none; }
.page { padding: 16px 28px 40px; display: grid; gap: 18px; max-width: 1200px; }

/* Cards & layout */
.card { background: rgba(13, 18, 32, 0.92); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h3 { font-size: 15px; margin-bottom: 12px; }
.card .hint { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin: 0 0 12px; }
.grid { display: grid; gap: 14px; }
.tiles { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.two { grid-template-columns: 1fr 1fr; }
.tile { background: rgba(13, 18, 32, 0.92); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile .label { color: var(--muted); font-size: 12px; }
.tile .value { font-size: 26px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* Forms */
label { display: grid; gap: 6px; color: var(--muted); font-size: 12.5px; }
input, textarea, select {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 8px;
  padding: 9px 11px; font: inherit; width: 100%;
}
textarea { min-height: 90px; resize: vertical; line-height: 1.45; }
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(61, 107, 255, 0.55); border-color: var(--blue); }
.check { display: flex; flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.check input { width: auto; }
.form { display: grid; gap: 14px; }
.form-error { color: var(--red); margin: 0; font-size: 13px; }

/* Buttons */
.btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text); padding: 9px 14px;
  border-radius: 8px; font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #33405f; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-2); }
.btn.danger { color: var(--red); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 10px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: default; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.mono { white-space: nowrap; }
.actions { display: flex; gap: 6px; justify-content: flex-end; }
tr:last-child td { border-bottom: 0; }
.empty { color: var(--muted); text-align: center; padding: 26px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.pill.green { color: var(--green); border-color: rgba(47, 191, 113, 0.4); }
.pill.red { color: var(--red); border-color: rgba(255, 93, 108, 0.4); }
.pill.amber { color: var(--amber); border-color: rgba(242, 179, 61, 0.4); }
.pill.blue { color: var(--blue-2); border-color: rgba(91, 140, 255, 0.4); }
.badge { background: var(--blue); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; color: var(--muted); }

/* Bar chart */
.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; align-items: end; height: 150px; }
.bar-col { display: grid; gap: 4px; align-items: end; height: 100%; grid-template-rows: 1fr auto; }
.bar { background: linear-gradient(180deg, var(--blue-2), var(--blue)); border-radius: 4px 4px 0 0; min-height: 2px; align-self: end; position: relative; }
.bar:hover::after {
  content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  background: #000; border: 1px solid var(--line); padding: 3px 7px; border-radius: 6px; font-size: 11px; white-space: nowrap; margin-bottom: 4px;
}
.bar-label { font-size: 10.5px; color: var(--muted); text-align: center; }

/* Preview */
.sms-preview {
  background: #0b1a12; border: 1px solid #1d3a2a; border-radius: 12px; padding: 12px 14px; line-height: 1.5;
  font-size: 13.5px; white-space: pre-wrap; word-break: break-word;
}
.notice { border-left: 3px solid var(--amber); background: rgba(242, 179, 61, 0.08); padding: 10px 12px; border-radius: 6px; font-size: 12.5px; line-height: 1.5; }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); display: grid; place-items: center; padding: 16px; z-index: 20; }
.modal { width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; }

/* Toast */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #10182b; border: 1px solid var(--line);
  padding: 10px 16px; border-radius: 10px; z-index: 30; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); max-width: calc(100vw - 32px);
}
.toast.error { border-color: rgba(255, 93, 108, 0.6); color: #ffd0d5; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 15; width: 240px; transform: translateX(-100%); transition: transform 0.2s; }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-block; }
  .topbar { padding: 14px 16px 4px; }
  .page { padding: 12px 16px 32px; }
  .two { grid-template-columns: 1fr; }
}

/* ---------- Icons & nav ---------- */
.ic { width: 18px; height: 18px; flex: none; }
#nav a { justify-content: flex-start; gap: 11px; font-weight: 500; }
#nav a .badge { margin-left: auto; }
#nav a.active .ic { color: var(--blue-2); }
.me-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.me-avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(145deg, #5b8cff, #2a4fd6); color: #fff; font-weight: 700; font-size: 13px;
}
.me-text { display: grid; min-width: 0; }
.me-text b { color: var(--text); font-size: 13px; }
.me-text small { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn .ic { width: 15px; height: 15px; vertical-align: -3px; margin-right: 4px; }
.small { font-size: 12.5px; }

/* =====================================================================
   Light admin theme (after login). Login screen keeps the dark theme.
   ===================================================================== */
body.app-light {
  --bg: #f5f6fb;
  --panel: #ffffff;
  --panel-2: #f5f5fb;
  --line: #e8e8f3;
  --text: #1d1f3d;
  --muted: #6f7392;
  --blue: #6d4cff;
  --blue-2: #7c5cff;
  --green: #1ea672;
  --red: #e5484d;
  --amber: #d98410;
  color-scheme: light;
  background: var(--bg);
  background-image: none;
  color: var(--text);
}
body.app-light a { color: var(--blue); }

/* Cards / generic surfaces */
body.app-light .card,
body.app-light .tile {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 1px 2px rgba(29, 31, 61, 0.04), 0 10px 30px rgba(76, 64, 160, 0.06);
}
body.app-light .card h3 { color: var(--text); }
body.app-light input, body.app-light textarea, body.app-light select {
  background: #fff; border: 1px solid var(--line); color: var(--text); border-radius: 10px;
}
body.app-light input:focus, body.app-light textarea:focus, body.app-light select:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(109, 76, 255, 0.14);
}
body.app-light label { color: #555a7a; }
body.app-light .check { color: var(--text); }
body.app-light .btn { background: #fff; border: 1px solid var(--line); color: var(--text); border-radius: 10px; }
body.app-light .btn:hover { border-color: #cfc8f5; }
body.app-light .btn.primary {
  background: linear-gradient(135deg, #7c5cff, #5b3fe0); border-color: transparent; color: #fff;
  box-shadow: 0 8px 18px rgba(109, 76, 255, 0.28);
}
body.app-light .btn.danger { color: var(--red); }
body.app-light th { color: #8a8eaa; }
body.app-light td { color: var(--text); }
body.app-light .pill { background: #f4f4fa; }
body.app-light .sms-preview { background: #effaf4; border-color: #cdeedb; color: #173a29; }
body.app-light .notice { background: #fff7e8; border-left-color: #f2a93b; color: #5d4518; }
body.app-light .toast { background: #1d1f3d; color: #fff; border-color: transparent; }
body.app-light .toast.error { background: #b4232c; color: #fff; }
body.app-light .modal-back { background: rgba(29, 31, 61, 0.45); }
body.app-light .badge { background: #ff5b7d; }
body.app-light .pager { color: var(--muted); }

/* Sidebar */
body.app-light .sidebar {
  background: linear-gradient(180deg, #1f1a4f 0%, #241c5c 55%, #2b2170 100%);
  border-right: 0; color: #d8d4ff; overflow: hidden; padding: 22px 16px;
}
body.app-light .sidebar .brand b { color: #fff; font-size: 24px; letter-spacing: 0; }
body.app-light .sidebar .brand small { color: #b3acec; font-size: 12.5px; }
body.app-light .sidebar .logo { width: 52px; height: 52px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: none; }
body.app-light #nav { gap: 6px; position: relative; z-index: 1; }
body.app-light #nav a { color: #d6d2fa; padding: 12px 16px; border-radius: 12px; font-size: 15px; gap: 14px; }
body.app-light #nav a .ic { width: 21px; height: 21px; color: #d6d2fa; }
body.app-light #nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
body.app-light #nav a.active {
  color: #fff; font-weight: 600; box-shadow: 0 10px 22px rgba(124, 92, 255, 0.38);
  background: linear-gradient(90deg, #8b6cff, #a48aff);
}
body.app-light #nav a.active .ic { color: #fff; }
.side-wave { position: absolute; left: 0; right: 0; bottom: 120px; width: 100%; height: 160px; pointer-events: none; }
body:not(.app-light) .side-wave { display: none; }
body.app-light .sidebar-foot { position: relative; z-index: 1; gap: 14px; }
body.app-light .me-chip { background: transparent; border: 0; padding: 0; }
body.app-light .me-avatar { width: 44px; height: 44px; background: #fff; color: #6d4cff; font-size: 17px; }
body.app-light .me-text b { color: #fff; font-size: 14.5px; }
body.app-light .me-text small { color: #b3acec; font-size: 12.5px; }
body.app-light .logout-btn {
  background: transparent; border: 1.5px solid rgba(216, 212, 255, 0.45); color: #fff; border-radius: 999px;
  padding: 11px; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px;
}
body.app-light .logout-btn:hover { background: rgba(255, 255, 255, 0.08); border-color: #fff; }
body.app-light .logout-btn .ic { margin: 0; width: 19px; height: 19px; }

/* Top bar */
body.app-light main { background: var(--bg); }
body.app-light .topbar { padding: 24px 32px 8px; gap: 16px; align-items: center; }
.tb-title { flex: 1; min-width: 0; }
.tb-title h2 { font-size: 30px; font-weight: 750; letter-spacing: -0.6px; color: var(--text); }
.tb-title p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.tb-actions { display: flex; gap: 10px; align-items: center; }
.range-pick {
  display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; padding: 0 6px 0 14px; height: 46px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 4px 14px rgba(76, 64, 160, 0.06); color: var(--text) !important;
}
.range-pick .ic { width: 19px; height: 19px; color: var(--text); }
.range-pick select { border: 0 !important; box-shadow: none !important; background: transparent !important; font-weight: 600; font-size: 14px; padding: 8px 6px; width: auto; cursor: pointer; }
.tb-bell { position: relative; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; color: var(--text) !important; }
.tb-bell:hover { background: #ecebf8; }
.tb-bell .ic { width: 24px; height: 24px; }
.tb-dot { position: absolute; top: 9px; right: 11px; width: 9px; height: 9px; border-radius: 50%; background: #ff4d6d; border: 2px solid var(--bg); }
.tb-avatar {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(145deg, #4c3bd6, #2d2190); color: #fff; font-weight: 700; font-size: 18px;
}
body:not(.app-light) .tb-bell, body:not(.app-light) .tb-avatar { display: none; }
body.app-light .page { padding: 16px 32px 40px; max-width: 1500px; gap: 22px; }

/* ---------------- Dashboard ---------------- */
.d-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
.d-kpi {
  --tone: #7c5cff; --tone-bg: #f3efff; --tone-line: #e2d9ff;
  position: relative; overflow: hidden; display: grid; gap: 2px; padding: 20px 20px 18px; border-radius: 20px;
  background: linear-gradient(160deg, var(--tone-bg), #fff 85%); border: 1px solid var(--tone-line);
  box-shadow: 0 10px 26px rgba(76, 64, 160, 0.07); text-decoration: none; color: var(--text) !important;
  transition: transform 0.15s, box-shadow 0.15s;
}
a.d-kpi:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(76, 64, 160, 0.12); }
.d-kpi-ic {
  width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 14px; color: #fff;
  background: var(--tone); box-shadow: 0 8px 18px color-mix(in srgb, var(--tone) 35%, transparent);
}
.d-kpi-ic .ic { width: 25px; height: 25px; }
.d-kpi-deco { position: absolute; right: 14px; top: 16px; color: var(--tone); opacity: 0.22; }
.d-kpi-deco .ic { width: 70px; height: 70px; stroke-width: 1.4; }
.d-label { font-size: 15.5px; font-weight: 600; color: var(--text); }
.d-val { font-size: 34px; font-weight: 750; line-height: 1.15; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; color: var(--text); }
.d-sub { font-size: 13px; color: #555a7a; }
.t-purple { --tone: #7c5cff; --tone-bg: #f1ecff; --tone-line: #e3dafd; }
.t-green { --tone: #20b27a; --tone-bg: #e8f8f1; --tone-line: #c9eedd; }
.t-orange { --tone: #ff7e2e; --tone-bg: #fff2e6; --tone-line: #ffdfc4; }
.t-blue { --tone: #4f72ff; --tone-bg: #ebf0ff; --tone-line: #d3defd; }
.t-pink { --tone: #ec4f87; --tone-bg: #ffedf3; --tone-line: #fbd3e1; }

.d-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.3fr); gap: 18px; }
.d-card {
  position: relative; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 22px 24px;
  box-shadow: 0 1px 2px rgba(29, 31, 61, 0.04), 0 10px 30px rgba(76, 64, 160, 0.06); color: var(--text);
}
.d-ticket { display: flex; gap: 18px; align-items: center; text-decoration: none; min-height: 150px; }
a.d-ticket:hover { border-color: #d6cdfb; }
.d-ticket-ic {
  width: 56px; height: 56px; border-radius: 15px; display: grid; place-items: center; flex: none; color: #fff;
  background: linear-gradient(145deg, #7c5cff, #5b3fe0); box-shadow: 0 10px 20px rgba(109, 76, 255, 0.3);
}
.d-ticket-ic .ic { width: 28px; height: 28px; }
.d-ticket-body { display: grid; gap: 2px; position: relative; z-index: 1; }
.d-link { color: var(--blue); font-weight: 600; font-size: 14.5px; text-decoration: underline; text-underline-offset: 3px; margin-top: 6px; }
.d-ticket-deco { position: absolute; right: 18px; bottom: -6px; color: #7c5cff; opacity: 0.12; transform: rotate(-28deg); }
.d-ticket-deco .ic { width: 120px; height: 120px; stroke-width: 1.2; }

.d-banner {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 22px; min-height: 150px; padding: 0 36px 0 20px;
  border-radius: 20px; color: #fff;
  background: radial-gradient(ellipse at 100% 100%, rgba(167, 139, 250, 0.55), transparent 50%), linear-gradient(110deg, #2a1f86 0%, #4a34c9 55%, #6a4cf0 100%);
  box-shadow: 0 16px 34px rgba(76, 52, 201, 0.28);
}
.d-banner::after {
  content: ""; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 200px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(196, 181, 253, 0.55), rgba(124, 92, 255, 0)); transform: rotate(-20deg);
}
.d-banner-art { width: 230px; height: 150px; flex: none; margin-top: 20px; filter: drop-shadow(0 12px 20px rgba(20, 10, 80, 0.35)); }
.d-banner-text { position: relative; z-index: 1; }
.d-banner-text h3 { font-size: 26px; font-weight: 750; letter-spacing: -0.3px; color: #fff; }
.d-banner-text p { margin: 8px 0 0; font-size: 16px; line-height: 1.5; color: #e6e1ff; max-width: 460px; }
.d-banner-mail { position: absolute; right: 70px; top: 18px; color: #c9bfff; opacity: 0.55; transform: rotate(10deg); }
.d-banner-mail .ic { width: 48px; height: 48px; stroke-width: 1.3; }

.d-row3 { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.d-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.d-card-head .ic { width: 26px; height: 26px; color: var(--blue); }
.d-card-head h3 { font-size: 19px; font-weight: 700; letter-spacing: -0.2px; }
.d-chart { position: relative; width: 100%; }
.d-chart svg { display: block; overflow: visible; }
.d-grid { stroke: #ececf5; stroke-width: 1; }
.d-grid.zero { stroke: #d9d9e8; }
.d-ytick { fill: #4a4e6e; font-size: 13px; text-anchor: end; font-variant-numeric: tabular-nums; }
.d-xtick { fill: #4a4e6e; font-size: 13px; text-anchor: middle; }
.d-line { fill: none; stroke: #6d4cff; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.d-pt { fill: #fff; stroke: #6d4cff; stroke-width: 2.5; transition: r 0.1s; }
.d-pt.on { fill: #6d4cff; stroke: #fff; stroke-width: 3; r: 7; }
.d-cross { stroke: #b9adf7; stroke-width: 1; stroke-dasharray: 3 4; }
.d-hit { fill: transparent; cursor: crosshair; }
.d-tip {
  position: absolute; transform: translateX(-50%); min-width: 150px; pointer-events: none; z-index: 2;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 12.5px;
  box-shadow: 0 14px 34px rgba(29, 31, 61, 0.16); display: grid; gap: 4px; color: var(--text);
}
.d-tip > b { margin-bottom: 2px; }
.d-tip div { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); }
.d-tip div b { color: var(--text); font-variant-numeric: tabular-nums; }

.d-sms-card { display: flex; flex-direction: column; }
.d-desc { margin: 2px 0 18px; color: #555a7a; font-size: 14.5px; line-height: 1.55; }
.d-sms-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; position: relative; z-index: 1; }
.d-sms {
  display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 16px;
  background: linear-gradient(135deg, var(--tone-bg), color-mix(in srgb, var(--tone-bg) 50%, #fff));
}
.d-sms .d-val { display: block; font-size: 30px; }
.d-sms-label { display: block; font-size: 15px; font-weight: 600; color: var(--text); }
.d-sms-ic {
  width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--tone);
  background: color-mix(in srgb, var(--tone) 16%, #fff);
}
.d-sms-ic .ic { width: 27px; height: 27px; }
.d-sms-deco { position: absolute; right: 22px; bottom: 10px; color: #7c5cff; opacity: 0.16; transform: rotate(-14deg); }
.d-sms-deco .ic { width: 110px; height: 110px; stroke-width: 1.1; }

.d-privacy { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--muted); font-size: 13px; }
.d-privacy .ic { width: 18px; height: 18px; color: var(--green); }

@media (max-width: 1280px) {
  .d-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1050px) {
  .d-row2, .d-row3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  body.app-light .topbar { padding: 16px; flex-wrap: wrap; }
  body.app-light .page { padding: 12px 16px 32px; }
  .tb-title h2 { font-size: 24px; }
  .d-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .d-banner { padding: 20px; }
  .d-banner-art { display: none; }
}
@media (max-width: 520px) {
  .d-kpis, .d-sms-grid { grid-template-columns: minmax(0, 1fr); }
  .tb-bell { display: none; }
}


body.app-light #nav a { white-space: nowrap; }
body.app-light .sidebar { width: auto; }

/* Sidebar always fits the screen: brand + footer fixed, menu scrolls if the window is short. */
body.app-light .sidebar { height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 18px 14px; }
body.app-light .sidebar .brand { flex: none; }
body.app-light .sidebar .logo { width: 44px; height: 44px; }
body.app-light .sidebar .brand b { font-size: 21px; }
body.app-light #nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; align-content: start; gap: 4px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
body.app-light #nav a { padding: 10px 14px; font-size: 14.5px; gap: 12px; }
body.app-light #nav a .ic { width: 19px; height: 19px; }
body.app-light .sidebar-foot { flex: none; margin-top: 0; gap: 10px; }
body.app-light .me-avatar { width: 38px; height: 38px; font-size: 15px; }
body.app-light .logout-btn { padding: 9px; font-size: 14px; }
.side-wave { bottom: 90px; z-index: 0; }
@media (max-height: 720px) {
  body.app-light #nav a { padding: 8px 12px; }
  body.app-light .sidebar { gap: 12px; padding: 14px 12px; }
  body.app-light .me-chip { display: none; }
}

/* ---------------- Splash screen page ---------------- */
.sp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.sp-logo-row { display: flex; gap: 16px; align-items: center; }
.sp-logo-thumb { width: 72px; height: 72px; border-radius: 16px; object-fit: contain; background: #0b1124; border: 1px solid var(--line); }
.sp-upload { cursor: pointer; display: inline-block !important; text-align: center; }
.sp-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.sp-color input[type='color'] { width: 44px; height: 36px; padding: 2px; border-radius: 8px; cursor: pointer; flex: none; }
.sp-preview-wrap { position: sticky; top: 16px; }
.sp-phone {
  width: 300px; height: 620px; margin: 0 auto; border-radius: 44px; padding: 12px; background: #0d0f16;
  box-shadow: 0 0 0 2px #2a2f3d, 0 24px 60px rgba(29, 31, 61, 0.35);
}
.sp-screen { position: relative; width: 100%; height: 100%; border-radius: 34px; overflow: hidden; display: grid; place-items: center; }
.sp-center { display: grid; justify-items: center; gap: 10px; transform: translateY(-40px); }
.sp-tile { width: 96px; height: 96px; border-radius: 24px; background: #05070d; display: grid; place-items: center; overflow: hidden; }
.sp-tile img { width: 100%; height: 100%; object-fit: cover; }
.sp-name { font-size: 40px; font-weight: 500; letter-spacing: 0.5px; margin-top: 18px; line-height: 1; }
.sp-tag { font-size: 11px; letter-spacing: 0.2px; }
.sp-maint {
  position: absolute; left: 16px; right: 16px; bottom: 28px; padding: 12px 14px; border-radius: 14px; font-size: 12.5px; line-height: 1.45;
  background: rgba(255, 255, 255, 0.1); color: #fff; border: 1px solid rgba(255, 255, 255, 0.2); text-align: center;
}
@media (max-width: 1100px) {
  .sp-layout { grid-template-columns: minmax(0, 1fr); }
  .sp-preview-wrap { position: static; }
}
