:root {
    --surface-bg: #f4f6f8;
    --surface-card: #ffffff;
    --surface-alt: #eef1f5;
    --surface-sidebar: #0f172a;
    --surface-sidebar-hover: rgba(255, 255, 255, 0.06);
    --surface-topbar: #ffffff;
    --border-soft: #d0d5dd;
    --divider-soft: #e4e7ec;
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
    --text-strong: #101828;
    --text-muted: #667085;
    --text-invert: #f8fafc;
    --accent-primary: #1f3c88;
    --accent-primary-strong: #162a5a;
    --accent-primary-soft: rgba(31, 60, 136, 0.12);
    --accent-success: #027a48;
    --accent-warning: #b54708;
    --accent-danger: #b42318;
    --radius-md: 14px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --transition-base: 150ms ease;
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

body.business-shell {
    background-color: var(--surface-bg);
    color: var(--text-strong);
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

.business-shell .sidebar-brand {
    color: var(--text-invert);
}

.business-shell .sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 1rem;
    font-size: 0.9375rem;
    color: rgba(226, 232, 240, 0.72);
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-base), color var(--transition-base);
}

.business-shell .sidebar-nav a:hover,
.business-shell .sidebar-nav a:focus-visible {
    background-color: var(--surface-sidebar-hover);
    color: var(--text-invert);
}

.business-shell .sidebar-nav a.is-active {
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.16) 0%, rgba(148, 163, 184, 0) 100%);
    color: #e2e8f0;
}

.business-shell .sidebar-section-title {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.45);
    margin: 1.5rem 1rem 0.75rem;
}

.ui-card {
    background-color: var(--surface-card);
    border: 1px solid var(--divider-soft);
    border-radius: var(--radius-md);
    box-shadow: none;
    transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.ui-card:hover {
    box-shadow: var(--shadow-soft);
    transform: translateY(-2px);
}

.ui-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--divider-soft);
    background: var(--surface-card);
}

.ui-toolbar__title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-strong);
}

.ui-toolbar__subtitle {
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.ui-chip-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ui-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--divider-soft);
    background: var(--surface-card);
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    transition: background-color var(--transition-base), color var(--transition-base), border-color var(--transition-base);
}

.ui-chip.is-active {
    background: var(--accent-primary-soft);
    border-color: rgba(31, 60, 136, 0.24);
    color: var(--accent-primary-strong);
}

.ui-chip.is-danger {
    border-color: rgba(180, 35, 24, 0.35);
    color: var(--accent-danger);
}

.ui-chip.is-danger.is-active {
    background: rgba(180, 35, 24, 0.12);
}

.ui-primary-btn,
.ui-secondary-btn,
.ui-tertiary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: transform var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
}

.ui-primary-btn {
    background: var(--accent-primary);
    color: var(--text-invert);
    box-shadow: 0 10px 20px rgba(31, 60, 136, 0.22);
}

.ui-primary-btn:hover {
    background: var(--accent-primary-strong);
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(31, 60, 136, 0.28);
}

.ui-secondary-btn {
    background: var(--surface-card);
    border: 1px solid var(--divider-soft);
    color: var(--accent-primary-strong);
}

.ui-secondary-btn:hover {
    border-color: rgba(31, 60, 136, 0.35);
    color: var(--accent-primary-strong);
    background: rgba(31, 60, 136, 0.08);
}

.ui-tertiary-btn {
    background: transparent;
    color: var(--text-muted);
}

.ui-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.ui-status-dot.is-success { background-color: var(--accent-success); }
.ui-status-dot.is-warning { background-color: var(--accent-warning); }
.ui-status-dot.is-danger { background-color: var(--accent-danger); }

.ui-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--divider-soft);
    border-radius: var(--radius-md);
    background: var(--surface-card);
    overflow: hidden;
}

.ui-table thead {
    background: var(--surface-alt);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.ui-table th,
.ui-table td {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--divider-soft);
    font-size: 0.9375rem;
}

.ui-table tbody tr:hover {
    background: rgba(15, 23, 42, 0.03);
}

.ui-metric {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ui-metric__label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.ui-metric__value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-strong);
}

.ui-toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: grid;
    gap: 1rem;
    z-index: 60;
}

.ui-toast {
    min-width: 280px;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--divider-soft);
    background: var(--surface-card);
    box-shadow: var(--shadow-soft);
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.ui-toast.is-success { border-color: rgba(2, 122, 72, 0.3); }
.ui-toast.is-warning { border-color: rgba(181, 71, 8, 0.3); }
.ui-toast.is-danger { border-color: rgba(180, 35, 24, 0.3); }

.ui-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.ui-breadcrumbs a {
    color: inherit;
    transition: color var(--transition-base);
}

.ui-breadcrumbs a:hover {
    color: var(--accent-primary-strong);
}

@media (max-width: 1024px) {
    .business-shell .sidebar-wrapper {
        position: fixed;
        inset: 0;
        z-index: 50;
    }
}


/* Overrides for legacy navigation utility classes when embedded inside the business shell */
.business-shell .sidebar-nav .text-crm-gray-dark { color: rgba(226, 232, 240, 0.72); }
.business-shell .sidebar-nav .hover\:bg-crm-gray-DEFAULT:hover { background-color: var(--surface-sidebar-hover); }
.business-shell .sidebar-nav .hover\:text-crm-blue:hover { color: var(--text-invert); }
.business-shell .sidebar-nav .border-crm-gray-DEFAULT { border-color: rgba(148, 163, 184, 0.16); }
.business-shell .sidebar-nav .text-crm-blue { color: var(--text-invert); }
.business-shell .sidebar-nav .text-slate-500 { color: rgba(226, 232, 240, 0.56); }
.business-shell .sidebar-nav .text-sky-500 { color: rgba(56, 189, 248, 0.85); }
.business-shell .sidebar-nav .text-indigo-500 { color: rgba(129, 140, 248, 0.9); }
.business-shell .sidebar-nav .text-emerald-500 { color: rgba(52, 211, 153, 0.9); }
.business-shell .sidebar-nav .text-orange-500 { color: rgba(249, 115, 22, 0.9); }
.business-shell .sidebar-nav .text-fuchsia-500 { color: rgba(217, 70, 239, 0.9); }
.business-shell .sidebar-nav .text-blue-500 { color: rgba(59, 130, 246, 0.9); }
.business-shell .sidebar-nav .text-red-500 { color: rgba(248, 113, 113, 0.9); }
.business-shell .sidebar-nav .text-amber-500 { color: rgba(245, 158, 11, 0.9); }
.business-shell .sidebar-nav .text-slate-400 { color: rgba(148, 163, 184, 0.75); }
