:root {
    --green-50: #f2fbf4;
    --green-100: #d7f0dc;
    --green-300: #86d6a0;
    --green-500: #2c9f5f;
    --green-600: #23834d;
    --green-700: #1a643c;
    --ink-900: #1f2b24;
    --ink-700: #3e4d45;
    --card-border: #c7e5cf;
}

@media (min-width: 992px) {
    html {
        font-size: 90%;
    }
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: 'Manrope', sans-serif;
    color: var(--ink-900);
    background-color: #ffffff;
}

.auth-page {
    background-color: var(--green-50);
    background-image: none;
}

.landing-page {
    background:
        radial-gradient(circle at top left, rgba(44, 159, 95, 0.18), transparent 32%),
        radial-gradient(circle at 85% 15%, rgba(134, 214, 160, 0.16), transparent 26%),
        linear-gradient(180deg, #f7fcf8 0%, #ffffff 72%);
}

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-wrapper {
    flex: 1;
    padding: 2rem 1.25rem;
}

.login-content {
    flex: 1;
    margin: 2rem;
}

.landing-content {
    flex: 1;
    padding: 0;
}

.landing-hero {
    position: relative;
    overflow: hidden;
    padding: 3rem 1.25rem 4rem;
}

.landing-hero::before,
.landing-hero::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.landing-hero::before {
    width: 18rem;
    height: 18rem;
    right: -6rem;
    top: -4rem;
    background: rgba(44, 159, 95, 0.1);
}

.landing-hero::after {
    width: 12rem;
    height: 12rem;
    left: -4rem;
    bottom: -3rem;
    background: rgba(134, 214, 160, 0.12);
}

.landing-shell {
    position: relative;
    z-index: 1;
    max-width: 1180px;
    margin: 0 auto;
}

.landing-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: rgba(44, 159, 95, 0.1);
    color: var(--green-700);
    font-size: 0.9rem;
    font-weight: 700;
}

.landing-title {
    margin-top: 1rem;
    margin-bottom: 1rem;
    font-size: clamp(2.5rem, 4vw, 4.4rem);
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ink-900);
}

.landing-lead {
    max-width: 42rem;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--ink-700);
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 1.6rem;
}

.landing-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.landing-metric {
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    border: 1px solid rgba(199, 229, 207, 0.9);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 16px 32px rgba(26, 100, 60, 0.08);
}

.landing-metric__value {
    display: block;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--green-700);
}

.landing-metric__label {
    color: var(--ink-700);
    font-size: 0.92rem;
}

.landing-preview-card {
    height: 100%;
    border: 1px solid rgba(199, 229, 207, 0.9);
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 20px 50px rgba(26, 100, 60, 0.14);
    padding: 1.4rem;
}

.landing-preview-list {
    display: grid;
    gap: 0.9rem;
    margin: 1.4rem 0 0;
    padding: 0;
    list-style: none;
}

.landing-preview-item {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    background: var(--green-50);
}

.landing-preview-item i {
    font-size: 1.1rem;
    color: var(--green-600);
    margin-top: 0.1rem;
}

.landing-preview-item strong {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--ink-900);
}

.landing-preview-item span {
    color: var(--ink-700);
    font-size: 0.94rem;
    line-height: 1.55;
}

.landing-section {
    padding: 0 1.25rem 4rem;
}

.landing-section__shell {
    max-width: 1180px;
    margin: 0 auto;
}

.landing-section__title {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--ink-900);
}

.landing-section__subtitle {
    color: var(--ink-700);
}

.landing-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.landing-feature-grid2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.landing-feature-card {
    padding: 1.25rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(199, 229, 207, 0.9);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 16px 28px rgba(26, 100, 60, 0.08);
    transition: all 0.3s ease;
}

.landing-feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 40px rgba(26, 100, 60, 0.15);
    border-color: rgba(44, 159, 95, 0.5);
}

.landing-feature-card i {
    display: inline-flex;
    width: 2.5rem;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.85rem;
    background: rgba(44, 159, 95, 0.1);
    color: var(--green-700);
    font-size: 1.15rem;
    margin-bottom: 1rem;
}

.landing-feature-card h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--ink-900);
    margin-bottom: 0.5rem;
}

.landing-feature-card p {
    color: var(--ink-700);
    line-height: 1.65;
    margin-bottom: 0;
}

.landing-cta-panel {
    margin-top: 1.5rem;
    padding: 1.4rem;
    border-radius: 1.5rem;
    background: linear-gradient(135deg, rgba(44, 159, 95, 0.12), rgba(255, 255, 255, 0.92));
    border: 1px solid rgba(199, 229, 207, 0.9);
    box-shadow: 0 16px 32px rgba(26, 100, 60, 0.08);
}

.landing-cta-panel h2 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
    color: var(--ink-900);
}

.landing-cta-panel p {
    color: var(--ink-700);
    margin-bottom: 0;
}

@media (max-width: 991.98px) {
    .landing-hero {
        padding-top: 2.25rem;
    }

    .landing-metric-grid,
    .landing-feature-grid {
        grid-template-columns: 1fr;
    }

    .landing-preview-card {
        margin-top: 1.5rem;
    }
}

.topbar-theme {
    background-color: #ecf7f0;
    border-bottom: 1px solid var(--card-border);
    box-shadow: 0 10px 24px rgba(26, 100, 60, 0.1);
    position: sticky;
    top: 0;
    z-index: 1030;
    overflow: visible;
}

.topbar-theme .navbar-collapse {
    position: relative;
    z-index: 1040;
}

.topbar-theme .container-fluid {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.topbar-theme .navbar-brand {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.topbar-theme .navbar-brand img {
    display: block;
}

.brand-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--green-700);
    letter-spacing: 0.2px;
}

.topbar-links .nav-link {
    color: var(--ink-700) !important;
    font-weight: 500;
    margin-right: 0.45rem;
    border-radius: 0;
    padding: 0.5rem 0.85rem !important;
    transition: color 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
}

.topbar-links {
    align-self: stretch;
}

.topbar-links .nav-item {
    display: flex;
    align-items: stretch;
}

.topbar-links .nav-link:hover {
    color: var(--green-700) !important;
    background-color: transparent;
}

.topbar-links .nav-link.active {
    color: var(--green-700) !important;
    background: transparent;
    font-weight: 700;
}

.topbar-links .nav-link.active::after {
    content: "";
    position: absolute;
    left: 0.85rem;
    right: 0.85rem;
    bottom: 0;
    height: 3px;
    background-color: var(--green-600);
    border-radius: 10px;
}

@media (min-width: 992px) {
    .topbar-theme {
        padding-top: 0;
        padding-bottom: 0;
    }

    .topbar-theme .container-fluid {
        min-height: 74px;
    }

    .topbar-theme .navbar-brand {
        display: flex;
        align-items: center;
        padding-top: 0.45rem;
        padding-bottom: 0.45rem;
    }

    .topbar-theme .navbar-collapse,
    .topbar-theme .navbar-nav,
    .topbar-links,
    .topbar-links .nav-item {
        align-self: stretch;
    }

    .topbar-theme .navbar-nav .nav-item {
        display: flex;
        align-items: stretch;
    }

    .topbar-theme .navbar-nav .dropdown-toggle {
        display: flex;
        align-items: center;
        padding-top: 0;
        padding-bottom: 0;
    }

    .topbar-links .nav-link.active::after {
        bottom: 0;
    }
}

.topbar-theme .navbar-nav .dropdown-toggle {
    color: var(--ink-700) !important;
    padding: 0.5rem 0.75rem !important;
}

.topbar-theme .navbar-nav .dropdown-toggle:hover,
.topbar-theme .navbar-nav .dropdown-toggle:focus,
.topbar-theme .navbar-nav .show > .dropdown-toggle {
    color: var(--green-700) !important;
    background-color: transparent !important;
}

.topbar-theme .dropdown-menu {
    border: 1px solid var(--card-border);
    border-radius: 0.8rem;
    box-shadow: 0 10px 22px rgba(26, 100, 60, 0.14);
}

.topbar-theme .dropdown-item:active,
.topbar-theme .dropdown-item:focus {
    background-color: rgba(44, 159, 95, 0.12);
    color: var(--ink-900);
}

.notification-toggle {
    font-size: 1.05rem;
}

.notification-toggle::after {
    display: none;
}

.notification-badge {
    position: absolute;
    top: 0.15rem;
    right: 0.15rem;
    min-width: 1.05rem;
    height: 1.05rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: #dc3545;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px #fff;
}

.notification-menu {
    width: min(380px, calc(100vw - 1.5rem));
    max-height: 420px;
    overflow-y: auto;
}

.notification-menu-header {
    padding: 0.75rem 1rem 0.5rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--green-700);
}

.notification-read-link {
    font-size: 0.78rem;
    color: #2c9f5f;
    text-decoration: none;
    font-weight: 600;
}

.notification-read-link:hover {
    color: #1a643c;
    text-decoration: underline;
}

.notification-item {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    cursor: pointer;
    white-space: normal;
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(199, 229, 207, 0.7);
}

.notification-item:hover,
.notification-item:focus {
    background-color: #f7fff8;
    color: inherit;
}

.notification-item__title {
    font-weight: 700;
    color: var(--ink-900);
    margin-bottom: 0.2rem;
}

.notification-item__message {
    font-size: 0.9rem;
    color: var(--ink-700);
    line-height: 1.35;
}

.notification-item__time {
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: #6d7d75;
}

.notification-item-empty {
    color: #6d7d75;
    font-style: italic;
}

.notification-item-unread {
    background-color: #f4fbf6;
}

.notification-item-unread .notification-item__title::before {
    content: '';
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: #2c9f5f;
    display: inline-block;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.notification-item-read {
    background-color: #ffffff;
    opacity: 0.84;
}

.notification-item-success {
    border-left: 4px solid #198754;
}

.notification-item-warning {
    border-left: 4px solid #f0a000;
}

.notification-item-danger {
    border-left: 4px solid #dc3545;
}

.notification-item-info {
    border-left: 4px solid #0d6efd;
}

#notificationDetailModal .modal-dialog {
    width: min(460px, calc(100vw - 2rem));
}

#notificationDetailModal .modal-content.notification-detail-card {
    border: 0;
    border-radius: 0.85rem;
    box-shadow: 0 22px 42px rgba(16, 24, 40, 0.28);
    overflow: hidden;
}

#notificationDetailModal .notification-detail-header {
    padding: 1rem 1.1rem;
    background-color: #eef8f1;
    border-bottom: 1px solid #d8ebdf;
}

#notificationDetailModal .notification-detail-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    color: #155a32;
}

#notificationDetailModal .notification-detail-body {
    padding: 1rem 1.1rem 0.95rem;
}

#notificationDetailModal .notification-detail-heading {
    font-size: 1rem;
    font-weight: 700;
    color: #20322a;
    margin-bottom: 0.45rem;
}

#notificationDetailModal .notification-detail-message {
    font-size: 0.95rem;
    color: #304238;
    line-height: 1.45;
    margin-bottom: 0.7rem;
    white-space: pre-wrap;
}

#notificationDetailModal .notification-detail-time {
    color: #6a7b72;
    font-size: 0.82rem;
}

#notificationDetailModal .notification-detail-actions {
    border-top: 0;
    padding: 0 1.1rem 1rem;
    justify-content: flex-end;
}

#notificationDetailModal .notification-detail-close-btn {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #ffffff;
    border-radius: 0.45rem;
    min-width: 108px;
    padding: 0.46rem 1.3rem;
    font-weight: 600;
}

#notificationDetailModal .notification-detail-close-btn:hover {
    background-color: #5a6268;
    border-color: #545b62;
    color: #ffffff;
}

@media (max-width: 767.98px) {
    #notificationDetailModal .modal-dialog {
        width: calc(100vw - 1.2rem);
        margin: 0.6rem auto;
    }
}

#deleteConfirmModal.modal.show {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1rem;
}

/* Ensure modal is hidden when not shown (override any display hacks) */
#deleteConfirmModal.modal:not(.show) {
    display: none !important;
}

#deleteConfirmModal.modal.show .modal-dialog {
    max-width: 600px;
    margin: 0;
}

#deleteConfirmModal .modal-content {
    border-radius: 0.85rem;
}

@media (max-width: 991.98px) {
    .notification-menu {
        width: min(100%, calc(100vw - 1rem));
    }
}

.topbar-theme .navbar-toggler {
    border-color: #a9d4b8;
}

.topbar-theme .navbar-toggler:focus {
    box-shadow: 0 0 0 0.16rem rgba(44, 159, 95, 0.2);
}

.app-footer {
    margin-top: auto;
    border-top: 1px solid var(--card-border);
    color: #5a6d63;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    background-color: rgba(255, 255, 255, 0.55);
}

.auth-footer {
    background-color: transparent;
    border-top-color: transparent;
}

.card {
    border: 1px solid var(--card-border);
    border-radius: 1rem;
}

.card.shadow {
    box-shadow: 0 16px 35px rgba(26, 100, 60, 0.12) !important;
}

.form-label {
    color: var(--ink-700);
    font-weight: 500;
}

.form-control {
    border-color: #b7dcc3;
    border-radius: 0.75rem;
}

.form-control:focus {
    border-color: var(--green-500);
    box-shadow: 0 0 0 0.2rem rgba(44, 159, 95, 0.2);
}

.btn-brand,
.btn-primary {
    background-color: var(--green-500);
    border-color: transparent;
    color: #fff;
    border-radius: 0.375rem;
    font-weight: 600;
}

.btn-brand:hover,
.btn-primary:hover {
    background-color: var(--green-600);
    color: #fff;
}

.btn-secondary {
    background-color: #6daa82;
    border-color: #6daa82;
}

.btn-secondary2 {
    background-color: var(--green-500);
    border-color: transparent;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #7ebc92;
    border-color: #7ebc92;
}

.btn-secondary2:hover {
    background-color: var(--green-600);
    color: #fff;
}

.auth-wrapper {
    min-height: 100vh;
    padding: 1.25rem;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    backdrop-filter: blur(2px);
}

.auth-alert-wrapper {
    max-width: 380px;
    margin-bottom: 0.85rem !important;
}

.field-empty,
.field-empty:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.18) !important;
}

.heading-accent {
    color: var(--green-700);
    font-weight: 800;
}

.muted-link {
    color: var(--green-600);
}

.muted-link:hover {
    color: var(--green-700);
}

.dashboard-shell {
    min-height: 100vh;
    padding: 1rem;
}

.dashboard-card {
    max-width: 760px;
    margin: 0 auto;
}

.dashboard-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dashboard-hero,
.dashboard-panel {
    border-radius: 1rem;
    overflow: hidden;
}

.dashboard-hero {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.05rem 1.15rem;
    position: relative;
    z-index: 1;
    overflow: visible;
    background: #f8fcf9;
}

@media (max-width: 991.98px) {
    .topbar-theme .navbar-collapse {
        margin-top: 0.55rem;
        padding: 0.5rem 0.65rem;
        border: 1px solid var(--card-border);
        border-radius: 0.75rem;
        background-color: #ecf7f0;
        box-shadow: 0 8px 18px rgba(26, 100, 60, 0.08);
    }
}

/* .dashboard-hero__copy {
    flex: 1 1 280px;
} */

.dashboard-title {
    color: var(--ink-900);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.dashboard-hero__text {
    color: var(--ink-700);
}

.dashboard-filter-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 0.75rem;
    align-items: end;
}

.dashboard-filter-form__item {
    min-width: 0;
}

.dashboard-filter-form__item--date {
    min-width: 150px;
}

.dashboard-filter-form__label {
    display: block;
    margin-bottom: 0.22rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ink-700);
}

.dashboard-filter-form__control {
    width: 100%;
    height: 38px;
    min-width: 0;
    border-radius: 0.7rem;
}

.dashboard-filter-form__button {
    width: 100%;
    height: 38px;
}

.dashboard-date-warning {
    position: fixed !important;
    top: 1rem !important;
    right: 1rem !important;
    left: auto !important;
    margin: 0 !important;
    z-index: 2000 !important;
    display: none;
    width: fit-content;
    max-width: min(360px, calc(100vw - 2rem));
}

@media (max-width: 991.98px) {
    .dashboard-date-warning {
        top: 5rem !important;
        left: 0.75rem !important;
        right: 0.75rem !important;
        width: auto;
        max-width: none;
        z-index: 1020 !important;
    }
}

.dashboard-date-warning.show {
    display: flex;
}

.dashboard-date-warning__text {
    flex: 1 1 auto;
}

.dashboard-date-warning__close {
    flex: 0 0 auto;
    box-shadow: none !important;
}

.dashboard-date-warning-border {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 0.15rem rgba(245, 158, 11, 0.18) !important;
}

.dashboard-period-dropdown {
    position: relative;
    width: 100%;
}

.dashboard-period-dropdown .btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-color: #198754;
    color: #198754;
    background-color: #fff;
}

.dashboard-period-dropdown .btn:hover,
.dashboard-period-dropdown .btn:focus,
.dashboard-period-dropdown .btn:active,
.dashboard-period-dropdown .btn.show {
    background-color: #157347;
    border-color: #157347;
    color: #fff;
    box-shadow: none;
}

.dashboard-period-dropdown .dropdown-item {
    color: #198754;
}

.dashboard-period-dropdown .dropdown-item:hover,
.dashboard-period-dropdown .dropdown-item:focus,
.dashboard-period-dropdown .dropdown-item.active {
    background-color: #198754;
    color: #fff;
}

.dashboard-period-dropdown .dropdown-menu {
    width: 100%;
    inset: calc(100% + 0.25rem) 0 auto 0;
    display: none;
    z-index: 1100;
}

.dashboard-period-dropdown.is-open .dropdown-menu {
    display: block;
}

.dashboard-filter-form__button {
    padding-inline: 1rem;
    white-space: nowrap;
}

.dashboard-filter-form__button.btn.btn-primary,
.dashboard-filter-form__button.btn.btn-primary:focus,
.dashboard-filter-form__button.btn.btn-primary:active,
.dashboard-filter-form__button.btn.btn-primary:hover {
    background-color: #198754;
    border-color: #198754;
    color: #ffffff;
}

.dashboard-filter-form__button.btn.btn-primary:disabled,
.dashboard-filter-form__button.btn.btn-primary.disabled {
    background-color: #198754;
    border-color: #198754;
    color: #ffffff;
    opacity: 0.65;
}

.dashboard-grid {
    display: grid;
    gap: 1rem;
}

.dashboard-grid--top {
    grid-template-columns: minmax(0, 2.1fr) minmax(280px, 1fr);
}

.dashboard-panel {
    padding: 1rem 1.05rem 1.1rem;
    background: #ffffff;
}

.dashboard-panel__header {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
}

.dashboard-panel__header--stacked {
    align-items: flex-start;
}

.dashboard-panel__eyebrow {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ink-700);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.15rem;
}

.dashboard-panel__value {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--ink-900);
    line-height: 1.2;
}

.dashboard-panel__value--small {
    font-size: 1rem;
    font-weight: 700;
}

.dashboard-panel__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
    font-size: 0.78rem;
    color: var(--ink-700);
    text-align: right;
}

.dashboard-chart-wrap {
    position: relative;
    width: 100%;
}

.dashboard-chart-wrap--line {
    height: 220px;
    margin-top: 0.45rem;
}

.dashboard-chart-wrap--bar {
    height: 260px;
}

.dashboard-menu-chart-wrap {
    margin-top: 0.35rem;
}

.dashboard-menu-chart-scroll {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
    padding-bottom: 0;
}

@media (max-width: 767.98px) {
    .dashboard-panel__header {
        flex-direction: column;
    }

    .dashboard-panel__meta {
        align-items: flex-start;
        text-align: left;
    }

    .dashboard-menu-chart-scroll {
        overflow-x: hidden;
        overflow-y: hidden;
        padding-bottom: 0;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        touch-action: auto;
    }
}

.dashboard-menu-chart-scroll::-webkit-scrollbar {
    height: 10px;
}

.dashboard-menu-chart-scroll::-webkit-scrollbar-track {
    background: #e8f2ec;
    border-radius: 999px;
    border: 1px solid #d6eadc;
}

.dashboard-menu-chart-scroll::-webkit-scrollbar-thumb {
    background: #4cad74;
    border-radius: 999px;
    border: 2px solid #e9f5ec;
    box-shadow: 0 2px 6px rgba(26, 100, 60, 0.22);
}

.dashboard-menu-chart-scroll::-webkit-scrollbar-thumb:hover {
    background: #2f9259;
}

.dashboard-menu-chart {
    display: block;
    width: max-content;
    min-width: 100%;
    min-height: 300px;
}

@media (max-width: 767.98px) {
    .dashboard-menu-chart {
        min-width: 0;
        width: 100%;
        min-height: 260px;
    }
}

.dashboard-menu-table-wrap {
    margin-top: 0.35rem;
}

.dashboard-menu-table {
    font-size: 0.84rem;
}

.dashboard-menu-table thead th {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-700);
    border-bottom: 1px solid rgba(199, 229, 207, 0.85);
}

.dashboard-menu-table td,
.dashboard-menu-table th {
    border-color: rgba(199, 229, 207, 0.55);
}

.dashboard-menu-table__name {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.dashboard-menu-table__name span {
    font-weight: 600;
    color: var(--ink-900);
}

.dashboard-menu-table__bar {
    height: 0.5rem;
    border-radius: 999px;
    background: #edf1ee;
    overflow: hidden;
}

.dashboard-menu-table__bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--green-500);
}

.dashboard-chart {
    display: block;
    width: 100%;
    height: 100%;
}

.dashboard-rank-table {
    margin-top: 0.55rem;
}

.dashboard-mini-table {
    font-size: 0.83rem;
}

.dashboard-mini-table thead th,
.dashboard-segment-table thead th {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-700);
    border-bottom: 1px solid rgba(199, 229, 207, 0.85);
}

.dashboard-mini-table td,
.dashboard-mini-table th,
.dashboard-segment-table td,
.dashboard-segment-table th {
    border-color: rgba(199, 229, 207, 0.55);
}

.dashboard-mini-table__name {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.dashboard-mini-table__name small {
    color: #6b7a71;
    font-size: 0.76rem;
}

.segment-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
}

.segment-badge-vip {
    background: #e7f6ee;
    color: #166534;
    border-color: #c9ead6;
}

.segment-badge-loyal {
    background: #fff4db;
    color: #8a5a00;
    border-color: #f3dfaf;
}

.segment-badge-potential {
    background: #e8f1ff;
    color: #1d4f91;
    border-color: #cbdcf8;
}

.segment-badge-dormant {
    background: #fdecec;
    color: #9f2f2f;
    border-color: #f7caca;
}

.segment-badge-default {
    background: #e9ecef;
    color: #495057;
    border-color: #d1d6db;
}

.dashboard-segment-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.9fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
}

.dashboard-segment-table-wrap {
    min-width: 0;
}

.dashboard-segment-table {
    font-size: 0.84rem;
}

.dashboard-donut-card {
    display: flex;
    justify-content: center;
    align-items: center;
}

.dashboard-donut-chart {
    width: min(220px, 100%);
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    position: relative;
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.08);
}

.dashboard-donut-chart::before {
    content: "";
    position: absolute;
    inset: 20%;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.dashboard-donut-chart__center {
    position: absolute;
    inset: 20%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
    text-align: center;
    gap: 0.1rem;
}

.dashboard-donut-chart__center span {
    font-size: 1.45rem;
    line-height: 1;
    font-weight: 800;
    color: var(--ink-900);
}

.dashboard-donut-chart__center small {
    color: var(--ink-700);
    font-size: 0.8rem;
    font-weight: 600;
}

.dashboard-segment-legend {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.dashboard-segment-legend__item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.6rem;
    align-items: center;
}

.dashboard-segment-legend__label-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 92px;
}

.dashboard-segment-legend__swatch {
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 0;
    flex: 0 0 auto;
}

.dashboard-segment-legend__label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--ink-700);
}

.dashboard-segment-legend__bar {
    height: 0.42rem;
    border-radius: 999px;
    background: #eceef0;
    overflow: hidden;
}

.dashboard-segment-legend__bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.dashboard-segment-legend__value {
    min-width: 42px;
    text-align: right;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ink-700);
}

.dashboard-segment-link {
    color: inherit;
    text-decoration: none;
}

.dashboard-segment-link:hover {
    color: inherit;
}

.dashboard-segment-link:focus-visible {
    outline: 2px solid #198754;
    outline-offset: 2px;
    border-radius: 0.35rem;
}

.dashboard-segment-link .segment-badge {
    cursor: pointer;
}

.dashboard-scatter-wrap {
    width: 100%;
    min-height: 340px;
}

.dashboard-scatter-svg {
    width: 100%;
    min-height: 340px;
    display: block;
}

.dashboard-scatter-axis-label {
    font-size: 11px;
    fill: #506158;
}

.dashboard-scatter-grid {
    stroke: #e3e8e4;
    stroke-width: 1;
}

.dashboard-scatter-point {
    opacity: 0.95;
    stroke: rgba(255, 255, 255, 0.75);
    stroke-width: 1;
}

.dashboard-scatter-point:hover {
    opacity: 1;
}

.dashboard-scatter-title {
    font-size: 12px;
    font-weight: 700;
    fill: #1f2b24;
}

@media (max-width: 991.98px) {
    .content-wrapper {
        padding: 1.25rem 0.9rem;
    }

    .topbar-theme .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .topbar-links .nav-link,
    .topbar-theme .navbar-nav .dropdown-toggle {
        margin-right: 0;
        margin-bottom: 0.35rem;
        display: inline-block;
    }

    .dashboard-grid--top,
    .dashboard-segment-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-filter-form {
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .dashboard-filter-form__item--action {
        grid-column: 1 / -1;
    }

    .dashboard-panel__meta {
        align-items: flex-start;
        text-align: left;
    }
}

@media (max-width: 767.98px) {
    .dashboard-hero {
        padding: 0.95rem 0.95rem 1rem;
    }

    .dashboard-filter-form {
        grid-template-columns: 1fr;
    }

    .dashboard-filter-form__item--date,
    .dashboard-filter-form__item--action {
        grid-column: auto;
    }

    .dashboard-panel {
        padding: 0.95rem;
    }

    .dashboard-segment-legend__item {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }

    .dashboard-segment-legend__value {
        text-align: left;
    }
}

/* Alert Styling */
.alert {
    border-radius: 0.75rem;
    border: none;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.messages-container {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: fit-content;
    max-width: min(560px, calc(100vw - 2rem));
    z-index: 2000;
    pointer-events: none;
}

.messages-container .alert {
    pointer-events: auto;
    width: 100%;
}

.app-alert-base {
    border-radius: 0;
    color: #3f3f3f;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    padding: 0.8rem 2.25rem 0.8rem 0.95rem;
    font-size: 0.98rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    min-height: 58px;
    position: relative;
}

.app-alert-base .bi {
    font-size: 1rem;
}

.app-alert-base .btn-close {
    position: absolute;
    right: 0.75rem;
    top: 0.62rem;
    padding: 0.35rem;
    opacity: 0.45;
    transform: scale(0.72);
}

.app-alert-base .btn-close:hover {
    opacity: 0.65;
}

.app-alert-info {
    background-color: #ffffff;
    border-left: 4px solid #0d6efd;
}

.app-alert-info .bi {
    color: #0d6efd;
}

.app-alert-success {
    background-color: #ffffff;
    border-left: 4px solid #198754;
}

.app-alert-success .bi {
    color: #198754;
}

.app-alert-warning {
    background-color: #ffffff;
    border-left: 4px solid #f0a000;
}

.app-alert-warning .bi {
    color: #f0a000;
}

.app-alert-danger {
    background-color: #ffffff;
    border-left: 4px solid #dc3545;
}

.app-alert-danger .bi {
    color: #dc3545;
}

.app-alert-secondary {
    background-color: #ffffff;
    border-left: 4px solid #6c757d;
}

.app-alert-secondary .bi {
    color: #6c757d;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-danger .btn-close {
    filter: invert(1);
}

.alert-danger .error-message {
    margin: 0;
}

.alert-danger .error-message p {
    margin: 0;
    font-weight: 500;
}

.app-alert-base .error-message {
    margin: 0;
}

.app-alert-base .error-message p {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 500;
}

.app-alert-base .btn-close {
    position: absolute;
    right: 0.75rem;
    top: 0.62rem;
    padding: 0.35rem;
    opacity: 0.45;
    transform: scale(0.72);
}

.app-alert-base .btn-close:hover {
    opacity: 0.65;
}

.mini-note {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.78rem;
    color: #334155;
    background-color: #f1f7f3;
    border: 1px solid #d7eadd;
    border-radius: 0.65rem;
    padding: 0.5rem 0.65rem;
}