:root {
    --portal-bg: #eef3fb;
    --portal-panel: #ffffff;
    --portal-text: #11243f;
    --portal-muted: #6f7f95;
    --portal-primary: #165df5;
    --portal-primary-soft: #e8f0ff;
    --portal-border: #dbe5f2;
    --portal-shadow: 0 18px 40px rgba(17, 36, 63, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Plus Jakarta Sans", sans-serif;
    color: var(--portal-text);
    background:
        radial-gradient(circle at top left, rgba(22, 93, 245, 0.08), transparent 26%),
        linear-gradient(180deg, #f7f9fc 0%, var(--portal-bg) 100%);
}

.auth-page { min-height: 100vh; }

.auth-wrapper {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
}

.auth-card {
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--portal-shadow);
}

.auth-copy {
    padding: 4rem;
    color: #fff;
    background: linear-gradient(155deg, rgba(22, 93, 245, 0.98), rgba(11, 24, 49, 0.94));
}

.auth-copy h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.08;
    margin-bottom: 1rem;
}

.auth-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

.auth-badges span {
    padding: 0.7rem 1rem;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    font-weight: 600;
}

.auth-form-panel {
    padding: 2rem;
    display: grid;
    align-content: center;
    background: rgba(255,255,255,0.92);
}

.portal-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 300px 1fr;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1030;
    display: none;
    background: rgba(15, 29, 51, 0.48);
    backdrop-filter: blur(3px);
}

.portal-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    background: linear-gradient(180deg, #0f1d33 0%, #112843 100%);
    color: #dbe7f8;
}

.brand-block, .sidebar-user, .portal-header, .header-tools, .user-chip, .metric-card, .panel-card__header, .hero-panel {
    display: flex;
    align-items: center;
}

.brand-block { gap: 1rem; }

.brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #4a8cff, #9ac0ff);
    color: #0b1a32;
    font-weight: 800;
}

.brand-block h1, .brand-block p, .sidebar-user small, .sidebar-card p { margin: 0; }
.brand-block h1, .sidebar-card h6 { color: #fff; }
.brand-block p, .sidebar-user small, .sidebar-card p { color: #90a6c7; }

.sidebar-user {
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(255,255,255,0.06);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #35d18a;
    box-shadow: 0 0 0 6px rgba(53,209,138,0.12);
}

.sidebar-nav { display: grid; gap: 0.4rem; }

.sidebar-logout {
    margin: 0;
}

.sidebar-link {
    width: 100%;
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #d9e4f7;
    text-decoration: none;
    border-radius: 16px;
    border: 0;
    background: transparent;
    transition: 0.2s ease;
}

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

.sidebar-link--logout {
    color: #ffd4da;
    border: 1px solid rgba(255, 95, 115, 0.28);
    background: rgba(255, 95, 115, 0.08);
}

.sidebar-link--logout:hover,
.sidebar-link--logout:focus-visible {
    color: #fff;
    background: rgba(255, 95, 115, 0.18);
}

.sidebar-card, .hero-panel, .metric-card, .panel-card, .module-tile {
    background: var(--portal-panel);
    border: 1px solid var(--portal-border);
    box-shadow: var(--portal-shadow);
}

.sidebar-card {
    margin-top: auto;
    border-radius: 22px;
    padding: 1rem;
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.1);
}

.portal-main { padding: 1.5rem; }
.portal-content, .portal-header, .portal-footer { padding-inline: 0.5rem; }

.portal-header {
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.portal-header h2 { margin: 0; font-weight: 800; }

.eyebrow {
    display: inline-block;
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--portal-primary);
}

.header-tools { gap: 0.75rem; }

.sidebar-toggle { display: none; }

.search-shell {
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--portal-border);
}

.search-shell .form-control { border: 0; box-shadow: none; padding: 0; }

.notification-badge {
    position: absolute;
    top: 0.2rem;
    right: 0.2rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ff5f73;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 0.68rem;
}

.notification-menu {
    width: min(380px, calc(100vw - 2rem));
    border-radius: 18px;
    overflow: hidden;
}

.notification-list {
    max-height: 360px;
    overflow-y: auto;
}

.notification-item {
    display: grid;
    gap: 0.25rem;
    padding: 0.85rem 1rem;
    white-space: normal;
    border-bottom: 1px solid #edf2f8;
}

.notification-item strong,
.notification-item span,
.notification-item small {
    display: block;
}

.notification-item span,
.notification-item small {
    color: var(--portal-muted);
}

.notification-item.is-unread {
    background: var(--portal-primary-soft);
}

.user-chip {
    gap: 0.75rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--portal-border);
    background: #fff;
}

.user-chip span {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--portal-primary-soft);
    color: var(--portal-primary);
    font-weight: 700;
}

.user-chip strong, .user-chip small, .metric-card strong, .metric-card span, .timeline-list strong, .timeline-list span {
    display: block;
}

.user-chip small, .metric-card span, .panel-card__header p, .module-tile p, .timeline-list span, .portal-footer {
    color: var(--portal-muted);
}

.hero-panel {
    justify-content: space-between;
    gap: 1rem;
    border-radius: 28px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.hero-panel h1 {
    font-size: clamp(1.7rem, 3vw, 2.8rem);
    margin-bottom: 0.5rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.metric-card {
    gap: 1rem;
    padding: 1.3rem;
    border-radius: 22px;
}

.metric-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: var(--portal-primary-soft);
    color: var(--portal-primary);
    font-size: 1.35rem;
}

.metric-card strong {
    font-size: 1.8rem;
    font-weight: 800;
}

.panel-card {
    border-radius: 28px;
    padding: 1.5rem;
}

.panel-card__header {
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-card__header h3, .module-tile h4 { margin-bottom: 0.25rem; }

.module-tile {
    height: 100%;
    padding: 1rem;
    border-radius: 20px;
}

.timeline-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1rem;
}

.timeline-list li {
    padding: 1rem;
    border-radius: 18px;
    background: #f8fbff;
    border: 1px solid #e3ebf7;
}

.alert-soft {
    border: 0;
    border-radius: 18px;
    box-shadow: var(--portal-shadow);
}

.table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: #f4f8ff;
}

.table thead th {
    color: #49627f;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom-color: var(--portal-border);
}

.table tbody tr { transition: background-color 0.18s ease; }

.btn, .form-control, .form-select {
    border-radius: 12px;
}

.btn:focus-visible,
.form-control:focus,
.form-select:focus,
.sidebar-link:focus-visible {
    box-shadow: 0 0 0 0.22rem rgba(22, 93, 245, 0.16);
}

@media (max-width: 1199.98px) {
    .portal-layout { grid-template-columns: 1fr; }
    .portal-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1040;
        width: min(320px, calc(100vw - 2rem));
        transform: translateX(-105%);
        transition: transform 0.22s ease;
    }
    .sidebar-open .portal-sidebar { transform: translateX(0); }
    .sidebar-open .sidebar-backdrop { display: block; }
    .sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; }
}

@media (max-width: 991.98px) {
    .auth-card { grid-template-columns: 1fr; }
    .portal-header, .hero-panel { flex-direction: column; align-items: flex-start; }
    .header-tools { width: 100%; flex-wrap: wrap; }
    .search-shell { min-width: 100%; }
}

@media (max-width: 575.98px) {
    .auth-wrapper, .portal-main, .portal-sidebar { padding: 1rem; }
    .auth-copy, .auth-form-panel, .hero-panel, .panel-card { padding: 1.25rem; }
    .portal-main { padding-top: 1rem; }
    .user-chip div { display: none; }
    .panel-card__header { align-items: flex-start; flex-direction: column; }
}
