
        :root {
            --bg-dark: #0f1117;
            --bg-sidebar: #1a1d27;
            --bg-panel: #1e2130;
            --bg-card: #252836;
            --bg-input: #2a2d3e;
            --bg-hover: #2e3248;
            --accent: #7c5cfc;
            --accent-2: #5b4de0;
            --accent-light: rgba(124, 92, 252, 0.15);
            --accent-glow: rgba(124, 92, 252, 0.3);
            --gold: #f5a623;
            --green: #22c55e;
            --red: #ef4444;
            --text-primary: #f1f3f9;
            --text-secondary: #8b8fa8;
            --text-muted: #5a5f7a;
            --border: rgba(255, 255, 255, 0.08);
            --border-hover: rgba(255, 255, 255, 0.15);
            --canvas-bg: #e8eaed;
            --radius-sm: 6px;
            --radius-md: 10px;
            --radius-lg: 14px;
            --radius-xl: 20px;
            --sidebar-w: 72px;
            --tpanel-w: 300px;
            --rpanel-w: 320px;
            --topbar-h: 60px;
            --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
            --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
        }

        *,
        *::before,
        *::after {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        html,
        body {
            height: 100%;
            overflow: hidden;
            font-family: 'DM Sans', sans-serif;
            background: var(--bg-dark);
            color: var(--text-primary);
        }

        button {
            cursor: pointer;
            border: none;
            outline: none;
            font-family: inherit;
        }

        input,
        select,
        textarea {
            font-family: inherit;
        }

        a {
            text-decoration: none;
            color: inherit;
        }

        ::-webkit-scrollbar {
            width: 5px;
            height: 5px;
        }

        ::-webkit-scrollbar-track {
            background: transparent;
        }

        ::-webkit-scrollbar-thumb {
            background: var(--bg-hover);
            border-radius: 10px;
        }

        /* ===== PAGE SYSTEM ===== */
        .page {
            display: none;
            width: 100vw;
            height: 100vh;
            overflow: hidden;
        }

        .page.active {
            display: flex;
        }

        /* ===== LANDING PAGE ===== */
        #page-landing {
            flex-direction: column;
            overflow-y: auto;
            background: #0a0c14;
            height: auto;
            min-height: 100vh;
        }

        .landing-nav {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 60px;
            height: 70px;
            border-bottom: 1px solid var(--border);
            background: rgba(10, 12, 20, 0.95);
            position: sticky;
            top: 0;
            z-index: 100;
            backdrop-filter: blur(12px);
        }

        .landing-logo {
            display: flex;
            align-items: center;
            gap: 10px;
            font-family: 'Bebas Neue', sans-serif;
            font-size: 22px;
            letter-spacing: 1px;
            color: var(--text-primary);
        }

        .landing-logo .logo-icon {
            width: 36px;
            height: 36px;
            background: var(--accent);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            color: white;
        }

        .nav-links {
            display: flex;
            align-items: center;
            gap: 32px;
        }

        .nav-links a {
            font-size: 14px;
            color: var(--text-secondary);
            transition: color 0.2s;
        }

        .nav-links a:hover {
            color: var(--text-primary);
        }

        .nav-actions {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .btn-ghost {
            padding: 8px 20px;
            border-radius: var(--radius-sm);
            font-size: 14px;
            font-weight: 500;
            color: var(--text-primary);
            background: transparent;
            border: 1px solid var(--border-hover);
            transition: all 0.2s;
        }

        .btn-ghost:hover {
            background: var(--bg-hover);
            border-color: var(--accent);
        }

        .btn-primary {
            padding: 8px 20px;
            border-radius: var(--radius-sm);
            font-size: 14px;
            font-weight: 600;
            color: white;
            background: var(--accent);
            transition: all 0.2s;
        }

        .btn-primary:hover {
            background: var(--accent-2);
            transform: translateY(-1px);
        }

        .hero-section {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 100px 60px 80px;
            text-align: center;
            background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(124, 92, 252, 0.15) 0%, transparent 70%);
        }

        .hero-badge {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: var(--accent-light);
            border: 1px solid var(--accent-glow);
            border-radius: 100px;
            padding: 6px 16px;
            font-size: 13px;
            color: var(--accent);
            margin-bottom: 28px;
        }

        .hero-badge i {
            font-size: 14px;
        }

        .hero-title {
            font-family: 'Space Grotesk', sans-serif;
            font-size: 68px;
            font-weight: 700;
            line-height: 1.1;
            max-width: 800px;
            margin-bottom: 24px;
        }

        .hero-title span {
            color: var(--accent);
        }

        .hero-subtitle {
            font-size: 18px;
            color: var(--text-secondary);
            max-width: 560px;
            line-height: 1.7;
            margin-bottom: 40px;
        }

        .hero-ctas {
            display: flex;
            gap: 16px;
        }

        .btn-hero {
            padding: 14px 32px;
            border-radius: var(--radius-md);
            font-size: 16px;
            font-weight: 600;
            transition: all 0.2s;
        }

        .btn-hero-primary {
            background: var(--accent);
            color: white;
        }

        .btn-hero-primary:hover {
            background: var(--accent-2);
            transform: translateY(-2px);
            box-shadow: 0 8px 32px var(--accent-glow);
        }

        .btn-hero-outline {
            background: transparent;
            color: var(--text-primary);
            border: 1px solid var(--border-hover);
        }

        .btn-hero-outline:hover {
            background: var(--bg-hover);
        }

        .hero-preview {
            margin-top: 60px;
            width: 100%;
            max-width: 1000px;
            border-radius: var(--radius-xl);
            overflow: hidden;
            border: 1px solid var(--border);
            box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
        }

        .hero-preview-bar {
            background: var(--bg-sidebar);
            padding: 12px 20px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .dot {
            width: 12px;
            height: 12px;
            border-radius: 50%;
        }

        .dot-red {
            background: #ff5f57;
        }

        .dot-yellow {
            background: #ffbd2e;
        }

        .dot-green {
            background: #28ca41;
        }

        .hero-preview-content {
            background: var(--bg-panel);
            height: 380px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-muted);
            font-size: 14px;
            position: relative;
            overflow: hidden;
        }

        .preview-templates {
            display: flex;
            gap: 16px;
            padding: 24px;
            overflow: hidden;
        }

        .preview-tpl {
            border-radius: var(--radius-md);
            overflow: hidden;
            flex-shrink: 0;
        }

        .preview-tpl img {
            width: 160px;
            height: 200px;
            object-fit: cover;
            display: block;
        }

        .preview-tpl-placeholder {
            width: 160px;
            height: 200px;
            background: var(--bg-card);
            border-radius: var(--radius-md);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-muted);
            font-size: 12px;
            border: 1px solid var(--border);
        }

        .categories-section {
            padding: 80px 60px;
        }

        .section-title {
            text-align: center;
            font-family: 'Space Grotesk', sans-serif;
            font-size: 40px;
            font-weight: 700;
            margin-bottom: 12px;
        }

        .section-sub {
            text-align: center;
            color: var(--text-secondary);
            font-size: 16px;
            margin-bottom: 50px;
        }

        .cat-grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 16px;
            max-width: 1100px;
            margin: 0 auto;
        }

        .cat-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 28px 20px;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s;
        }

        .cat-card:hover {
            border-color: var(--accent);
            transform: translateY(-4px);
            box-shadow: 0 12px 40px rgba(124, 92, 252, 0.2);
        }

        .cat-icon {
            width: 56px;
            height: 56px;
            border-radius: var(--radius-md);
            background: var(--accent-light);
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 16px;
            font-size: 24px;
            color: var(--accent);
        }

        .cat-name {
            font-size: 14px;
            font-weight: 600;
        }

        .cat-count {
            font-size: 12px;
            color: var(--text-muted);
            margin-top: 4px;
        }

        .features-section {
            padding: 80px 60px;
            background: linear-gradient(180deg, transparent 0%, rgba(124, 92, 252, 0.05) 100%);
        }

        .features-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 24px;
            max-width: 1100px;
            margin: 0 auto;
        }

        .feature-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 32px;
        }

        .feature-icon {
            width: 48px;
            height: 48px;
            border-radius: var(--radius-md);
            background: var(--accent-light);
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 20px;
            font-size: 22px;
            color: var(--accent);
        }

        .feature-title {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 10px;
        }

        .feature-desc {
            font-size: 14px;
            color: var(--text-secondary);
            line-height: 1.7;
        }

        .pricing-section {
            padding: 80px 60px;
        }

        .pricing-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 24px;
            max-width: 900px;
            margin: 0 auto;
        }

        .pricing-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-xl);
            padding: 36px;
            text-align: center;
            position: relative;
            overflow: hidden;
        }

        .pricing-card.featured {
            border-color: var(--accent);
            background: linear-gradient(135deg, rgba(124, 92, 252, 0.1) 0%, var(--bg-card) 100%);
        }

        .pricing-badge {
            position: absolute;
            top: 16px;
            right: 16px;
            background: var(--accent);
            color: white;
            font-size: 11px;
            font-weight: 700;
            padding: 4px 12px;
            border-radius: 100px;
        }

        .pricing-plan {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-bottom: 16px;
        }

        .pricing-price {
            font-family: 'Space Grotesk', sans-serif;
            font-size: 48px;
            font-weight: 700;
            margin-bottom: 4px;
        }

        .pricing-price span {
            font-size: 18px;
            font-weight: 400;
            color: var(--text-secondary);
        }

        .pricing-period {
            font-size: 13px;
            color: var(--text-muted);
            margin-bottom: 28px;
        }

        .pricing-features {
            list-style: none;
            margin-bottom: 32px;
        }

        .pricing-features li {
            font-size: 14px;
            padding: 10px 0;
            border-bottom: 1px solid var(--border);
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .pricing-features li:last-child {
            border: none;
        }

        .pricing-features li i {
            color: var(--green);
            font-size: 14px;
        }

        .landing-footer {
            padding: 40px 60px;
            border-top: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: auto;
        }

        .footer-logo {
            font-family: 'Bebas Neue', sans-serif;
            font-size: 20px;
            letter-spacing: 1px;
        }

        .footer-links {
            display: flex;
            gap: 24px;
        }

        .footer-links a {
            font-size: 13px;
            color: var(--text-muted);
            transition: color 0.2s;
        }

        .footer-links a:hover {
            color: var(--text-primary);
        }

        .footer-copy {
            font-size: 12px;
            color: var(--text-muted);
        }

        /* ===== AUTH PAGES ===== */
        #page-login,
        #page-register {
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: #0a0c14;
            overflow-y: auto;
            height: 100vh;
        }

        .auth-card {
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: var(--radius-xl);
            padding: 48px 44px;
            width: 440px;
            max-width: 95vw;
        }

        .auth-logo {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 36px;
        }

        .auth-logo .logo-icon {
            width: 40px;
            height: 40px;
            background: var(--accent);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            color: white;
        }

        .auth-logo-text {
            font-family: 'Bebas Neue', sans-serif;
            font-size: 22px;
            letter-spacing: 1px;
        }

        .auth-logo-sub {
            font-size: 11px;
            color: var(--text-muted);
            letter-spacing: 0.5px;
        }

        .auth-title {
            font-family: 'Space Grotesk', sans-serif;
            font-size: 28px;
            font-weight: 700;
            margin-bottom: 8px;
        }

        .auth-sub {
            font-size: 14px;
            color: var(--text-secondary);
            margin-bottom: 32px;
        }

        .form-group {
            margin-bottom: 18px;
        }

        .form-label {
            display: block;
            font-size: 13px;
            font-weight: 500;
            color: var(--text-secondary);
            margin-bottom: 8px;
        }

        .form-input {
            width: 100%;
            padding: 12px 16px;
            background: var(--bg-input);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            color: var(--text-primary);
            font-size: 14px;
            transition: border-color 0.2s;
        }

        .form-input:focus {
            outline: none;
            border-color: var(--accent);
        }

        .form-input::placeholder {
            color: var(--text-muted);
        }

        .btn-auth {
            width: 100%;
            padding: 13px;
            background: var(--accent);
            color: white;
            border-radius: var(--radius-md);
            font-size: 15px;
            font-weight: 600;
            transition: all 0.2s;
            margin-top: 8px;
        }

        .btn-auth:hover {
            background: var(--accent-2);
        }

        .auth-footer {
            text-align: center;
            margin-top: 24px;
            font-size: 14px;
            color: var(--text-secondary);
        }

        .auth-footer a {
            color: var(--accent);
            font-weight: 500;
        }

        .auth-divider {
            text-align: center;
            color: var(--text-muted);
            font-size: 13px;
            margin: 20px 0;
            position: relative;
        }

        .auth-divider::before,
        .auth-divider::after {
            content: '';
            position: absolute;
            top: 50%;
            width: 40%;
            height: 1px;
            background: var(--border);
        }

        .auth-divider::before {
            left: 0;
        }

        .auth-divider::after {
            right: 0;
        }

        /* ===== DASHBOARD ===== */
        #page-dashboard {
            flex-direction: row;
            overflow: hidden;
        }

        .dash-sidebar {
            width: 240px;
            background: var(--bg-sidebar);
            border-right: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            flex-shrink: 0;
            overflow-y: auto;
        }

        .dash-logo {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 20px 20px 24px;
            border-bottom: 1px solid var(--border);
        }

        .dash-logo .logo-icon {
            width: 34px;
            height: 34px;
            background: var(--accent);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            color: white;
            flex-shrink: 0;
        }

        .dash-logo-text {
            font-family: 'Bebas Neue', sans-serif;
            font-size: 18px;
            letter-spacing: 1px;
        }

        .dash-logo-sub {
            font-size: 10px;
            color: var(--text-muted);
            letter-spacing: 0.5px;
        }

        .dash-nav {
            padding: 16px 12px;
            flex: 1;
        }

        .dash-nav-label {
            font-size: 10px;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 1.5px;
            padding: 0 8px;
            margin: 16px 0 6px;
        }

        .dash-nav-link {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 12px;
            border-radius: var(--radius-md);
            color: var(--text-secondary);
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.15s;
            margin-bottom: 2px;
        }

        .dash-nav-link:hover {
            background: var(--bg-hover);
            color: var(--text-primary);
        }

        .dash-nav-link.active {
            background: var(--accent-light);
            color: var(--accent);
        }

        .dash-nav-link i {
            width: 20px;
            text-align: center;
            font-size: 16px;
        }

        .dash-nav-link .badge-new {
            background: var(--accent);
            color: white;
            font-size: 10px;
            font-weight: 700;
            padding: 2px 8px;
            border-radius: 100px;
            margin-left: auto;
        }

        .dash-user {
            padding: 16px 12px;
            border-top: 1px solid var(--border);
            display: flex;
            align-items: center;
            gap: 12px;
            cursor: pointer;
            margin: 8px 12px 12px;
            background: var(--bg-hover);
            border-radius: var(--radius-md);
        }

        .dash-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: var(--accent);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            font-weight: 700;
            color: white;
            flex-shrink: 0;
        }

        .dash-user-name {
            font-size: 14px;
            font-weight: 600;
        }

        .dash-user-plan {
            font-size: 11px;
            color: var(--text-muted);
        }

        .dash-main {
            flex: 1;
            overflow-y: auto;
            background: #0f1117;
        }

        .dash-topbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 32px;
            height: 64px;
            border-bottom: 1px solid var(--border);
            background: var(--bg-dark);
            position: sticky;
            top: 0;
            z-index: 10;
        }

        .dash-search {
            display: flex;
            align-items: center;
            gap: 10px;
            background: var(--bg-input);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            padding: 9px 16px;
            width: 300px;
        }

        .dash-search i {
            color: var(--text-muted);
            font-size: 14px;
        }

        .dash-search input {
            background: transparent;
            border: none;
            color: var(--text-primary);
            font-size: 14px;
            width: 100%;
        }

        .dash-search input::placeholder {
            color: var(--text-muted);
        }

        .dash-search input:focus {
            outline: none;
        }

        .dash-topbar-right {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .notif-btn {
            width: 38px;
            height: 38px;
            border-radius: var(--radius-md);
            background: var(--bg-input);
            border: 1px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-secondary);
            position: relative;
        }

        .notif-btn::after {
            content: '';
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--accent);
            position: absolute;
            top: 6px;
            right: 6px;
        }

        .dash-content {
            padding: 32px;
        }

        .dash-welcome {
            margin-bottom: 32px;
        }

        .dash-welcome h1 {
            font-family: 'Space Grotesk', sans-serif;
            font-size: 28px;
            font-weight: 700;
            margin-bottom: 6px;
        }

        .dash-welcome p {
            color: var(--text-secondary);
            font-size: 15px;
        }

        .dash-actions {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 16px;
            margin-bottom: 36px;
        }

        .dash-action-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 24px;
            cursor: pointer;
            transition: all 0.2s;
            text-align: center;
        }

        .dash-action-card:hover {
            border-color: var(--accent);
            transform: translateY(-3px);
        }

        .dash-action-card:first-child {
            background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
            border: none;
        }

        .dash-action-card:first-child .action-icon {
            background: rgba(255, 255, 255, 0.2);
            color: white;
        }

        .dash-action-card:first-child .action-title {
            color: white;
        }

        .action-icon {
            width: 48px;
            height: 48px;
            border-radius: var(--radius-md);
            background: var(--accent-light);
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 12px;
            font-size: 22px;
            color: var(--accent);
        }

        .action-title {
            font-size: 14px;
            font-weight: 600;
            margin-bottom: 4px;
        }

        .action-desc {
            font-size: 12px;
            color: var(--text-muted);
        }

        .dash-section-title {
            font-size: 18px;
            font-weight: 700;
            margin-bottom: 16px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .dash-section-title a {
            font-size: 13px;
            font-weight: 500;
            color: var(--accent);
        }

        .recent-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 16px;
            margin-bottom: 36px;
        }

        .project-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            overflow: hidden;
            cursor: pointer;
            transition: all 0.2s;
        }

        .project-card:hover {
            border-color: var(--accent);
            transform: translateY(-3px);
            box-shadow: var(--shadow);
        }

        .project-thumb {
            height: 150px;
            background: var(--bg-input);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-muted);
            font-size: 36px;
            position: relative;
            overflow: hidden;
        }

        .project-thumb.tpl-1 {
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
        }

        .project-thumb.tpl-2 {
            background: linear-gradient(135deg, #0d0d0d 0%, #1a0a00 100%);
        }

        .project-thumb.tpl-3 {
            background: linear-gradient(135deg, #0a1628 0%, #1e0535 100%);
        }

        .project-thumb.tpl-4 {
            background: linear-gradient(135deg, #0f2027 0%, #203a43 100%);
        }

        .project-info {
            padding: 14px;
        }

        .project-name {
            font-size: 13px;
            font-weight: 600;
            margin-bottom: 4px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .project-meta {
            font-size: 11px;
            color: var(--text-muted);
        }

        .project-tag {
            display: inline-block;
            background: var(--accent-light);
            color: var(--accent);
            font-size: 10px;
            font-weight: 600;
            padding: 2px 8px;
            border-radius: 100px;
            margin-top: 6px;
        }

        .tpl-grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 12px;
            margin-bottom: 36px;
        }

        .tpl-mini {
            border-radius: var(--radius-md);
            overflow: hidden;
            border: 2px solid transparent;
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
        }

        .tpl-mini:hover {
            border-color: var(--accent);
            transform: scale(1.03);
        }

        .tpl-mini-thumb {
            height: 130px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            color: white;
            text-align: center;
            padding: 8px;
            font-weight: 700;
        }

        .tpl-mini-label {
            padding: 8px 10px;
            background: var(--bg-card);
            font-size: 11px;
            font-weight: 600;
            border-top: 1px solid var(--border);
        }

        /* ===== EDITOR PAGE ===== */
        #page-editor {
            flex-direction: column;
            overflow: hidden;
            background: var(--canvas-bg);
        }

        .editor-topbar {
            height: var(--topbar-h);
            background: var(--bg-sidebar);
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            padding: 0 16px;
            gap: 12px;
            flex-shrink: 0;
            z-index: 20;
        }

        .editor-logo {
            display: flex;
            align-items: center;
            gap: 8px;
            padding-right: 16px;
            border-right: 1px solid var(--border);
        }

        .editor-logo .logo-icon {
            width: 30px;
            height: 30px;
            background: var(--accent);
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            color: white;
        }

        .editor-logo-text {
            font-family: 'Bebas Neue', sans-serif;
            font-size: 16px;
            letter-spacing: 1px;
        }

        .file-name-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 7px 14px;
            background: var(--bg-input);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: border-color 0.2s;
        }

        .file-name-btn:hover {
            border-color: var(--accent);
        }

        .editor-btn {
            width: 36px;
            height: 36px;
            background: var(--bg-input);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.15s;
        }

        .editor-btn:hover {
            background: var(--bg-hover);
            color: var(--text-primary);
            border-color: var(--border-hover);
        }

        .editor-btn.active {
            background: var(--accent-light);
            color: var(--accent);
            border-color: var(--accent);
        }

        .editor-btn:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

        .topbar-spacer {
            flex: 1;
        }

        .topbar-center {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .btn-upgrade {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 7px 16px;
            background: linear-gradient(135deg, var(--gold), #e08b00);
            border-radius: var(--radius-sm);
            font-size: 13px;
            font-weight: 700;
            color: #1a0f00;
            cursor: pointer;
            transition: transform 0.2s;
        }

        .btn-upgrade:hover {
            transform: translateY(-1px);
        }

        .btn-share {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 7px 16px;
            background: var(--bg-input);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.15s;
        }

        .btn-share:hover {
            border-color: var(--accent);
            color: var(--accent);
        }

        .btn-download {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 7px 18px;
            background: var(--accent);
            border-radius: var(--radius-sm);
            font-size: 13px;
            font-weight: 600;
            color: white;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-download:hover {
            background: var(--accent-2);
            transform: translateY(-1px);
        }

        .download-arrow {
            width: 28px;
            height: 28px;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
        }

        .editor-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: var(--accent);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            font-weight: 700;
            color: white;
            cursor: pointer;
        }

        .editor-body {
            flex: 1;
            display: flex;
            overflow: hidden;
        }

        /* Left Sidebar */
        .editor-sidebar {
            width: var(--sidebar-w);
            background: var(--bg-sidebar);
            border-right: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 8px 0;
            overflow-y: auto;
            flex-shrink: 0;
            z-index: 15;
        }

        .sidebar-btn {
            width: 56px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 5px;
            padding: 10px 4px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            transition: all 0.15s;
            color: var(--text-muted);
            font-size: 11px;
            font-weight: 500;
            margin: 2px 0;
        }

        .sidebar-btn:hover {
            background: var(--bg-hover);
            color: var(--text-primary);
        }

        .sidebar-btn.active {
            background: var(--accent-light);
            color: var(--accent);
        }

        .sidebar-btn i {
            font-size: 22px;
        }

        .sidebar-divider {
            width: 40px;
            height: 1px;
            background: var(--border);
            margin: 6px 0;
        }

        /* Template Panel */
        .template-panel {
            width: var(--tpanel-w);
            background: var(--bg-panel);
            border-right: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            flex-shrink: 0;
        }

        .panel-header {
            padding: 16px 14px 12px;
            border-bottom: 1px solid var(--border);
            flex-shrink: 0;
        }

        .panel-search {
            display: flex;
            align-items: center;
            gap: 8px;
            background: var(--bg-input);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            padding: 9px 12px;
            margin-bottom: 12px;
        }

        .panel-search i {
            color: var(--text-muted);
            font-size: 13px;
        }

        .panel-search input {
            background: transparent;
            border: none;
            color: var(--text-primary);
            font-size: 13px;
            width: 100%;
        }

        .panel-search input::placeholder {
            color: var(--text-muted);
        }

        .panel-search input:focus {
            outline: none;
        }

        .panel-filter {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .panel-tabs {
            display: flex;
            gap: 4px;
        }

        .panel-tab {
            padding: 5px 12px;
            border-radius: var(--radius-sm);
            font-size: 12px;
            font-weight: 500;
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.15s;
            border: 1px solid transparent;
        }

        .panel-tab.active {
            background: var(--accent-light);
            color: var(--accent);
            border-color: var(--accent-glow);
        }

        .panel-tab:hover:not(.active) {
            color: var(--text-primary);
            background: var(--bg-hover);
        }

        .filter-icon {
            width: 30px;
            height: 30px;
            border-radius: var(--radius-sm);
            background: var(--bg-input);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            color: var(--text-secondary);
            cursor: pointer;
        }

        .panel-body {
            flex: 1;
            overflow-y: auto;
            padding: 14px;
        }

        .tpl-section-title {
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 13px;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 10px;
            margin-top: 6px;
        }

        .tpl-section-see {
            font-size: 12px;
            font-weight: 500;
            color: var(--accent);
            cursor: pointer;
        }

        .tpl-cards-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
            margin-bottom: 20px;
        }

        .tpl-card {
            border-radius: var(--radius-md);
            overflow: hidden;
            border: 2px solid transparent;
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
        }

        .tpl-card:hover {
            border-color: var(--accent);
            transform: scale(1.02);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
        }

        .tpl-card-thumb {
            height: 130px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            font-weight: 700;
            color: white;
            text-align: center;
            padding: 10px;
            position: relative;
            overflow: hidden;
        }

        .tpl-card-label {
            background: var(--bg-card);
            padding: 7px 10px;
            font-size: 11px;
            font-weight: 600;
            color: var(--text-secondary);
        }

        .tpl-card-premium {
            position: absolute;
            top: 6px;
            right: 6px;
            background: var(--gold);
            color: #1a0f00;
            font-size: 10px;
            font-weight: 700;
            padding: 2px 7px;
            border-radius: 100px;
        }

        /* Canvas workspace */
        .canvas-workspace {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            position: relative;
        }

        .canvas-toolbar {
            height: 48px;
            background: white;
            border-bottom: 1px solid #e0e0e0;
            display: flex;
            align-items: center;
            padding: 0 16px;
            gap: 6px;
            z-index: 10;
            flex-shrink: 0;
        }

        .ctool-btn {
            width: 34px;
            height: 34px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            color: #333;
            cursor: pointer;
            transition: background 0.15s;
            background: transparent;
            border: 1px solid transparent;
        }

        .ctool-btn:hover {
            background: #f0f0f0;
            border-color: #d0d0d0;
        }

        .ctool-btn.active {
            background: #e8e0ff;
            color: var(--accent);
            border-color: #c0b0f0;
        }

        .ctool-separator {
            width: 1px;
            height: 24px;
            background: #e0e0e0;
            margin: 0 4px;
        }

        .ctool-text {
            font-size: 13px;
            color: #666;
            padding: 0 10px;
        }

        .canvas-area {
            flex: 1;
            overflow: auto;
            display: flex;
            align-items: flex-start;
            justify-content: center;
            padding: 40px;
            background: var(--canvas-bg);
            position: relative;
        }

        .canvas-wrap {
            position: relative;
            box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
        }

        #mainCanvas {
            display: block;
        }

        .canvas-bottombar {
            height: 50px;
            background: white;
            border-top: 1px solid #e0e0e0;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 20px;
            z-index: 10;
            flex-shrink: 0;
        }

        .bottombar-left {
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 13px;
            color: #555;
        }

        .bottombar-left i {
            font-size: 16px;
        }

        .page-indicator {
            display: flex;
            align-items: center;
            gap: 8px;
            background: #f5f5f5;
            border: 1px solid #e0e0e0;
            border-radius: 6px;
            padding: 5px 14px;
            font-size: 13px;
            color: #333;
            cursor: pointer;
        }

        .zoom-ctrl {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .zoom-btn {
            width: 28px;
            height: 28px;
            border-radius: 5px;
            background: #f5f5f5;
            border: 1px solid #e0e0e0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            color: #333;
            cursor: pointer;
        }

        .zoom-btn:hover {
            background: #e8e0ff;
        }

        .zoom-level {
            font-size: 13px;
            font-weight: 600;
            color: #333;
            min-width: 40px;
            text-align: center;
            cursor: pointer;
        }

        .view-modes {
            display: flex;
            gap: 4px;
        }

        .view-mode-btn {
            width: 28px;
            height: 28px;
            border-radius: 5px;
            border: 1px solid #e0e0e0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            color: #666;
            cursor: pointer;
        }

        .view-mode-btn:hover,
        .view-mode-btn.active {
            background: #e8e0ff;
            color: var(--accent);
            border-color: #c0b0f0;
        }

        .add-page-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 7px 16px;
            border: 1px solid #d0d0d0;
            border-radius: 6px;
            font-size: 13px;
            color: #555;
            cursor: pointer;
            transition: all 0.15s;
            background: white;
        }

        .add-page-btn:hover {
            border-color: var(--accent);
            color: var(--accent);
            background: #f5f0ff;
        }

        /* Right Panel */
        .right-panel {
            width: var(--rpanel-w);
            background: white;
            border-left: 1px solid #e0e0e0;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            flex-shrink: 0;
        }

        .rpanel-tabs {
            display: flex;
            border-bottom: 1px solid #e0e0e0;
            flex-shrink: 0;
        }

        .rpanel-tab {
            flex: 1;
            padding: 14px 0;
            text-align: center;
            font-size: 13px;
            font-weight: 600;
            color: #666;
            cursor: pointer;
            border-bottom: 2px solid transparent;
            transition: all 0.15s;
        }

        .rpanel-tab.active {
            color: var(--accent);
            border-color: var(--accent);
        }

        .rpanel-tab:hover:not(.active) {
            color: #333;
            background: #fafafa;
        }

        .rpanel-body {
            flex: 1;
            overflow-y: auto;
            padding: 16px;
        }

        .rpanel-section {
            margin-bottom: 20px;
        }

        .rpanel-section-title {
            font-size: 12px;
            font-weight: 700;
            color: #333;
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-bottom: 12px;
        }

        /* Text properties */
        .prop-text-input {
            width: 100%;
            padding: 9px 12px;
            background: #f5f5f7;
            border: 1px solid #e0e0e0;
            border-radius: var(--radius-sm);
            font-size: 14px;
            color: #111;
            transition: border-color 0.2s;
        }

        .prop-text-input:focus {
            outline: none;
            border-color: var(--accent);
        }

        .prop-row {
            display: flex;
            gap: 8px;
            margin-bottom: 10px;
            align-items: center;
        }

        .prop-row-label {
            font-size: 12px;
            color: #666;
            width: 70px;
            flex-shrink: 0;
        }

        .font-select {
            flex: 1;
            padding: 8px 10px;
            background: #f5f5f7;
            border: 1px solid #e0e0e0;
            border-radius: var(--radius-sm);
            font-size: 13px;
            color: #111;
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 10px center;
            padding-right: 30px;
            cursor: pointer;
        }

        .font-select:focus {
            outline: none;
            border-color: var(--accent);
        }

        .style-select {
            flex: 1;
            padding: 8px 10px;
            background: #f5f5f7;
            border: 1px solid #e0e0e0;
            border-radius: var(--radius-sm);
            font-size: 13px;
            color: #111;
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 10px center;
            padding-right: 30px;
            cursor: pointer;
        }

        .size-control {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .size-btn {
            width: 28px;
            height: 28px;
            border-radius: 5px;
            background: #f5f5f7;
            border: 1px solid #e0e0e0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            color: #333;
            cursor: pointer;
        }

        .size-btn:hover {
            background: #e8e0ff;
            border-color: var(--accent);
            color: var(--accent);
        }

        .size-input {
            width: 60px;
            text-align: center;
            padding: 6px;
            background: #f5f5f7;
            border: 1px solid #e0e0e0;
            border-radius: 5px;
            font-size: 14px;
            font-weight: 600;
            color: #111;
        }

        .size-input:focus {
            outline: none;
            border-color: var(--accent);
        }

        .format-btns {
            display: flex;
            gap: 4px;
        }

        .fmt-btn {
            width: 34px;
            height: 34px;
            border-radius: var(--radius-sm);
            background: #f5f5f7;
            border: 1px solid #e0e0e0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            color: #333;
            cursor: pointer;
            font-weight: 700;
            transition: all 0.15s;
        }

        .fmt-btn:hover {
            background: #e8e0ff;
            border-color: var(--accent);
            color: var(--accent);
        }

        .fmt-btn.active {
            background: var(--accent);
            color: white;
            border-color: var(--accent);
        }

        .fmt-btn.Bold {
            font-weight: 900;
        }

        .fmt-btn.Italic {
            font-style: italic;
        }

        .fmt-btn.Underline {
            text-decoration: underline;
        }

        .align-btns {
            display: flex;
            gap: 4px;
        }

        .align-btn {
            width: 34px;
            height: 34px;
            border-radius: var(--radius-sm);
            background: #f5f5f7;
            border: 1px solid #e0e0e0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 15px;
            color: #333;
            cursor: pointer;
            transition: all 0.15s;
        }

        .align-btn:hover,
        .align-btn.active {
            background: #e8e0ff;
            border-color: var(--accent);
            color: var(--accent);
        }

        .color-row {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 10px;
        }

        .color-swatch {
            width: 32px;
            height: 32px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            border: 2px solid transparent;
            transition: all 0.15s;
        }

        .color-swatch:hover {
            transform: scale(1.15);
        }

        .color-swatch.active {
            border-color: var(--accent);
            transform: scale(1.15);
            box-shadow: 0 0 0 2px white, 0 0 0 4px var(--accent);
        }

        .add-color {
            width: 32px;
            height: 32px;
            border-radius: var(--radius-sm);
            border: 2px dashed #ccc;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #999;
            font-size: 18px;
            cursor: pointer;
        }

        .color-picker-wrap {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .color-picker-btn {
            width: 36px;
            height: 36px;
            border-radius: var(--radius-sm);
            border: 2px solid #e0e0e0;
            cursor: pointer;
            transition: all 0.15s;
            overflow: hidden;
        }

        .color-input-hidden {
            width: 0;
            height: 0;
            border: none;
            padding: 0;
            opacity: 0;
            position: absolute;
        }

        .effects-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 8px;
        }

        .effect-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            padding: 10px 4px;
            border-radius: var(--radius-sm);
            border: 1px solid #e0e0e0;
            cursor: pointer;
            transition: all 0.15s;
            background: #f9f9f9;
        }

        .effect-btn:hover {
            border-color: var(--accent);
            background: #f0eaff;
        }

        .effect-btn.active {
            border-color: var(--accent);
            background: var(--accent);
        }

        .effect-btn.active span {
            color: white;
        }

        .effect-icon {
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            font-weight: 900;
        }

        .effect-label {
            font-size: 10px;
            font-weight: 600;
            color: #555;
        }

        .opacity-row {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .opacity-slider {
            flex: 1;
            height: 4px;
            border-radius: 2px;
            background: linear-gradient(to right, #ccc 0%, #333 100%);
            cursor: pointer;
        }

        .opacity-val {
            font-size: 13px;
            font-weight: 600;
            color: #333;
            min-width: 32px;
            text-align: right;
        }

        .range-input {
            width: 100%;
            -webkit-appearance: none;
            height: 4px;
            border-radius: 2px;
            background: #e0e0e0;
            outline: none;
        }

        .range-input::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: var(--accent);
            cursor: pointer;
        }

        .range-input::-webkit-slider-runnable-track {
            background: linear-gradient(to right, var(--accent) 0%, #e0e0e0 100%);
            border-radius: 2px;
        }

        .prop-number {
            width: 70px;
            text-align: center;
            padding: 6px;
            background: #f5f5f7;
            border: 1px solid #e0e0e0;
            border-radius: 5px;
            font-size: 13px;
            font-weight: 600;
            color: #111;
        }

        .prop-number:focus {
            outline: none;
            border-color: var(--accent);
        }

        /* Layers panel */
        .layers-list {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .layer-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 10px;
            border-radius: var(--radius-sm);
            border: 1px solid #e0e0e0;
            background: #fafafa;
            cursor: pointer;
            transition: all 0.15s;
        }

        .layer-item:hover {
            border-color: var(--accent);
            background: #f5f0ff;
        }

        .layer-item.active {
            border-color: var(--accent);
            background: var(--accent-light);
        }

        .layer-icon {
            width: 28px;
            height: 28px;
            border-radius: 4px;
            background: var(--accent-light);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            color: var(--accent);
        }

        .layer-name {
            flex: 1;
            font-size: 13px;
            font-weight: 500;
            color: #333;
        }

        .layer-actions {
            display: flex;
            gap: 4px;
        }

        .layer-action-btn {
            width: 24px;
            height: 24px;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            color: #999;
            cursor: pointer;
        }

        .layer-action-btn:hover {
            background: #e0d8ff;
            color: var(--accent);
        }

        /* Object floating toolbar */
        .floating-toolbar {
            position: absolute;
            top: -48px;
            left: 50%;
            transform: translateX(-50%);
            background: var(--bg-sidebar);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            display: flex;
            align-items: center;
            padding: 6px 10px;
            gap: 6px;
            box-shadow: var(--shadow);
            display: none;
            z-index: 100;
            white-space: nowrap;
        }

        .ft-btn {
            width: 32px;
            height: 32px;
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 15px;
            color: var(--text-secondary);
            cursor: pointer;
            background: transparent;
            transition: all 0.15s;
        }

        .ft-btn:hover {
            background: var(--bg-hover);
            color: var(--text-primary);
        }

        .ft-btn.danger:hover {
            background: rgba(239, 68, 68, 0.15);
            color: var(--red);
        }

        .ft-separator {
            width: 1px;
            height: 24px;
            background: var(--border);
        }

        /* Panels for sidebar sections */
        .side-panel {
            display: none;
        }

        .side-panel.active {
            display: flex;
            flex-direction: column;
        }

        /* Elements panel */
        .elements-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
        }

        .element-btn {
            aspect-ratio: 1;
            border-radius: var(--radius-md);
            border: 1px solid var(--border);
            background: var(--bg-card);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 6px;
            cursor: pointer;
            transition: all 0.15s;
        }

        .element-btn:hover {
            border-color: var(--accent);
            background: var(--accent-light);
        }

        .element-btn i {
            font-size: 22px;
            color: var(--text-secondary);
        }

        .element-btn:hover i {
            color: var(--accent);
        }

        .element-btn span {
            font-size: 11px;
            color: var(--text-muted);
        }

        /* Background panel */
        .bg-colors {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 8px;
            margin-bottom: 16px;
        }

        .bg-color {
            width: 100%;
            aspect-ratio: 1;
            border-radius: var(--radius-sm);
            cursor: pointer;
            border: 2px solid transparent;
            transition: all 0.15s;
        }

        .bg-color:hover {
            transform: scale(1.1);
            border-color: var(--accent);
        }

        .bg-gradient-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
        }

        .bg-gradient {
            height: 60px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            border: 2px solid transparent;
            transition: all 0.15s;
        }

        .bg-gradient:hover {
            transform: scale(1.03);
            border-color: var(--accent);
        }

        /* AI Panel */
        .ai-panel {
            padding: 14px;
        }

        .ai-prompt {
            width: 100%;
            background: var(--bg-input);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            padding: 12px;
            color: var(--text-primary);
            font-size: 13px;
            resize: none;
            font-family: 'DM Sans', sans-serif;
        }

        .ai-prompt:focus {
            outline: none;
            border-color: var(--accent);
        }

        .ai-generate-btn {
            width: 100%;
            padding: 12px;
            background: linear-gradient(135deg, var(--accent), #a855f7);
            color: white;
            border-radius: var(--radius-md);
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            margin-top: 10px;
            transition: all 0.2s;
        }

        .ai-generate-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 20px var(--accent-glow);
        }

        .ai-results {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
            margin-top: 12px;
        }

        .ai-result {
            height: 100px;
            border-radius: var(--radius-md);
            border: 2px solid var(--border);
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            color: var(--text-muted);
        }

        .ai-result:hover {
            border-color: var(--accent);
        }

        /* Upload panel */
        .upload-area {
            border: 2px dashed var(--border);
            border-radius: var(--radius-md);
            padding: 32px 20px;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s;
            margin-bottom: 14px;
        }

        .upload-area:hover {
            border-color: var(--accent);
            background: var(--accent-light);
        }

        .upload-area i {
            font-size: 32px;
            color: var(--text-muted);
            margin-bottom: 10px;
            display: block;
        }

        .upload-area p {
            font-size: 13px;
            color: var(--text-secondary);
        }

        .upload-area span {
            font-size: 12px;
            color: var(--text-muted);
        }

        .uploaded-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
        }

        .uploaded-item {
            height: 80px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border);
            background: var(--bg-input);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            color: var(--text-muted);
            cursor: pointer;
            overflow: hidden;
        }

        .uploaded-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .uploaded-item:hover {
            border-color: var(--accent);
        }

        /* Download Modal */
        .modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.7);
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s;
            backdrop-filter: blur(4px);
        }

        .modal-overlay.open {
            opacity: 1;
            pointer-events: all;
        }

        .modal-box {
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: var(--radius-xl);
            padding: 32px;
            width: 420px;
            max-width: 95vw;
            transform: scale(0.95);
            transition: transform 0.2s;
        }

        .modal-overlay.open .modal-box {
            transform: scale(1);
        }

        .modal-title {
            font-family: 'Space Grotesk', sans-serif;
            font-size: 22px;
            font-weight: 700;
            margin-bottom: 6px;
        }

        .modal-sub {
            font-size: 14px;
            color: var(--text-secondary);
            margin-bottom: 24px;
        }

        .modal-options {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            margin-bottom: 24px;
        }

        .modal-opt {
            padding: 16px;
            border: 2px solid var(--border);
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: all 0.15s;
            text-align: center;
        }

        .modal-opt:hover {
            border-color: var(--accent);
            background: var(--accent-light);
        }

        .modal-opt.selected {
            border-color: var(--accent);
            background: var(--accent-light);
        }

        .modal-opt i {
            font-size: 24px;
            color: var(--accent);
            margin-bottom: 8px;
            display: block;
        }

        .modal-opt-title {
            font-size: 14px;
            font-weight: 600;
        }

        .modal-opt-desc {
            font-size: 12px;
            color: var(--text-muted);
            margin-top: 3px;
        }

        .modal-actions {
            display: flex;
            gap: 10px;
        }

        .btn-cancel {
            flex: 1;
            padding: 11px;
            border-radius: var(--radius-md);
            background: var(--bg-input);
            border: 1px solid var(--border);
            color: var(--text-primary);
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: background 0.15s;
        }

        .btn-cancel:hover {
            background: var(--bg-hover);
        }

        .btn-do-download {
            flex: 2;
            padding: 11px;
            border-radius: var(--radius-md);
            background: var(--accent);
            color: white;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-do-download:hover {
            background: var(--accent-2);
        }

        /* Toast */
        .toast {
            position: fixed;
            bottom: 24px;
            left: 50%;
            transform: translateX(-50%) translateY(20px);
            background: var(--bg-sidebar);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            padding: 12px 24px;
            font-size: 14px;
            color: var(--text-primary);
            z-index: 9999;
            opacity: 0;
            transition: all 0.3s;
            box-shadow: var(--shadow);
        }

        .toast.show {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }

        .toast.success {
            border-color: var(--green);
            color: var(--green);
        }

        .toast.error {
            border-color: var(--red);
            color: var(--red);
        }

        /* Brochure Maker, AI Gen, Brand Kit pages */
        #page-brochure,
        #page-ai-gen,
        #page-brandkit,
        #page-templates,
        #page-pricing {
            flex-direction: row;
            overflow: hidden;
        }

        .content-main {
            flex: 1;
            overflow-y: auto;
            padding: 40px;
            background: var(--bg-dark);
        }

        .content-header {
            margin-bottom: 36px;
        }

        .content-header h1 {
            font-family: 'Space Grotesk', sans-serif;
            font-size: 32px;
            font-weight: 700;
            margin-bottom: 8px;
        }

        .content-header p {
            color: var(--text-secondary);
            font-size: 15px;
        }

        .brochure-types {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 16px;
            margin-bottom: 36px;
        }

        .btype-card {
            background: var(--bg-card);
            border: 2px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 28px 20px;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btype-card:hover,
        .btype-card.selected {
            border-color: var(--accent);
            background: var(--accent-light);
        }

        .btype-icon {
            font-size: 36px;
            margin-bottom: 14px;
        }

        .btype-title {
            font-size: 15px;
            font-weight: 700;
            margin-bottom: 6px;
        }

        .btype-desc {
            font-size: 12px;
            color: var(--text-muted);
        }

        .brochure-form {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 32px;
        }

        .form-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 18px;
        }

        .form-group-dark {
            margin-bottom: 0;
        }

        .form-label-dark {
            display: block;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-secondary);
            margin-bottom: 8px;
        }

        .form-input-dark {
            width: 100%;
            padding: 11px 14px;
            background: var(--bg-input);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            color: var(--text-primary);
            font-size: 14px;
            transition: border-color 0.2s;
        }

        .form-input-dark:focus {
            outline: none;
            border-color: var(--accent);
        }

        .form-input-dark::placeholder {
            color: var(--text-muted);
        }

        .color-input-row {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .color-preview {
            width: 44px;
            height: 44px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border);
            cursor: pointer;
        }

        .btn-generate {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 13px 32px;
            background: linear-gradient(135deg, var(--accent), #a855f7);
            color: white;
            border-radius: var(--radius-md);
            font-size: 15px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s;
            margin-top: 28px;
        }

        .btn-generate:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 30px var(--accent-glow);
        }

        .brochure-preview {
            margin-top: 36px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 32px;
            display: none;
        }

        .brochure-preview.show {
            display: block;
        }

        .preview-frame {
            background: white;
            border-radius: var(--radius-md);
            overflow: hidden;
            box-shadow: var(--shadow);
        }

        /* AI Generator */
        .ai-gen-form {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 32px;
            margin-bottom: 28px;
        }

        .styles-grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 10px;
            margin-top: 8px;
        }

        .style-chip {
            padding: 10px 6px;
            border: 2px solid var(--border);
            border-radius: var(--radius-md);
            text-align: center;
            cursor: pointer;
            transition: all 0.15s;
        }

        .style-chip:hover,
        .style-chip.selected {
            border-color: var(--accent);
            background: var(--accent-light);
        }

        .style-chip i {
            font-size: 20px;
            color: var(--accent);
            display: block;
            margin-bottom: 6px;
        }

        .style-chip span {
            font-size: 12px;
            font-weight: 600;
            color: var(--text-secondary);
        }

        .ai-results-section {
            display: none;
        }

        .ai-results-section.show {
            display: block;
        }

        .ai-cards {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 20px;
        }

        .ai-card {
            background: var(--bg-card);
            border: 2px solid var(--border);
            border-radius: var(--radius-lg);
            overflow: hidden;
            cursor: pointer;
            transition: all 0.2s;
        }

        .ai-card:hover {
            border-color: var(--accent);
            transform: translateY(-4px);
            box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
        }

        .ai-card-thumb {
            height: 280px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        .ai-card-footer {
            padding: 14px 16px;
            border-top: 1px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .ai-card-title {
            font-size: 13px;
            font-weight: 600;
        }

        .btn-edit-design {
            padding: 7px 16px;
            background: var(--accent);
            color: white;
            border-radius: var(--radius-sm);
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
        }

        /* Brand Kit */
        .brandkit-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 24px;
        }

        .bk-section {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 24px;
        }

        .bk-section-title {
            font-size: 15px;
            font-weight: 700;
            margin-bottom: 18px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .bk-section-title i {
            color: var(--accent);
        }

        .logo-upload-area {
            border: 2px dashed var(--border);
            border-radius: var(--radius-md);
            height: 140px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s;
        }

        .logo-upload-area:hover {
            border-color: var(--accent);
            background: var(--accent-light);
        }

        .logo-upload-area i {
            font-size: 36px;
            color: var(--text-muted);
            margin-bottom: 10px;
        }

        .logo-upload-area p {
            font-size: 13px;
            color: var(--text-secondary);
        }

        .colors-palette {
            display: flex;
            gap: 10px;
            margin-bottom: 14px;
        }

        .palette-color {
            width: 48px;
            height: 48px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            border: 2px solid transparent;
            position: relative;
            transition: all 0.15s;
        }

        .palette-color:hover {
            border-color: var(--accent);
            transform: scale(1.1);
        }

        .palette-add {
            width: 48px;
            height: 48px;
            border-radius: var(--radius-sm);
            border: 2px dashed var(--border);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-muted);
            font-size: 22px;
            cursor: pointer;
        }

        .font-preview {
            background: var(--bg-input);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            padding: 16px;
            margin-bottom: 10px;
            text-align: center;
        }

        .font-preview-text {
            font-size: 24px;
            font-weight: 700;
        }

        .font-preview-name {
            font-size: 12px;
            color: var(--text-muted);
            margin-top: 6px;
        }

        /* Templates browse page */
        .tpl-browse-filters {
            display: flex;
            gap: 10px;
            margin-bottom: 28px;
            flex-wrap: wrap;
        }

        .filter-chip {
            padding: 8px 18px;
            border-radius: 100px;
            border: 1px solid var(--border);
            font-size: 13px;
            font-weight: 500;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.15s;
            background: var(--bg-card);
        }

        .filter-chip:hover,
        .filter-chip.active {
            border-color: var(--accent);
            color: var(--accent);
            background: var(--accent-light);
        }

        .tpl-browse-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 16px;
        }

        .tpl-browse-card {
            background: var(--bg-card);
            border: 2px solid var(--border);
            border-radius: var(--radius-lg);
            overflow: hidden;
            cursor: pointer;
            transition: all 0.2s;
        }

        .tpl-browse-card:hover {
            border-color: var(--accent);
            transform: translateY(-4px);
            box-shadow: var(--shadow);
        }

        .tpl-browse-thumb {
            height: 200px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 14px;
            font-weight: 700;
            text-align: center;
            padding: 12px;
            position: relative;
            overflow: hidden;
        }

        .tpl-browse-info {
            padding: 12px 14px;
        }

        .tpl-browse-name {
            font-size: 13px;
            font-weight: 600;
            margin-bottom: 4px;
        }

        .tpl-browse-cat {
            font-size: 11px;
            color: var(--text-muted);
        }

        .tpl-browse-badge {
            position: absolute;
            top: 8px;
            left: 8px;
            font-size: 10px;
            font-weight: 700;
            padding: 3px 9px;
            border-radius: 100px;
        }

        .badge-free {
            background: rgba(34, 197, 94, 0.2);
            color: var(--green);
        }

        .badge-pro {
            background: rgba(245, 166, 35, 0.2);
            color: var(--gold);
        }

        /* Responsive tweaks */
        @media (max-width: 1200px) {
            .cat-grid {
                grid-template-columns: repeat(4, 1fr);
            }

            .tpl-browse-grid {
                grid-template-columns: repeat(3, 1fr);
            }
        }
    