﻿@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');


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

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --secondary: #7c3aed;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --bg: #f4f7fb;
  --bg-strong: #edf2f8;
  --surface: rgba(255,255,255,.94);
  --surface-solid: #ffffff;
  --border: #e5eaf2;
  --border-strong: #d9e2ec;
  --text: #172033;
  --text-muted: #66758d;
  --sidebar-w: 272px;
  --header-h: 68px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 12px 28px rgba(15,23,42,.06);
  --shadow-md: 0 18px 40px rgba(15,23,42,.1);
}

html, body { height: 100%; font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif; }
body {
  background:
    radial-gradient(circle at top right, rgba(79,70,229,.08), transparent 28%),
    radial-gradient(circle at left center, rgba(14,165,233,.06), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 48%, #eef3f8 100%);
  color: var(--text);
  direction: rtl;
  line-height: 1.6;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
button,
input,
select,
textarea { font: inherit; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(79,70,229,.12);
}


::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }


.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  padding: 1rem;
}
.login-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo .logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: .75rem;
}
.login-logo-img {
  width: 80px; height: 80px;
  object-fit: contain;
  border-radius: 16px;
  display: block;
  margin: 0 auto .75rem;
}
.login-logo h1 { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.login-logo p { color: var(--text-muted); font-size: .875rem; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .5rem; color: var(--text); }
.form-group input {
  width: 100%; padding: .75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  transition: border-color .2s;
  background: #f8fafc;
  color: var(--text);
  direction: ltr;
  text-align: right;
}
.form-group input:focus { outline: none; border-color: var(--primary); background: #fff; }
.btn-login {
  width: 100%; padding: .875rem;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff; border: none;
  border-radius: var(--radius); font-size: 1rem;
  font-weight: 600; transition: opacity .2s, transform .1s;
}
.btn-login:hover { opacity: .9; }
.btn-login:active { transform: scale(.99); }
.login-error {
  background: #fee2e2; color: #dc2626;
  padding: .75rem 1rem; border-radius: 8px;
  font-size: .875rem; margin-bottom: 1rem;
  display: none;
}
.login-error.show { display: block; }


.layout { display: flex; min-height: 100vh; overflow: hidden; }


.sidebar {
  width: var(--sidebar-w);
  background: rgba(255,255,255,.84);
  border-left: 1px solid rgba(229,234,242,.95);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 100;
  transition: transform .3s ease;
  overflow: hidden;
  box-shadow: -10px 0 30px rgba(15,23,42,.04);
  backdrop-filter: blur(14px);
}
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 88px;
  background: linear-gradient(180deg, rgba(79,70,229,.08), transparent);
  pointer-events: none;
}
.sidebar-header {
  padding: 1.12rem 1.32rem .96rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .78rem;
  min-height: var(--header-h);
}
.sidebar-logo-img {
  width: 40px; height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  object-fit: contain;
  background: #fff;
  padding: .18rem;
  box-shadow: 0 10px 20px rgba(79,70,229,.12);
}
.sidebar-title { font-size: 1rem; font-weight: 800; color: var(--text); }
.sidebar-subtitle { font-size: .75rem; color: var(--text-muted); }

.sidebar-nav {
  padding: .78rem 0 .52rem;
  flex: 1;
  min-height: 0;
}
.nav-section { padding: 0 .82rem; margin-bottom: .48rem; }
.nav-section-label {
  font-size: .72rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .08em; padding: .38rem .86rem .32rem;
}
.nav-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .66rem .88rem; border-radius: 12px;
  color: var(--text-muted); font-size: .86rem; font-weight: 600;
  transition: background .2s, color .2s, transform .2s, box-shadow .2s;
  cursor: pointer; margin-bottom: 2px;
  border: none; background: none; width: 100%; text-align: right;
  text-decoration: none;
  position: relative;
  line-height: 1.25;
}
.nav-item:hover {
  background: linear-gradient(135deg, rgba(79,70,229,.06), rgba(255,255,255,.75));
  color: var(--text);
  transform: translateY(-1px);
}
.nav-item.active {
  background: linear-gradient(135deg, #eef2ff, #f8faff);
  color: var(--primary);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(79,70,229,.08);
}
.nav-item .nav-icon {
  font-size: 1.04rem;
  flex-shrink: 0;
  width: 1.5rem;
  display: inline-flex;
  justify-content: center;
}
.nav-item .nav-badge {
  margin-right: auto; background: var(--danger);
  color: #fff; font-size: .65rem; font-weight: 700;
  padding: 1px 6px; border-radius: 999px; min-width: 18px; text-align: center;
}

.sidebar-footer {
  padding: .82rem .9rem .96rem;
  border-top: 1px solid var(--border);
}
.user-info {
  display: flex; align-items: center; gap: .75rem;
  padding: .62rem .78rem; border-radius: 12px;
  cursor: default;
  background: rgba(248,250,252,.85);
  border: 1px solid rgba(229,234,242,.85);
}
.user-avatar {
  width: 36px; height: 36px;
  background: var(--primary-light); color: var(--primary);
  border-radius: 12px; display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: .875rem;
}
.user-name { font-size: .86rem; font-weight: 600; }
.user-role { font-size: .72rem; color: var(--text-muted); }
.btn-logout {
  display: flex; align-items: center; gap: .5rem;
  padding: .62rem .78rem; border-radius: 12px;
  color: var(--danger); font-size: .86rem;
  background: none; border: none; width: 100%; margin-top: .35rem;
  transition: background .2s, transform .2s;
}
.btn-logout:hover { background: #fee2e2; transform: translateY(-1px); }


.main-content {
  flex: 1;
  margin-right: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}


.topbar {
  height: var(--header-h);
  background: rgba(255,255,255,.84);
  border-bottom: 1px solid rgba(229,234,242,.95);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  position: sticky;
  top: 0; z-index: 50;
  backdrop-filter: blur(16px);
}
.topbar-right { display: flex; align-items: center; gap: .75rem; }
.topbar-title { font-size: 1.15rem; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.btn-menu {
  display: none; background: rgba(255,255,255,.8); border: 1px solid var(--border);
  font-size: 1.2rem; color: var(--text-muted); padding: .25rem;
  width: 42px; height: 42px; border-radius: 12px;
  align-items: center; justify-content: center;
}
.topbar-actions { display: flex; align-items: center; gap: .65rem; }
.btn-refresh {
  background: rgba(255,255,255,.86); border: 1px solid var(--border);
  border-radius: 12px; padding: .55rem .95rem;
  font-size: .82rem; font-weight: 600; color: var(--text-muted);
  display: flex; align-items: center; gap: .4rem;
  transition: border-color .2s, color .2s, transform .2s, box-shadow .2s, background .2s;
  box-shadow: 0 4px 12px rgba(15,23,42,.04);
}
.btn-refresh:hover {
  border-color: rgba(79,70,229,.18);
  color: var(--primary);
  background: #fff;
  transform: translateY(-1px);
}
.btn-refresh.spinning .icon-refresh { animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }


.page-content { padding: 1.75rem; flex: 1; }
.page-header { margin-bottom: 1.5rem; }
.page-header h2 { font-size: 1.375rem; font-weight: 700; }
.page-header p { color: var(--text-muted); font-size: .875rem; margin-top: .25rem; }


.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.15rem;
  margin-bottom: 1.75rem;
}
.stat-card {
  background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(248,250,252,.94));
  border-radius: 20px;
  padding: 1.35rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  border: 1px solid rgba(229,234,242,.92);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(79,70,229,.05), transparent 52%);
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: rgba(79,70,229,.14);
}
.stat-card:hover::after { opacity: 1; }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.75);
}
.stat-icon.indigo { background: #ede9fe; }
.stat-icon.blue { background: #dbeafe; }
.stat-icon.green { background: #d1fae5; }
.stat-icon.orange { background: #fef3c7; }
.stat-icon.red { background: #fee2e2; }
.stat-icon.purple { background: #f3e8ff; }
.stat-info { flex: 1; min-width: 0; }
.stat-value { font-size: 1.85rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.stat-label { font-size: .83rem; color: var(--text-muted); margin-top: .32rem; }
.stat-change { font-size: .77rem; margin-top: .55rem; font-weight: 600; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }


.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.chart-card {
  background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(250,252,255,.94));
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(229,234,242,.92);
}
.chart-card h3 { font-size: 1rem; font-weight: 800; margin-bottom: 1.1rem; color: var(--text); }
.chart-container { position: relative; height: 236px; }


.table-card {
  background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(250,252,255,.94));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid rgba(229,234,242,.92);
}
.table-header {
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.table-header h3 { font-size: .98rem; font-weight: 800; }
.table-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.search-input {
  padding: .58rem .95rem;
  border: 1px solid var(--border);
  border-radius: 12px; font-size: .86rem;
  background: rgba(244,247,251,.88); direction: rtl;
  width: 210px; transition: border-color .2s, box-shadow .2s, background .2s;
}
.search-input:focus {
  outline: none;
  border-color: rgba(79,70,229,.28);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79,70,229,.08);
}

.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  background: #f8fafc;
  padding: .85rem 1rem;
  text-align: right;
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 1rem;
  font-size: .875rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fbfcff; }
.td-actions { display: flex; gap: .4rem; justify-content: flex-start; }


.badge {
  display: inline-flex; align-items: center;
  padding: .2rem .6rem; border-radius: 999px;
  font-size: .75rem; font-weight: 600; white-space: nowrap;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-purple { background: #f3e8ff; color: #6b21a8; }


.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1rem; border-radius: 8px;
  font-size: .875rem; font-weight: 600; border: none;
  transition: all .15s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(.9); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.9); }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline {
  background: none; border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--text); color: var(--text); }
.btn-sm { padding: .3rem .65rem; font-size: .8rem; border-radius: 6px; }
.btn-icon { padding: .4rem; border-radius: 8px; }
.btn-icon.edit { background: #dbeafe; color: #1d4ed8; }
.btn-icon.edit:hover { background: #bfdbfe; }
.btn-icon.del { background: #fee2e2; color: #dc2626; }
.btn-icon.del:hover { background: #fecaca; }
.btn-icon.toggle-on { background: #d1fae5; color: #065f46; }
.btn-icon.toggle-off { background: #fee2e2; color: #991b1b; }


.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200; display: flex;
  align-items: center; justify-content: center;
  padding: 1rem; opacity: 0;
  visibility: hidden; transition: all .2s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--surface);
  border-radius: 16px; padding: 1.75rem;
  width: 100%; max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  transform: scale(.95); transition: transform .2s;
  max-height: 90vh; overflow-y: auto;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 1.25rem;
}
.modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.btn-close {
  background: none; border: none;
  font-size: 1.25rem; color: var(--text-muted);
  line-height: 1; padding: .2rem;
}
.btn-close:hover { color: var(--text); }
.modal-body { }
.modal-footer {
  display: flex; gap: .75rem; justify-content: flex-end;
  margin-top: 1.25rem; padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.form-control {
  width: 100%; padding: .65rem .9rem;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: .9rem; transition: border-color .2s;
  background: #f8fafc; direction: ltr; text-align: right;
  color: var(--text);
}
.form-control:focus { outline: none; border-color: var(--primary); background: #fff; }
.form-label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: .4rem; }


.empty-state {
  text-align: center; padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: .75rem; opacity: .4; }
.empty-state p { font-size: .9rem; }


.toast-container {
  position: fixed; bottom: 1.5rem; left: 1.5rem;
  z-index: 999; display: flex; flex-direction: column; gap: .5rem;
}
.toast {
  background: var(--text); color: #fff;
  padding: .75rem 1.25rem; border-radius: 10px;
  font-size: .875rem; font-weight: 500;
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; gap: .5rem;
  animation: slideUp .3s ease;
  max-width: 320px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
@keyframes slideUp { from { opacity:0; transform: translateY(10px); } to { opacity:1; transform: translateY(0); } }


.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,.36);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
}


.loading-spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: currentColor;
  border-radius: 50%; animation: spin .7s linear infinite;
}
.page-loader {
  display: flex; align-items: center; justify-content: center;
  padding: 3rem; color: var(--text-muted);
}
.page-loader .loading-spinner { border-color: rgba(79,70,229,.2); border-top-color: var(--primary); }


.settings-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.settings-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,.34), transparent 32%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 45%, #3730a3 100%);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.settings-hero-copy { max-width: 680px; }
.settings-kicker {
  display: inline-flex;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .78;
  margin-bottom: .9rem;
}
.settings-hero h2 {
  font-size: 1.45rem;
  line-height: 1.35;
  margin-bottom: .6rem;
}
.settings-hero p {
  color: rgba(255,255,255,.82);
  line-height: 1.8;
  max-width: 58ch;
}
.settings-hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .75rem;
  min-width: 260px;
}
.settings-chip {
  min-width: 130px;
  padding: .85rem 1rem;
  border-radius: 18px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(8px);
}
.settings-chip strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .18rem;
}
.settings-chip span {
  font-size: .77rem;
  color: rgba(255,255,255,.82);
}
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, .92fr);
  gap: 1rem;
  align-items: start;
}
.settings-main-column,
.settings-side-column,
.settings-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.settings-panel {
  background: var(--surface);
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 24px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.settings-panel-accent {
  background: linear-gradient(180deg, rgba(238,242,255,.88), rgba(255,255,255,.98) 26%);
}
.settings-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.settings-panel-header h3 {
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: .35rem;
}
.settings-panel-header p {
  font-size: .84rem;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 62ch;
}
.settings-panel-eyebrow {
  display: inline-flex;
  margin-bottom: .45rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primary);
}
.branding-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .82fr);
  gap: 1rem;
  align-items: start;
}
.branding-fields { min-width: 0; }
.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem 1rem;
}
.settings-form-grid .span-2 { grid-column: 1 / -1; }
.settings-textarea {
  min-height: 112px;
  resize: vertical;
}
.field-note {
  margin-top: .45rem;
  font-size: .76rem;
  color: var(--text-muted);
}
.logo-source-switch {
  display: inline-flex;
  gap: .35rem;
  padding: .3rem;
  border-radius: 999px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
}
.logo-source-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
  padding: .55rem .95rem;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s ease;
}
.logo-source-btn.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 8px 18px rgba(79,70,229,.18);
}
.logo-source-panel { display: none; }
.logo-source-panel.active { display: block; }
.logo-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-height: 172px;
  padding: 1.35rem;
  border-radius: 22px;
  border: 1.5px dashed #94a3b8;
  background: linear-gradient(180deg, rgba(248,250,252,.95), rgba(241,245,249,.95));
  text-align: center;
  cursor: pointer;
  transition: all .2s ease;
}
.logo-dropzone:hover,
.logo-dropzone.dragover {
  border-color: var(--primary);
  background: linear-gradient(180deg, rgba(238,242,255,.95), rgba(224,231,255,.85));
  transform: translateY(-1px);
}
.logo-dropzone-icon { font-size: 1.7rem; }
.logo-dropzone-title {
  font-size: .92rem;
  font-weight: 700;
}
.logo-dropzone-subtitle {
  font-size: .77rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.logo-upload-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: .75rem;
  flex-wrap: wrap;
}
.logo-upload-status {
  font-size: .78rem;
  color: var(--text-muted);
}
.logo-upload-status.loading { color: #b45309; }
.logo-upload-status.success { color: #047857; }
.logo-upload-status.error { color: #b91c1c; }
.brand-preview-card {
  position: sticky;
  top: 1rem;
  padding: 1rem;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(148,163,184,.2);
  box-shadow: 0 18px 40px rgba(15,23,42,.08);
}
.brand-preview-badge {
  display: inline-flex;
  padding: .3rem .7rem;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--primary);
  font-size: .72rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.brand-preview-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  background: radial-gradient(circle at top right, rgba(99,102,241,.12), transparent 45%), linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  border: 1px solid rgba(148,163,184,.18);
  overflow: hidden;
  margin-bottom: 1rem;
}
.brand-preview-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.brand-preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, #1d4ed8, #4f46e5);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: .08em;
}
.brand-preview-copy h4 {
  font-size: 1rem;
  margin-bottom: .35rem;
}
.brand-preview-copy p {
  font-size: .84rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.brand-preview-footer {
  margin-top: 1rem;
  padding-top: .9rem;
  border-top: 1px dashed var(--border);
  font-size: .76rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.links-stack {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .85rem .95rem;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  border: 1px solid rgba(148,163,184,.16);
}
.link-item-copy { min-width: 0; }
.link-item-name {
  font-size: .9rem;
  font-weight: 700;
  margin-bottom: .2rem;
}
.link-item-url {
  font-size: .76rem;
  color: var(--text-muted);
  direction: ltr;
  overflow-wrap: anywhere;
}
.link-item-actions {
  display: flex;
  gap: .35rem;
  flex-shrink: 0;
}
.settings-empty {
  text-align: center;
  padding: 1.25rem;
  border-radius: 18px;
  background: #f8fafc;
  color: var(--text-muted);
  font-size: .84rem;
}
.settings-toggle-card {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: .9rem 1rem;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid rgba(148,163,184,.18);
  cursor: pointer;
}
.settings-toggle-card input[type="checkbox"] {
  margin-top: .2rem;
  inline-size: 18px;
  block-size: 18px;
  accent-color: var(--primary);
}
.settings-toggle-card strong {
  display: block;
  font-size: .88rem;
  margin-bottom: .2rem;
}
.settings-toggle-card span {
  display: block;
  font-size: .76rem;
  color: var(--text-muted);
  line-height: 1.6;
}


@media (max-width: 1024px) {
  .charts-grid { grid-template-columns: 1fr; }
  .stats-section { grid-template-columns: 1fr !important; }
  .settings-layout,
  .branding-grid {
    grid-template-columns: 1fr;
  }
  .brand-preview-card {
    position: static;
  }
}


.stats-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}


#visitsByCountry {
  padding: 1rem 0;
}
.country-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: .75rem;
  padding: .5rem;
  background: var(--bg);
  border-radius: 8px;
}
.country-name {
  font-weight: 600;
  min-width: 60px;
}
.country-bar {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.country-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 4px;
  transition: width .3s ease;
}
.country-count {
  font-size: .85rem;
  color: var(--text-muted);
  min-width: 80px;
  text-align: right;
}


#topCustomers {
  padding: 1rem 0;
}
.customer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: .5rem;
}
.customer-name {
  font-weight: 600;
}
.customer-mobile {
  font-size: .8rem;
  color: var(--text-muted);
}
.customer-orders {
  font-weight: 700;
  color: var(--primary);
}


.orders-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.order-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.order-id {
  font-weight: 700;
  color: var(--primary);
}
.order-ref {
  font-family: monospace;
  font-size: .85rem;
  color: var(--text-muted);
  direction: ltr;
}
.order-card-body {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: 1rem;
}
.order-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.order-label {
  font-size: .85rem;
  color: var(--text-muted);
}
.order-value {
  font-weight: 500;
}
.order-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, .95fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.overview-side {
  display: grid;
  gap: 1rem;
}
.overview-grid-single {
  grid-template-columns: minmax(0, 1fr);
}
.chart-card-wide {
  min-height: 100%;
}
.activity-chart-card {
  border-radius: 32px;
  padding: 1.9rem 2rem 1.35rem;
  border: 1px solid rgba(229,234,242,.92);
  box-shadow: var(--shadow);
}
.activity-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.2rem;
  margin-bottom: 1rem;
}
.activity-card-title {
  display: flex;
  align-items: center;
  gap: .65rem;
}
.activity-card-title h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 900;
  color: #11243f;
}
.activity-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 1rem;
  line-height: 1;
  color: #9aa3b2;
}
.activity-card-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: .2rem;
}
.activity-legend-item {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: #6b7280;
  font-size: .9rem;
  font-weight: 500;
  white-space: nowrap;
}
.activity-legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
}
.activity-legend-dot.orders {
  background: #63d7ad;
}
.activity-legend-dot.visits {
  background: #8f9bf4;
}
.chart-tall {
  height: 320px;
}
.activity-chart-wrap {
  height: 265px;
}
.section-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.section-card-head h3 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: .2rem;
}
.section-card-head p {
  color: var(--text-muted);
  font-size: .8rem;
}
.section-badge {
  display: inline-flex;
  align-items: center;
  padding: .35rem .7rem;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}
.insights-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.insight-card {
  padding: 1.5rem;
  border-radius: 28px;
  border: 1px solid rgba(229,234,242,.92);
  box-shadow: var(--shadow);
}
.completed-orders-card {
  padding: 1.25rem;
}
.ranking-card {
  background: #fff;
}
.ranking-card-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  margin-bottom: 1.45rem;
}
.ranking-card-title {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}
.ranking-card-head h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 900;
  color: #11243f;
}
.ranking-head-icon {
  width: 28px;
  height: 28px;
  color: #a1a9b8;
  flex-shrink: 0;
}
.ranking-head-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}
.ranking-head-icon.customer {
  color: #f2b529;
}
.ranking-card-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.completed-orders-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.completed-orders-head h3 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: .2rem;
}
.completed-orders-head p {
  color: var(--text-muted);
  font-size: .82rem;
}
.completed-orders-total {
  min-width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  color: #4f46e5;
  font-size: 1rem;
  font-weight: 800;
}
.completed-orders-list {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
.completed-order-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 48px;
  gap: .9rem;
  align-items: center;
  padding: 1rem 1.05rem;
  background: linear-gradient(180deg, rgba(248,250,252,.96), rgba(241,245,249,.96));
  border: 1px solid var(--border);
  border-radius: 18px;
}
.completed-order-count {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: #14233c;
}
.completed-order-count strong {
  font-size: 1.8rem;
  line-height: 1;
  font-weight: 800;
}
.completed-order-count span {
  color: var(--text-muted);
  font-size: .9rem;
  margin-top: .25rem;
}
.completed-order-main {
  min-width: 0;
}
.completed-order-name {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: .3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.completed-order-meta {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: var(--text-muted);
  font-size: .88rem;
  flex-wrap: wrap;
}
.completed-order-rank {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  color: #c2410c;
  font-size: 1rem;
  font-weight: 800;
}
.empty-inline {
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg);
  border-radius: 12px;
  font-size: .9rem;
}
.country-list,
.customer-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.country-spotlight-list,
.customer-spotlight-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.country-spotlight-row {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.country-spotlight-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.country-spotlight-name {
  font-size: 1rem;
  font-weight: 700;
  color: #24354c;
}
.country-spotlight-value {
  font-size: 1rem;
  line-height: 1.2;
  font-weight: 800;
  color: #14233c;
}
.country-spotlight-track {
  width: 100%;
  height: 11px;
  border-radius: 999px;
  background: #f0f2f6;
  overflow: hidden;
}
.country-spotlight-fill {
  height: 100%;
  border-radius: inherit;
  background: #7278f4;
}
.customer-spotlight-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 52px;
  gap: 1rem;
  align-items: center;
  padding: 1.15rem 1.2rem;
  background: linear-gradient(180deg, #fbfcff, #f7f9fc);
  border-radius: 22px;
}
.customer-spotlight-count {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: #14233c;
}
.customer-spotlight-count strong {
  font-size: 1.05rem;
  line-height: 1.1;
  font-weight: 800;
}
.customer-spotlight-count span {
  margin-top: .2rem;
  color: #97a1b2;
  font-size: .92rem;
}
.customer-spotlight-main {
  min-width: 0;
}
.customer-spotlight-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1f2f46;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.customer-spotlight-mobile {
  margin-top: .32rem;
  color: #97a1b2;
  font-size: .92rem;
  direction: ltr;
  text-align: left;
}
.customer-spotlight-rank {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
}
.customer-spotlight-rank.is-gold {
  background: #fff2c8;
  color: #c78b00;
}
.customer-spotlight-rank.is-silver {
  background: #eceaf7;
  color: #738098;
}
.customer-spotlight-rank.is-bronze {
  background: #ffe5ce;
  color: #c56d2a;
}
.customer-spotlight-rank.is-blue {
  background: #eef4ff;
  color: #2f68d6;
}
.country-row,
.customer-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: .9rem;
  align-items: center;
  padding: .9rem 1rem;
  background: linear-gradient(180deg, rgba(248,250,252,.95), rgba(241,245,249,.95));
  border: 1px solid var(--border);
  border-radius: 14px;
}
.country-rank,
.customer-rank {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--surface);
  color: var(--primary);
  font-weight: 800;
  box-shadow: var(--shadow);
}
.country-main,
.customer-main {
  min-width: 0;
}
.country-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .55rem;
}
.country-track {
  width: 100%;
  height: 10px;
  background: #dbe4ef;
  border-radius: 999px;
  overflow: hidden;
}
.country-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #14b8a6);
  border-radius: inherit;
}
.country-count,
.country-percent {
  color: var(--text-muted);
  font-size: .84rem;
  font-weight: 700;
}
.customer-name {
  font-size: .95rem;
  font-weight: 800;
  color: var(--text);
}
.customer-mobile {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .15rem;
}
.customer-orders {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .1rem;
  color: var(--primary);
  font-size: .78rem;
}
.customer-orders strong {
  font-size: 1.25rem;
  line-height: 1;
}
.orders-table-wrap {
  padding: 0 1rem 1rem;
}
.orders-table th {
  background: #f8fbff;
}
.orders-table td {
  vertical-align: top;
}
.order-inline-code {
  font-family: Consolas, monospace;
  direction: ltr;
  display: inline-block;
  font-size: .82rem;
  font-weight: 700;
  color: var(--text);
}
.cell-main {
  font-weight: 700;
  color: var(--text);
}
.cell-subtle {
  margin-top: .25rem;
  font-size: .75rem;
  color: var(--text-muted);
}
.count-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
}
.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: .35rem .75rem;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 800;
  font-size: .82rem;
}
.order-card-vertical {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}
.order-card-grid {
  display: grid;
  gap: .65rem;
}
.order-field {
  gap: .75rem;
  align-items: flex-start;
}
.order-label {
  min-width: 88px;
}
.order-value {
  text-align: left;
}
.order-value-mono {
  font-family: Consolas, monospace;
  direction: ltr;
  font-size: .82rem;
}


@media (max-width: 768px) {
  .stats-section {
    grid-template-columns: 1fr;
  }
  .customer-item {
    flex-direction: column;
    align-items: flex-start;
    gap: .25rem;
  }
  .country-item {
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
  }
  .country-bar {
    width: 100%;
  }
  .country-row,
  .customer-row,
  .completed-order-row,
  .customer-spotlight-row {
    grid-template-columns: 1fr;
  }
  .country-rank,
  .customer-rank {
    width: 34px;
    height: 34px;
  }
  .country-spotlight-top {
    flex-direction: column-reverse;
    align-items: flex-start;
  }
  .customer-spotlight-rank {
    width: 44px;
    height: 44px;
  }
  .completed-orders-head {
    flex-direction: column;
  }
  .completed-order-rank,
  .completed-orders-total {
    width: 40px;
    height: 40px;
  }
  .country-percent,
  .customer-orders {
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay {
    display: block;
  }
  .sidebar.open + .sidebar-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .main-content { margin-right: 0; }
  .btn-menu { display: flex; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-content { padding: 1rem; }
  .topbar { padding: 0 1rem; }
  .topbar-actions { gap: .5rem; }
  .btn-refresh { padding: .52rem .8rem; }
  .settings-hero {
    padding: 1.15rem;
    border-radius: 20px;
  }
  .settings-hero-stats {
    justify-content: stretch;
    width: 100%;
  }
  .settings-chip {
    flex: 1 1 0;
    min-width: 0;
  }
  .settings-form-grid {
    grid-template-columns: 1fr;
  }
  .settings-form-grid .span-2 {
    grid-column: auto;
  }
  .settings-panel-header {
    flex-direction: column;
  }
  .logo-upload-actions {
    align-items: flex-start;
  }
  th, td { padding: .6rem .75rem; }
  .table-header { flex-direction: column; align-items: flex-start; }
  .search-input { width: 100%; }
  .overview-grid,
  .insights-grid {
    grid-template-columns: 1fr;
  }
  .activity-card-header {
    flex-direction: column;
    align-items: stretch;
  }
  .chart-tall {
    height: 280px;
  }
  .activity-chart-wrap {
    height: 230px;
  }
  .orders-table-wrap {
    padding: 0;
  }
}

@media (max-height: 820px) and (min-width: 769px) {
  .sidebar-header {
    padding: .9rem 1.1rem .72rem;
  }
  .sidebar-nav {
    padding: .5rem 0 .28rem;
  }
  .nav-section {
    padding: 0 .62rem;
    margin-bottom: .28rem;
  }
  .nav-section-label {
    font-size: .66rem;
    padding: .24rem .72rem .2rem;
  }
  .nav-item {
    padding: .5rem .72rem;
    font-size: .8rem;
    border-radius: 10px;
  }
  .sidebar-footer {
    padding: .62rem .72rem .72rem;
  }
  .user-info,
  .btn-logout {
    padding: .5rem .62rem;
  }
}

@media (max-height: 720px) and (min-width: 769px) {
  .sidebar-title {
    font-size: .92rem;
  }
  .sidebar-subtitle,
  .user-role {
    font-size: .68rem;
  }
  .nav-item {
    padding: .44rem .66rem;
    font-size: .77rem;
  }
  .nav-item .nav-icon {
    width: 1.25rem;
    font-size: .92rem;
  }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .buttons-summary-grid { grid-template-columns: 1fr; }
  .topbar {
    height: auto;
    min-height: var(--header-h);
    padding: .75rem 1rem;
    align-items: flex-start;
    gap: .75rem;
    flex-wrap: wrap;
  }
  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .modal { padding: 1.25rem; }
  .td-actions { flex-wrap: wrap; }
}

.editor-steps {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
}

.editor-step {
  padding: .45rem .8rem;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 700;
}

.editor-step.active {
  background: #eef2ff;
  color: var(--primary);
}

.editor-step.done {
  background: #d1fae5;
  color: #047857;
}

.preview-box {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 22px;
  padding: 1rem 1.1rem;
}

.inst-title {
  font-size: .86rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: .65rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}

.info-card {
  padding: .9rem 1rem;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid rgba(148,163,184,.18);
}

.info-card .label {
  display: block;
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: .3rem;
}

.info-card .value {
  display: block;
  font-size: .9rem;
  font-weight: 800;
  color: var(--text);
}

.preview-media {
  width: 100%;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(148,163,184,.18);
  background: #fff;
  box-shadow: var(--shadow);
  margin-top: 1rem;
}

.preview-media img,
.preview-media video {
  width: 100%;
  display: block;
  max-height: 360px;
  object-fit: cover;
}

.log-payload {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.log-payload strong {
  font-size: .82rem;
}

.log-payload span {
  font-size: .75rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.overview-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 1.5rem;
  border-radius: 28px;
  background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
  color: #fff;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.35rem;
}

.overview-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.overview-brand-logo {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: rgba(255,255,255,.1);
  padding: .35rem;
}

.overview-brand h2 {
  font-size: 1.45rem;
  margin-bottom: .2rem;
}

.overview-brand span {
  display: block;
  font-size: .82rem;
  letter-spacing: .16em;
  opacity: .76;
}

.overview-actions {
  display: flex;
  gap: .65rem;
  flex-wrap: wrap;
}

.buttons-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: .85rem;
  padding: 1rem 1.15rem 0;
}

.summary-mini-card {
  padding: .95rem 1rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(248,250,252,.98), rgba(241,245,249,.95));
  border: 1px solid rgba(148,163,184,.16);
  box-shadow: 0 12px 28px rgba(15,23,42,.04);
}

.summary-mini-card span {
  display: block;
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: .35rem;
}

.summary-mini-card strong {
  display: block;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--text);
}

.dashboard-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.dashboard-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .95rem 1rem;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(148,163,184,.18);
}

.dashboard-list-item strong {
  display: block;
  font-size: .92rem;
  color: var(--text);
  margin-bottom: .2rem;
}

.dashboard-list-item span {
  display: block;
  font-size: .76rem;
  color: var(--text-muted);
}

.dashboard-list-item b {
  font-size: .82rem;
  color: var(--primary);
  white-space: nowrap;
}

.log-diff-list {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.log-diff-item {
  display: flex;
  flex-direction: column;
  gap: .18rem;
  padding: .72rem .82rem;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid rgba(148,163,184,.16);
}

.log-diff-item strong {
  font-size: .76rem;
  color: var(--text);
}

.log-diff-item span {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.log-diff-empty {
  padding: .9rem 1rem;
  border-radius: 16px;
  background: #f8fafc;
  color: var(--text-muted);
  border: 1px solid rgba(148,163,184,.14);
  line-height: 1.7;
}

.modal-wide {
  max-width: 980px;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .9fr);
  gap: 1rem;
}

.editor-form,
.editor-preview {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.editor-preview {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 24px;
  padding: 1rem;
}

.editor-preview-head {
  font-size: .86rem;
  font-weight: 800;
  color: var(--text);
}

.editor-preview-text {
  min-height: 220px;
  padding: 1rem;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid rgba(148,163,184,.18);
  line-height: 1.9;
  white-space: pre-wrap;
}

.editor-preview-media {
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(148,163,184,.18);
  background: #fff;
  box-shadow: var(--shadow);
}

.editor-preview-media img,
.editor-preview-media video {
  width: 100%;
  display: block;
  max-height: 360px;
  object-fit: cover;
}

.editor-preview-caption {
  padding: .95rem 1rem;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid rgba(148,163,184,.18);
  line-height: 1.8;
}

.editor-upload-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 1rem;
  color: var(--text-muted);
  background: #f8fafc;
}

.editor-textarea {
  min-height: 220px;
  resize: vertical;
}

.upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-height: 180px;
  padding: 1.1rem;
  border-radius: 22px;
  border: 1.5px dashed #94a3b8;
  background: linear-gradient(180deg, rgba(248,250,252,.95), rgba(241,245,249,.95));
  text-align: center;
  cursor: pointer;
  transition: all .2s ease;
}

.upload-dropzone.dragover,
.upload-dropzone:hover {
  border-color: var(--primary);
  background: linear-gradient(180deg, rgba(238,242,255,.96), rgba(224,231,255,.88));
}

.upload-dropzone-icon {
  font-size: .95rem;
  font-weight: 800;
  color: var(--primary);
}

.upload-dropzone-title {
  font-size: .92rem;
  font-weight: 800;
}

.upload-dropzone-subtitle {
  font-size: .78rem;
  color: var(--text-muted);
}

.settings-single-card {
  max-width: 640px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(248,250,252,.96));
  border-radius: 28px;
  padding: 1.5rem;
  border: 1px solid rgba(148,163,184,.18);
  box-shadow: var(--shadow);
}

.settings-grid {
  display: grid;
  gap: 1.25rem;
}

.settings-section-card {
  width: 100%;
  max-width: none;
}

.settings-single-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.settings-single-head h3 {
  font-size: 1.05rem;
  font-weight: 800;
}

.settings-single-head span {
  display: inline-flex;
  padding: .35rem .8rem;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--primary);
  font-size: .76rem;
  font-weight: 700;
}

.settings-section-head {
  align-items: flex-start;
}

.settings-textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.85;
}

.settings-actions {
  display: flex;
  justify-content: flex-start;
}

.password-field {
  position: relative;
}

.password-input {
  padding-left: 3.1rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  left: .65rem;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 12px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 8px 18px rgba(15,23,42,.08);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color .18s ease, transform .18s ease, background .18s ease;
}

.password-toggle:hover {
  color: var(--primary);
  background: #fff;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

.mobile-cards {
  display: none;
}

.mobile-data-card {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96));
  border-radius: 22px;
  border: 1px solid rgba(148,163,184,.18);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.mobile-data-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .85rem;
}

.mobile-data-head strong {
  font-size: .92rem;
  line-height: 1.6;
}

.mobile-data-row {
  display: flex;
  flex-direction: column;
  gap: .18rem;
  padding: .7rem 0;
  border-top: 1px solid rgba(148,163,184,.14);
}

.mobile-data-row:first-of-type {
  border-top: none;
}

.mobile-data-row span {
  font-size: .74rem;
  color: var(--text-muted);
}

.mobile-data-row b {
  font-size: .86rem;
  color: var(--text);
  line-height: 1.7;
}

.mobile-card-actions {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin-top: .9rem;
}

.desktop-hide {
  display: none;
}

@media (max-width: 900px) {
  .editor-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .settings-single-card {
    padding: 1.2rem;
  }

  .settings-single-head {
    flex-direction: column;
    align-items: stretch;
  }

  .overview-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .buttons-summary-grid {
    padding: 1rem 1rem 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-hide {
    display: none !important;
  }

  .desktop-hide,
  .mobile-cards {
    display: grid;
    gap: 1rem;
  }
}

