/* ========================================
   DASHBOARD — Styles
   ======================================== */

.dashboard-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--gray-50);
}

/* ========== GLOBAL TOPBAR (full-width) ========== */
.topbar-global {
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    min-height: 60px;
    background: #ffffff;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    width: 100%;
    box-sizing: border-box;
}

body.dark .topbar-global {
    background: #3a363f;
    border-color: #5a5560;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.topbar-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    display: flex;
    align-items: center;
}

.topbar-center a {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.topbar-center a:hover {
    opacity: 0.85;
}

.topbar-logo {
    height: 42px;
    width: auto;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.06));
}

body.dark .topbar-logo {
    filter: brightness(1.15) drop-shadow(0 1px 3px rgba(0,0,0,0.3));
}

/* ========== APP LAYOUT (sidebar + main) ========== */
.app-layout {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* ---- Dark Mode ---- */
.dark .dashboard-body,
body.dark {
    --dark: #f8fafc;
    --dark-800: #f1f5f9;
    --dark-700: #e2e8f0;
    --dark-600: #cbd5e1;
    --gray: #64748b;
    --gray-light: #334155;
    --gray-100: #5a5560;
    --gray-50: #4f4a54;
    --white: #5a5560;
}

body.dark {
    background: #4f4a54;
    color: #f8fafc;
}

body.dark .sidebar {
    background: #4f4a54;
    border-color: #5a5560;
}

body.dark .topbar {
    background: rgba(15, 23, 42, 0.9);
    border-color: #5a5560;
}

body.dark .stat-card,
body.dark .project-card,
body.dark .action-card,
body.dark .preview-panel,
body.dark .creator-controls,
body.dark .control-section,
body.dark .upload-zone {
    background: #5a5560;
    border-color: #334155;
}

body.dark input,
body.dark select,
body.dark textarea {
    background: #4f4a54;
    border-color: #334155;
    color: #f8fafc;
}

body.dark .sidebar-link:hover,
body.dark .sidebar-link.active {
    background: rgba(124, 58, 237, 0.15);
}

body.dark .form-select,
body.dark .form-textarea {
    background: #4f4a54;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark .credits-card {
    background: rgba(124, 58, 237, 0.1);
    border-color: #334155;
}

body.dark .important-notice {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
}

/* ========== APPEARANCE DRAWER (shared with orders) ========== */
.appearance-overlay {
    position: fixed; inset: 0; z-index: 998;
    background: rgba(0,0,0,0.3);
    opacity: 0; visibility: hidden;
    transition: all 0.3s ease;
}
.appearance-overlay.open { opacity: 1; visibility: visible; }
.appearance-drawer {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 340px; max-width: 92vw; z-index: 999;
    background: #fff; border-right: 1px solid #e5e7eb;
    box-shadow: 8px 0 32px rgba(0,0,0,0.12);
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
    display: flex; flex-direction: column; overflow: hidden;
}
.appearance-drawer.open { transform: translateX(0) !important; }
.appear-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px; border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f8fafc, #eef2f7);
}
.appear-header h3 { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 700; margin: 0; }
.appear-close { width: 32px; height: 32px; border-radius: 8px; border: none; background: #f1f5f9; cursor: pointer; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; }
.appear-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.appear-section { display: flex; flex-direction: column; gap: 8px; }
.appear-label { font-size: 0.82rem; font-weight: 700; color: #374151; text-transform: uppercase; letter-spacing: 0.03em; }
.appear-color-row { display: flex; align-items: center; gap: 8px; }
.appear-color-input { width: 40px; height: 36px; border: 2px solid #e5e7eb; border-radius: 8px; cursor: pointer; padding: 2px; background: #fff; }
.appear-color-input::-webkit-color-swatch-wrapper { padding: 0; }
.appear-color-input::-webkit-color-swatch { border-radius: 5px; border: none; }
.appear-hex-input { flex: 1; padding: 8px 12px; border: 1.5px solid #e5e7eb; border-radius: 8px; font-family: 'Space Grotesk', monospace; font-size: 0.88rem; font-weight: 600; color: #374151; text-align: center; }
.appear-hex-input:focus { border-color: var(--primary); outline: none; }
.appear-reset-btn { width: 36px; height: 36px; border-radius: 8px; border: 1.5px solid #e5e7eb; background: #f8fafc; cursor: pointer; font-size: 1rem; color: #6b7280; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.appear-reset-btn:hover { background: #fee2e2; color: #ef4444; }
.appear-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.appear-preset { width: 28px; height: 28px; border-radius: 8px; border: 2px solid #e5e7eb; cursor: pointer; transition: all 0.2s; }
.appear-preset:hover { transform: scale(1.15); border-color: var(--primary); }
.appear-slider-row { display: flex; align-items: center; gap: 12px; }
.appear-range { flex: 1; height: 6px; -webkit-appearance: none; appearance: none; background: #e5e7eb; border-radius: 3px; }
.appear-range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; background: var(--primary, #7c3aed); border-radius: 50%; cursor: pointer; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(124,58,237,0.3); }
.appear-range-val { min-width: 44px; text-align: center; font-size: 0.82rem; font-weight: 700; color: var(--primary, #7c3aed); background: rgba(124,58,237,0.06); padding: 4px 8px; border-radius: 6px; }
.appear-divider { height: 1px; background: #e5e7eb; margin: 4px 0; }
.appear-actions { display: flex; gap: 8px; margin-top: 8px; }
.appear-actions .btn-primary, .appear-actions .btn-outline { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 14px; border-radius: 10px; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
body.dark .appearance-drawer { background: #5a5560; border-color: #334155; }
body.dark .appear-header { background: linear-gradient(135deg, #5a5560, #4f4a54); border-color: #334155; }
body.dark .appear-header h3 { color: #f1f5f9; }
body.dark .appear-close { background: #334155; color: #e2e8f0; }
body.dark .appear-label { color: #cbd5e1; }
body.dark .appear-hex-input { background: #4f4a54; border-color: #334155; color: #e2e8f0; }

/* ========== SIDEBAR ========== */
.sidebar {
    width: 260px;
    min-width: 260px;
    height: calc(100vh - 60px);
    position: sticky;
    top: 60px;
    background: var(--white);
    border-right: none;
    box-shadow: 2px 0 8px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    overflow-y: auto;
    margin-top: 0;
    align-self: flex-start;
}

body.dark .sidebar {
    box-shadow: 2px 0 8px rgba(0,0,0,0.2);
}

/* Sidebar fully hidden */
.sidebar.hidden {
    width: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: none !important;
    box-shadow: none !important;
}

/* Sidebar toggle button */
.sidebar-toggle-btn {
    display: flex !important;
    transition: transform 0.3s ease;
}

.sidebar.hidden ~ .main-content {
    flex: 1;
}

.sidebar.collapsed {
    width: 70px;
    min-width: 70px;
}

.sidebar.collapsed .sidebar-search,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .sidebar-link span,
.sidebar.collapsed .link-badge,
.sidebar.collapsed .credits-card,
.sidebar.collapsed .user-info,
.sidebar.collapsed .user-menu-btn,
.sidebar.collapsed .logo-text {
    display: none;
}

.sidebar.collapsed .sidebar-link {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
}

.sidebar-header {
    display: none;
}

.sidebar-collapse-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray);
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.sidebar-collapse-btn:hover {
    color: var(--primary);
    background: var(--primary-50);
}

/* Search */
.sidebar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 16px;
    padding: 8px 12px;
    background: var(--gray-50);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: var(--radius-sm);
    color: var(--gray);
}

.sidebar-search input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 0.82rem;
    color: var(--dark);
    font-family: 'Inter', sans-serif;
}

.sidebar-search kbd {
    padding: 2px 6px;
    font-size: 0.65rem;
    background: var(--white);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 4px;
    color: var(--gray);
    font-family: 'Inter', sans-serif;
}

/* Nav */
.sidebar-nav {
    flex: 1;
    padding: 8px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 16px;
}

.nav-section-title {
    display: block;
    padding: 8px 8px 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--dark-600);
    transition: all var(--transition);
    cursor: pointer;
    text-decoration: none;
}

.sidebar-link i {
    width: 18px;
    height: 18px;
    min-width: 18px;
}

.sidebar-link:hover {
    background: var(--primary-50);
    color: var(--primary);
}

.sidebar-link.active {
    background: var(--primary-100);
    color: var(--primary);
    font-weight: 600;
}

.link-badge {
    margin-left: auto;
    padding: 1px 7px;
    border-radius: var(--radius-full);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
}

.link-badge.popular { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.link-badge.new { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.link-badge.sale { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

/* Sidebar Footer */
.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(0,0,0,0.04);
}

.credits-card {
    padding: 12px;
    background: var(--primary-50);
    border: 1px solid var(--primary-200);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.credits-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.credits-bar {
    height: 6px;
    background: var(--primary-100);
    border-radius: 3px;
    margin-bottom: 8px;
    overflow: hidden;
}

.credits-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    transition: width 1s ease;
}

.credits-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
}

.credits-info span { color: var(--gray); }
.credits-info a { color: var(--primary); font-weight: 600; }

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
}

.user-card:hover {
    background: var(--gray-50);
}

.user-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
}

.user-info strong {
    display: block;
    font-size: 0.85rem;
    color: var(--dark);
}

.user-info span {
    font-size: 0.72rem;
    color: var(--gray);
}

.user-menu-btn {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray);
    padding: 4px;
    border-radius: 4px;
}

.user-menu-btn:hover {
    color: var(--primary);
    background: var(--primary-50);
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid rgba(124,58,237,0.1);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s ease;
    z-index: 100;
}

.user-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--dark-600);
    transition: all var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
}

.dropdown-item:hover {
    background: var(--primary-50);
    color: var(--primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-100);
    margin: 4px 0;
}

body.dark .user-dropdown {
    background: #5a5560;
    border-color: #334155;
}
body.dark .dropdown-item { color: #94a3b8; }
body.dark .dropdown-item:hover { background: rgba(124,58,237,0.15); color: #a78bfa; }
body.dark .dropdown-divider { background: #334155; }

/* ========== MAIN CONTENT ========== */
.main-content {
    flex: 1;
    min-width: 0;
    min-height: calc(100vh - 60px);
}

/* Topbar (legacy - kept for compatibility) */
.topbar {
    display: none;
}

/* Sidebar logo - hidden (logo is now in topbar-global) */
.sidebar-header .logo {
    display: none;
}

.logo-img {
    height: 38px;
    width: auto;
    max-width: 160px;
    display: block;
    object-fit: contain;
}

body.dark .logo-img {
    filter: brightness(1.1) drop-shadow(0 1px 3px rgba(0,0,0,0.3));
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-sidebar-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--dark-600);
    padding: 4px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--gray);
}

.breadcrumb .current {
    color: var(--dark);
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-btn {
    width: 36px;
    height: 36px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    cursor: pointer;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    position: relative;
    box-shadow: 0 1px 2px rgba(15,23,42,0.05);
}

.topbar-btn:hover {
    background: #f8fafc;
    color: #4f4a54;
    border-color: #9ca3af;
}

.notification-btn .notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--error);
    border-radius: 50%;
    border: 2px solid var(--white);
}

/* ========== PANELS ========== */
.panel {
    display: none;
    padding: 32px;
    animation: fadeIn 0.3s ease;
}

.panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 36px;
    flex-wrap: wrap;
    gap: 16px;
}

.panel-header h1 {
    font-family: 'Inter', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

body.dark .panel-header h1 { color: #f8fafc; }

.panel-header p {
    font-size: 0.9rem;
    color: var(--gray);
}

.cost-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--warning);
}

.cost-badge.sale {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

/* ---- Stats Grid (unified wrapper — matches orders.css reference) ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    margin-bottom: 40px;
    border: 1px solid #d9e1e8;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 4px rgba(15,23,42,0.04);
}

body.dark .stats-grid {
    background: #4f4a54;
    border-color: #635e69;
}

.stat-card {
    background: transparent;
    border: 0;
    border-inline-start: 1px solid #e5ebf0;
    border-radius: 0;
    box-shadow: none;
    min-height: 92px;
    padding: 14px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    overflow: hidden;
    transition: none;
}

.stat-card:first-child {
    border-inline-start: 0;
}

.stat-card::before {
    content: '';
    position: absolute;
    bottom: 12px;
    left: 22px;
    right: 22px;
    height: 2px;
    width: auto;
    top: auto;
    background: linear-gradient(90deg, #93c5fd, #38bdf8);
    opacity: .9;
    border-radius: 999px;
}

.stat-card:hover {
    transform: none;
    box-shadow: none;
}

body.dark .stat-card {
    border-inline-start-color: rgba(148,163,184,0.10);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
}

.stat-card-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #3f3f46;
}

body.dark .stat-card-label { color: #cbd5e1; }

.stat-card-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-icon.blue { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.stat-card-icon.purple { background: rgba(124, 58, 237, 0.1); color: #7c3aed; }
.stat-card-icon.cyan { background: rgba(6, 182, 212, 0.1); color: #06b6d4; }
.stat-card-icon.amber { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

body.dark .stat-card-icon.blue { background: rgba(59,130,246,0.2); color: #60a5fa; }
body.dark .stat-card-icon.purple { background: rgba(124,58,237,0.2); color: #a78bfa; }
body.dark .stat-card-icon.cyan { background: rgba(6,182,212,0.2); color: #22d3ee; }
body.dark .stat-card-icon.amber { background: rgba(245,158,11,0.2); color: #fbbf24; }

.stat-card-value {
    font-family: 'Inter', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: #4f4a54;
    margin-bottom: 4px;
    line-height: 1.2;
}

body.dark .stat-card-value { color: #f8fafc; }

.stat-card-change {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    font-size: 0.78rem;
    font-weight: 700;
}

.stat-card-change.positive { color: #16a34a; }
.stat-card-change.negative { color: #dc2626; }
.stat-card-change.neutral { color: #6b7280; }

body.dark .stat-card-change.positive { color: #34d399; }
body.dark .stat-card-change.negative { color: #f87171; }
body.dark .stat-card-change.neutral { color: #94a3b8; }

/* ---- Quick Actions ---- */
.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title-row h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--dark);
}

body.dark .section-title-row h2 { color: #f8fafc; }

.see-all {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary);
}

.see-all:hover { text-decoration: underline; }

.quick-actions {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 40px;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 12px;
    background: var(--white);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
}

.action-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-200);
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-card span {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--dark-700);
}

/* ---- Projects Grid ---- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.project-card {
    background: var(--white);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.project-thumb {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.ugc-thumb { background: linear-gradient(135deg, #fce7f3, #f3e8ff); }
.lp-thumb { background: linear-gradient(135deg, #e0f2fe, #ede9fe); }
.video-thumb { background: linear-gradient(135deg, #d1fae5, #e0f2fe); }
.ad-thumb { background: linear-gradient(135deg, #fef3c7, #fce7f3); }

.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity var(--transition);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-action {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark);
    transition: all var(--transition);
}

.project-action:hover {
    background: var(--white);
    transform: scale(1.1);
}

.project-type-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(124, 58, 237, 0.9);
    color: white;
}

.project-type-badge.lp { background: rgba(6, 182, 212, 0.9); }
.project-type-badge.video { background: rgba(16, 185, 129, 0.9); }
.project-type-badge.ad { background: rgba(245, 158, 11, 0.9); }

.project-info {
    padding: 14px 16px;
}

.project-info strong {
    display: block;
    font-size: 0.88rem;
    color: var(--dark);
    margin-bottom: 2px;
}

body.dark .project-info strong { color: #f8fafc; }

.project-info span {
    font-size: 0.78rem;
    color: var(--gray);
}

/* ========== CREATOR LAYOUT ========== */
.creator-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.creator-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-section {
    background: var(--white);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.control-section h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 12px;
}

body.dark .control-section h3 { color: #f8fafc; }

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--primary-200);
    border-radius: var(--radius-md);
    padding: 32px;
    text-align: center;
    background: var(--primary-50);
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
}

.upload-zone:hover {
    border-color: var(--primary);
    background: var(--primary-100);
}

.upload-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-100);
    transform: scale(1.01);
}

.upload-content p {
    font-weight: 600;
    color: var(--dark-700);
    margin-top: 12px;
}

.upload-content span {
    font-size: 0.82rem;
    color: var(--gray);
}

.upload-preview {
    position: relative;
}

.upload-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-sm);
}

.remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Form elements */
.form-select {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    color: var(--dark);
    background: var(--gray-50);
    border: 1.5px solid var(--gray-light);
    border-radius: var(--radius-md);
    outline: none;
    cursor: pointer;
    transition: all var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.form-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    color: var(--dark);
    background: var(--gray-50);
    border: 1.5px solid var(--gray-light);
    border-radius: var(--radius-md);
    outline: none;
    resize: vertical;
    min-height: 80px;
    transition: all var(--transition);
}

.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-100);
}

/* Style Grid */
.style-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.style-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border: 1.5px solid rgba(0,0,0,0.08);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--dark-600);
}

.style-option:hover {
    border-color: var(--primary-200);
    background: var(--primary-50);
}

.style-option.active {
    border-color: var(--primary);
    background: var(--primary-100);
    color: var(--primary);
}

/* Gender Options */
.gender-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.gender-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: 1.5px solid rgba(0,0,0,0.08);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--dark-600);
    transition: all var(--transition);
}

.gender-btn:hover { border-color: var(--primary-200); }

.gender-btn.active {
    background: var(--dark);
    color: var(--white);
    border-color: var(--dark);
}

body.dark .gender-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Variations Slider */
.variations-slider input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--gray-light);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.variations-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 0 3px var(--primary-200);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--gray);
    margin-top: 4px;
}

/* Color Options */
.color-options {
    display: flex;
    gap: 10px;
}

.color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all var(--transition);
}

.color-swatch:hover { transform: scale(1.15); }

.color-swatch.active {
    border-color: var(--white);
    box-shadow: 0 0 0 2px var(--primary);
}

/* AI Features List */
.ai-features-list {
    margin-top: 16px;
    padding: 16px;
    background: rgba(124, 58, 237, 0.04);
    border-radius: var(--radius-sm);
    border: 1px solid var(--primary-100);
}

.ai-features-list p {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--dark-700);
    margin-bottom: 8px;
}

.ai-features-list ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ai-features-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--dark-600);
}

/* Control Actions */
.control-actions {
    padding-top: 8px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.icon-btn {
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--gray);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.icon-btn:hover {
    background: var(--primary-50);
    color: var(--primary);
    border-color: var(--primary-200);
}

/* ---- Preview Panel ---- */
.creator-preview {
    position: sticky;
    top: 80px;
    align-self: start;
}

.preview-panel {
    background: var(--white);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.preview-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.preview-top-bar h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
}

.preview-actions {
    display: flex;
    gap: 6px;
}

.preview-area {
    min-height: 400px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-preview {
    text-align: center;
    padding: 40px;
}

.empty-preview-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    background: var(--primary-50);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-preview h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-700);
    margin-bottom: 6px;
}

.empty-preview p {
    font-size: 0.85rem;
    color: var(--gray);
}

.preview-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid rgba(0,0,0,0.06);
}

.preview-status {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gray);
}

.preview-download-actions {
    display: flex;
    gap: 8px;
}

/* Important Notice */
.important-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    width: 100%;
}

.notice-icon {
    color: var(--warning);
    min-width: 24px;
}

.important-notice strong {
    display: block;
    font-size: 0.88rem;
    color: var(--dark);
    margin-bottom: 2px;
}

.important-notice p {
    font-size: 0.82rem;
    color: var(--gray);
}

/* Coming Soon Panel */
.coming-soon-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 40px;
    gap: 16px;
}

.coming-soon-panel h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.coming-soon-panel p {
    color: var(--gray);
    max-width: 400px;
}

/* Generation Progress */
.generation-progress {
    width: 100%;
    text-align: center;
    padding: 40px;
}

.progress-ring {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    position: relative;
}

.progress-ring svg {
    transform: rotate(-90deg);
}

.progress-ring circle {
    fill: none;
    stroke-width: 6;
}

.progress-ring .bg { stroke: var(--gray-light); }

.progress-ring .fill {
    stroke: var(--primary);
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s ease;
}

.progress-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.progress-text {
    font-size: 0.9rem;
    color: var(--gray);
}

/* Generated Result */
.generated-result {
    width: 100%;
}

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

.generated-image {
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--gray-50);
    aspect-ratio: 3/4;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 2px solid transparent;
    transition: all var(--transition);
    cursor: pointer;
}

.generated-image:hover {
    border-color: var(--primary);
    transform: scale(1.02);
}

.generated-image .placeholder-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-card:nth-child(odd) { border-inline-start: 0; }
    .quick-actions { grid-template-columns: repeat(3, 1fr); }
    .projects-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
    .creator-layout { grid-template-columns: 1fr; }
    .creator-preview { position: static; }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        z-index: 200;
        box-shadow: var(--shadow-xl);
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .mobile-sidebar-btn {
        display: block;
    }

    .main-content {
        width: 100%;
    }

    .panel {
        padding: 16px;
    }

    .topbar {
        padding: 12px 16px;
    }

    .stats-grid { grid-template-columns: 1fr; }
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
    .projects-grid { grid-template-columns: 1fr; }

    .panel-header {
        flex-direction: column;
    }

    .style-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   NEW PANEL STYLES — All Services
   ============================================ */

/* Cost Badge */
.cost-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--primary-50, rgba(124, 58, 247, 0.08));
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.cost-badge.premium {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(234, 88, 12, 0.1));
    color: #f59e0b;
}

body.dark .cost-badge {
    background: rgba(124, 58, 247, 0.15);
}
body.dark .cost-badge.premium {
    background: rgba(245, 158, 11, 0.15);
}

/* Form Select */
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-light, #e2e8f0);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    background: white;
    color: var(--dark-900, #4f4a54);
    cursor: pointer;
    transition: border-color 0.2s;
}
.form-select:focus {
    outline: none;
    border-color: var(--primary);
}
body.dark .form-select {
    background: var(--dark-800, #5a5560);
    color: #e2e8f0;
    border-color: rgba(255,255,255,0.1);
}

/* Form Textarea */
.form-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--gray-light, #e2e8f0);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
    background: white;
    color: var(--dark-900, #4f4a54);
    line-height: 1.6;
    transition: border-color 0.2s;
}
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
}
body.dark .form-textarea {
    background: var(--dark-800, #5a5560);
    color: #e2e8f0;
    border-color: rgba(255,255,255,0.1);
}

/* Form Input (in new panels) */
.form-input {
    width: 100%;
    padding: 11px 14px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    background: #ffffff;
    color: #4f4a54;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.form-input::placeholder {
    color: #94a3b8;
    opacity: 1;
}
.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.10);
    background: #fff;
}
body.dark .form-input {
    background: #4f4a54;
    color: #f1f5f9;
    border-color: #334155;
}
body.dark .form-input::placeholder {
    color: #64748b;
}
body.dark .form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.18);
    background: #5a5560;
}

/* Variations Slider */
.variations-slider {
    padding: 4px 0;
}
.variations-slider input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
    cursor: pointer;
}
.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--gray);
    margin-top: 4px;
}

/* Button Glow */
.btn-glow {
    position: relative;
    overflow: hidden;
}
.btn-glow::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.2) 50%, transparent 60%);
    background-size: 200% 200%;
    animation: btn-shimmer 3s ease-in-out infinite;
}
@keyframes btn-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Checkbox labels */
.checkbox-label {
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--dark-600, #475569);
}
.checkbox-label input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px; height: 16px; cursor: pointer;
}
body.dark .checkbox-label {
    color: #cbd5e1;
}

/* Color Swatches */
.color-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.color-swatch {
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.active {
    box-shadow: 0 0 0 3px var(--primary), 0 0 0 5px white;
    transform: scale(1.15);
}

/* Preview top bar actions */
.preview-actions {
    display: flex;
    gap: 6px;
}
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border: 1px solid var(--gray-light, #e2e8f0);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    color: var(--gray);
    transition: all 0.2s;
}
.icon-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-50, rgba(124,58,247,0.08));
}
body.dark .icon-btn {
    border-color: rgba(255,255,255,0.1);
    color: #94a3b8;
}
body.dark .icon-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Empty Preview */
.empty-preview {
    text-align: center;
    padding: 60px 20px;
}
.empty-preview-icon {
    margin-bottom: 16px;
}
.empty-preview h4 {
    font-size: 1.05rem;
    margin-bottom: 8px;
    color: var(--dark-600, #475569);
}
.empty-preview p {
    font-size: 0.85rem;
    color: var(--gray);
}
body.dark .empty-preview h4 { color: #cbd5e1; }

/* Generating State */
.generating-state {
    text-align: center;
    padding: 60px 20px;
}
.gen-spinner {
    width: 48px; height: 48px;
    border: 4px solid var(--gray-light, #e2e8f0);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.gen-progress-bar {
    width: 100%; max-width: 300px;
    height: 6px;
    background: var(--gray-light, #e2e8f0);
    border-radius: 3px;
    margin: 16px auto 12px;
    overflow: hidden;
}
.gen-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-primary, linear-gradient(135deg, #7c3aed, #06b6d4));
    border-radius: 3px;
    transition: width 0.8s ease;
}
.gen-progress-text {
    font-size: 0.85rem;
    color: var(--gray);
}

/* Result Container */
.result-container {
    animation: fadeInUp 0.4s ease;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.result-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 60px 20px;
}
.error-state h4 { margin: 16px 0 8px; }
.error-state p { font-size: 0.85rem; color: var(--gray); }

/* Storyboard Grid */
.storyboard-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}
.storyboard-scene {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary, #f8fafc);
    border-radius: 12px;
    border-left: 4px solid var(--primary);
}
body.dark .storyboard-scene {
    background: rgba(255,255,255,0.03);
}
.scene-number {
    width: 32px; height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.scene-time {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    white-space: nowrap;
    min-width: 50px;
}
.scene-visual {
    flex-shrink: 0;
}
.scene-desc {
    font-size: 0.85rem;
    color: var(--dark-600, #475569);
    line-height: 1.5;
}
body.dark .scene-desc { color: #94a3b8; }

/* Demo Image Grid */
.demo-image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
}
.demo-image-card {
    background: var(--bg-secondary, #f8fafc);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid var(--gray-light, #e2e8f0);
    transition: transform 0.2s;
}
.demo-image-card:hover { transform: translateY(-2px); }
body.dark .demo-image-card {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.1);
}
.demo-img-placeholder { font-size: 2rem; margin-bottom: 8px; }
.demo-image-card span { font-size: 0.8rem; color: var(--gray); }

/* Ad Preview */
.ad-preview-card { animation: fadeInUp 0.4s ease; }
.ad-copy-section { font-size: 0.9rem; }
.hashtag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--primary-50, rgba(124,58,247,0.08));
    color: var(--primary);
    border-radius: 4px;
    font-size: 0.8rem;
}
body.dark .hashtag {
    background: rgba(124,58,247,0.15);
}

/* Image Grid Result */
.image-grid-result {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}
.result-image img {
    width: 100%;
    border-radius: 12px;
}

/* Buttons */
.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.btn-primary.btn-sm {
    background: var(--primary);
    color: white;
    border: none;
}
.btn-primary.btn-sm:hover {
    background: var(--primary-hover, #6d28d9);
}
.btn-secondary {
    background: transparent;
    border: 1px solid var(--gray-light, #e2e8f0);
    color: var(--dark-600, #475569);
}
.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.btn-secondary.btn-sm {
    background: transparent;
    border: 1px solid var(--gray-light, #e2e8f0);
    color: var(--dark-600, #475569);
    cursor: pointer;
}
.btn-secondary.btn-sm:hover {
    border-color: var(--primary);
    color: var(--primary);
}
body.dark .btn-secondary,
body.dark .btn-secondary.btn-sm {
    border-color: rgba(255,255,255,0.1);
    color: #94a3b8;
}
body.dark .btn-secondary:hover,
body.dark .btn-secondary.btn-sm:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Audio Wave Animation */
@keyframes wave {
    0%, 100% { height: 20%; }
    50% { height: 80%; }
}
.audio-wave .wave-bar {
    animation-delay: calc(var(--i, 0) * 0.1s);
}
.audio-wave .wave-bar:nth-child(1) { --i: 0; }
.audio-wave .wave-bar:nth-child(2) { --i: 1; }
.audio-wave .wave-bar:nth-child(3) { --i: 2; }
.audio-wave .wave-bar:nth-child(4) { --i: 3; }
.audio-wave .wave-bar:nth-child(5) { --i: 4; }
.audio-wave .wave-bar:nth-child(6) { --i: 5; }
.audio-wave .wave-bar:nth-child(7) { --i: 6; }
.audio-wave .wave-bar:nth-child(8) { --i: 7; }
.audio-wave .wave-bar:nth-child(9) { --i: 8; }
.audio-wave .wave-bar:nth-child(10) { --i: 9; }

/* Upload Preview */
.upload-preview {
    text-align: center;
    padding: 10px;
}
.upload-preview img {
    border: 2px solid var(--gray-light, #e2e8f0);
}

/* LP Preview Frame */
.lp-preview-frame {
    min-height: 400px;
}
.lp-preview-frame iframe {
    min-height: 400px;
}

/* Responsive: New panels */
@media (max-width: 768px) {
    .demo-image-grid { grid-template-columns: repeat(2, 1fr); }
    .storyboard-scene { flex-wrap: wrap; gap: 8px; }
    .scene-time { min-width: auto; }
}

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

/* ═════════════════════════════════════════════
   LP GENERATOR — Upload, Scanner, Edit Toolbar
   ═════════════════════════════════════════════ */

/* Multi-image upload grid */
.lp-images-grid {
    display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px;
}
.lp-images-grid .lp-thumb {
    width: 64px; height: 64px; border-radius: 10px; overflow: hidden;
    border: 2px solid var(--border); position: relative; cursor: pointer;
    transition: all 0.2s;
}
.lp-images-grid .lp-thumb:hover { border-color: var(--primary); }
.lp-images-grid .lp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lp-images-grid .lp-thumb .lp-thumb-remove {
    position: absolute; top: -4px; right: -4px; width: 18px; height: 18px;
    background: var(--danger); color: #fff; border-radius: 50%; font-size: 10px;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    opacity: 0; transition: opacity 0.2s; border: 2px solid var(--bg);
}
.lp-images-grid .lp-thumb:hover .lp-thumb-remove { opacity: 1; }
.lp-images-grid .lp-thumb .lp-thumb-badge {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: rgba(124,58,247,0.85); color: #fff; font-size: 0.6rem;
    text-align: center; padding: 2px 0; font-weight: 600;
}
.lp-images-grid .lp-add-more {
    width: 64px; height: 64px; border-radius: 10px; border: 2px dashed var(--border);
    display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer;
    color: var(--gray); transition: all 0.2s; gap: 2px;
}
.lp-images-grid .lp-add-more span { font-size: 0.6rem; }
.lp-images-grid .lp-add-more:hover {
    border-color: var(--primary); color: var(--primary); background: rgba(124,58,247,0.04);
}
.lp-images-grid .lp-add-more span {
    font-size: 0.62rem; margin-top: 2px; display: block; text-align: center;
}
.lp-images-grid .lp-add-more { flex-direction: column; }
.lp-thumb-badge {
    position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
    background: var(--primary); color: #fff; font-size: 0.58rem; padding: 1px 6px;
    border-radius: 6px; font-weight: 600; letter-spacing: 0.3px;
}
.lp-images-grid .lp-add-more span {
    font-size: 0.6rem; margin-top: 2px;
}
.lp-images-grid .lp-add-more { flex-direction: column; }
.lp-thumb-badge {
    position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
    background: var(--primary); color: #fff; font-size: 0.55rem; font-weight: 700;
    padding: 1px 6px; border-radius: 6px; letter-spacing: 0.3px;
}

/* Scanner animation */
.lp-scanner-overlay {
    position: relative; overflow: hidden; border-radius: var(--radius-md);
    border: 2px solid var(--primary); margin-top: 12px;
}
.lp-scanner-overlay img { width: 100%; display: block; filter: brightness(0.85); }
.lp-scanner-line {
    position: absolute; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    box-shadow: 0 0 16px var(--primary), 0 0 40px rgba(124,58,247,0.3);
    animation: scanLine 2s ease-in-out infinite;
}
@keyframes scanLine { 0%{top:0} 50%{top:100%} 100%{top:0} }
.lp-scanner-badge {
    position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.8); color: #fff; padding: 6px 16px; border-radius: 20px;
    font-size: 0.78rem; display: flex; align-items: center; gap: 6px;
    backdrop-filter: blur(8px);
}
.lp-scanner-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); animation: pulse 1s infinite; }

/* Analyze results card */
.lp-analyze-card {
    margin-top: 12px; padding: 14px; border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(124,58,247,0.06), rgba(34,197,94,0.06));
    border: 1px solid rgba(124,58,247,0.15);
}
.lp-analyze-card .lp-analyze-header {
    display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
    font-weight: 600; color: var(--success); font-size: 0.85rem;
}
.lp-analyze-card .lp-analyze-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.lp-analyze-card .lp-analyze-item {
    padding: 6px 10px; background: var(--bg); border-radius: 8px;
    font-size: 0.78rem; border: 1px solid var(--border);
}
.lp-analyze-card .lp-analyze-label {
    font-size: 0.68rem; color: var(--gray); text-transform: uppercase; letter-spacing: 0.5px;
    display: block;
}
.lp-analyze-card .lp-analyze-value {
    font-weight: 500; color: var(--text); margin-top: 2px; display: block;
}

/* Modern edit toolbar */
.lp-edit-bar {
    display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px;
    background: var(--bg-secondary); border-radius: 14px;
    border: 1px solid var(--border); margin-bottom: 10px;
    align-items: center;
}
.lp-edit-bar-label {
    font-size: 0.72rem; color: var(--gray); width: 100%; margin-bottom: 2px;
    display: flex; align-items: center; gap: 4px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.lp-edit-chip {
    padding: 6px 14px; border-radius: 24px; border: 1.5px solid var(--border);
    background: var(--bg); cursor: pointer; font-size: 0.76rem; color: var(--text-secondary);
    transition: all 0.25s ease; display: inline-flex; align-items: center; gap: 5px;
    font-weight: 500; white-space: nowrap;
}
.lp-edit-chip:hover {
    border-color: var(--primary); color: var(--primary);
    background: rgba(124,58,247,0.06); transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(124,58,247,0.12);
}
.lp-edit-chip.chip-magic {
    border-color: var(--primary); color: var(--primary);
    background: rgba(124,58,247,0.06); font-weight: 600;
}
.lp-edit-chip.chip-magic:hover {
    background: var(--primary); color: #fff;
    box-shadow: 0 4px 16px rgba(124,58,247,0.3);
}

/* Inline edit input bar (replaces prompt()) */
.lp-inline-edit {
    display: flex; gap: 8px; padding: 10px 14px;
    background: var(--bg-secondary); border-radius: 14px;
    border: 2px solid var(--primary); margin-bottom: 10px;
    align-items: center; animation: slideDown 0.25s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.lp-inline-input {
    flex: 1; padding: 8px 14px; border: 1px solid var(--border); border-radius: 10px;
    font-size: 0.85rem; background: var(--bg); color: var(--text);
    outline: none; font-family: inherit;
}
.lp-inline-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,58,247,0.1); }
.lp-inline-input.shake { animation: shakeInput 0.4s ease; }
@keyframes shakeInput { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }
.lp-inline-submit {
    padding: 8px 18px; border-radius: 10px; border: none;
    background: var(--primary); color: #fff; cursor: pointer;
    font-size: 0.82rem; font-weight: 600; white-space: nowrap;
    transition: all 0.2s; font-family: inherit;
}
.lp-inline-submit:hover { background: var(--primary-dark, #5b21b6); transform: scale(1.02); }
.lp-inline-cancel {
    padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--bg); color: var(--gray); cursor: pointer; font-size: 1rem;
    line-height: 1; font-family: inherit;
}
.lp-inline-cancel:hover { border-color: var(--danger); color: var(--danger); }

/* LP result action buttons (modern) */
.lp-result-actions {
    display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap;
}
.lp-result-actions .lp-action-btn {
    flex: 1; min-width: 120px; padding: 10px 16px; border-radius: 12px;
    font-size: 0.82rem; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: all 0.25s ease; border: 1.5px solid var(--border);
}
.lp-action-btn.primary {
    background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none;
}
.lp-action-btn.primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(124,58,247,0.3); }
.lp-action-btn.secondary {
    background: var(--bg); color: var(--text);
}
.lp-action-btn.secondary:hover { border-color: var(--primary); color: var(--primary); }

/* Editing overlay on image */
.lp-editing-overlay {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.6); border-radius: var(--radius-md); z-index: 5;
    backdrop-filter: blur(2px); animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.lp-editing-pill {
    background: rgba(0,0,0,0.85); color: #fff; padding: 14px 28px; border-radius: 16px;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,0.1);
}

/* LP result container */
.lp-result-container { padding: 16px; }

/* LP image frame */
.lp-image-frame {
    position: relative; border-radius: 12px; overflow: hidden;
    border: 1px solid var(--border); background: var(--bg-secondary);
}
.lp-image-frame img { width: 100%; display: block; transition: filter 0.3s ease; }

/* ═══════════════════════════════════════════════════════
   LP RESULT — flat French analytics style
   Dark primary + light secondary buttons, white cards.
   ═══════════════════════════════════════════════════════ */
.lp-result-container {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.lp-result-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin-top: 0;
}
.lp-result-actions .lp-action-btn {
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
    border: 1px solid #e3e3e6;
    background: #ffffff;
    color: #1f2937;
    text-decoration: none;
    font-family: inherit;
    white-space: nowrap;
}
.lp-result-actions .lp-action-btn:hover {
    border-color: #c7c8cc;
    background: #f7f7f9;
}
.lp-result-actions .lp-action-btn:active { transform: translateY(1px); }
.lp-result-actions .lp-action-btn.primary,
.lp-result-actions .lp-action-btn.lp-edit-cta {
    background: #111114;
    border-color: #111114;
    color: #ffffff;
}
.lp-result-actions .lp-action-btn.primary:hover,
.lp-result-actions .lp-action-btn.lp-edit-cta:hover {
    background: #000000;
    border-color: #000000;
    box-shadow: none;
    transform: none;
}
.lp-result-actions .lp-action-btn.success {
    background: #ffffff;
    border-color: #16a34a;
    color: #15803d;
}
.lp-result-actions .lp-action-btn.success:hover {
    background: #f0fdf4;
    border-color: #15803d;
}
.lp-result-actions .lp-action-btn.publish {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}
.lp-result-actions .lp-action-btn.publish:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}
.lp-result-actions .lp-action-btn[disabled] {
    opacity: .55;
    cursor: not-allowed;
    pointer-events: none;
}
.lp-result-actions .lp-action-btn svg { flex-shrink: 0; }

/* Published badge link */
.lp-published-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #14532d;
    font-size: 0.85rem;
}
.lp-published-link .lp-pl-url {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #166534;
    text-decoration: none;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.lp-published-link button {
    background: #ffffff;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
}
.lp-published-link button:hover { background: #dcfce7; }

/* ── Quick text-edit card (Nano Banana 2) ── */
.lp-quick-edit-card {
    background: #ffffff;
    border: 1px solid #e3e3e6;
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
.lp-quick-edit-head {
    display: flex;
    align-items: center;
    gap: 10px;
}
.lp-quick-edit-head h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
    flex: 1;
}
.lp-qe-icon {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #f4f4f5;
    border-radius: 9px;
    color: #111114;
}
.lp-qe-pill {
    background: #f4f4f5;
    color: #475569;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 999px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.lp-quick-edit-help {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.55;
    color: #64748b;
}
.lp-quick-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
@media (max-width: 520px) {
    .lp-quick-edit-grid { grid-template-columns: 1fr; }
}
.lp-qe-field { display: flex; flex-direction: column; gap: 6px; }
.lp-qe-field label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.lp-qe-field input {
    padding: 10px 12px;
    border: 1px solid #e3e3e6;
    border-radius: 9px;
    background: #fafafa;
    color: #0f172a;
    font-size: 0.88rem;
    font-family: inherit;
    transition: border-color .15s ease, background .15s ease;
}
.lp-qe-field input:focus {
    outline: none;
    border-color: #111114;
    background: #ffffff;
}
.lp-qe-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.lp-qe-apply {
    background: #111114;
    border: 1px solid #111114;
    color: #ffffff;
    padding: 9px 14px;
    border-radius: 9px;
    font-size: 0.82rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s ease;
}
.lp-qe-apply:hover { background: #000000; }
.lp-qe-apply[disabled] { opacity: .55; cursor: not-allowed; }
.lp-qe-secondary {
    background: #ffffff;
    border: 1px solid #e3e3e6;
    color: #475569;
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s ease, border-color .15s ease;
}
.lp-qe-secondary:hover { background: #f7f7f9; border-color: #c7c8cc; }
.lp-qe-status {
    font-size: 0.78rem;
    color: #64748b;
    margin-inline-start: auto;
}

/* Dark mode adapt */
body.dark .lp-quick-edit-card,
html.dark .lp-quick-edit-card {
    background: #4f4a54;
    border-color: #635e69;
    box-shadow: none;
}
body.dark .lp-quick-edit-head h4,
html.dark .lp-quick-edit-head h4 { color: #f1f1f2; }
body.dark .lp-qe-icon,
html.dark .lp-qe-icon { background: #5a5560; color: #f1f1f2; }
body.dark .lp-qe-pill,
html.dark .lp-qe-pill { background: #5a5560; color: #b8b7ba; }
body.dark .lp-quick-edit-help,
html.dark .lp-quick-edit-help { color: #b8b7ba; }
body.dark .lp-qe-field input,
html.dark .lp-qe-field input {
    background: #5a5560; border-color: #635e69; color: #f1f1f2;
}
body.dark .lp-qe-field input:focus,
html.dark .lp-qe-field input:focus {
    background: #635e69; border-color: #8ab4ff;
}
body.dark .lp-qe-secondary,
html.dark .lp-qe-secondary {
    background: #5a5560; border-color: #635e69; color: #f1f1f2;
}
body.dark .lp-qe-apply,
html.dark .lp-qe-apply { background: #2f63d8; border-color: #2f63d8; }
body.dark .lp-qe-apply:hover,
html.dark .lp-qe-apply:hover { background: #3f73e8; }
body.dark .lp-result-actions .lp-action-btn,
html.dark .lp-result-actions .lp-action-btn {
    background: #5a5560; border-color: #635e69; color: #f1f1f2;
}
body.dark .lp-result-actions .lp-action-btn:hover,
html.dark .lp-result-actions .lp-action-btn:hover { background: #635e69; }
body.dark .lp-result-actions .lp-action-btn.primary,
body.dark .lp-result-actions .lp-action-btn.lp-edit-cta,
html.dark .lp-result-actions .lp-action-btn.primary,
html.dark .lp-result-actions .lp-action-btn.lp-edit-cta {
    background: #2f63d8; border-color: #2f63d8; color: #ffffff;
}
body.dark .lp-result-actions .lp-action-btn.publish,
html.dark .lp-result-actions .lp-action-btn.publish {
    background: #2f63d8; border-color: #2f63d8;
}
body.dark .lp-published-link,
html.dark .lp-published-link {
    background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.3); color: #bbf7d0;
}
body.dark .lp-published-link .lp-pl-url,
html.dark .lp-published-link .lp-pl-url { color: #86efac; }
body.dark .lp-published-link button,
html.dark .lp-published-link button {
    background: #5a5560; border-color: #635e69; color: #f1f1f2;
}

/* Scanner wrap */
.lp-scanner-wrap { position: relative; border-radius: 12px; overflow: hidden; margin-top: 10px; }
.lp-scanner-wrap img { width: 100%; display: block; border-radius: 12px; filter: brightness(0.85); }
.lp-editing-pill .spinner-ring {
    width: 28px; height: 28px; border: 3px solid rgba(255,255,255,0.2);
    border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════
   GLOBAL DARK-MODE INPUT / TEXTAREA / SELECT FIX
   Ensures ALL form fields are visible in dark mode
   ═══════════════════════════════════════════════════════ */
body.dark input[type="text"],
body.dark input[type="url"],
body.dark input[type="email"],
body.dark input[type="password"],
body.dark input[type="number"],
body.dark input[type="search"],
body.dark input[type="tel"],
body.dark textarea,
body.dark select {
    background: #4f4a54 !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
    caret-color: var(--primary);
}
body.dark input::placeholder,
body.dark textarea::placeholder {
    color: #64748b !important;
    opacity: 1 !important;
}
body.dark input:focus,
body.dark textarea:focus,
body.dark select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(124,58,237,0.18) !important;
    background: #5a5560 !important;
}
body.dark option {
    background: #5a5560;
    color: #f1f5f9;
}

/* ═══════════════════════════════════════════════════════
   PREMIUM UI ENHANCEMENTS — World-Class Polish
   ═══════════════════════════════════════════════════════ */

/* — Glass-morphism topbar — */
body.dark .topbar {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-color: rgba(124,58,237,0.08);
}

/* — Card hover micro-interactions — */
.control-section {
    transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.control-section:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
body.dark .control-section:hover {
    box-shadow: 0 8px 30px rgba(124,58,237,0.08);
    border-color: rgba(124,58,237,0.15);
}

/* — Stat cards glow on hover — */
.stat-card {
    transition: transform 0.25s ease, box-shadow 0.3s ease;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(124,58,237,0.10);
}
body.dark .stat-card:hover {
    box-shadow: 0 12px 40px rgba(124,58,237,0.12);
}

/* — Sidebar link micro-animation — */
.sidebar-link {
    transition: all 0.2s cubic-bezier(0.25,0.46,0.45,0.94);
    position: relative;
}
.sidebar-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 60%;
    background: var(--gradient-primary);
    border-radius: 0 3px 3px 0;
    transition: transform 0.2s ease;
}
.sidebar-link.active::before,
.sidebar-link:hover::before {
    transform: translateY(-50%) scaleY(1);
}

/* — Button press effect & ripple — */
.btn-primary,
.btn-primary.btn-lg,
.btn-primary.btn-sm {
    transition: transform 0.12s ease, box-shadow 0.25s ease, background 0.2s ease;
    position: relative;
    overflow: hidden;
}
.btn-primary:active {
    transform: scale(0.97);
}
.btn-primary:hover {
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}

/* — Upload zone enhanced — */
.upload-zone {
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}
.upload-zone::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, transparent 40%, rgba(124,58,237,0.04) 50%, transparent 60%);
    background-size: 200% 200%;
    opacity: 0;
    transition: opacity 0.3s;
}
.upload-zone:hover::after {
    opacity: 1;
    animation: btn-shimmer 2.5s ease-in-out infinite;
}

/* — Preview panel polish — */
.preview-panel {
    transition: box-shadow 0.3s ease;
}
.preview-panel:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}
body.dark .preview-panel:hover {
    box-shadow: 0 8px 40px rgba(124,58,237,0.10);
}

/* — Badge pulse animation — */
.link-badge.popular {
    animation: badgePulse 3s ease-in-out infinite;
}
@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* — Credits bar animated gradient — */
.credits-fill {
    background: linear-gradient(90deg, #7c3aed, #06b6d4, #7c3aed);
    background-size: 200% 100%;
    animation: creditsShimmer 3s linear infinite;
}
@keyframes creditsShimmer {
    0% { background-position: 0% 0; }
    100% { background-position: 200% 0; }
}

/* — Style option pulse on active — */
.style-option.active {
    position: relative;
    box-shadow: 0 0 0 2px var(--primary), 0 4px 12px rgba(124,58,237,0.15);
}

/* — Smooth scroll indicator in sidebar — */
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(124,58,237,0.2);
    border-radius: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(124,58,237,0.4);
}

/* — Main content smooth scrollbar — */
.main-content::-webkit-scrollbar { width: 6px; }
.main-content::-webkit-scrollbar-track { background: transparent; }
.main-content::-webkit-scrollbar-thumb {
    background: rgba(124,58,237,0.15);
    border-radius: 6px;
}
.main-content::-webkit-scrollbar-thumb:hover {
    background: rgba(124,58,237,0.3);
}

/* — Enhanced focus ring for accessibility — */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* — Panel entrance animation — */
.panel.active {
    animation: panelSlideIn 0.35s cubic-bezier(0.25,0.46,0.45,0.94);
}
@keyframes panelSlideIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* — LP Scanner glow border — */
.lp-scanner-overlay {
    box-shadow: 0 0 20px rgba(124,58,247,0.2);
}

/* — Quick Action cards glow on hover (dark mode) — */
body.dark .action-card:hover {
    box-shadow: 0 8px 32px rgba(124,58,237,0.18);
    border-color: rgba(124,58,237,0.3);
}

/* — Notification dot animation — */
.notification-btn .notif-dot {
    animation: notifPulse 2s ease-in-out infinite;
}
@keyframes notifPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.6; }
}

/* — Project card shimmer overlay on hover — */
.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(124,58,237,0.05) 50%, transparent 60%);
    background-size: 250% 250%;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.project-card:hover::before {
    opacity: 1;
    animation: btn-shimmer 3s ease-in-out infinite;
}

/* — Responsive polish — */
@media (max-width: 768px) {
    .stat-card:hover,
    .action-card:hover,
    .control-section:hover {
        transform: none;
    }
}

/* ═══════════════════════════════════════════════════════
   TOAST NOTIFICATION SYSTEM
   ═══════════════════════════════════════════════════════ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 400px;
}
.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    animation: toastSlideIn 0.35s cubic-bezier(0.22,1,0.36,1);
    min-width: 280px;
    position: relative;
    overflow: hidden;
}
body.dark .toast {
    background: #5a5560;
    border-color: #334155;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.toast.toast-exit {
    animation: toastSlideOut 0.3s ease forwards;
}
@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(60px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastSlideOut {
    to { opacity: 0; transform: translateX(60px) scale(0.95); }
}
.toast-icon {
    width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px;
}
.toast-body {
    flex: 1; min-width: 0;
}
.toast-title {
    font-weight: 600; font-size: 0.88rem; margin-bottom: 2px;
}
.toast-message {
    font-size: 0.8rem; color: var(--gray); line-height: 1.4;
}
.toast-close {
    background: none; border: none; cursor: pointer;
    color: var(--gray); padding: 2px; font-size: 1.1rem;
    opacity: 0.6; transition: opacity 0.2s;
}
.toast-close:hover { opacity: 1; }
.toast-progress {
    position: absolute; bottom: 0; left: 0; height: 3px;
    border-radius: 0 0 14px 14px;
    animation: toastProgress var(--toast-duration, 4s) linear forwards;
}
@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}
.toast.success .toast-icon { color: #10b981; }
.toast.success .toast-progress { background: #10b981; }
.toast.error .toast-icon { color: #ef4444; }
.toast.error .toast-progress { background: #ef4444; }
.toast.warning .toast-icon { color: #f59e0b; }
.toast.warning .toast-progress { background: #f59e0b; }
.toast.info .toast-icon { color: #3b82f6; }
.toast.info .toast-progress { background: #3b82f6; }

/* ═══════════════════════════════════════════════════════
   GENERATION HISTORY PANEL
   ═══════════════════════════════════════════════════════ */
.history-overlay {
    position: fixed; inset: 0; z-index: 99998;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    display: none; animation: fadeIn 0.2s ease;
}
.history-overlay.open { display: block; }
.history-drawer {
    position: fixed; top: 0; right: -460px; width: 440px; max-width: 90vw;
    height: 100vh; background: #fff; z-index: 99999;
    box-shadow: -12px 0 40px rgba(0,0,0,0.12);
    transition: right 0.35s cubic-bezier(0.22,1,0.36,1);
    display: flex; flex-direction: column;
    overflow: hidden;
}
body.dark .history-drawer {
    background: #4f4a54;
    box-shadow: -12px 0 40px rgba(0,0,0,0.6);
}
.history-drawer.open { right: 0; }
.history-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.history-header h3 {
    font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 8px;
}
.history-header .history-count {
    background: var(--primary); color: #fff; font-size: 0.7rem;
    padding: 2px 8px; border-radius: 20px; font-weight: 600;
}
.history-close {
    background: none; border: 1px solid var(--border); width: 32px; height: 32px;
    border-radius: 8px; cursor: pointer; display: flex; align-items: center;
    justify-content: center; color: var(--gray); transition: all 0.2s;
}
.history-close:hover { border-color: var(--danger); color: var(--danger); }
.history-list {
    flex: 1; overflow-y: auto; padding: 16px;
}
.history-item {
    display: flex; gap: 12px; padding: 12px;
    border-radius: 12px; border: 1px solid var(--border);
    margin-bottom: 10px; cursor: pointer;
    transition: all 0.2s ease;
}
.history-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(124,58,237,0.1);
}
.history-item-thumb {
    width: 64px; height: 64px; border-radius: 8px;
    overflow: hidden; flex-shrink: 0; background: var(--bg-secondary);
}
.history-item-thumb img {
    width: 100%; height: 100%; object-fit: cover;
}
.history-item-info {
    flex: 1; min-width: 0;
}
.history-item-title {
    font-weight: 600; font-size: 0.85rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.history-item-meta {
    font-size: 0.75rem; color: var(--gray); margin-top: 4px;
}
.history-item-actions {
    display: flex; gap: 4px; margin-top: 6px;
}
.history-item-actions button {
    padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border);
    background: var(--bg); cursor: pointer; font-size: 0.7rem; color: var(--gray);
    transition: all 0.2s;
}
.history-item-actions button:hover {
    border-color: var(--primary); color: var(--primary);
}
.history-empty {
    text-align: center; padding: 60px 20px; color: var(--gray);
}
.history-empty svg { opacity: 0.3; margin-bottom: 12px; }
.history-footer {
    padding: 14px 24px; border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.history-clear {
    padding: 6px 14px; border-radius: 8px; border: 1px solid rgba(239,68,68,0.3);
    background: transparent; color: #ef4444; cursor: pointer;
    font-size: 0.78rem; font-weight: 500; transition: all 0.2s;
}
.history-clear:hover {
    background: rgba(239,68,68,0.08);
}

/* ═══════════════════════════════════════════════════════
   KEYBOARD SHORTCUTS MODAL
   ═══════════════════════════════════════════════════════ */
.shortcuts-modal-bg {
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center;
}
.shortcuts-modal-bg.open { display: flex; }
.shortcuts-modal {
    background: #fff; border-radius: 20px; width: 480px; max-width: 90vw;
    max-height: 80vh; overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,0.2);
    animation: scaleIn 0.25s cubic-bezier(0.22,1,0.36,1);
}
body.dark .shortcuts-modal {
    background: #5a5560; box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}
.shortcuts-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.shortcuts-modal-header h3 { font-size: 1rem; font-weight: 700; }
.shortcuts-list {
    padding: 16px 24px;
}
.shortcut-group-title {
    font-size: 0.72rem; text-transform: uppercase; font-weight: 700;
    color: var(--gray); letter-spacing: 0.05em; margin: 12px 0 8px;
}
.shortcut-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,0.04);
}
body.dark .shortcut-row { border-color: rgba(255,255,255,0.04); }
.shortcut-row:last-child { border-bottom: none; }
.shortcut-label { font-size: 0.85rem; }
.shortcut-keys {
    display: flex; gap: 4px;
}
.shortcut-keys kbd {
    background: var(--bg-secondary); border: 1px solid var(--border);
    padding: 3px 8px; border-radius: 6px; font-size: 0.72rem;
    font-family: inherit; font-weight: 600; min-width: 28px;
    text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
body.dark .shortcut-keys kbd {
    background: #4f4a54; border-color: #334155;
}

/* ═══════════════════════════════════════════════════════
   IMPROVED ERROR STATE WITH RETRY
   ═══════════════════════════════════════════════════════ */
.error-state-enhanced {
    text-align: center; padding: 48px 28px;
    animation: shakeError 0.5s ease;
}
@keyframes shakeError {
    0%,100% { transform: translateX(0); }
    15% { transform: translateX(-6px); }
    30% { transform: translateX(6px); }
    45% { transform: translateX(-4px); }
    60% { transform: translateX(4px); }
}
.error-state-enhanced .error-icon-wrap {
    width: 64px; height: 64px; border-radius: 50%;
    background: rgba(239,68,68,0.1); display: flex;
    align-items: center; justify-content: center; margin: 0 auto 16px;
}
.error-state-enhanced h4 {
    color: #ef4444; font-size: 1rem; margin-bottom: 8px;
}
.error-state-enhanced .error-msg {
    color: var(--gray); font-size: 0.88rem; margin-bottom: 20px; line-height: 1.5;
}
.error-state-enhanced .error-actions {
    display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
}
.error-retry-btn {
    padding: 10px 24px; border-radius: 12px; border: none;
    background: var(--primary); color: #fff; cursor: pointer;
    font-size: 0.85rem; font-weight: 600;
    display: flex; align-items: center; gap: 6px;
    transition: all 0.2s;
}
.error-retry-btn:hover {
    box-shadow: 0 4px 16px rgba(124,58,237,0.3);
    transform: translateY(-1px);
}
.error-dismiss-btn {
    padding: 10px 20px; border-radius: 12px;
    border: 1px solid var(--border); background: var(--bg);
    color: var(--gray); cursor: pointer; font-size: 0.85rem;
    transition: all 0.2s;
}
.error-dismiss-btn:hover { border-color: var(--primary); }

/* ═══════════════════════════════════════════════════════
   SEARCH RESULTS DROPDOWN
   ═══════════════════════════════════════════════════════ */
.sidebar-search {
    position: relative;
}
.search-results {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border: 1px solid var(--border);
    border-radius: 12px; margin-top: 4px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
    z-index: 200; max-height: 300px; overflow-y: auto;
    display: none;
}
body.dark .search-results {
    background: #5a5560; border-color: #334155;
    box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}
.search-results.open { display: block; animation: slideDown 0.2s ease; }
.search-result-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; cursor: pointer; transition: background 0.15s;
}
.search-result-item:hover {
    background: rgba(124,58,237,0.06);
}
.search-result-item i { width: 16px; height: 16px; color: var(--primary); }
.search-result-item span { font-size: 0.85rem; }
.search-result-item .search-match {
    color: var(--primary); font-weight: 600;
}
.search-no-results {
    padding: 20px; text-align: center; color: var(--gray); font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════════
   FORM VALIDATION STYLES
   ═══════════════════════════════════════════════════════ */
.form-input.invalid,
.form-textarea.invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.12) !important;
}
.form-input.valid,
.form-textarea.valid {
    border-color: #10b981 !important;
}
.field-hint {
    font-size: 0.72rem; color: var(--gray); margin-top: 4px;
    display: flex; align-items: center; gap: 4px;
}
.field-hint.error { color: #ef4444; }
.field-hint.success { color: #10b981; }
.char-counter {
    font-size: 0.72rem; color: var(--gray); text-align: right; margin-top: 4px;
}
.char-counter.warning { color: #f59e0b; }
.char-counter.danger { color: #ef4444; }

/* ═══════════════════════════════════════════════════════
   CREDITS TRACKER ENHANCED
   ═══════════════════════════════════════════════════════ */
.credits-toast {
    position: fixed; bottom: 20px; right: 20px; z-index: 99990;
    background: linear-gradient(135deg, #7c3aed, #06b6d4);
    color: #fff; padding: 12px 20px; border-radius: 14px;
    display: none; align-items: center; gap: 10px;
    box-shadow: 0 8px 32px rgba(124,58,237,0.3);
    animation: toastSlideIn 0.35s cubic-bezier(0.22,1,0.36,1);
    font-size: 0.85rem; font-weight: 600;
}
.credits-toast.show { display: flex; }
.credits-toast .credits-change {
    background: rgba(255,255,255,0.2); padding: 2px 10px;
    border-radius: 8px; font-size: 0.78rem;
}

/* ═══════════════════════════════════════════════════════
   BEFORE/AFTER IMAGE COMPARISON SLIDER
   ═══════════════════════════════════════════════════════ */
.ba-slider-container {
    position: relative; overflow: hidden; border-radius: 14px;
    border: 2px solid var(--border); user-select: none;
    cursor: col-resize; touch-action: none;
}
.ba-slider-container img {
    width: 100%; display: block; pointer-events: none;
}
.ba-after-wrap {
    position: absolute; inset: 0; overflow: hidden;
    width: 50%;
}
.ba-after-wrap img {
    position: absolute; top: 0; left: 0;
    width: var(--ba-full-width, 100%); max-width: none; height: 100%; object-fit: cover;
}
.ba-handle {
    position: absolute; top: 0; bottom: 0; width: 4px;
    background: var(--primary); left: 50%; transform: translateX(-50%);
    z-index: 3; cursor: col-resize;
}
.ba-handle::before, .ba-handle::after {
    content: ''; position: absolute; left: 50%; transform: translateX(-50%);
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--primary); border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    display: flex; align-items: center; justify-content: center;
}
.ba-handle::before {
    top: 50%; transform: translate(-50%, -50%);
    background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5'%3E%3Cpolyline points='15 18 9 12 15 6'/%3E%3C/svg%3E") center/20px no-repeat;
}
.ba-handle::after { display: none; }
.ba-label {
    position: absolute; top: 12px; padding: 4px 12px; border-radius: 8px;
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; z-index: 2; pointer-events: none;
}
.ba-label-before { left: 12px; background: rgba(239,68,68,0.85); color: #fff; }
.ba-label-after { right: 12px; background: rgba(16,185,129,0.85); color: #fff; }

/* ═══════════════════════════════════════════════════════
   LIVE STATS COUNTERS (OVERVIEW PANEL)
   ═══════════════════════════════════════════════════════ */
.stat-card-value {
    transition: all 0.4s cubic-bezier(0.22,1,0.36,1);
}
.stat-card-value.counting {
    transform: scale(1.05);
    color: var(--primary);
}
.stat-card-sparkline {
    height: 32px; margin-top: 8px; display: flex; align-items: flex-end; gap: 2px;
}
.stat-card-sparkline .bar {
    flex: 1; background: rgba(124,58,237,0.15); border-radius: 2px 2px 0 0;
    transition: height 0.3s ease; min-height: 2px;
}
body.dark .stat-card-sparkline .bar {
    background: rgba(124,58,237,0.25);
}

/* ═══════════════════════════════════════════════════════
   GENERATION QUEUE / BATCH INDICATOR
   ═══════════════════════════════════════════════════════ */
.btn-glow .gen-queue-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%;
    background: rgba(255,255,255,0.25); font-size: 0.7rem;
    font-weight: 700; margin-left: 6px;
}

/* ═══════════════════════════════════════════════════════
   EMPTY STATE IMPROVEMENTS
   ═══════════════════════════════════════════════════════ */
.empty-preview {
    transition: all 0.3s ease;
}
.empty-preview:hover .empty-preview-icon {
    transform: scale(1.08);
}
.empty-preview:hover .empty-preview-icon i {
    color: rgba(124,58,237,0.35) !important;
}
.empty-preview-icon {
    transition: transform 0.3s ease;
}

/* ═══════════════════════════════════════════════════════
   NOTIFICATION CENTER (ENHANCED BELL)
   ═══════════════════════════════════════════════════════ */
.notif-panel {
    position: absolute; top: calc(100% + 8px); right: 0;
    width: 340px; max-height: 420px; background: #fff;
    border: 1px solid var(--border); border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.12);
    z-index: 300; display: none; overflow: hidden;
}
body.dark .notif-panel {
    background: #5a5560; border-color: #334155;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.notif-panel.open { display: block; animation: scaleIn 0.2s ease; }
.notif-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid var(--border);
    font-weight: 700; font-size: 0.9rem;
}
.notif-panel-body {
    max-height: 340px; overflow-y: auto; padding: 8px;
}
.notif-item {
    display: flex; gap: 10px; padding: 10px 12px;
    border-radius: 10px; cursor: pointer; transition: background 0.15s;
}
.notif-item:hover { background: rgba(124,58,237,0.04); }
.notif-item-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 0.9rem;
}
.notif-item-icon.green { background: rgba(16,185,129,0.1); color: #10b981; }
.notif-item-icon.blue { background: rgba(59,130,246,0.1); color: #3b82f6; }
.notif-item-icon.amber { background: rgba(245,158,11,0.1); color: #f59e0b; }
.notif-item-icon.purple { background: rgba(124,58,237,0.1); color: #7c3aed; }
.notif-item-text {
    flex: 1; min-width: 0;
}
.notif-item-text strong {
    display: block; font-size: 0.82rem; margin-bottom: 2px;
}
.notif-item-text span {
    font-size: 0.72rem; color: var(--gray);
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE FIXES — MOBILE & TABLET
   ═══════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .creator-layout {
        flex-direction: column;
    }
    .creator-controls, .creator-preview {
        width: 100% !important;
        max-width: 100% !important;
    }
}
@media (max-width: 640px) {
    .toast-container {
        left: 10px; right: 10px; max-width: none;
    }
    .toast { min-width: auto; }
    .history-drawer { width: 100%; max-width: 100%; }
    .shortcuts-modal { width: 95vw; }
    .topbar-right {
        gap: 2px;
    }
    .topbar-btn {
        padding: 6px;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    .quick-actions {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    .notif-panel { width: 300px; right: -60px; }
}

/* ═══════════════════════════════════════════════════════
   PREMIUM UNIFIED CARD SYSTEM
   ═══════════════════════════════════════════════════════ */
.action-card,
.project-card,
.preview-panel,
.creator-controls,
.control-section {
    position: relative;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
    border: 1px solid #dde5ec;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255,255,255,0.7);
    overflow: hidden;
}

.action-card::before,
.project-card::before,
.preview-panel::before,
.creator-controls::before,
.control-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #7c3aed, #3b82f6, #22c55e);
    opacity: .95;
}

.action-card:hover,
.project-card:hover,
.preview-panel:hover,
.control-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.09);
    border-color: #cfd9e3;
}

.action-card {
    align-items: flex-start;
    text-align: left;
    padding: 16px 14px;
    gap: 12px;
}
.action-card span {
    font-size: 0.82rem;
    font-weight: 700;
}
.action-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}

body.dark .action-card,
body.dark .project-card,
body.dark .preview-panel,
body.dark .creator-controls,
body.dark .control-section {
    background: linear-gradient(180deg, #4f4a54 0%, #4f4a54 100%);
    border-color: #635e69;
    box-shadow: 0 12px 32px rgba(0,0,0,0.28);
}
body.dark .action-card span { color: #f8fafc; }

/* ===== BILLING PANEL STYLES ===== */
.billing-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.billing-card {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    border-radius: 16px;
    padding: 32px;
    color: white;
    margin-bottom: 32px;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.2);
}

.balance-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.balance-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.balance-amount {
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 8px;
}

.balance-subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.billing-packages h3,
.billing-history h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #0f172a;
}

.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.package-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.package-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    border-color: #7c3aed;
}

.package-card.featured {
    border-color: #7c3aed;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
}

.package-badge {
    position: absolute;
    top: -10px;
    right: 16px;
    background: #7c3aed;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.package-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.package-header h4 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
}

.package-price {
    font-size: 24px;
    font-weight: 800;
    color: #7c3aed;
}

.package-credits {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #0f172a;
}

.package-perk {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 6px;
}

.history-table-container {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.billing-history-table {
    width: 100%;
    border-collapse: collapse;
}

.billing-history-table th {
    background: #f8fafc;
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
}

.billing-history-table td {
    padding: 12px 16px;
    font-size: 14px;
    color: #0f172a;
    border-bottom: 1px solid #f1f5f9;
}

.billing-history-table tr:last-child td {
    border-bottom: none;
}

.billing-history-table tr:hover {
    background: #f8fafc;
}

/* Dark mode support */
body.dark .billing-packages h3,
body.dark .billing-history h3 {
    color: #f8fafc;
}

body.dark .package-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark .package-card:hover {
    border-color: #7c3aed;
}

body.dark .package-card.featured {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border-color: #7c3aed;
}

body.dark .package-header h4,
body.dark .package-credits {
    color: #f8fafc;
}

body.dark .history-table-container {
    background: #1e293b;
    border-color: #334155;
}

body.dark .billing-history-table th {
    background: #0f172a;
    color: #cbd5e1;
    border-color: #334155;
}

body.dark .billing-history-table td {
    color: #f8fafc;
    border-color: #334155;
}

body.dark .billing-history-table tr:hover {
    background: #334155;
}

/* Server-filled recharge grid: the muted line is a state (loading, empty, refused), the notice is the
   answer the purchase returned — never a message the page invented about its own money. */
.billing-muted {
    color: #64748b;
    font-size: 13px;
    margin: 0 0 12px;
}

.billing-notice {
    color: #0f766e;
    font-size: 13px;
    margin: 12px 0 0;
    padding: 10px 12px;
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    border-radius: 10px;
}

body.dark .billing-muted { color: #94a3b8; }
body.dark .billing-notice { color: #5eead4; background: #042f2e; border-color: #115e59; }
