@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --primary: #4f46e5;
    --primary-soft: #eef2ff;
    --primary-dark: #4338ca;
    --secondary: #7c3aed;
    --success: #059669;
    --success-soft: #ecfdf5;
    --warning: #d97706;
    --warning-soft: #fffbeb;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --bg: #f6f8fb;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-hover: #f1f5f9;
    --bg-input: #f8fafc;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.08);
    --sidebar-width: 272px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Login ── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 20% 20%, rgba(79, 70, 229, 0.08), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(124, 58, 237, 0.06), transparent 40%),
        var(--bg);
}

.login-container { width: 100%; max-width: 400px; padding: 24px; }

.login-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.login-header { text-align: center; margin-bottom: 32px; }

.login-logo {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.login-header p {
    color: var(--text-muted);
    margin-top: 6px;
    font-size: 0.9rem;
}

/* ── Layout ── */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-logo {
    padding: 4px 12px 24px;
    margin-bottom: 8px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.brand-text h2 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.brand-text span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.sidebar nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-group-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    padding: 16px 12px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.nav-item.active {
    background: var(--primary-soft);
    color: var(--primary);
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item.active .nav-icon { opacity: 1; }

.nav-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

#logout-btn { color: var(--text-muted); }
#logout-btn:hover { background: var(--danger-soft); color: var(--danger); }

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px 40px 48px;
    max-width: 1280px;
}

/* ── Page headers ── */
.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 4px;
    font-weight: 400;
}

/* ── Dashboard hero ── */
.dash-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.dash-eyebrow {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.dash-hero h1 {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.dash-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 6px;
    max-width: 480px;
}

.dash-hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Stats ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.stat-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.stat-icon.blue { background: var(--primary-soft); }
.stat-icon.green { background: var(--success-soft); }
.stat-icon.amber { background: var(--warning-soft); }
.stat-icon.purple { background: #f5f3ff; }

.stat-trend {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
}

.stat-trend.ok { background: var(--success-soft); color: var(--success); }
.stat-trend.wait { background: var(--warning-soft); color: var(--warning); }
.stat-trend.idle { background: var(--bg-hover); color: var(--text-muted); }

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1;
}

.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 6px;
    font-weight: 500;
}

/* ── Dashboard grid ── */
.dash-grid-2 {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
}

/* ── Steps ── */
.step-list { display: flex; flex-direction: column; gap: 4px; }

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
    cursor: pointer;
}

.step-item:hover { background: var(--bg-hover); }

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-hover);
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: all 0.2s;
}

.step-item.done .step-num {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.step-item.active .step-num {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.step-body h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.step-body p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ── Status list ── */
.status-list { display: flex; flex-direction: column; gap: 0; }

.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
    gap: 12px;
}

.status-row:last-child { border-bottom: none; }

.status-row-label {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 500;
}

.status-badge {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.status-badge.success { background: var(--success-soft); color: var(--success); }
.status-badge.warning { background: var(--warning-soft); color: var(--warning); }
.status-badge.info { background: var(--primary-soft); color: var(--primary); }
.status-badge.muted { background: var(--bg-hover); color: var(--text-muted); }

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* ── Forms ── */
.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
}

.form-group small {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 6px;
    line-height: 1.4;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: #fff;
}

.form-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.form-row input { flex: 1; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 1px 2px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover { background: #047857; }

.btn-warning {
    background: var(--warning);
    color: #fff;
}

.btn-danger { background: var(--danger); color: #fff; }

.btn-outline {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--bg-hover);
    border-color: #cbd5e1;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 8px 14px;
}

.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }
.btn-sm { padding: 7px 12px; font-size: 0.8rem; }

/* ── Alerts ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.5;
}

.alert-success { background: var(--success-soft); color: #047857; border: 1px solid #a7f3d0; }
.alert-error { background: var(--danger-soft); color: var(--danger); border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-soft); color: #b45309; border: 1px solid #fde68a; }
.alert-info { background: var(--primary-soft); color: var(--primary); border: 1px solid #c7d2fe; }

/* ── Progress ── */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-hover);
    border-radius: 99px;
    overflow: hidden;
    margin: 12px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 99px;
    transition: width 0.5s ease;
}

/* ── Tags ── */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    margin: 4px;
    font-weight: 500;
    color: var(--text);
}

.tag .remove {
    cursor: pointer;
    color: var(--text-light);
    font-size: 1.1rem;
    line-height: 1;
    transition: color 0.15s;
}

.tag .remove:hover { color: var(--danger); }

/* ── Sectors ── */
.sector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.sector-item {
    padding: 18px 12px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
}

.sector-item:hover {
    border-color: #c7d2fe;
    background: #fff;
}

.sector-item.selected {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.sector-item .icon { font-size: 1.75rem; margin-bottom: 8px; }
.sector-item .name { font-size: 0.82rem; font-weight: 600; color: var(--text); }

/* ── Tables ── */
.page-section { display: none; }
.page-section.active { display: block; animation: fadeIn 0.2s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.table { width: 100%; border-collapse: collapse; }

.table th,
.table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.88rem;
}

.table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--bg-input);
}

.table tbody tr:hover { background: #fafbfc; }

.table td a {
    color: var(--primary);
    text-decoration: none;
    word-break: break-all;
    font-weight: 500;
}

.table td a:hover { text-decoration: underline; }

.table .slug-cell { max-width: 320px; }

.table .slug-cell small {
    display: block;
    color: var(--text-light);
    font-size: 0.78rem;
    margin-top: 3px;
    font-weight: 400;
}

/* ── Usage meter ── */
.usage-meter { margin: 15px 0; }

.usage-meter .meter-bar {
    height: 8px;
    background: var(--bg-hover);
    border-radius: 99px;
    overflow: hidden;
}

.usage-meter .meter-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.5s;
}

.usage-meter .meter-fill.low { background: var(--success); }
.usage-meter .meter-fill.medium { background: var(--warning); }
.usage-meter .meter-fill.high { background: var(--danger); }

/* ── Log ── */
.log-output {
    background: #0f172a;
    border-radius: var(--radius-sm);
    padding: 16px;
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 0.8rem;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    color: #94a3b8;
    line-height: 1.5;
}

.hidden { display: none !important; }

code {
    background: var(--primary-soft);
    color: var(--primary);
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 0.82rem;
    font-weight: 500;
}

/* ── Content tabs ── */
.content-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    background: var(--bg-input);
    padding: 4px;
    border-radius: var(--radius-sm);
    width: fit-content;
    border: 1px solid var(--border);
}

.content-tab {
    padding: 8px 18px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.15s;
}

.content-tab:hover { color: var(--text); }

.content-tab.active {
    background: #fff;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.content-tab-panel { display: none; }
.content-tab-panel.active { display: block; }

.content-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.content-filters .form-group { min-width: 160px; flex: 1; margin-bottom: 0; }

.table-wrap { overflow-x: auto; margin-bottom: 15px; border-radius: var(--radius-sm); border: 1px solid var(--border-light); }

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-content: center;
    padding-top: 12px;
}

.pagination .page-btn {
    padding: 7px 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    font-size: 0.84rem;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.15s;
}

.pagination .page-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination .page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pagination .page-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.pagination .page-info { color: var(--text-muted); font-size: 0.84rem; padding: 0 8px; }

/* ── Sitemap cards ── */
.sitemap-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 16px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    flex-wrap: wrap;
    transition: border-color 0.15s;
}

.sitemap-card:hover { border-color: #c7d2fe; }

.sitemap-card-info h4 {
    margin-bottom: 4px;
    font-size: 0.95rem;
    font-weight: 700;
}

.sitemap-card-info p {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin: 2px 0;
}

.sitemap-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.sitemap-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--primary-soft);
    color: var(--primary);
    margin-left: 6px;
}

.sitemap-url-list { list-style: none; }

.sitemap-url-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    word-break: break-all;
}

.sitemap-url-list a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
}

.sitemap-url-list a:hover { text-decoration: underline; }

/* ── Template gallery ── */
.template-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-top: 10px;
}

.template-card {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-card);
}

.template-card:hover {
    border-color: #c7d2fe;
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.template-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.template-card-preview {
    height: 110px;
    display: flex;
    align-items: flex-end;
    padding: 14px;
    position: relative;
    overflow: hidden;
}

.template-card-preview::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.15;
    background: linear-gradient(180deg, transparent 30%, currentColor 100%);
}

.template-card-preview-bar {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    height: 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.5);
}

.template-card-preview-hero {
    width: 70%;
    height: 10px;
    border-radius: 4px;
    background: rgba(255,255,255,0.85);
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.template-card-preview-sub {
    width: 50%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.5);
    position: relative;
    z-index: 1;
}

.template-card-body {
    padding: 12px 14px;
    border-top: 1px solid var(--border-light);
}

.template-card-body h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.template-card-body p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.template-card-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
    margin-left: auto;
}

.builder-template-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0 8px;
}

.template-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.template-modal.active { display: flex; }

.template-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
}

.template-modal-panel {
    position: relative;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 960px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.template-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 24px 24px 12px;
    border-bottom: 1px solid var(--border-light);
}

.template-modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.template-modal-header p {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.template-gallery-modal {
    padding: 20px 24px 28px;
    overflow-y: auto;
}

/* ── Deploy list ── */
.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    color: var(--text-muted);
}

.feature-list li strong {
    color: var(--text);
    font-weight: 600;
    min-width: 160px;
}

.feature-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
}

.mt-20 { margin-top: 20px; }
.mt-15 { margin-top: 15px; }
.mt-10 { margin-top: 10px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.88rem; }

#builder-container { height: calc(100vh - 180px); min-height: 500px; }

/* ── Responsive ── */
@media (max-width: 1024px) {
    .dash-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        width: 68px;
        padding: 16px 8px;
    }

    .brand-text,
    .nav-item span:not(.nav-icon),
    .nav-group-label { display: none; }

    .brand { justify-content: center; }
    .nav-item { justify-content: center; padding: 10px; }
    .main-content { margin-left: 68px; padding: 20px 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .dash-hero { flex-direction: column; }
}
