/* ── GLOBAL & BASE STYLES ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-body: #f8fafc;
    --bg-navbar: #ffffff;
    --bg-features: #ffffff;
    --bg-card: #ffffff;
    --bg-preview: #ffffff;
    --bg-preview-grid: #f1f5f9;
    --bg-icon: #eff6ff;
    --bg-badge: #eff6ff;
    --border-color: #f1f5f9;
    --border-badge: #dbeafe;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-badge: #2563eb;
    --text-card-desc: #64748b;
    --btn-outline-bg: #f8fafc;
    --btn-outline-text: #334155;
    --btn-outline-border: #e2e8f0;
    --signin-bg: #f8fafc;
    --signin-text: #334155;
    --signin-border: #e2e8f0;
    --icon-color: #2563eb;
    --moon-icon: #64748b;
}

[data-theme="dark"] {
    --bg-body: #0d1117;
    --bg-navbar: #161b22;
    --bg-features: #0d1117;
    --bg-card: #161b22;
    --bg-preview: #1a2234;
    --bg-preview-grid: #1e2a3a;
    --bg-icon: #1e3a5f;
    --bg-badge: #1a2340;
    --border-color: #21262d;
    --border-badge: #2d4a8a;
    --text-primary: #f0f6fc;
    --text-secondary: #c9d1d9;
    --text-muted: #8b949e;
    --text-badge: #58a6ff;
    --text-card-desc: #8b949e;
    --btn-outline-bg: transparent;
    --btn-outline-text: #c9d1d9;
    --btn-outline-border: #30363d;
    --signin-bg: transparent;
    --signin-text: #c9d1d9;
    --signin-border: #30363d;
    --icon-color: #58a6ff;
    --moon-icon: #c9d1d9;
}

body {
    font-family: 'Cambria', 'Georgia', 'Times New Roman', serif;
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
}

/* ── NAVBAR ── */
.navbar {
    display: flex;
    align-items: center;
    height: 56px;
    background: var(--bg-navbar);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    transition: background 0.3s, border-color 0.3s;
}

.logo-wrap {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    text-decoration: none;
}

.logo-icon {
    width: 28px;
    height: 28px;
    background: #2563eb;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-text {
    font-family: 'Cambria', serif;
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    transition: color 0.3s;
}

.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-icon-btn, .nav-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    border-radius: 7px;
    cursor: pointer;
    color: var(--moon-icon);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.nav-icon-btn:hover, .nav-btn:hover {
    background: var(--bg-card);
}

.signin-btn {
    border: 1px solid var(--signin-border);
    background: var(--signin-bg);
    border-radius: 7px;
    padding: 6px 18px;
    font-family: 'Cambria', serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--signin-text);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.3s;
    text-decoration: none;
}

.signin-btn:hover {
    opacity: 0.85;
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 20px;
    }
}

/* ── LANDING PAGE ── */
.landing-page .hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 40px 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 120px;
}

.landing-page .hero-left { flex: 1; }
.landing-page .hero-right { flex-shrink: 0; }

.landing-page .badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--border-badge);
    border-radius: 999px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-badge);
    background: var(--bg-badge);
    margin-bottom: 22px;
}

.landing-page .hero-heading {
    font-size: 44px;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 18px;
}

.landing-page .hero-heading .blue { color: #2563eb; }

.landing-page .hero-sub {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 420px;
    margin-bottom: 32px;
}

.landing-page .cta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.landing-page .btn-primary {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 11px 24px;
    font-weight: 600;
    cursor: pointer;
}

.landing-page .btn-outline {
    background: var(--btn-outline-bg);
    color: var(--btn-outline-text);
    border: 1.5px solid var(--btn-outline-border);
    border-radius: 7px;
    padding: 10px 22px;
    font-weight: 600;
    cursor: pointer;
}

.landing-page .trust-row {
    display: flex;
    align-items: center;
    gap: 18px;
}

.landing-page .trust-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.landing-page .trust-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2563eb;
}

.landing-page .app-preview {
    width: 360px;
    height: 240px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    background-image: 
        linear-gradient(rgba(37, 99, 235, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.03) 1px, transparent 1px);
    background-size: 24px 24px;
}

.landing-page .app-icon-wrap {
    width: 52px;
    height: 52px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.landing-page .app-preview-name {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 2px;
}

.landing-page .app-preview-sub {
    font-size: 11px;
    color: #64748b;
}

.landing-page .features-section {
    background: var(--bg-features);
    border-top: 1px solid var(--border-color);
    padding: 100px 40px;
    text-align: center;
}

.landing-page .section-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
}

.landing-page .section-sub {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 60px;
}

.landing-page .cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    text-align: left;
}

.landing-page .feature-card {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 40px 32px;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

.landing-page .card-icon { margin-bottom: 24px; }
.landing-page .card-title { font-size: 18px; margin-bottom: 12px; font-weight: 700; }
.landing-page .card-desc { font-size: 13px; line-height: 1.6; color: var(--text-muted); }

.landing-page .feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
}

/* ── STATS ROW ── */
.stats-row {
    display: flex;
    justify-content: center;
    gap: 100px;
    margin-top: 100px;
    flex-wrap: wrap;
    max-width: 100%;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 12px;
    letter-spacing: 0em;
    color: var(--text-muted);
    font-weight: 500;
}

/* ── FOOTER ── */
.footer {
    border-top: 1px solid var(--border-color);
    padding: 40px 20px;
    text-align: center;
    background: var(--bg-features);
}

.copyright {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.copyright-icon {
    width: 16px;
    height: 16px;
    color: #2563eb;
}

/* ── DASHBOARD PAGE ── */
.dashboard-page {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.dashboard-page .main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.dashboard-page .app-icon-wrap {
    width: 68px;
    height: 68px;
    background: var(--bg-icon);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.dashboard-page .app-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.dashboard-page .app-sub {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.dashboard-page .cards-row {
    display: flex;
    gap: 20px;
}

.dashboard-page .workspace-card {
    width: 280px;
    padding: 40px 32px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    text-decoration: none;
    color: inherit;
}

.dashboard-page .workspace-card.featured {
    background: #eff6ff;
    border: 1px solid #dbeafe;
}

.dashboard-page .workspace-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.dashboard-page .card-icon-wrap {
    margin-bottom: 6px;
    background: #eff6ff;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-page .card-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    transition: color 0.2s;
}

.dashboard-page .workspace-card.featured .card-title {
    color: #2563eb;
}

.dashboard-page .card-desc {
    font-size: 13px;
    line-height: 1.6;
    color: #64748b;
}

.avatar {
    width: 32px;
    height: 32px;
    background: #2563eb;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.sub-banner {
    width: 100%;
    max-width: 640px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    font-size: 13px;
    color: var(--text-secondary);
}

.sub-badge {
    padding: 4px 8px;
    background: #16a34a;
    color: #fff;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}

.sub-badge.trial { background: #2563eb; }
.sub-badge.expired { background: #dc2626; }

.projects-section {
    width: 100%;
    max-width: 640px;
    margin-top: 32px;
}

.projects-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    font-weight: 700;
    font-size: 14px;
}

.project-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, background 0.2s;
}

.project-item:hover {
    transform: translateX(4px);
    background: var(--bg-navbar);
}

.project-step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e5e7eb;
}

.project-name {
    font-weight: 600;
    font-size: 14px;
}

.project-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.project-progress {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.project-progress-bar {
    height: 100%;
    background: #2563eb;
    border-radius: 2px;
}


/* ── EDITOR PAGE ── */
.sketch-editor-page {
    overflow: hidden;
    background: #f1f5f9;
}

.editor-header {
    height: 52px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-center {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-title {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    margin-left: 12px;
}

.editor-layout {
    display: flex;
    height: calc(100vh - 52px - 32px); /* Header - Status Bar */
}

.editor-sidebar-left {
    width: 48px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    gap: 8px;
}

.tool-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    background: transparent;
    border: none;
    transition: all 0.2s;
}

.tool-btn:hover { background: #f1f5f9; color: #0f172a; }
.tool-btn.active { background: #2563eb; color: #ffffff; }

.editor-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #e2e8f0;
}

.empty-state-widget {
    background: #ffffff;
    border-radius: 20px;
    padding: 48px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    max-width: 400px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    background: #eff6ff;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.editor-sidebar-right {
    width: 280px;
    background: #f8fafc;
    border-left: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 16px;
}

.property-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    background: #ffffff;
}

.property-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #2563eb;
    margin-bottom: 12px;
}

.property-card-sub {
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 4px;
}

.property-card-hint {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.4;
}

.editor-status-bar {
    height: 32px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    font-size: 11px;
    color: #64748b;
}

.control-input-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.control-input {
    flex: 1;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px;
    font-size: 11px;
    text-align: center;
}

.control-label {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: 4px;
    display: block;
}

.editor-btn-primary {
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.editor-btn-outline {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
}

.sketch-editor-page .editor-toolbar {
    width: 64px;
    background: var(--bg-navbar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    gap: 12px;
}

.sketch-editor-page .tool-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
}

.sketch-editor-page .tool-btn.active {
    background: var(--bg-icon);
    color: var(--icon-color);
}

.sketch-editor-page .editor-main {
    flex: 1;
    background: var(--bg-body);
    display: flex;
    flex-direction: column;
}

.sketch-editor-page .canvas-container {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    background-image:
        linear-gradient(var(--bg-preview-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--bg-preview-grid) 1px, transparent 1px);
    background-size: 20px 20px;
}

.sketch-editor-page .main-canvas {
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    width: 800px;
    height: 600px;
}

.sketch-editor-page .editor-side {
    width: 280px;
    background: var(--bg-navbar);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sketch-editor-page .panel-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
}

.sketch-editor-page .color-picker {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.sketch-editor-page .color-swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 4px;
    cursor: pointer;
}

.sketch-editor-page .color-swatch.active {
    box-shadow: 0 0 0 2px var(--icon-color), 0 0 0 4px #fff;
}
