@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&display=swap');

/* ================================================================
   SOCIALITE AGENCY — Dashboard Design System
   ================================================================ */

:root {
  --grad-start:   #4ECDC4;
  --grad-end:     #2EBC6E;
  --grad:         linear-gradient(135deg, var(--grad-start), var(--grad-end));
  --bg:           #0F1923;
  --surface:      #1A2635;
  --surface-hi:   #1E2D40;
  --border:       #2A3645;
  --border-hi:    #354860;
  --text:         #FFFFFF;
  --text-2:       #A0AEC0;
  --text-3:       #627386;
  --danger:       #E53E3E;
  --danger-dim:   rgba(229,62,62,0.12);
  --success:      #48BB78;
  --success-dim:  rgba(72,187,120,0.12);
  --warning:      #F6AD55;
  --warning-dim:  rgba(246,173,85,0.12);
  --accent:       #4ECDC4;
  --accent-dim:   rgba(78,205,196,0.12);
  --sidebar-w:    240px;
  --header-h:     64px;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 4px 24px rgba(0,0,0,0.35);
  --font:         'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: var(--font); cursor: pointer; }
input, textarea, select { font-family: var(--font); }

/* ================================================================
   LAYOUT
   ================================================================ */

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

/* ── Sidebar ── */

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-size: 17px;
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.sidebar-logo .logo-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.nav-section {
  padding: 0 12px 8px;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}

.nav-item svg { flex-shrink: 0; opacity: 0.7; }

.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.nav-item:hover svg { opacity: 1; }

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.nav-item.active svg { opacity: 1; color: var(--accent); }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

.sidebar-footer form { margin: 0; }

/* Platform nav — section header (non-clickable) */
.nav-section-header {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 14px 12px 4px;
  pointer-events: none;
}

.nav-section-header svg { opacity: 0.6; flex-shrink: 0; }

/* Platform nav — sub-items (indented, slightly smaller) */
.nav-sub-item {
  padding-left: 28px;
  font-size: 13px;
}

/* Sidebar footer user info */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 10px;
  color: var(--text-3);
  font-size: 12px;
}

.sidebar-user svg { flex-shrink: 0; opacity: 0.6; }
.sidebar-user-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Main content ── */

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

/* ── Page header ── */

.page-header {
  padding: 32px 32px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-2);
  margin-top: 4px;
}

/* ── Page content ── */

.page-content {
  padding: 24px 32px 48px;
  flex: 1;
}

/* ================================================================
   CARDS
   ================================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.card-body { padding: 24px; }

/* ── Stat cards ── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad);
  border-radius: var(--radius) var(--radius) 0 0;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-value.active   { color: var(--success); }
.stat-value.inactive { color: var(--danger); }

/* ── Client cards ── */

.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.client-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.client-card:hover {
  border-color: var(--border-hi);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.client-screenshot {
  height: 160px;
  background: var(--surface-hi);
  position: relative;
  overflow: hidden;
}

.client-screenshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.client-screenshot .no-screenshot {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-3);
  font-size: 13px;
}

/* Logo badge overlaid on client card screenshot */
.client-logo-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-hi);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  z-index: 1;
}
.client-logo-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.client-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.client-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.client-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.client-url {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.client-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.client-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 4px;
}

/* ── Module badges ── */

.module-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.module-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--accent-dim);
  color: var(--accent);
  letter-spacing: 0.02em;
}

/* ================================================================
   BADGES / STATUS
   ================================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-active {
  background: var(--success-dim);
  color: var(--success);
}
.badge-active .badge-dot { background: var(--success); }

.badge-inactive {
  background: var(--danger-dim);
  color: var(--danger);
}
.badge-inactive .badge-dot { background: var(--danger); }

.badge-plan {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ================================================================
   BUTTONS
   ================================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; }

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 14px rgba(78,205,196,0.25);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(78,205,196,0.4);
  opacity: 1;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-hi);
  color: var(--text-2);
}

.btn-outline:hover { background: rgba(255,255,255,0.04); color: var(--text); }

.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid rgba(229,62,62,0.3);
}

.btn-success {
  background: var(--success-dim);
  color: var(--success);
  border: 1px solid rgba(72,187,120,0.3);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 12px 28px;
  font-size: 15px;
}

.btn-icon-only {
  width: 34px; height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.btn-icon-only:hover { background: rgba(255,255,255,0.09); color: var(--text); }

/* ── Toggle switch ── */

.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.toggle {
  position: relative;
  width: 44px; height: 24px;
  flex-shrink: 0;
}

.toggle input {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}

.toggle-track {
  position: absolute; inset: 0;
  background: var(--border);
  border-radius: 24px;
  transition: background 0.2s;
  cursor: pointer;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.toggle input:checked + .toggle-track {
  background: var(--grad-start);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}

/* ================================================================
   FORMS
   ================================================================ */

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.form-label .required { color: var(--danger); margin-left: 2px; }
.form-hint {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}

.form-control {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(78,205,196,0.12);
}

.form-control::placeholder { color: var(--text-3); }

textarea.form-control {
  resize: vertical;
  min-height: 90px;
  line-height: 1.55;
}

.form-control-sm {
  padding: 7px 11px;
  font-size: 13px;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23627386' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

select.form-control option {
  background: var(--surface);
  color: var(--text);
}

.color-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-swatch {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.15s;
}

.color-swatch:hover { border-color: var(--accent); }

input[type="color"] {
  width: 36px; height: 36px;
  padding: 2px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* ── Form row ── */

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Collapsible sections ── */

.section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.section-header:hover { background: var(--surface-hi); }

.section-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.section-letter {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.section-chevron {
  color: var(--text-3);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.section.open .section-chevron { transform: rotate(180deg); }

.section-body {
  padding: 20px;
  background: rgba(255,255,255,0.01);
  border-top: 1px solid var(--border);
  display: none;
}

.section.open .section-body { display: block; }

/* ── Module toggle cards ── */

.modules-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.module-card {
  background: var(--surface-hi);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  transition: border-color 0.15s;
}

.module-card.enabled { border-color: rgba(78,205,196,0.3); }

.module-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.module-card-info { flex: 1; }

.module-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.module-desc {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 3px;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(246,173,85,0.15);
  color: var(--warning);
  letter-spacing: 0.02em;
}

.module-sub {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: none;
}

.module-card.enabled .module-sub { display: block; }

/* ── Chips preview ── */

.chips-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  min-height: 48px;
}

.chip-preview {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(78,205,196,0.25);
  border-radius: 20px;
  padding: 5px 13px;
}

.chip-preview.disabled {
  opacity: 0.3;
}

/* == Upload area ── */

.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 28px;
  text-align: center;
  color: var(--text-3);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.upload-area:hover, .upload-area.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.upload-area p { font-size: 13px; margin-top: 6px; }

.files-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-hi);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.file-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item-date {
  font-size: 11px;
  color: var(--text-3);
  flex-shrink: 0;
}

/* ================================================================
   TABLES
   ================================================================ */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--surface-hi);
}

td { font-size: 13px; color: var(--text-2); }
td:first-child { color: var(--text); font-weight: 500; }

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ================================================================
   LOGIN PAGE
   ================================================================ */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 800px 600px at 50% 0%, rgba(78,205,196,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 600px 400px at 0% 100%, rgba(46,188,110,0.04) 0%, transparent 70%);
  padding: 24px;
}

.login-box {
  width: 100%;
  max-width: 400px;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .brand {
  font-size: 26px;
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.login-logo .tagline {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 4px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.4);
}

.login-card h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.login-card p {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 24px;
}

.login-error {
  background: var(--danger-dim);
  border: 1px solid rgba(229,62,62,0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--danger);
  margin-bottom: 16px;
}

/* ================================================================
   PROGRESS / SPINNER
   ================================================================ */

.progress-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 0;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-3);
}

.step-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-hi);
  border: 1px solid var(--border);
  flex-shrink: 0;
  font-size: 12px;
}

.progress-step.done { color: var(--success); }
.progress-step.done .step-icon { background: var(--success-dim); border-color: rgba(72,187,120,0.4); color: var(--success); }

.progress-step.active { color: var(--text); }
.progress-step.active .step-icon {
  background: var(--accent-dim);
  border-color: rgba(78,205,196,0.4);
  color: var(--accent);
}

.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(78,205,196,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================================
   TOAST NOTIFICATIONS
   ================================================================ */

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: toast-in 0.3s ease;
  pointer-events: all;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast-success { background: #1a472a; border: 1px solid rgba(72,187,120,0.4); }
.toast-error   { background: #4a1919; border: 1px solid rgba(229,62,62,0.4); }
.toast-info    { background: #1a2e4a; border: 1px solid rgba(78,205,196,0.3); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   DEMO PAGE
   ================================================================ */

.demo-page {
  min-height: 100vh;
  position: relative;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.demo-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

.demo-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(15,25,35,0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.demo-topbar .demo-title {
  font-size: 14px;
  font-weight: 600;
  flex: 1;
  min-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demo-topbar .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.demo-powered {
  position: fixed;
  bottom: 100px;
  left: 20px;
  z-index: 100;
  background: rgba(15,25,35,0.85);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 11px;
  color: var(--text-3);
  backdrop-filter: blur(8px);
}

.demo-powered strong {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ================================================================
   EMBED SCRIPT BOX
   ================================================================ */

.embed-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--accent);
  word-break: break-all;
  position: relative;
}

/* ================================================================
   HAMBURGER (mobile)
   ================================================================ */

.hamburger {
  display: none;
  position: fixed;
  top: 16px; left: 16px;
  z-index: 200;
  width: 40px; height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-2);
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 90;
}

/* ================================================================
   MISC UTILITIES
   ================================================================ */

.divider { height: 1px; background: var(--border); margin: 20px 0; }
.text-muted { color: var(--text-3); }
.text-sm { font-size: 12px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }
.w-full { width: 100%; }

.save-bar {
  position: fixed;
  bottom: 0; left: var(--sidebar-w); right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  z-index: 50;
}

/* ================================================================
   MOBILE RESPONSIVE
   ================================================================ */

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .main { margin-left: 0; }

  .sidebar {
    transform: translateX(-100%);
    width: 240px;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0,0,0,0.5);
  }

  .hamburger { display: flex; }

  .overlay.show { display: block; }

  .page-header { padding: 24px 16px 0 64px; }
  .page-content { padding: 20px 16px 80px; }

  .save-bar { left: 0; padding: 12px 16px; }

  .form-row { grid-template-columns: 1fr; }

  .clients-grid { grid-template-columns: 1fr; }

  .stats-grid { grid-template-columns: 1fr 1fr; }

  .demo-topbar .demo-title { display: none; }

  .client-card-actions .btn span { display: none; }
}

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

/* ================================================================
   PHASE 4 ADDITIONS — skeleton loaders, empty states, warning toast
   ================================================================ */

/* ── Skeleton loaders ── */

@keyframes skeleton-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}

.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.4s infinite;
  border-radius: 4px;
}

.skeleton-text  { height: 14px; width: 70%; margin: 6px 0; }
.skeleton-title { height: 18px; width: 40%; margin: 4px 0; }
.skeleton-badge { height: 22px; width: 60px; border-radius: 20px; }
.skeleton-full  { height: 14px; width: 100%; margin: 6px 0; }

/* ── Empty states ── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-3);
  gap: 12px;
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  opacity: 0.35;
}

.empty-state-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-2);
}

.empty-state-desc {
  font-size: 13px;
  color: var(--text-3);
  max-width: 320px;
  line-height: 1.6;
}

.empty-state .btn {
  margin-top: 4px;
}

/* ── Warning toast (was missing) ── */

.toast-warning { background: #3d2e0a; border: 1px solid rgba(246,173,85,0.4); }

/* ── Toast with close icon ── */

.toast { position: relative; max-width: 360px; }

/* ── Table row height 48px (touch-friendly) ── */

.table-wrap table tbody tr td {
  height: 48px;
  padding: 0 16px;
  vertical-align: middle;
}

.table-wrap table thead tr th {
  padding: 10px 16px;
}

.table-wrap table tbody tr:hover {
  background: rgba(255,255,255,0.025);
  cursor: pointer;
}

/* ── Mobile table: horizontal scroll ── */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Buttons minimum touch target ── */

@media (max-width: 768px) {
  .btn, button.nav-item, .nav-item {
    min-height: 44px;
  }

  .page-header {
    padding: 20px 16px 0;
    flex-direction: column;
    align-items: flex-start;
  }

  .page-content {
    padding: 16px 16px 40px;
  }
}
