:root {
    --ec-primary: #2563eb;
    --ec-primary-dark: #1d4ed8;
    --ec-accent: #0ea5e9;
    --ec-success: #10b981;
    --ec-warning: #f59e0b;
    --ec-danger: #ef4444;
    --ec-sidebar: #0f172a;
    --ec-sidebar-hover: #1e293b;
    --ec-bg: #f1f5f9;
    --ec-card: #ffffff;
    --ec-border: #e2e8f0;
    --ec-text: #0f172a;
    --ec-muted: #64748b;
    --sidebar-width: 272px;
    --header-height: 64px;
}

body.ec-portal {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background: var(--ec-bg);
    color: var(--ec-text);
    margin: 0;
}

.ec-wrapper { display: flex; min-height: 100vh; }

.ec-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--ec-sidebar) 0%, #020617 100%);
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    overflow-y: auto;
    transition: transform .25s ease;
}

.ec-sidebar-brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
    color: #fff;
}

.ec-sidebar-brand .logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--ec-primary), var(--ec-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.ec-sidebar-brand span { font-weight: 700; font-size: 1.05rem; }

.ec-nav-section {
    padding: 1rem 1.5rem .35rem;
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #64748b;
}

.ec-nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem 1.5rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: .925rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all .15s;
}

.ec-nav-link i { font-size: 1.1rem; width: 1.25rem; text-align: center; }

.ec-nav-link:hover { color: #fff; background: var(--ec-sidebar-hover); }

.ec-nav-link.active {
    color: #fff;
    background: rgba(37, 99, 235, .2);
    border-left-color: var(--ec-accent);
}

.ec-nav-badge {
    margin-left: auto;
    font-size: .7rem;
    background: var(--ec-primary);
    color: #fff;
    padding: .15rem .45rem;
    border-radius: 999px;
}

.ec-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
}

.ec-header {
    height: var(--header-height);
    background: var(--ec-card);
    border-bottom: 1px solid var(--ec-border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.ec-content { padding: 1.5rem 1.75rem 2rem; }

.ec-page-title { font-size: 1.35rem; font-weight: 700; margin: 0; }
.ec-page-subtitle { color: var(--ec-muted); font-size: .9rem; margin: .25rem 0 0; }

.ec-breadcrumb { font-size: .85rem; margin-bottom: 1.25rem; }
.ec-breadcrumb a { color: var(--ec-muted); text-decoration: none; }
.ec-breadcrumb a:hover { color: var(--ec-primary); }

.ec-card {
    background: var(--ec-card);
    border: 1px solid var(--ec-border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}

.ec-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--ec-border);
    font-weight: 600;
}

.ec-stat-card {
    padding: 1.25rem;
    border-radius: 12px;
    background: var(--ec-card);
    border: 1px solid var(--ec-border);
    height: 100%;
}

.ec-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.ec-table thead th {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ec-muted);
    font-weight: 600;
    background: #f8fafc;
    border-bottom: 1px solid var(--ec-border);
}

.ec-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--ec-muted);
}

.ec-empty-icon { font-size: 3rem; opacity: .5; margin-bottom: 1rem; }

.ec-risk-ring {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 4px solid;
    margin: 0 auto;
}

.btn-ec-primary {
    background: var(--ec-primary);
    border-color: var(--ec-primary);
}
.btn-ec-primary:hover {
    background: var(--ec-primary-dark);
    border-color: var(--ec-primary-dark);
}

.ec-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1035;
}

@media (max-width: 991.98px) {
    .ec-sidebar { transform: translateX(-100%); }
    .ec-sidebar.show { transform: translateX(0); }
    .ec-sidebar-overlay.show { display: block; }
    .ec-main { margin-left: 0; }
}

.ec-public-nav {
    background: #fff;
    border-bottom: 1px solid var(--ec-border);
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.ec-auth-card {
    max-width: 440px;
    margin: 0 auto;
    border-radius: 16px;
    border: 1px solid var(--ec-border);
    box-shadow: 0 10px 40px rgba(15, 23, 42, .08);
}
