:root {
    --bg: #f6f7fb;
    --panel: #ffffff;
    --text: #1f2430;
    --muted: #6b7280;
    --line: #e5e7eb;
    --accent: #111827;
    --accent-soft: #f3f4f6;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: #0f172a;
    color: #fff;
    padding: 28px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.brand-title {
    font-weight: 700;
}

.brand-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.68);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar .nav-link {
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.78);
    padding: 11px 14px;
    text-decoration: none;
}

.sidebar .nav-link.active,
.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.main-content {
    padding: 28px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.page-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
}

.page-subtitle {
    color: var(--muted);
    font-size: 14px;
}

.panel-card,
.stat-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.04);
}

.panel-card {
    overflow: hidden;
}

.panel-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
}

.panel-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.panel-body {
    padding: 22px;
}

.stat-card {
    padding: 18px;
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 30px;
    font-weight: 700;
}

.custom-item {
    padding: 18px 22px;
    border-top: 1px solid var(--line);
}

.custom-item:first-of-type {
    border-top: 0;
}

.table-modern {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(17, 24, 39, 0.02);
    --bs-table-hover-bg: rgba(17, 24, 39, 0.04);
    margin: 0;
}

.table-modern thead th {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.table-modern td,
.table-modern th {
    vertical-align: middle;
    padding: 16px 18px;
}

.empty-state {
    padding: 28px 22px;
    color: var(--muted);
}

.checkbox-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    min-height: 50px;
    cursor: pointer;
}

.checkbox-card input {
    margin: 0;
}

.preview-box {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
}

.wa-preview-section {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 16px;
    background: #fff;
}

.wa-variant-dark {
    background: #111827;
    color: #fff;
}

.wa-variant-brand-soft {
    background: #f3f4f6;
}

.wa-variant-accent {
    background: #f59e0b;
    color: #111827;
}

.wa-preview-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    height: 100%;
}

.json-box {
    background: #0f172a;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 14px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    margin-top: 12px;
}

.competitor-row + .competitor-row {
    margin-top: 14px;
}

@media (max-width: 991.98px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
    }
}
