:root {
  --bg: #07080d;
  --bg-soft: #0b0d14;
  --panel: #10121b;
  --panel-2: #141722;
  --line: rgba(255,255,255,.08);
  --line-strong: rgba(255,255,255,.14);
  --text: #f6f7fb;
  --muted: #a5a9b8;
  --soft: #727788;
  --accent: #8b6cff;
  --accent-rgb: 139,108,255;
  --accent-2: #5e8dff;
  --success: #55d99a;
  --warning: #ffca62;
  --danger: #ff6b78;
  --shadow: 0 28px 80px rgba(0,0,0,.5);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--text); background: var(--bg); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.55; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

.login-screen { position: fixed; inset: 0; display: grid; place-items: center; overflow: auto; padding: 28px; background: radial-gradient(circle at 20% 10%, rgba(var(--accent-rgb),.18), transparent 35%), radial-gradient(circle at 90% 90%, rgba(70,130,255,.12), transparent 34%), #07080d; }
.login-glow { position: fixed; width: 480px; height: 480px; border-radius: 50%; background: rgba(var(--accent-rgb),.12); filter: blur(120px); }
.login-card { position: relative; z-index: 2; display: grid; gap: 15px; width: min(100%, 440px); padding: 34px; border: 1px solid var(--line-strong); border-radius: 28px; background: rgba(14,16,24,.9); box-shadow: var(--shadow); backdrop-filter: blur(24px); }
.login-logo { width: 72px; height: 72px; margin-bottom: 5px; }
.login-logo img { border-radius: 22px; }
.eyebrow { color: #c7bbff; font-size: 10px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.login-card h1 { margin: 0; font-size: 31px; line-height: 1.12; letter-spacing: -.04em; }
.login-card > p { margin: -4px 0 5px; color: var(--muted); font-size: 14px; }
.login-card label, .form-field { display: grid; gap: 7px; }
.login-card label span, .form-field > span, .field-label { color: #c5c8d4; font-size: 12px; font-weight: 800; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 12px; outline: none; color: var(--text); background: #0b0d14; transition: .2s ease; }
input, select { min-height: 45px; padding: 0 13px; }
textarea { min-height: 120px; padding: 12px 13px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: rgba(var(--accent-rgb),.55); box-shadow: 0 0 0 4px rgba(var(--accent-rgb),.09); }
input[type="color"] { padding: 5px; }
input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--accent); }
option { background: #11131d; }
.form-message { min-height: 20px; margin: 0 !important; color: var(--danger) !important; text-align: center; font-size: 12px !important; }
.back-link { color: var(--soft); text-align: center; font-size: 12px; font-weight: 700; }
.back-link:hover { color: #fff; }

.primary-button, .secondary-button, .danger-button, .ghost-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 43px; padding: 0 16px; border: 1px solid transparent; border-radius: 12px; font-size: 13px; font-weight: 800; cursor: pointer; transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.primary-button:hover, .secondary-button:hover, .danger-button:hover, .ghost-button:hover { transform: translateY(-1px); }
.primary-button { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 12px 26px rgba(var(--accent-rgb),.22); }
.secondary-button { border-color: var(--line); background: rgba(255,255,255,.035); }
.secondary-button:hover, .ghost-button:hover { border-color: rgba(var(--accent-rgb),.38); background: rgba(var(--accent-rgb),.08); }
.danger-button { color: #ffd9dc; border-color: rgba(255,107,120,.25); background: rgba(255,107,120,.10); }
.ghost-button { border-color: transparent; color: var(--muted); background: transparent; }
.small { min-height: 36px; padding-inline: 12px; font-size: 12px; }
.wide { width: 100%; }
button:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: rgba(255,255,255,.03); cursor: pointer; }
.icon-button:hover { color: #fff; border-color: var(--line-strong); }

.admin-shell { display: grid; grid-template-columns: 262px minmax(0,1fr); min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; display: flex; flex-direction: column; width: 262px; padding: 16px 12px; border-right: 1px solid var(--line); background: #090a10; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 7px 8px 17px; border-bottom: 1px solid var(--line); }
.sidebar-brand img { width: 43px; height: 43px; border-radius: 13px; }
.sidebar-brand div { display: grid; line-height: 1.2; }
.sidebar-brand strong { font-size: 16px; }
.sidebar-brand small { margin-top: 4px; color: var(--soft); font-size: 10px; }
.sidebar-nav { flex: 1; overflow: auto; display: grid; align-content: start; gap: 3px; padding: 14px 0; }
.sidebar-nav button { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid transparent; border-radius: 11px; color: var(--muted); background: transparent; text-align: left; font-size: 13px; font-weight: 700; cursor: pointer; }
.sidebar-nav button > span { display: grid; place-items: center; width: 20px; color: var(--soft); font-size: 15px; }
.sidebar-nav button:hover { color: #fff; background: rgba(255,255,255,.035); }
.sidebar-nav button.active { color: #fff; border-color: rgba(var(--accent-rgb),.22); background: rgba(var(--accent-rgb),.10); }
.sidebar-nav button.active > span { color: #cfc7ff; }
.nav-label { margin: 13px 10px 5px; color: #545869; font-size: 9px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.nav-badge { margin-left: auto; min-width: 21px; padding: 2px 6px; border-radius: 99px; color: #fff; background: var(--danger); font-size: 9px; text-align: center; }
.sidebar-footer { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 12px 8px 2px; border-top: 1px solid var(--line); }
.admin-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); font-weight: 900; }
.admin-copy { display: grid; min-width: 0; line-height: 1.15; }
.admin-copy strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.admin-copy small { margin-top: 5px; color: var(--soft); font-size: 9px; text-transform: uppercase; }
.workspace { grid-column: 2; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 82px; padding: 14px 28px; border-bottom: 1px solid var(--line); background: rgba(7,8,13,.82); backdrop-filter: blur(20px); }
.topbar > div:first-of-type { min-width: 0; }
.topbar h1 { margin: 3px 0 0; font-size: 24px; line-height: 1.15; letter-spacing: -.035em; }
.top-kicker { color: #6d7180; font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.mobile-sidebar-button { display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.03); }
.view-container { padding: 26px 28px 60px; }

.view-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.view-header h2 { margin: 0; font-size: 23px; letter-spacing: -.03em; }
.view-header p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.view-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; }
.stat-card { min-height: 130px; padding: 19px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(19,21,31,.96), rgba(12,13,20,.96)); }
.stat-card-top { display: flex; justify-content: space-between; align-items: center; color: var(--soft); font-size: 11px; font-weight: 800; }
.stat-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 10px; color: #d6ceff; background: rgba(var(--accent-rgb),.10); }
.stat-card strong { display: block; margin-top: 18px; font-size: 29px; line-height: 1; letter-spacing: -.04em; }
.stat-card small { display: block; margin-top: 8px; color: var(--soft); font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 14px; margin-top: 14px; }
.panel { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); overflow: hidden; }
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 57px; padding: 12px 17px; border-bottom: 1px solid var(--line); }
.panel-header h3 { margin: 0; font-size: 14px; }
.panel-header span { color: var(--soft); font-size: 10px; }
.panel-body { padding: 16px; }
.top-app-list { display: grid; gap: 10px; }
.top-app-item { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.02); }
.top-app-item strong { display: block; font-size: 12px; }
.top-app-item small { color: var(--soft); font-size: 10px; }
.top-app-numbers { text-align: right; }
.top-app-numbers b { display: block; font-size: 13px; }
.top-app-numbers span { color: var(--soft); font-size: 9px; }
.activity-list { display: grid; }
.activity-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 11px 0; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--accent); }
.activity-item strong { display: block; font-size: 11px; }
.activity-item p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.activity-item time { color: var(--soft); font-size: 9px; white-space: nowrap; }
.status-panel { display: flex; align-items: center; gap: 12px; }
.status-orb { width: 13px; height: 13px; border-radius: 50%; background: var(--success); box-shadow: 0 0 16px rgba(85,217,154,.55); }
.status-panel strong { display: block; font-size: 12px; }
.status-panel small { display: block; margin-top: 4px; color: var(--soft); font-size: 10px; }

.table-shell { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: #757a8a; background: rgba(255,255,255,.018); font-size: 9px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
td { color: #d7d9e2; font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255,255,255,.018); }
.cell-main { display: flex; align-items: center; gap: 11px; min-width: 210px; }
.cell-icon { display: grid; place-items: center; flex: 0 0 auto; width: 39px; height: 39px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; color: #d9d2ff; background: rgba(var(--accent-rgb),.09); font-size: 11px; font-weight: 900; }
.cell-icon img { width: 100%; height: 100%; object-fit: cover; }
.cell-copy { display: grid; min-width: 0; line-height: 1.25; }
.cell-copy strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.cell-copy small { max-width: 300px; margin-top: 4px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 9px; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: rgba(255,255,255,.03); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.badge.green { color: #9cf0c5; border-color: rgba(85,217,154,.22); background: rgba(85,217,154,.07); }
.badge.yellow { color: #ffdda0; border-color: rgba(255,202,98,.22); background: rgba(255,202,98,.07); }
.badge.red { color: #ffc0c6; border-color: rgba(255,107,120,.22); background: rgba(255,107,120,.07); }
.badge.purple { color: #d4ccff; border-color: rgba(var(--accent-rgb),.25); background: rgba(var(--accent-rgb),.08); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-action { display: grid; place-items: center; min-width: 31px; height: 31px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: rgba(255,255,255,.025); font-size: 10px; font-weight: 800; cursor: pointer; }
.row-action:hover { color: #fff; border-color: var(--line-strong); }
.row-action.delete:hover { color: #ffb8be; border-color: rgba(255,107,120,.30); background: rgba(255,107,120,.06); }
.empty-table { padding: 50px 20px; color: var(--muted); text-align: center; }
.empty-table strong { display: block; color: var(--text); font-size: 15px; }
.empty-table span { display: block; margin-top: 6px; font-size: 11px; }

.upload-panel { display: grid; grid-template-columns: 1fr 1.25fr; gap: 18px; margin-bottom: 18px; padding: 20px; border: 1px solid rgba(var(--accent-rgb),.24); border-radius: 19px; background: linear-gradient(135deg, rgba(var(--accent-rgb),.09), rgba(65,119,255,.04)); }
.upload-copy h3 { margin: 5px 0 9px; font-size: 20px; }
.upload-copy p { margin: 0; color: var(--muted); font-size: 12px; }
.upload-form { display: grid; gap: 10px; }
.form-grid { display: grid; gap: 12px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.checkbox-field { display: flex; align-items: center; gap: 9px; min-height: 42px; color: var(--muted); font-size: 12px; font-weight: 700; }
.help-text { margin: 5px 0 0; color: var(--soft); font-size: 10px; }
.preview-image { width: 90px; height: 90px; object-fit: cover; border: 1px solid var(--line); border-radius: 15px; background: #0b0d14; }

.settings-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-card { padding: 19px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.settings-card.full { grid-column: 1 / -1; }
.settings-card h3 { margin: 0 0 15px; font-size: 14px; }
.settings-card .form-grid { gap: 12px; }
.message-detail { display: grid; gap: 13px; }
.message-content { padding: 15px; border: 1px solid var(--line); border-radius: 13px; color: #d6d8e1; background: #0b0d14; white-space: pre-wrap; font-size: 12px; }
.file-preview { width: 42px; height: 42px; object-fit: cover; border-radius: 10px; }
.security-card { max-width: 620px; padding: 23px; border: 1px solid var(--line); border-radius: 19px; background: var(--panel); }
.security-card h2 { margin: 0 0 6px; font-size: 20px; }
.security-card > p { margin: 0 0 19px; color: var(--muted); font-size: 12px; }

.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3,4,8,.78); backdrop-filter: blur(14px); }
.modal-card { position: relative; z-index: 2; width: min(760px, 100%); max-height: calc(100vh - 40px); overflow: hidden; border: 1px solid var(--line-strong); border-radius: 22px; background: #0e1018; box-shadow: var(--shadow); }
.modal-card > header { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 74px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-card h2 { margin: 5px 0 0; font-size: 20px; }
.modal-close { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: rgba(255,255,255,.025); font-size: 23px; cursor: pointer; }
.modal-body { max-height: calc(100vh - 116px); overflow: auto; display: grid; gap: 14px; padding: 20px; }
.modal-actions { position: sticky; bottom: -20px; display: flex; justify-content: flex-end; gap: 8px; margin: 6px -20px -20px; padding: 14px 20px; border-top: 1px solid var(--line); background: rgba(14,16,24,.95); backdrop-filter: blur(14px); }
.confirm-card { position: relative; z-index: 2; width: min(400px,100%); padding: 27px; border: 1px solid var(--line-strong); border-radius: 21px; background: #10121b; box-shadow: var(--shadow); text-align: center; }
.confirm-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 15px; border-radius: 16px; color: #ffd0d4; background: rgba(255,107,120,.10); font-size: 22px; font-weight: 900; }
.confirm-card h2 { margin: 0; font-size: 20px; }
.confirm-card p { margin: 10px 0 20px; color: var(--muted); font-size: 12px; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 130; max-width: min(420px, calc(100% - 40px)); padding: 13px 16px; border: 1px solid var(--line-strong); border-radius: 12px; color: #fff; background: #171a25; box-shadow: var(--shadow); font-size: 12px; font-weight: 700; }
.toast.error { border-color: rgba(255,107,120,.35); }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .upload-panel { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-105%); transition: transform .2s ease; box-shadow: 20px 0 60px rgba(0,0,0,.5); }
  .admin-shell.sidebar-open .sidebar { transform: translateX(0); }
  .workspace { grid-column: 1; }
  .mobile-sidebar-button { display: grid; place-items: center; }
  .topbar { padding-inline: 17px; }
  .view-container { padding: 20px 16px 50px; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-card.full { grid-column: auto; }
}
@media (max-width: 620px) {
  .login-screen { padding: 12px; }
  .login-card { padding: 24px; border-radius: 21px; }
  .topbar-actions .secondary-button { display: none; }
  .view-header { align-items: start; flex-direction: column; }
  .view-actions { width: 100%; }
  .view-actions > * { flex: 1; }
  .stats-grid { grid-template-columns: 1fr; }
  .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
  .modal { padding: 7px; }
  .modal-card { max-height: calc(100vh - 14px); border-radius: 16px; }
  .modal-body { max-height: calc(100vh - 90px); }
}

/* Site logo settings */
.logo-settings { display: grid; grid-template-columns: 150px minmax(0,1fr); align-items: center; gap: 22px; }
.logo-preview-shell { display: grid; place-items: center; width: 150px; height: 150px; overflow: hidden; border: 1px solid rgba(var(--accent-rgb),.28); border-radius: 24px; background: radial-gradient(circle at 50% 30%, rgba(var(--accent-rgb),.16), rgba(255,255,255,.025)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.025); }
.logo-preview-shell img { width: 104px; height: 104px; object-fit: contain; }
.logo-settings-copy { min-width: 0; }
.logo-settings-copy > strong { display: block; margin-bottom: 7px; color: var(--text); font-size: 17px; }
.logo-settings-copy > p { max-width: 760px; margin: 0 0 15px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.logo-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 9px; }
.file-button { position: relative; overflow: hidden; cursor: pointer; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
@media (max-width: 620px) {
  .logo-settings { grid-template-columns: 1fr; }
  .logo-preview-shell { width: 120px; height: 120px; }
  .logo-preview-shell img { width: 82px; height: 82px; }
}
[data-site-logo] { object-fit: contain; }
