:root {
  color-scheme: dark;
  --bg: #05070c;
  --panel: #0d111b;
  --panel-2: #111725;
  --line: #202a3b;
  --muted: #8290a6;
  --text: #f6f8fc;
  --blue: #2475ff;
  --cyan: #21c7ec;
  --green: #27d17f;
  --red: #ff5470;
  --orange: #ff9f43;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.auth-view { min-height: 100vh; display: grid; place-items: center; padding: 30px 18px; position: relative; overflow: hidden; }
.auth-glow { position: absolute; width: 720px; height: 720px; border-radius: 50%; background: rgba(36,117,255,.18); filter: blur(130px); left: 50%; top: 50%; transform: translate(-50%,-50%); }
.auth-card { width: min(430px, 100%); position: relative; padding: 42px; border: 1px solid var(--line); background: rgba(13,17,27,.92); border-radius: 24px; box-shadow: 0 30px 90px rgba(0,0,0,.55); }
.brand { color: white; text-decoration: none; display: inline-flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 800; letter-spacing: -.8px; }
.brand > span:last-child span { color: var(--blue); }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(145deg, #2f83ff, #1652d4); box-shadow: 0 10px 24px rgba(36,117,255,.3); font-weight: 900; }
.eyebrow { color: #679cf7; font-weight: 800; font-size: 11px; letter-spacing: 1.6px; margin: 30px 0 8px; }
.eyebrow b { border: 1px solid #315b9d; background: #102347; padding: 3px 7px; border-radius: 20px; margin-left: 5px; }
.auth-card h1 { margin: 0; font-size: 35px; letter-spacing: -1.5px; }
.auth-copy { color: var(--muted); line-height: 1.6; margin: 10px 0 26px; }
.auth-form { display: grid; gap: 16px; }
.auth-form label { display: grid; gap: 8px; color: #b9c3d3; font-size: 13px; font-weight: 650; }
.auth-form input { width: 100%; border-radius: 11px; border: 1px solid #283449; background: #080b12; padding: 13px 14px; color: white; outline: none; }
.auth-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36,117,255,.13); }
.auth-form small { color: var(--muted); font-weight: 400; }
.auth-form button { margin-top: 6px; padding: 14px 16px; border: 0; border-radius: 11px; background: linear-gradient(135deg, #287dff, #175ce6); font-weight: 800; display: flex; justify-content: space-between; cursor: pointer; }
.auth-form button:disabled { opacity: .6; cursor: wait; }
.auth-message { border: 1px solid #57303b; background: #231118; color: #ff9cad; padding: 11px 13px; border-radius: 10px; font-size: 13px; line-height: 1.4; }
.auth-message[data-type="success"] { border-color: #24583e; background: #10271b; color: #79dda7; }
.text-button { display: block; margin: 20px auto 0; background: none; border: 0; color: #83aefb; cursor: pointer; font-size: 13px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; border-right: 1px solid #1d2533; background: #080b12; padding: 24px 14px; display: flex; flex-direction: column; z-index: 20; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 25px; border-bottom: 1px solid #19202c; }
.sidebar-brand .brand-mark { width: 40px; height: 40px; }
.sidebar-brand div { display: grid; }
.sidebar-brand strong { font-size: 20px; letter-spacing: -.5px; }
.sidebar-brand small { color: #627089; font-size: 9px; font-weight: 800; letter-spacing: 1.5px; }
.sidebar nav { display: grid; gap: 4px; padding-top: 22px; }
.nav-item { background: transparent; border: 0; border-radius: 10px; text-align: left; padding: 11px 12px; color: #8d99ab; cursor: pointer; font-size: 14px; display: flex; align-items: center; gap: 12px; }
.nav-item span { width: 24px; text-align: center; color: #71809a; font-size: 17px; }
.nav-item:hover { color: white; background: #101622; }
.nav-item.active { color: white; background: linear-gradient(90deg, rgba(36,117,255,.24), rgba(36,117,255,.06)); box-shadow: inset 3px 0 var(--blue); }
.nav-item.active span { color: #69a0ff; }
.sidebar-footer { margin-top: auto; border-top: 1px solid #19202c; padding: 18px 10px 0; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 7px; color: #94a0b2; font-size: 12px; }
.sidebar-footer small { grid-column: 1 / -1; color: #4f5b70; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }

.main-content { grid-column: 2; min-width: 0; }
.topbar { height: 82px; position: sticky; top: 0; z-index: 10; display: flex; align-items: center; padding: 0 34px; background: rgba(5,7,12,.9); border-bottom: 1px solid #19202c; backdrop-filter: blur(16px); }
.topbar > div:first-of-type p { color: #637087; font-size: 11px; margin: 0; }
.topbar h1 { font-size: 21px; margin: 2px 0 0; }
.menu-button { display: none; background: transparent; border: 0; font-size: 22px; margin-right: 12px; }
.admin-menu { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.admin-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: #182d55; color: #83adfa; font-weight: 850; }
.admin-menu > div:nth-child(2) { display: grid; min-width: 90px; }
.admin-menu strong { font-size: 13px; }
.admin-menu small { color: #728097; font-size: 11px; text-transform: capitalize; }
.admin-menu button { border: 1px solid #293449; border-radius: 9px; background: #0d121c; padding: 8px 11px; color: #9ba7b9; cursor: pointer; font-size: 12px; }

.page { padding: 30px 34px 50px; max-width: 1500px; margin: 0 auto; }
.welcome-panel { border: 1px solid #203257; background: radial-gradient(circle at 90% 20%, rgba(37,118,255,.24), transparent 34%), linear-gradient(135deg, #101827, #0b101a); border-radius: 18px; padding: 26px 28px; display: flex; align-items: center; justify-content: space-between; gap: 25px; }
.welcome-panel .eyebrow { margin: 0 0 7px; }
.welcome-panel h2 { margin: 0; font-size: 27px; letter-spacing: -.8px; }
.welcome-panel p:last-child { color: #8f9cb0; margin: 7px 0 0; }
.live-pill { border: 1px solid #275940; background: rgba(24,74,48,.38); color: #72d99f; border-radius: 40px; padding: 9px 13px; font-size: 12px; white-space: nowrap; }
.live-pill i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 7px; box-shadow: 0 0 8px var(--green); }
.stat-grid { display: grid; grid-template-columns: repeat(6, minmax(145px, 1fr)); gap: 14px; margin-top: 20px; }
.stat-grid article { border: 1px solid #1d2635; background: var(--panel); border-radius: 15px; padding: 18px; min-width: 0; }
.stat-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; margin-bottom: 18px; }
.stat-icon.blue { background: #132e5f; color: #65a0ff; }.stat-icon.cyan { background: #0c3543; color: #4ddaf5; }.stat-icon.violet { background: #302057; color: #aa82ff; }.stat-icon.green { background: #123a2a; color: #4add91; }.stat-icon.orange { background: #432a15; color: #ffaf5b; }.stat-icon.red { background: #441b29; color: #ff7087; }
.stat-grid p { margin: 0; color: #8996a9; font-size: 12px; }
.stat-grid strong { display: block; margin: 6px 0 3px; font-size: 28px; letter-spacing: -1px; }
.stat-grid small { color: #556277; font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: 1.5fr .8fr; gap: 18px; margin-top: 20px; }
.panel { border: 1px solid #1d2635; background: var(--panel); border-radius: 15px; padding: 20px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.panel-heading .eyebrow { margin: 0 0 3px; }
.panel-heading h3 { margin: 0; font-size: 18px; }
.panel-heading > button { background: none; border: 0; color: #70a2f9; font-size: 12px; cursor: pointer; }
.empty-state { padding: 32px 0; text-align: center; color: #647087; font-size: 13px; }
.activity-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid #1b2330; }
.activity-row > span { width: 31px; height: 31px; border-radius: 9px; background: #132c55; color: #6ea4ff; display: grid; place-items: center; }
.activity-row > div { display: grid; gap: 3px; }
.activity-row strong { font-size: 13px; }.activity-row small { color: #657289; font-size: 11px; }
.quick-panel > button { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; background: #0a0e16; border: 1px solid #1d2635; border-radius: 11px; padding: 12px; margin-top: 9px; text-align: left; cursor: pointer; }
.quick-panel > button:hover { border-color: #315891; background: #0e1624; }
.quick-panel > button > span { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: #132c55; color: #74a8ff; }
.quick-panel button div { display: grid; gap: 2px; }.quick-panel b { font-size: 12px; }.quick-panel small { color: #647087; font-size: 10px; }.quick-panel i { font-style: normal; color: #5d6b82; }
.placeholder-page { min-height: calc(100vh - 82px); display: grid; place-content: center; text-align: center; max-width: 650px; }
.placeholder-page .placeholder-icon { margin: 0 auto; width: 58px; height: 58px; border-radius: 17px; display: grid; place-items: center; background: #142d57; color: #70a4ff; font-size: 22px; }
.placeholder-page .eyebrow { margin-top: 18px; }.placeholder-page h2 { font-size: 34px; margin: 0; }.placeholder-page > p:last-child { color: #7f8ca1; line-height: 1.6; }
.module-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.module-heading .eyebrow { margin: 0 0 5px; }.module-heading h2 { margin: 0; font-size: 27px; }.module-heading p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.module-heading > button, .editor-actions button { border: 0; border-radius: 10px; background: var(--blue); padding: 11px 15px; font-weight: 750; cursor: pointer; }
.apps-layout { display: grid; grid-template-columns: minmax(280px, .7fr) minmax(540px, 1.5fr); gap: 18px; align-items: start; }
.app-list-panel { padding: 0; overflow: hidden; }.list-heading { display: flex; justify-content: space-between; padding: 17px 18px; border-bottom: 1px solid #1d2635; }.list-heading strong { font-size: 13px; }.list-heading span { color: var(--muted); font-size: 11px; }
.app-list { padding: 8px; max-height: 680px; overflow: auto; }
.app-list-item { width: 100%; border: 0; border-radius: 11px; background: transparent; padding: 11px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; text-align: left; cursor: pointer; }
.app-list-item:hover { background: #131a27; }.app-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: white; font-weight: 850; }.app-list-item div { display: grid; gap: 3px; min-width: 0; }.app-list-item strong { font-size: 13px; }.app-list-item small { color: #68768c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
.app-list-item i { font-style: normal; font-size: 9px; padding: 4px 7px; border-radius: 20px; }.app-list-item i.live { color: #64d797; background: #123324; }.app-list-item i.maintenance { color: #ffb35f; background: #3c2815; }.app-list-item i.disabled { color: #8d98a9; background: #222a36; }
.app-editor-panel { padding: 22px; }.unsaved-pill { color: #8eb5ff; border: 1px solid #294f8b; background: #122647; border-radius: 20px; padding: 5px 9px; font-size: 10px; }
.app-form { display: grid; gap: 18px; }.editor-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }.editor-grid label { display: grid; gap: 7px; }.editor-grid label.full { grid-column: 1 / -1; }.editor-grid label > span { color: #9ca9bb; font-size: 11px; font-weight: 700; }
.editor-grid input, .editor-grid textarea { width: 100%; border: 1px solid #273247; background: #090d14; border-radius: 9px; color: white; padding: 10px 11px; outline: none; resize: vertical; }.editor-grid input:focus, .editor-grid textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36,117,255,.1); }.editor-grid input[type="color"] { padding: 4px; height: 41px; }
.switch-row { display: flex; flex-wrap: wrap; gap: 12px; border-top: 1px solid #1d2635; border-bottom: 1px solid #1d2635; padding: 14px 0; }.switch-row label { display: flex; align-items: center; gap: 7px; color: #a3afbf; font-size: 11px; }.switch-row input { accent-color: var(--blue); }
.editor-actions { display: flex; justify-content: flex-end; gap: 10px; }.editor-actions button.secondary { background: #171e2b; border: 1px solid #293449; color: #aeb8c7; }.editor-actions button:disabled { opacity: .6; cursor: wait; }
.editor-actions button.danger { margin-right: auto; background: #38151f; border: 1px solid #6a2638; color: #ff8fa2; }
.editor-message { border: 1px solid #57303b; background: #231118; color: #ff9cad; padding: 10px 12px; border-radius: 9px; font-size: 12px; margin: 0; }.editor-message[data-type="success"] { border-color: #24583e; background: #10271b; color: #79dda7; }
.compatibility-note { display: grid; gap: 5px; margin: -5px 0 18px; padding: 13px 15px; border: 1px solid #4a3820; border-radius: 11px; background: #21190e; color: #dcb876; font-size: 12px; line-height: 1.5; }
.compatibility-note span { color: #aa956f; }
.service-mark { background: linear-gradient(145deg, #1d64e5, #1748a2); }
.advanced-fields { border: 1px solid #273247; border-radius: 10px; padding: 11px; background: #090d14; }
.advanced-fields summary { cursor: pointer; color: #91a1b8; font-size: 11px; font-weight: 700; }
.advanced-fields[open] { display: grid; gap: 13px; }
.advanced-fields label { margin-top: 12px; }

@media (max-width: 1180px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { transform: translateX(-102%); transition: transform .2s ease; box-shadow: 20px 0 60px rgba(0,0,0,.5); }
  .sidebar.open { transform: translateX(0); }
  .main-content { min-height: 100vh; }
  .menu-button { display: block; }
  .topbar { padding: 0 18px; }
  .page { padding: 20px 18px 40px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .admin-menu > div:nth-child(2), .admin-menu button { display: none; }
  .apps-layout { grid-template-columns: 1fr; }.app-list { max-height: 300px; }
}
@media (max-width: 580px) {
  .auth-card { padding: 30px 22px; }
  .auth-card h1 { font-size: 30px; }
  .welcome-panel { align-items: flex-start; flex-direction: column; padding: 22px; }
  .welcome-panel h2 { font-size: 23px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid article { padding: 15px; }
  .stat-grid strong { font-size: 24px; }
  .module-heading { align-items: flex-start; flex-direction: column; }.editor-grid { grid-template-columns: 1fr; }.editor-grid label.full { grid-column: auto; }
}
