/* =====================================================
   ADSMACHINE AI — APP PAGES CSS
   ===================================================== */

/* ---- APP LAYOUT ---- */
.app-body {
  background: var(--bg-primary);
  min-height: 100vh;
  display: flex;
}

/* APP SIDEBAR */
.app-sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-color);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.15rem;
}
.sidebar-plan-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.badge-basic { background: rgba(100, 116, 139, 0.2); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.3); }
.badge-pro { background: rgba(124, 58, 237, 0.2); color: #a78bfa; border: 1px solid rgba(124, 58, 237, 0.4); }
.badge-premium { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}
.sidebar-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 8px 8px 6px;
  margin-top: 8px;
}
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 2px;
  text-decoration: none;
}
.sidebar-nav-item:hover, .sidebar-nav-item.active {
  background: rgba(124, 58, 237, 0.15);
  color: var(--text-primary);
}
.sidebar-nav-item.active { border-left: 3px solid var(--purple-primary); }
.sidebar-nav-item i { width: 18px; text-align: center; font-size: 0.95rem; }
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border-color);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}
.sidebar-user:hover { background: rgba(255,255,255,0.05); }
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-pro);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.user-info strong { display: block; font-size: 0.85rem; }
.user-info span { font-size: 0.75rem; color: var(--text-muted); }
.sidebar-credits {
  margin: 8px 12px;
  padding: 12px;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: var(--radius-md);
}
.credits-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.credits-bar {
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 4px;
}
.credits-fill {
  height: 100%;
  background: var(--gradient-pro);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}
.credits-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

/* APP MAIN CONTENT */
.app-main {
  margin-left: 260px;
  flex: 1;
  min-height: 100vh;
  padding: 32px;
}
.app-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}
.app-topbar-title h1 {
  font-size: 1.5rem;
  font-weight: 800;
}
.app-topbar-title p { font-size: 0.88rem; color: var(--text-secondary); margin-top: 2px; }
.btn-create-ad {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gradient-pro);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  transition: var(--transition);
  cursor: pointer;
  border: none;
}
.btn-create-ad:hover { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(124, 58, 237, 0.5); }

/* DASHBOARD STATS */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
}
.stat-card:hover { border-color: var(--border-hover); }
.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 12px;
}
.stat-icon.purple { background: rgba(124, 58, 237, 0.2); }
.stat-icon.blue { background: rgba(37, 99, 235, 0.2); }
.stat-icon.green { background: rgba(16, 185, 129, 0.2); }
.stat-icon.orange { background: rgba(245, 158, 11, 0.2); }
.stat-number { font-size: 1.8rem; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 0.82rem; color: var(--text-muted); }
.stat-trend {
  font-size: 0.75rem;
  margin-top: 6px;
}
.trend-up { color: var(--green-primary); }
.trend-down { color: var(--red-primary); }

/* APP PANELS */
.app-panel {
  display: none;
}
.app-panel.active { display: block; }

/* APP CARDS */
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 24px;
}
.app-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.app-card-title {
  font-size: 1rem;
  font-weight: 700;
}
.app-card-badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(124, 58, 237, 0.15);
  color: var(--purple-light);
  border: 1px solid rgba(124, 58, 237, 0.3);
}

/* AD LIST */
.ad-list { display: flex; flex-direction: column; gap: 12px; }
.ad-list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
  cursor: pointer;
}
.ad-list-item:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.ad-platform-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.platform-fb { background: rgba(24, 119, 242, 0.2); color: #1877f2; }
.platform-ig { background: rgba(225, 48, 108, 0.2); color: #e1306c; }
.platform-gg { background: rgba(66, 133, 244, 0.2); color: #4285f4; }
.platform-wa { background: rgba(37, 211, 102, 0.2); color: #25d366; }
.ad-info { flex: 1; min-width: 0; }
.ad-info-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-info-meta { font-size: 0.75rem; color: var(--text-muted); }
.ad-status {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.status-active { background: rgba(16, 185, 129, 0.15); color: var(--green-primary); border: 1px solid rgba(16, 185, 129, 0.3); }
.status-draft { background: rgba(100, 116, 139, 0.15); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.3); }
.ad-actions { display: flex; gap: 8px; }
.btn-ad-action {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.btn-ad-action:hover { border-color: var(--border-hover); color: var(--text-primary); }

/* CREATE AD FORM */
.create-ad-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.create-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 28px;
}
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}
.form-group label span {
  color: #ef4444;
  margin-left: 2px;
}
.form-control {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
  resize: vertical;
}
.form-control:focus { border-color: var(--purple-primary); background: var(--bg-card-hover); }
.form-control option { background: var(--bg-card); }
textarea.form-control { min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.platform-selector { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.platform-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.platform-option:hover { border-color: var(--border-hover); }
.platform-option.selected { border-color: var(--purple-primary); background: rgba(124, 58, 237, 0.15); color: var(--text-primary); }
.platform-option i { font-size: 1.2rem; }
.btn-generate {
  width: 100%;
  background: var(--gradient-pro);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
  position: relative;
  overflow: hidden;
}
.btn-generate:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(124, 58, 237, 0.5); }
.btn-generate:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.btn-generate-variations {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(124, 58, 237, 0.4);
  color: var(--purple-light);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 14px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
}
.btn-generate-variations:hover { background: rgba(124, 58, 237, 0.1); border-color: var(--purple-primary); }

/* RESULT PANEL */
.result-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 28px;
  min-height: 500px;
}
.result-empty {
  height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
}
.result-empty-icon { font-size: 4rem; margin-bottom: 16px; opacity: 0.5; }
.result-empty p { font-size: 0.9rem; max-width: 280px; line-height: 1.6; }

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.result-title { font-size: 1rem; font-weight: 700; }
.result-actions { display: flex; gap: 8px; }
.btn-result-action {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
}
.btn-result-action:hover { border-color: var(--border-hover); color: var(--text-primary); }
.btn-result-save { background: var(--gradient-pro); color: #fff; border: none; }
.btn-result-save:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4); }

.result-section {
  margin-bottom: 16px;
}
.result-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.result-section-content {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.result-section-content.cta-content {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--green-primary);
  font-weight: 700;
}

/* VARIATIONS */
.variations-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.variation-tab {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.variation-tab:hover { border-color: var(--border-hover); color: var(--text-secondary); }
.variation-tab.active { background: rgba(124, 58, 237, 0.2); border-color: var(--purple-primary); color: var(--purple-light); }

/* STRATEGY GRID */
.strategy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.strategy-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
}
.strategy-item-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.strategy-item-value { font-size: 0.88rem; color: var(--text-primary); font-weight: 600; }

/* WHATSAPP MODULE */
.whatsapp-preview {
  background: #0b1417;
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-top: 16px;
  border: 1px solid rgba(37, 211, 102, 0.2);
}
.wa-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 16px;
}
.wa-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25d366, #128c7e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.wa-name { font-weight: 700; font-size: 0.9rem; }
.wa-status { font-size: 0.72rem; color: #25d366; }
.wa-message {
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.2);
  border-radius: 0 12px 12px 12px;
  padding: 12px 14px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-primary);
  max-width: 90%;
  white-space: pre-wrap;
}
.wa-time { font-size: 0.68rem; color: var(--text-muted); margin-top: 4px; text-align: right; }

/* HISTORY TABLE */
.history-search {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.history-search input {
  flex: 1;
  min-width: 200px;
}
.history-table-wrapper { overflow-x: auto; }
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.history-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}
.history-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  vertical-align: middle;
}
.history-table tbody tr { transition: var(--transition); }
.history-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.history-table tbody tr:last-child td { border-bottom: none; }

/* PLANS UPGRADE SECTION */
.plans-upgrade-card {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(37, 99, 235, 0.15));
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: var(--radius-xl);
  padding: 28px;
  text-align: center;
  margin-bottom: 24px;
}
.plans-upgrade-card h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 8px; }
.plans-upgrade-card p { font-size: 0.88rem; color: var(--text-secondary); margin-bottom: 20px; }
.btn-upgrade {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gradient-pro);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  transition: var(--transition);
  border: none;
  cursor: pointer;
}
.btn-upgrade:hover { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(124, 58, 237, 0.5); }

/* LOGIN PAGE */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  padding: 24px;
  position: relative;
}
.auth-bg {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(124, 58, 237, 0.12) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(37, 99, 235, 0.08) 0%, transparent 60%);
  pointer-events: none;
}
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.3rem;
  margin-bottom: 8px;
}
.auth-card h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 6px; }
.auth-card .auth-subtitle { font-size: 0.88rem; color: var(--text-secondary); margin-bottom: 28px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.btn-auth {
  width: 100%;
  background: var(--gradient-pro);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 4px;
}
.btn-auth:hover { transform: translateY(-1px); box-shadow: 0 6px 25px rgba(124, 58, 237, 0.5); }
.auth-divider {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  position: relative;
  margin: 4px 0;
}
.auth-divider::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: calc(50% - 24px);
  height: 1px;
  background: var(--border-color);
}
.auth-divider::after {
  content: '';
  position: absolute;
  right: 0; top: 50%;
  width: calc(50% - 24px);
  height: 1px;
  background: var(--border-color);
}
.auth-switch {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 8px;
}
.auth-switch a { color: var(--purple-light); font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }
.auth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.85rem;
  color: #ef4444;
  display: none;
}
.auth-error.visible { display: block; }
.auth-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--green-primary);
  display: none;
}
.auth-success.visible { display: block; }
.demo-accounts {
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 12px;
}
.demo-accounts strong { color: var(--text-secondary); }
.demo-account-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 0;
  cursor: pointer;
  color: var(--purple-light);
  font-size: 0.8rem;
  transition: var(--transition);
  background: transparent;
  border: none;
  font-family: inherit;
}
.demo-account-btn:hover { color: var(--text-primary); }

/* SETTINGS PAGE */
.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 20px;
}
.settings-section h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}
.settings-row:last-child { border-bottom: none; }
.settings-row-label strong { display: block; font-size: 0.88rem; }
.settings-row-label span { font-size: 0.78rem; color: var(--text-muted); }
.btn-settings {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
}
.btn-settings:hover { border-color: var(--border-hover); color: var(--text-primary); }
.btn-settings-danger { border-color: rgba(239, 68, 68, 0.3); color: #ef4444; }
.btn-settings-danger:hover { background: rgba(239, 68, 68, 0.1); border-color: #ef4444; }
.btn-settings-primary { background: var(--gradient-pro); color: #fff; border: none; }
.btn-settings-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4); }

/* TOAST NOTIFICATION */
.toast {
  position: fixed;
  bottom: 80px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  z-index: 9998;
  box-shadow: var(--shadow-lg);
  transform: translateX(120%);
  transition: transform 0.3s ease;
  max-width: 360px;
}
.toast.show { transform: translateX(0); }
.toast.toast-success { border-color: rgba(16, 185, 129, 0.4); }
.toast.toast-success .toast-icon { color: var(--green-primary); }
.toast.toast-error { border-color: rgba(239, 68, 68, 0.4); }
.toast.toast-error .toast-icon { color: #ef4444; }
.toast-icon { font-size: 1rem; flex-shrink: 0; }

/* MODAL */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 9990;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(8px);
}
.modal-overlay.active { display: flex; }
.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 560px;
  animation: popupSlide 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-card::-webkit-scrollbar { width: 4px; }
.modal-card::-webkit-scrollbar-track { background: transparent; }
.modal-card::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-header h3 { font-size: 1.1rem; font-weight: 800; }
.modal-close {
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  padding: 4px 8px;
  border-radius: 4px;
}
.modal-close:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }

/* RESPONSIVE APP */
@media (max-width: 900px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-sidebar.open { transform: translateX(0); }
  .app-main { margin-left: 0; padding: 20px 16px; }
  .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
  .create-ad-layout { grid-template-columns: 1fr; }
  .strategy-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .dashboard-stats { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .app-card { padding: 20px; }
  .auth-card { padding: 32px 24px; }
}
