/* ── CoreBIM App CSS ─────────────────────────────────────────────────────── */

/* ── Design tokens ──────────────────────────────────────────────────────────── */
:root {
    --brand: #3788d8;
    --brand-dark: #2563ae;
    --brand-light: #e8f1fb;

    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-2: #f0f3f8;
    --border: #e2e8f0;
    --border-subtle: #eef1f6;

    --text: #0f172a;
    --text-2: #475569;
    --text-3: #94a3b8;

    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,.07);
    --shadow: 0 4px 16px rgba(0,0,0,.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.12);

    --sidebar-w: 240px;
    --topbar-h: 56px;

    --font: 'Inter', system-ui, sans-serif;
    --font-heading: 'Space Grotesk', system-ui, sans-serif;

    --transition: 200ms cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-2: #273449;
    --border: #2d3f55;
    --border-subtle: #253145;
    --text: #f1f5f9;
    --text-2: #94a3b8;
    --text-3: #475569;
    --brand-light: #1d3352;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
    --shadow: 0 4px 16px rgba(0,0,0,.4);
}

/* ── Reset & base ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4,h5,h6 { font-family: var(--font-heading); font-weight: 600; line-height: 1.25; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* ── App shell ───────────────────────────────────────────────────────────────── */
.app-shell { display: flex; height: 100dvh; overflow: hidden; }

/* ── Sidebar ─────────────────────────────────────────────────────────────────── */
.app-sidebar {
    width: var(--sidebar-w);
    height: 100dvh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform var(--transition);
    overflow-y: auto;
    z-index: 200;
}

.app-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    color: var(--text);
}
.app-logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .95rem;
    letter-spacing: -.01em;
}

.app-nav {
    flex: 1;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
    user-select: none;
}
.app-nav-item i { width: 18px; height: 18px; flex-shrink: 0; }
.app-nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.app-nav-item.active { background: var(--brand-light); color: var(--brand); }

.app-nav-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 6px 4px;
}
.app-nav-group-label {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-3);
    padding: 6px 12px 2px;
}

/* ── Sidebar subnav ─────────────────────────────────────────────────────────── */
.app-nav-parent {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: background var(--transition), color var(--transition);
}
.app-nav-parent:hover { background: var(--surface-2); color: var(--text); }
.app-nav-parent.active { background: var(--brand-light); color: var(--brand); }
.app-nav-parent i { width: 18px; height: 18px; flex-shrink: 0; }
.app-nav-parent-chevron {
    margin-left: auto;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: transform var(--transition);
}
.app-nav-parent.open .app-nav-parent-chevron { transform: rotate(180deg); }

.app-nav-children {
    display: none;
    flex-direction: column;
    gap: 2px;
    margin: 2px 0 2px 10px;
    padding-left: 10px;
    border-left: 2px solid var(--border-subtle);
}
.app-nav-children.open { display: flex; }

.app-nav-child {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: .82rem;
    font-weight: 500;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}
.app-nav-child i { width: 15px; height: 15px; flex-shrink: 0; }
.app-nav-child:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.app-nav-child.active { background: var(--brand-light); color: var(--brand); }

/* ── User menu (top-right) ─────────────────────────────────────────────────── */
.user-menu { position: relative; }
.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px 5px 6px;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
}
.user-menu-trigger:hover { background: var(--surface-2); }
.user-menu-trigger i { color: var(--text-3); }
.user-menu-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: .76rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.user-menu-name {
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-2);
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-menu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg, 0 10px 30px rgba(0,0,0,.12));
    padding: 6px;
    z-index: 50;
}
.user-menu.open .user-menu-dropdown { display: block; }
.user-menu-dropdown-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
}
.user-menu-dropdown-email {
    font-size: .8rem;
    color: var(--text-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-menu-dropdown-divider { height: 1px; background: var(--border-subtle); margin: 4px 4px 6px; }
.user-menu-dropdown-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 10px;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    color: var(--text-2);
    cursor: pointer;
    text-align: left;
    text-decoration: none;
}
.user-menu-dropdown-item:hover { background: var(--surface-2); color: var(--text); }
.user-menu-dropdown-item i { width: 15px; height: 15px; flex-shrink: 0; }
.user-menu-dropdown-item--danger { color: var(--danger); }
.user-menu-dropdown-item--danger:hover { background: var(--danger-light, rgba(220,38,38,.08)); }

.sidebar-close-btn { display: none; }

/* ── Body area ───────────────────────────────────────────────────────────────── */
.app-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.app-topbar {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.sidebar-open-btn { display: none; }
.app-topbar-title {
    flex: 1;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.topbar-search {
    display: flex; align-items: center; gap: 8px;
    width: 280px; flex-shrink: 0;
    padding: 7px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.topbar-search i { width: 15px; height: 15px; color: var(--text-3); flex-shrink: 0; }
.topbar-search input {
    border: none; background: none; outline: none;
    font-size: .82rem; color: var(--text); width: 100%; font-family: inherit;
}
@media (max-width: 860px) { .topbar-search { display: none; } }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.notification-bell { position: relative; }
.notification-badge {
    position: absolute; top: 2px; right: 2px;
    min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 8px;
    background: #ef4444; color: #fff;
    font-size: 10px; font-weight: 600; line-height: 16px;
    text-align: center; pointer-events: none;
}

.app-main {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* Chat page — remove padding so chat fills the full content area */
.app-main--chat {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.hidden { display: none !important; }
.app-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 199;
}
.app-overlay.visible { display: block; }

/* ── Shared buttons ──────────────────────────────────────────────────────────── */
.btn-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-2);
    transition: background var(--transition), color var(--transition);
    flex-shrink: 0;
    text-decoration: none;
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.btn-icon i, .btn-icon svg { width: 17px; height: 17px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background var(--transition), opacity var(--transition);
    white-space: nowrap;
    text-decoration: none;
}
.btn i { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .88; text-decoration: none; color: #fff; }
.btn-sm { padding: 6px 13px; font-size: .8rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── Cards ───────────────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}
.card-title {
    font-family: var(--font-heading);
    font-size: .95rem;
    font-weight: 600;
    color: var(--text);
}
.card-subtitle {
    font-size: .8rem;
    color: var(--text-3);
    margin-top: 2px;
}

/* ── Stat cards ──────────────────────────────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
}
.stat-label { font-size: .78rem; color: var(--text-3); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-family: var(--font-heading); font-size: 1.75rem; font-weight: 700; color: var(--text); margin: 4px 0; }
.stat-delta { font-size: .78rem; color: var(--text-2); }
.stat-delta.up { color: var(--success); }
.stat-delta.down { color: var(--danger); }

/* ── Badges ──────────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .02em;
}
.badge-blue   { background: var(--brand-light); color: var(--brand); }
.badge-green  { background: #dcfce7; color: #16a34a; }
.badge-yellow { background: #fef9c3; color: #a16207; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-orange { background: #fff7ed; color: #c2410c; }
.badge-gray   { background: var(--surface-2); color: var(--text-2); }
[data-theme="dark"] .badge-green  { background: #14532d; color: #86efac; }
[data-theme="dark"] .badge-yellow { background: #422006; color: #fde68a; }
[data-theme="dark"] .badge-red    { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .badge-orange { background: #431407; color: #fdba74; }

/* ── Form controls ───────────────────────────────────────────────────────────── */
.form-section { margin-bottom: 28px; }
.form-section-title {
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-3);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: .82rem; font-weight: 500; color: var(--text-2); }
.form-input, .form-select, .form-textarea {
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font);
    font-size: .875rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: .76rem; color: var(--text-3); }
.form-error { font-size: .76rem; color: var(--danger); }

/* ── Checkbox / Radio ────────────────────────────────────────────────────────── */
.checklist { display: flex; flex-direction: column; gap: 10px; }
.check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
    user-select: none;
}
.check-item:hover { background: var(--surface-2); }
.check-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); flex-shrink: 0; }
.check-item-label { font-size: .875rem; color: var(--text); }

/* ── Tables ──────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th {
    text-align: left;
    padding: 11px 16px;
    background: var(--surface-2);
    color: var(--text-2);
    font-size: .76rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text);
    vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }

/* ── Project header bar + horizontal tab nav ──────────────────────────────────── */
.project-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.project-tabs {
    display: flex;
    gap: 2px;
    padding: 0 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    flex-wrap: nowrap;
}
.project-tab {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 12px 14px;
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-2);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color var(--transition), border-color var(--transition);
}
.project-tab:hover { color: var(--text); }
.project-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.project-tab i { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Upload drop zone ───────────────────────────────────────────────────────── */
.upload-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    text-align: center;
    gap: 8px;
}
.upload-dropzone:hover,
.upload-dropzone--over {
    border-color: var(--brand);
    background: var(--brand-light);
}
.upload-dropzone-icon {
    width: 40px;
    height: 40px;
    color: var(--text-3);
    transition: color var(--transition);
}
.upload-dropzone:hover .upload-dropzone-icon,
.upload-dropzone--over .upload-dropzone-icon { color: var(--brand); }
.upload-dropzone-text {
    font-size: .9rem;
    color: var(--text-2);
}
.upload-dropzone-link {
    color: var(--brand);
    cursor: pointer;
    text-decoration: underline;
}
.upload-dropzone-hint {
    font-size: .78rem;
    color: var(--text-3);
    max-width: 420px;
}

/* ── Alerts ──────────────────────────────────────────────────────────────────── */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    margin-bottom: 18px;
}
.alert i { width: 16px; height: 16px; flex-shrink: 0; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert-danger  { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-warning { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.alert-info    { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
[data-theme="dark"] .alert-success { background: #14532d; color: #86efac; border-color: #166534; }
[data-theme="dark"] .alert-danger  { background: #450a0a; color: #fca5a5; border-color: #7f1d1d; }

/* ── Empty state ─────────────────────────────────────────────────────────────── */
.empty-state-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-3);
}
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
    gap: 12px;
    color: var(--text-3);
}
.empty-state-icon { opacity: .4; }
.empty-state-title { font-size: 1rem; font-weight: 600; color: var(--text-2); }
.empty-state-desc { font-size: .85rem; max-width: 340px; }

/* ── Page header ─────────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header-left {}
.page-title { font-size: 1.35rem; font-weight: 700; color: var(--text); }
.page-desc { font-size: .85rem; color: var(--text-2); margin-top: 2px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── Tabs ────────────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab-btn {
    padding: 10px 18px;
    border: none;
    background: transparent;
    font-size: .875rem;
    font-weight: 500;
    color: var(--text-2);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color var(--transition), border-color var(--transition);
    cursor: pointer;
}
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-btn:hover { color: var(--text); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Toasts ──────────────────────────────────────────────────────────────────── */
.toast-zone {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 9999;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    font-size: .85rem;
    font-weight: 500;
    color: var(--text);
    animation: toastIn .22s ease;
    max-width: 340px;
}
.toast-success { border-left: 4px solid var(--success); }
.toast-error   { border-left: 4px solid var(--danger); }
.toast-info    { border-left: 4px solid var(--brand); }
@keyframes toastIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }

/* ── Modal ───────────────────────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn .15s ease;
}
.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title { font-size: 1rem; font-weight: 600; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

/* ── Dashboard grid ──────────────────────────────────────────────────────────── */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
}
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

/* ── Toolbar ─────────────────────────────────────────────────────────────────── */
.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.toolbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    flex: 1;
    max-width: 320px;
}
.toolbar-search i { color: var(--text-3); width: 15px; height: 15px; flex-shrink: 0; }
.toolbar-search input {
    border: none;
    background: transparent;
    outline: none;
    font-size: .875rem;
    color: var(--text);
    width: 100%;
}
.toolbar-search input::placeholder { color: var(--text-3); }

/* ── Plan banner ─────────────────────────────────────────────────────────────── */
.plan-banner {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.plan-banner-text .plan-name { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 700; }
.plan-banner-text .plan-desc { font-size: .85rem; opacity: .85; margin-top: 2px; }
.btn-white { background: rgba(255,255,255,.95); color: var(--brand); font-weight: 600; }
.btn-white:hover { background: #fff; text-decoration: none; color: var(--brand-dark); }

/* ── Auth pages ──────────────────────────────────────────────────────────────── */
.auth-page { background: var(--bg); display: flex; align-items: center; justify-content: center; min-height: 100dvh; }
.auth-container { width: 100%; max-width: 420px; padding: 16px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px 32px; box-shadow: var(--shadow); }
.auth-logo { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 24px; }
.auth-logo-name { font-family: var(--font-heading); font-weight: 700; font-size: 1.1rem; color: var(--text); }
.auth-title { font-family: var(--font-heading); font-size: 1.35rem; font-weight: 700; text-align: center; margin-bottom: 4px; letter-spacing: -0.01em; }
.auth-subtitle { font-size: .875rem; color: var(--text-2); text-align: center; margin-bottom: 24px; line-height: 1.5; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-footer { text-align: center; font-size: .85rem; color: var(--text-2); margin-top: 20px; }
.auth-footer-text { text-align: center; font-size: .8125rem; color: var(--text-2); margin-top: 8px; }
.auth-link { color: var(--brand); font-weight: 500; }
.auth-link:hover { text-decoration: underline; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-3); font-size: .8125rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: .84rem;
    color: #b91c1c;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.auth-error i, .auth-error svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Auth form helpers */
.btn-full { width: 100%; justify-content: center; }
.form-label-row { display: flex; align-items: center; justify-content: space-between; }
.form-input-wrap { position: relative; }
.form-input-wrap .form-input { padding-right: 42px; }
.btn-password-toggle {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    color: var(--text-3); padding: 4px; border-radius: var(--radius-sm);
    background: none; border: none; cursor: pointer;
    transition: color var(--transition);
}
.btn-password-toggle:hover { color: var(--text); }
.btn-password-toggle i, .btn-password-toggle svg { width: 17px; height: 17px; display: block; }
.form-options { display: flex; align-items: center; justify-content: space-between; }
.form-checkbox { display: flex; align-items: center; gap: 7px; font-size: .8125rem; color: var(--text-2); cursor: pointer; }
.form-checkbox input { accent-color: var(--brand); }

/* Auth card centred within the public layout (header + footer still visible) */
.pub-auth-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100dvh - 65px - 160px);
    padding: 40px 16px;
}
@media (max-width: 480px) {
    .auth-card { padding: 28px 20px; }
    .pub-auth-section { padding: 24px 16px; }
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100dvh;
        transform: translateX(-100%);
    }
    .app-sidebar.open { transform: translateX(0); }
    .sidebar-close-btn { display: flex; }
    .sidebar-open-btn { display: flex; }

    .split-layout { flex-direction: column; }
    .split-sidebar { width: 100%; max-height: 200px; }

    .dash-grid .col-4, .dash-grid .col-6, .dash-grid .col-8 { grid-column: span 12; }

    .app-main { padding: 16px; }
}

@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .form-grid { grid-template-columns: 1fr; }
}


/* ══════════════════════════════════════════════════════════════════════════════
   PUBLIC / MARKETING PAGES
   ══════════════════════════════════════════════════════════════════════════════ */

.public-page { min-height: 100dvh; display: flex; flex-direction: column; }
.public-page main { flex: 1; }

/* ── Container ───────────────────────────────────────────────────────────────── */
.pub-container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ── Nav ─────────────────────────────────────────────────────────────────────── */
.pub-nav {
    position: sticky; top: 0; z-index: 100;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.pub-nav-inner {
    display: flex; align-items: center; gap: 32px;
    height: 60px;
}
.pub-nav-logo {
    display: flex; align-items: center; gap: 9px;
    font-family: var(--font-heading); font-weight: 700;
    font-size: .95rem; color: var(--text); text-decoration: none; flex-shrink: 0;
}
.pub-nav-logo:hover { text-decoration: none; }
.pub-nav-links {
    display: flex; align-items: center; gap: 4px; flex: 1;
}
.pub-nav-link {
    padding: 6px 12px; border-radius: var(--radius-sm);
    color: var(--text-2); font-size: .875rem; font-weight: 500;
    text-decoration: none; transition: background var(--transition), color var(--transition);
}
.pub-nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.pub-nav-link.active { color: var(--brand); background: var(--brand-light); }
.pub-nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.pub-nav-hamburger { display: none; }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.pub-btn-primary {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--brand); color: #fff;
    padding: 9px 18px; border-radius: var(--radius-sm);
    font-size: .875rem; font-weight: 600; text-decoration: none;
    transition: background var(--transition);
}
.pub-btn-primary:hover { background: var(--brand-dark); color: #fff; text-decoration: none; }
.pub-btn-ghost {
    display: inline-flex; align-items: center; gap: 6px;
    background: transparent; color: var(--text-2);
    padding: 9px 18px; border-radius: var(--radius-sm);
    font-size: .875rem; font-weight: 500; text-decoration: none;
    border: 1px solid var(--border);
    transition: background var(--transition), color var(--transition);
}
.pub-btn-ghost:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.pub-btn-lg { padding: 12px 24px; font-size: 1rem; }
.pub-btn-full { width: 100%; justify-content: center; }
.pub-btn-submit {
    padding: 14px 24px; border-radius: var(--radius);
    letter-spacing: .01em; border: none; cursor: pointer;
    box-shadow: 0 1px 2px rgba(55,136,216,.18), 0 4px 12px rgba(55,136,216,.18);
    transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}
.pub-btn-submit:hover {
    box-shadow: 0 2px 4px rgba(55,136,216,.2), 0 8px 20px rgba(55,136,216,.25);
    transform: translateY(-1px);
}
.pub-btn-submit:active { transform: translateY(0); box-shadow: 0 1px 3px rgba(55,136,216,.2); }

/* ── Mobile menu ─────────────────────────────────────────────────────────────── */
.pub-nav-mobile {
    display: none; flex-direction: column; gap: 6px;
    padding: 12px 20px 16px; border-top: 1px solid var(--border);
}
.pub-nav-mobile.open { display: flex; }

/* ── Sections ────────────────────────────────────────────────────────────────── */
.pub-section { padding: 80px 0; }
.pub-section-alt { background: var(--surface-2); }
.pub-section-title { font-size: 1.75rem; text-align: center; margin-bottom: 10px; }
.pub-section-subtitle { color: var(--text-2); text-align: center; margin-bottom: 48px; }

/* ── Hero ────────────────────────────────────────────────────────────────────── */
.pub-hero { padding: 96px 0 80px; }
.pub-hero-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 24px; }
.pub-hero-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--brand-light); color: var(--brand);
    padding: 5px 14px; border-radius: 999px;
    font-size: .8rem; font-weight: 600;
}
.pub-hero-badge i { width: 14px; height: 14px; }
.pub-hero-title {
    font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.03em;
    line-height: 1.15; max-width: 700px;
}
.pub-hero-subtitle {
    color: var(--text-2); font-size: 1.1rem; max-width: 560px; line-height: 1.7;
}
.pub-hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ── Page hero (inner pages) ─────────────────────────────────────────────────── */
.pub-page-hero { padding: 64px 0 48px; border-bottom: 1px solid var(--border); }
.pub-page-title { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: 12px; }
.pub-page-subtitle { color: var(--text-2); font-size: 1.05rem; max-width: 560px; line-height: 1.7; }

/* ── Features grid ───────────────────────────────────────────────────────────── */
.pub-features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.pub-feature-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 28px 24px;
}
.pub-feature-icon {
    width: 44px; height: 44px;
    background: var(--brand-light); color: var(--brand);
    border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
}
.pub-feature-icon i { width: 22px; height: 22px; }
.pub-feature-card h3 { font-size: 1rem; margin-bottom: 8px; }
.pub-feature-card p { color: var(--text-2); font-size: .875rem; line-height: 1.6; }

/* ── Feature rows (Features page) ───────────────────────────────────────────── */
.pub-feature-row {
    display: grid; grid-template-columns: 80px 1fr; gap: 32px;
    align-items: start; padding: 40px 0; border-bottom: 1px solid var(--border-subtle);
}
.pub-feature-row:last-child { border-bottom: none; }
.pub-feature-row-reverse { direction: rtl; }
.pub-feature-row-reverse > * { direction: ltr; }
.pub-feature-row-icon {
    width: 64px; height: 64px;
    background: var(--brand-light); color: var(--brand);
    border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.pub-feature-row-icon i { width: 28px; height: 28px; }
.pub-feature-row-body h2 { font-size: 1.3rem; margin-bottom: 10px; }
.pub-feature-row-body p { color: var(--text-2); line-height: 1.7; margin-bottom: 16px; }
.pub-feature-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.pub-feature-list li { display: flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--text-2); }
.pub-feature-list i { width: 16px; height: 16px; color: var(--success); flex-shrink: 0; }

/* ── CTA section ─────────────────────────────────────────────────────────────── */
.pub-cta { background: var(--brand); }
.pub-cta-inner { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pub-cta h2 { color: #fff; font-size: 1.75rem; }
.pub-cta p { color: rgba(255,255,255,.8); font-size: 1rem; }
.pub-cta .pub-btn-primary { background: #fff; color: var(--brand); }
.pub-cta .pub-btn-primary:hover { background: var(--brand-light); color: var(--brand-dark); }

/* ── Pricing grid ────────────────────────────────────────────────────────────── */
.pub-pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; align-items: start; }
.pub-pricing-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 32px 28px;
    position: relative;
}
.pub-pricing-card-featured { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.pub-pricing-badge {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--brand); color: #fff;
    padding: 3px 14px; border-radius: 999px; font-size: .75rem; font-weight: 700;
    white-space: nowrap;
}
.pub-pricing-header { margin-bottom: 24px; }
.pub-pricing-name { font-size: 1.1rem; margin-bottom: 10px; }
.pub-pricing-price { display: flex; align-items: baseline; gap: 4px; margin-bottom: 8px; }
.pub-pricing-amount { font-family: var(--font-heading); font-size: 2.25rem; font-weight: 700; }
.pub-pricing-period { color: var(--text-2); font-size: .875rem; }
.pub-pricing-desc { color: var(--text-2); font-size: .875rem; }
.pub-pricing-features { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.pub-pricing-features li { display: flex; align-items: center; gap: 10px; font-size: .875rem; }
.pub-pricing-features i { width: 16px; height: 16px; flex-shrink: 0; color: var(--success); }
.pub-pricing-dim { color: var(--text-3); }
.pub-pricing-dim i { color: var(--text-3); }

/* ── Contact ─────────────────────────────────────────────────────────────────── */
.pub-contact-layout { display: grid; grid-template-columns: 1fr 1.4fr; gap: 64px; align-items: start; }
.pub-contact-info h2 { font-size: 1.3rem; margin-bottom: 12px; }
.pub-contact-info p { color: var(--text-2); line-height: 1.7; margin-bottom: 28px; }
.pub-contact-items { display: flex; flex-direction: column; gap: 16px; }
.pub-contact-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 16px; background: var(--surface-2); border-radius: var(--radius);
}
.pub-contact-item i { width: 20px; height: 20px; color: var(--brand); flex-shrink: 0; margin-top: 2px; }
.pub-contact-item strong { display: block; font-size: .875rem; margin-bottom: 2px; }
.pub-contact-item span { color: var(--text-2); font-size: .875rem; }
.pub-contact-form-wrap {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 32px;
    position: relative;
}
.contact-overlay {
    position: absolute; inset: 0;
    background: rgba(255,255,255,.78);
    border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    z-index: 10;
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
}
.contact-overlay.is-visible { opacity: 1; pointer-events: auto; }
.contact-spinner {
    width: 44px; height: 44px;
    border: 4px solid var(--border);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: contact-spin .75s linear infinite;
}
@keyframes contact-spin { to { transform: rotate(360deg); } }
.pub-contact-form { display: flex; flex-direction: column; gap: 20px; }
.pub-form-error {
    background: #fef2f2; color: var(--danger);
    padding: 10px 14px; border-radius: var(--radius-sm); font-size: .875rem;
}
.form-textarea { resize: vertical; min-height: 120px; }
.pub-contact-success {
    text-align: center; padding: 40px 20px;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.pub-contact-success i { width: 48px; height: 48px; color: var(--success); }
.pub-contact-success h3 { font-size: 1.2rem; }
.pub-contact-success p { color: var(--text-2); }

/* ── Footer ──────────────────────────────────────────────────────────────────── */
.pub-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 40px 0 20px; margin-top: auto; }
.pub-footer-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; margin-bottom: 28px; }
.pub-footer-brand { display: flex; flex-direction: column; gap: 8px; }
.pub-footer-tagline { color: var(--text-2); font-size: .875rem; }
.pub-footer-links { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.pub-footer-links a { color: var(--text-2); font-size: .875rem; text-decoration: none; }
.pub-footer-links a:hover { color: var(--text); }
.pub-footer-copy { color: var(--text-3); font-size: .8rem; padding-top: 16px; border-top: 1px solid var(--border-subtle); }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .pub-nav-links, .pub-nav-actions { display: none; }
    .pub-nav-hamburger { display: flex; margin-left: auto; }
    .pub-feature-row { grid-template-columns: 1fr; }
    .pub-feature-row-reverse { direction: ltr; }
    .pub-contact-layout { grid-template-columns: 1fr; gap: 40px; }
    .pub-footer-inner { flex-direction: column; }
    .pub-pricing-grid { grid-template-columns: 1fr; }
}

/* ── Shared utility ──────────────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Onboarding ──────────────────────────────────────────────────────────────── */
.onboarding-steps { display: flex; align-items: center; gap: 6px; justify-content: center; margin-bottom: 20px; font-size: .82rem; }
.onboarding-step { color: var(--text-3); font-weight: 500; }
.onboarding-step.active { color: var(--brand); font-weight: 600; }
.onboarding-step.done { color: var(--success, #16a34a); }
.onboarding-step.done::before { content: '✓ '; }
.onboarding-sep { color: var(--text-3); }

/* ── Plan pills ──────────────────────────────────────────────────────────────── */
.plan-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.plan-free { background: var(--surface-2, #f1f5f9); color: var(--text-2); }
.plan-pro { background: #dbeafe; color: #1d4ed8; }
.plan-enterprise { background: #fef9c3; color: #92400e; }

/* ── Payment summary box ─────────────────────────────────────────────────────── */
.payment-summary { display: flex; align-items: flex-start; gap: 14px; background: var(--surface-2, #f8fafc); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 20px 0; }
.payment-summary p { margin: 0; font-size: .875rem; color: var(--text-2); line-height: 1.5; }

/* ── Simplex Procedimento ────────────────────────────────────────────────────── */
.simplex-form { display: flex; flex-direction: column; gap: 20px; max-width: 780px; }
.simplex-card { padding: 20px 24px; }
.simplex-card .card-header { padding: 0 0 14px; }
.simplex-card .card-title {
    display: flex; align-items: center; gap: 8px;
    font-size: .9rem; font-weight: 600; color: var(--text);
}
.simplex-card .card-title i { width: 16px; height: 16px; color: var(--brand); }

/* Radio grid for operation type */
.simplex-radio-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px;
}
.simplex-radio-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    cursor: pointer; transition: background var(--transition), border-color var(--transition);
    font-size: .875rem; user-select: none;
}
.simplex-radio-item:hover { background: var(--surface-2); }
.simplex-radio-item input[type="radio"] { accent-color: var(--brand); flex-shrink: 0; }

/* Details grid */
.simplex-details-grid { display: flex; flex-direction: column; gap: 8px; }

/* Enrichment info chip */
.simplex-enrichment-info {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
    padding: 6px 12px; background: #dcfce7; border-radius: var(--radius-sm);
    font-size: .82rem; font-weight: 500; color: #16a34a;
}
[data-theme="dark"] .simplex-enrichment-info { background: #14532d; color: #86efac; }

/* Alert */
.simplex-alert {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px;
    font-size: .875rem; font-weight: 500;
}
.simplex-alert i { width: 18px; height: 18px; flex-shrink: 0; }
.simplex-alert-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
[data-theme="dark"] .simplex-alert-error { background: #450a0a; color: #fca5a5; border-color: #7f1d1d; }

/* ── Result view ─────────────────────────────────────────────────────────────── */
.simplex-result { max-width: 780px; }
.simplex-result-header {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
}
.simplex-procedure-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px; border-radius: var(--radius);
    font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em;
}
.simplex-procedure-badge i { width: 20px; height: 20px; }
.simplex-procedure-badge.badge-green  { background: #dcfce7; color: #16a34a; }
.simplex-procedure-badge.badge-blue   { background: var(--brand-light); color: var(--brand); }
.simplex-procedure-badge.badge-yellow { background: #fef9c3; color: #a16207; }
[data-theme="dark"] .simplex-procedure-badge.badge-green  { background: #14532d; color: #86efac; }
[data-theme="dark"] .simplex-procedure-badge.badge-blue   { background: #1d3352; color: #93c5fd; }
[data-theme="dark"] .simplex-procedure-badge.badge-yellow { background: #422006; color: #fde68a; }

.simplex-deadline {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .85rem; color: var(--text-2); font-weight: 500;
}

.simplex-explanation {
    padding: 14px 18px; background: var(--surface-2); border-radius: var(--radius);
    font-size: .875rem; color: var(--text-2); line-height: 1.6; margin-bottom: 20px;
}

/* Simplex tabs */
.simplex-tabs {
    display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 20px;
}
.simplex-tab-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 18px; border: none; background: transparent;
    font-size: .875rem; font-weight: 500; color: var(--text-2);
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    cursor: pointer; transition: color var(--transition), border-color var(--transition);
}
.simplex-tab-btn i { width: 14px; height: 14px; }
.simplex-tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); }
.simplex-tab-btn:hover { color: var(--text); }
.simplex-tab-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 999px; background: var(--surface-2); font-size: .7rem; font-weight: 600;
}
.simplex-tab-btn.active .simplex-tab-count { background: var(--brand-light); color: var(--brand); }

.simplex-tab-panel { display: none; }
.simplex-tab-panel.active { display: block; }

/* Legal basis */
.simplex-legal-basis { display: flex; flex-direction: column; gap: 10px; }
.simplex-legal-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 16px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: .875rem; color: var(--text);
}
.simplex-legal-item i { color: var(--brand); margin-top: 2px; }

/* Documents */
.simplex-doc-list { display: flex; flex-direction: column; gap: 8px; }
.simplex-doc-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.simplex-doc-item i { color: var(--success); margin-top: 2px; }
.simplex-doc-optional i { color: var(--text-3); }
.simplex-doc-name { font-size: .875rem; font-weight: 500; color: var(--text); }
.simplex-doc-desc { font-size: .78rem; color: var(--text-2); margin-top: 2px; }

/* Consultations */
.simplex-consult-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.simplex-consult-card {
    padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface);
}
.simplex-consult-entity {
    display: flex; align-items: center; gap: 8px;
    font-size: .875rem; font-weight: 600; color: var(--text); margin-bottom: 6px;
}
.simplex-consult-entity i { color: var(--brand); }
.simplex-consult-reason { font-size: .8rem; color: var(--text-2); margin-bottom: 8px; }
.simplex-consult-deadline {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: .75rem; color: var(--text-3); font-weight: 500;
}

/* Warnings */
.simplex-warnings { display: flex; flex-direction: column; gap: 8px; }
.simplex-warning-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 14px; background: #fef9c3; border: 1px solid #fde68a;
    border-radius: var(--radius-sm); font-size: .85rem; color: #92400e;
}
[data-theme="dark"] .simplex-warning-item { background: #422006; color: #fde68a; border-color: #78350f; }

/* History list */
.simplex-history-list { display: flex; flex-direction: column; gap: 8px; }
.simplex-history-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); transition: border-color .15s;
}
.simplex-history-item:hover { border-color: var(--brand); }
