.dashboard-shell {
    --dashboard-font: 'Montserrat', 'Segoe UI', Roboto, Arial, sans-serif;
    --dashboard-bg: #e9edf6;
    --dashboard-surface: rgba(255, 255, 255, 0.92);
    --dashboard-surface-bg: url('../assets/img/auth/background_light.png');
    --dashboard-card: #ffffff;
    --dashboard-card-text: #1a1f2e;
    --dashboard-muted: #6b6f8d;
    --dashboard-border: rgba(36, 44, 120, 0.12);
    --dashboard-shadow-sm: 0 6px 14px rgba(36, 44, 120, 0.12);
    --dashboard-shadow-md: 0 18px 40px rgba(36, 44, 120, 0.18);
    --dashboard-radius-lg: 28px;
    --dashboard-radius-md: 20px;
    --dashboard-radius-sm: 16px;
    --dashboard-pill: 999px;
    --dashboard-accent: #556cb2;
    --dashboard-accent-strong: #3f55a3;
    --dashboard-highlight: #f7931e;
    color: var(--dashboard-card-text);
    font-family: var(--dashboard-font);
}

.dashboard-header {
    margin-bottom: 1.5rem;
}

.dashboard-header__inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.85rem 1.5rem;
    background: var(--dashboard-surface);
    border-radius: var(--dashboard-radius-lg);
    box-shadow: var(--dashboard-shadow-sm);
    border: 1px solid var(--dashboard-border);
}

body[data-bs-theme="dark"] .dashboard-header__inner {
    background: rgba(18, 20, 36, 0.9);
    box-shadow: var(--dashboard-shadow-sm);
    border-color: rgba(72, 79, 140, 0.35);
}

.dashboard-header__start {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}

.dashboard-header__menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--dashboard-pill);
    border: 1px solid var(--dashboard-border);
    background: var(--dashboard-card);
    color: var(--dashboard-card-text);
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-header__menu-button:hover,
.dashboard-header__menu-button:focus {
    background: var(--dashboard-card-text);
    color: #ffffff;
    box-shadow: var(--dashboard-shadow-sm);
}

body[data-bs-theme="dark"] .dashboard-header__menu-button {
    background: rgba(27, 30, 52, 0.85);
    color: var(--dashboard-card-text);
}

.dashboard-header__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: var(--dashboard-card);
    border: 1px solid var(--dashboard-border);
    overflow: hidden;
}

.dashboard-header__logo-image {
    display: block;
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.dashboard-header__logo-image--dark {
    display: none;
}

body[data-bs-theme="dark"] .dashboard-header__logo-image--light {
    display: none;
}

body[data-bs-theme="dark"] .dashboard-header__logo-image--dark {
    display: block;
}

.dashboard-header__brand {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    min-width: 0;
}

.dashboard-header__brand-name {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--dashboard-card-text);
}

.dashboard-header__brand-tagline {
    font-size: 0.75rem;
    color: var(--dashboard-muted);
    white-space: nowrap;
}

.dashboard-header__nav {
    display: none;
    align-items: center;
    gap: 0.35rem;
    margin-left: 1.25rem;
}

.dashboard-header__nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.95rem;
    border-radius: var(--dashboard-pill);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dashboard-muted);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-header__nav-link:hover,
.dashboard-header__nav-link:focus {
    color: var(--dashboard-card-text);
    background: rgba(85, 108, 178, 0.14);
    box-shadow: var(--dashboard-shadow-sm);
}

.dashboard-header__nav-link.is-active {
    background: var(--dashboard-card);
    color: var(--dashboard-card-text);
    box-shadow: var(--dashboard-shadow-sm);
}

body[data-bs-theme="dark"] .dashboard-header__nav-link {
    color: rgba(199, 207, 252, 0.8);
}

body[data-bs-theme="dark"] .dashboard-header__nav-link.is-active {
    background: rgba(63, 85, 163, 0.35);
    color: #ffffff;
}

.dashboard-header__action {
    display: none;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    border-radius: var(--dashboard-pill);
    padding-inline: 1.2rem;
    box-shadow: var(--dashboard-shadow-sm);
}

.dashboard-header__utilities {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.dashboard-header__toggle .switch {
    transform: scale(0.92);
}

.dashboard-header__language {
    position: relative;
}

.dashboard-header .language-selector__button {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.75rem;
    border-radius: var(--dashboard-pill);
    border: 1px solid var(--dashboard-border);
    background: var(--dashboard-card);
    color: var(--dashboard-card-text);
    font-weight: 600;
    font-size: 0.85rem;
}

.dashboard-header .language-selector__caret {
    font-size: 0.65rem;
}

body[data-bs-theme="dark"] .dashboard-header .language-selector__button {
    background: rgba(27, 30, 52, 0.85);
    color: var(--dashboard-card-text);
    border-color: rgba(72, 79, 140, 0.35);
}

.dashboard-header .language-selector__menu {
    min-width: 180px;
    padding: 0.5rem;
    border-radius: var(--dashboard-radius-sm);
    box-shadow: var(--dashboard-shadow-sm);
}

.dashboard-header .language-selector__option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.5rem;
    border-radius: var(--dashboard-radius-sm);
    font-weight: 600;
}

.dashboard-header .language-selector__option.is-active {
    background: rgba(85, 108, 178, 0.14);
}

.dashboard-header__icon-button {
    width: 42px;
    height: 42px;
    border-radius: var(--dashboard-pill);
    border: 1px solid var(--dashboard-border);
    background: var(--dashboard-card);
    color: var(--dashboard-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-header__icon-button:hover,
.dashboard-header__icon-button:focus {
    color: var(--dashboard-card-text);
    background: rgba(85, 108, 178, 0.14);
    box-shadow: var(--dashboard-shadow-sm);
}

body[data-bs-theme="dark"] .dashboard-header__icon-button {
    background: rgba(27, 30, 52, 0.85);
    color: var(--dashboard-card-text);
    border-color: rgba(72, 79, 140, 0.35);
}

.dashboard-header__profile {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.35rem 0.6rem 0.35rem 0.35rem;
    border-radius: var(--dashboard-pill);
    border: 1px solid var(--dashboard-border);
    background: var(--dashboard-card);
    color: var(--dashboard-card-text);
    font-weight: 600;
    text-decoration: none;
    min-width: 0;
}

.dashboard-header__profile:focus,
.dashboard-header__profile:hover {
    box-shadow: var(--dashboard-shadow-sm);
}

body[data-bs-theme="dark"] .dashboard-header__profile {
    background: rgba(27, 30, 52, 0.85);
    border-color: rgba(72, 79, 140, 0.35);
}

.dashboard-header__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(85, 108, 178, 0.85), rgba(247, 147, 30, 0.85));
    color: #ffffff;
    font-weight: 700;
    display: grid;
    place-items: center;
    letter-spacing: 0.02em;
}

.dashboard-header__profile-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.dashboard-header__profile-name {
    font-size: 0.9rem;
    color: var(--dashboard-card-text);
    max-width: 12ch;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-header__profile-email {
    font-size: 0.72rem;
    color: var(--dashboard-muted);
    max-width: 18ch;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-header__profile-caret {
    font-size: 0.7rem;
    color: var(--dashboard-muted);
}

.dashboard-header__dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 600;
}

.dashboard-header__dropdown .dropdown-item i {
    font-size: 1rem;
}

.dashboard-header__drawer .offcanvas-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dashboard-header__drawer-nav {
    display: grid;
    gap: 0.75rem;
}

.dashboard-header__drawer-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--dashboard-radius-md);
    background: rgba(85, 108, 178, 0.08);
    color: var(--dashboard-card-text);
    font-weight: 600;
    text-decoration: none;
}

.dashboard-header__drawer-link.is-active {
    background: rgba(85, 108, 178, 0.18);
}

.dashboard-header__drawer-actions {
    display: grid;
    gap: 0.75rem;
}

/* Legacy dashboard layout (pre-migration) */
.dashboard-shell--legacy {
    display: grid;
    gap: 2rem;
}

.dashboard-shell--legacy .card {
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    background: var(--dashboard-card, var(--bs-card-bg));
    color: var(--dashboard-card-text, inherit);
    border: 1px solid var(--dashboard-border, var(--bs-border-color));
    box-shadow: var(--dashboard-shadow-sm, 0 6px 14px rgba(36, 44, 120, 0.12));
}

.dashboard-shell--legacy .card-header {
    border-bottom: none;
    background: transparent;
}

.dashboard-shell--legacy .nav-tabs {
    display: flex;
    width: 100%;
}

.dashboard-shell--legacy .nav-tabs .nav-item {
    flex-grow: 1;
    text-align: center;
}

.dashboard-shell--legacy .tab-card {
    border-top: none;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    background-color: var(--dashboard-card, var(--bs-card-cap-bg));
    padding: 0;
    margin-top: -1px;
    box-shadow: var(--dashboard-shadow-sm, 0 6px 14px rgba(36, 44, 120, 0.12));
}

.dashboard-shell--legacy .card-header-tabs {
    margin-right: 0 !important;
    margin-left: 0 !important;
    border-bottom: 0;
}

@media (min-width: 768px) {
    .dashboard-header__brand-tagline {
        white-space: normal;
    }
}

@media (min-width: 992px) {
    .dashboard-header__menu-button {
        display: none;
    }

    .dashboard-header__nav {
        display: flex;
    }

    .dashboard-header__drawer {
        display: none;
    }
}

@media (min-width: 1200px) {
    .dashboard-header__action {
        display: inline-flex;
    }
}

@media (max-width: 575.98px) {
    .dashboard-header__brand-tagline {
        display: none;
    }

    .dashboard-header__utilities {
        width: 100%;
        justify-content: flex-end;
    }
}

body[data-bs-theme="dark"] .dashboard-shell {
    --dashboard-bg: #18192a;
    --dashboard-surface: rgba(23, 24, 42, 0.94);
    --dashboard-surface-bg: url('../assets/img/auth/background_dark.png');
    --dashboard-card: #0f1220;
    --dashboard-card-text: #f4f6ff;
    --dashboard-muted: #c7cffc;
    --dashboard-border: rgba(11, 12, 32, 0.6);
    --dashboard-shadow-sm: 0 10px 24px rgba(0, 0, 0, 0.45);
    --dashboard-shadow-md: 0 26px 58px rgba(0, 0, 0, 0.55);
    --dashboard-accent: #8c9dff;
    --dashboard-accent-strong: #c3cbff;
    --dashboard-highlight: #f8a848;
}

.dashboard-shell__stage {
    background: var(--dashboard-bg);
    padding: 2.5rem 1.25rem;
    border-radius: var(--dashboard-radius-lg);
    box-shadow: inset 0 0 0 1px rgba(36, 44, 120, 0.08);
    display: flex;
    justify-content: center;
}

body[data-bs-theme="dark"] .dashboard-shell__stage {
    box-shadow: inset 0 0 0 1px rgba(18, 20, 36, 0.4);
}

.dashboard-shell__frame {
    width: 100%;
    max-width: 1040px;
}

.dashboard-shell__screen {
    background: var(--dashboard-surface);
    background-image: var(--dashboard-surface-bg);
    background-size: cover;
    background-position: center bottom;
    border-radius: var(--dashboard-radius-lg);
    box-shadow: var(--dashboard-shadow-md);
    padding: 2.25rem 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.dashboard-shell__intro {
    display: grid;
    gap: 1.5rem;
}

.dashboard-shell__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--dashboard-muted);
}

.dashboard-shell__headline {
    font-size: clamp(1.75rem, 2.4vw, 2.6rem);
    font-weight: 800;
    margin: 0;
    color: var(--dashboard-card-text);
}

.dashboard-shell__subheadline {
    margin: 0;
    font-size: 1.05rem;
    color: var(--dashboard-muted);
    max-width: 48ch;
}

.dashboard-shell__intro-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.dashboard-shell__intro-actions .btn {
    border-radius: var(--dashboard-pill);
    padding-inline: 1.35rem;
    font-weight: 600;
}

.dashboard-shell__identity {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem 1.25rem;
}

.dashboard-shell__identity dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--dashboard-muted);
}

.dashboard-shell__identity dd {
    margin: 0.25rem 0 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dashboard-card-text);
}

.dashboard-shell__content {
    padding: 0;
}

.dashboard-shell .insight-hero,
.dashboard-shell .insight-entry {
    position: relative;
    background: var(--dashboard-card);
    color: var(--dashboard-card-text);
    border-radius: var(--dashboard-radius-md);
    border: 1px solid var(--dashboard-border);
    box-shadow: var(--dashboard-shadow-sm);
}

.dashboard-shell .insight-hero {
    overflow: hidden;
    margin-bottom: 3.5rem;
}

.dashboard-shell .insight-media {
    height: 200px;
    background-size: cover;
    background-position: center;
}

.dashboard-shell .insight-pin {
    position: absolute;
    top: -20px;
    right: 1.5rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #ffffff;
    color: var(--dashboard-accent);
    box-shadow: var(--dashboard-shadow-sm);
    border: 1px solid var(--dashboard-border);
    font-size: 1.15rem;
}

body[data-bs-theme="dark"] .dashboard-shell .insight-pin {
    background: rgba(15, 18, 32, 0.9);
    color: var(--dashboard-highlight);
}

.dashboard-shell .insight-body {
    padding: 1.5rem 1.65rem 1.75rem;
}

.dashboard-shell .hero-eyebrow {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    color: var(--dashboard-accent);
}

body[data-bs-theme="dark"] .dashboard-shell .hero-eyebrow {
    color: var(--dashboard-highlight);
}

.dashboard-shell .hero-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.dashboard-shell .hero-sub {
    margin: 0;
    font-size: 1rem;
    line-height: 1.55;
    color: var(--dashboard-card-text);
}

.dashboard-shell .hero-more {
    color: var(--dashboard-highlight);
    font-weight: 700;
    margin-left: 0.35rem;
    text-decoration: none;
}

.dashboard-shell .hero-more:hover {
    text-decoration: underline;
}

.dashboard-shell .insight-actions {
    position: absolute;
    left: 50%;
    bottom: -30px;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
}

.dashboard-shell .round-action {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--dashboard-accent);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    box-shadow: var(--dashboard-shadow-sm);
    text-decoration: none;
}

.dashboard-shell .round-action:hover {
    background: var(--dashboard-accent-strong);
}

body[data-bs-theme="dark"] .dashboard-shell .round-action {
    color: var(--dashboard-card-text);
}

.dashboard-shell__list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.dashboard-shell__list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.dashboard-shell__list-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.dashboard-shell__list-header .btn-link {
    font-weight: 600;
    color: var(--dashboard-accent);
    text-decoration: none;
}

.dashboard-shell__list-header .btn-link:hover {
    text-decoration: underline;
}

.dashboard-shell .insight-entry {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.5rem 1.65rem;
}

.dashboard-shell__meta-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    display: grid;
    gap: 0.25rem;
    font-size: 0.92rem;
    color: var(--dashboard-muted);
}

.dashboard-shell__meta-label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-right: 0.35rem;
    color: var(--dashboard-card-text);
}

.dashboard-shell__entry-actions {
    display: flex;
    justify-content: flex-end;
}

.dashboard-shell__entry-actions .btn {
    border-radius: var(--dashboard-pill);
    font-weight: 600;
}

.dashboard-shell__empty {
    text-align: center;
    padding: 2.5rem 1rem;
    background: var(--dashboard-card);
    border-radius: var(--dashboard-radius-md);
    border: 1px dashed var(--dashboard-border);
}

.dashboard-shell__empty p {
    margin-bottom: 1.25rem;
    color: var(--dashboard-muted);
}

.dashboard-shell__stats {
    margin-top: 2.5rem;
    background: var(--dashboard-card);
    border-radius: var(--dashboard-radius-md);
    border: 1px solid var(--dashboard-border);
    box-shadow: var(--dashboard-shadow-sm);
    padding: 2rem 2rem 2.25rem;
}

.dashboard-shell__stats-header {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
}

.dashboard-shell__stats-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.dashboard-shell__stats-header p {
    margin: 0;
    color: var(--dashboard-muted);
    font-size: 0.96rem;
}

.dashboard-shell__stats-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.dashboard-shell__stat-card {
    background: rgba(255, 255, 255, 0.72);
    border-radius: var(--dashboard-radius-sm);
    padding: 1.5rem;
    border: 1px solid var(--dashboard-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

body[data-bs-theme="dark"] .dashboard-shell__stat-card {
    background: rgba(12, 14, 28, 0.9);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dashboard-shell__stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dashboard-card-text);
}

.dashboard-shell__stat-label {
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    color: var(--dashboard-muted);
    margin-top: 0.35rem;
}

.dashboard-shell__stat-caption {
    margin: 0.75rem 0 0;
    font-size: 0.92rem;
    color: var(--dashboard-card-text);
    opacity: 0.82;
}

@media (max-width: 768px) {
    .dashboard-shell__stage {
        padding: 1.5rem 0.75rem;
    }

    .dashboard-shell__screen {
        padding: 1.75rem 1.25rem 2rem;
    }

    .dashboard-shell .insight-actions {
        position: static;
        transform: none;
        justify-content: flex-end;
        margin-top: 1.5rem;
    }

    .dashboard-shell .insight-hero {
        margin-bottom: 2rem;
    }

    .dashboard-shell__list-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-shell__entry-actions {
        justify-content: flex-start;
    }
}
