/* Shared visual language from Documentation. Loaded after vendor styles. */
:root {
    --app-primary: #4656d7;
    --app-primary-hover: #3544bd;
    --app-primary-soft: #eef0ff;
    --app-ink: #172033;
    --app-muted: #667085;
    --app-border: #e7eaf0;
    --app-surface: #fff;
    --app-canvas: #f5f6fb;
    --app-shadow: 0 4px 18px rgba(23, 32, 51, .045);
    --sidebar-bg: #16213e;
    --sidebar-bg-deep: #101a34;
    --sidebar-text: #c8d2e5;
    --sidebar-text-muted: #8391ad;
    --sidebar-active: #fff;
    --sidebar-accent: #2fc477;
    --sidebar-hover: rgba(255, 255, 255, .075);
    --sidebar-border: rgba(255, 255, 255, .09);
}

html[data-bs-theme="dark"] {
    --app-primary: #a6b0ff;
    --app-primary-hover: #c1c8ff;
    --app-primary-soft: #303755;
    --app-ink: #f1f3f8;
    --app-muted: #aeb5c3;
    --app-border: #353d50;
    --app-surface: #242b3a;
    --app-canvas: #1a202e;
    --app-shadow: 0 4px 18px rgba(0, 0, 0, .12);
    --sidebar-bg: #10182d;
    --sidebar-bg-deep: #0c1428;
    --sidebar-text: #d3dbea;
    --sidebar-text-muted: #8390a9;
    --sidebar-hover: rgba(255, 255, 255, .08);
    --sidebar-border: rgba(255, 255, 255, .08);
}

html body {
    --bs-primary: #4656d7;
    --bs-primary-rgb: 70, 86, 215;
    --bs-link-color: var(--app-primary);
    --bs-link-hover-color: var(--app-primary-hover);
    --bs-body-color: var(--app-ink);
    --bs-body-bg: var(--app-canvas);
    --bs-border-color: var(--app-border);
    color: var(--app-ink);
    background: var(--app-canvas);
    letter-spacing: 0;
}
a { color: var(--app-primary); }
a:hover { color: var(--app-primary-hover); }

/* Sidebar: fixed brand color with a deeper variation in dark mode. */
html[data-bs-theme] body .sidebar-wrapper,
html[data-bs-theme] body .sidebar-wrapper .sidebar-header {
    color: var(--sidebar-text);
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-deep) 100%);
    border-right: 1px solid var(--sidebar-border);
    box-shadow: none;
}

html[data-bs-theme] body .sidebar-wrapper {
    box-shadow: 8px 0 30px rgba(8, 16, 35, .12);
}

html[data-bs-theme] body .sidebar-wrapper .sidebar-header {
    height: 76px;
    padding: 0 13px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-wrapper .sidebar-brand-mark {
    display: flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(4, 10, 25, .22);
}

html[data-bs-theme] body .sidebar-wrapper .sidebar-header .logo-icon {
    width: 39px;
    height: 30px;
    object-fit: contain;
}

.sidebar-wrapper .sidebar-brand-copy {
    min-width: 0;
    margin-left: 10px;
    line-height: 1.1;
}

html[data-bs-theme] body .sidebar-wrapper .sidebar-header .logo-text {
    margin: 0;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.35px;
}

.sidebar-wrapper .sidebar-brand-caption {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    color: var(--sidebar-text-muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .16em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

html[data-bs-theme] body .sidebar-wrapper .sidebar-header .mobile-toggle-icon {
    padding: 0;
    border: 0;
    color: var(--sidebar-text);
    background: rgba(255, 255, 255, .07);
}

html[data-bs-theme] body .sidebar-wrapper .sidebar-header .mobile-toggle-icon:hover,
html[data-bs-theme] body .sidebar-wrapper .sidebar-header .mobile-toggle-icon:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, .14);
}

.sidebar-wrapper .metismenu {
    margin-top: 76px;
    padding: 14px 10px 28px;
}

.sidebar-wrapper .metismenu li + li { margin-top: 4px; }

html[data-bs-theme] body .sidebar-wrapper .metismenu a {
    min-height: 44px;
    padding: 10px 11px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--sidebar-text);
    font-size: 13px;
    letter-spacing: 0;
    transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease;
}

.sidebar-wrapper .metismenu a .parent-icon {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    border-radius: 9px;
    color: #aebbd3;
    background: rgba(255, 255, 255, .055);
    text-align: center;
    font-size: 16px;
}

.sidebar-wrapper .metismenu a .menu-title { margin-left: 9px; }

html[data-bs-theme] body .sidebar-wrapper .metismenu ul {
    margin: 4px 4px 7px 16px;
    padding: 5px 0 5px 10px;
    border-left: 1px solid rgba(255, 255, 255, .11);
    border-radius: 0 10px 10px 0;
    background: rgba(4, 11, 27, .18);
}

html[data-bs-theme] body .sidebar-wrapper .metismenu ul a {
    min-height: 37px;
    padding: 8px 10px;
    border-radius: 9px;
    color: var(--sidebar-text-muted);
    font-size: 12px;
}

.sidebar-wrapper .metismenu ul a i {
    margin-right: 8px;
    color: #71809d;
    font-size: 13px;
}

html[data-bs-theme] body .sidebar-wrapper .metismenu .mm-active > a,
html[data-bs-theme] body .sidebar-wrapper .metismenu a:hover,
html[data-bs-theme] body .sidebar-wrapper .metismenu a:focus-visible {
    color: var(--sidebar-active);
    border-color: rgba(255, 255, 255, .08);
    background: var(--sidebar-hover);
    transform: translateX(2px);
}

html[data-bs-theme] body .sidebar-wrapper .metismenu > .mm-active > a {
    color: #fff;
    border-color: rgba(91, 111, 239, .32);
    background: linear-gradient(90deg, rgba(70, 86, 215, .42), rgba(70, 86, 215, .18));
    box-shadow: inset 3px 0 0 var(--sidebar-accent);
}

html[data-bs-theme] body .sidebar-wrapper .metismenu .mm-active > a .parent-icon,
html[data-bs-theme] body .sidebar-wrapper .metismenu > li > a:hover .parent-icon,
html[data-bs-theme] body .sidebar-wrapper .metismenu > li > a:focus-visible .parent-icon {
    color: #fff;
    background: rgba(255, 255, 255, .11);
}

html[data-bs-theme] body .sidebar-wrapper .metismenu ul .mm-active > a {
    color: #fff;
    border-color: transparent;
    background: rgba(255, 255, 255, .07);
    transform: none;
}

.sidebar-wrapper .metismenu .has-arrow::after {
    width: 7px;
    height: 7px;
    border-color: var(--sidebar-text-muted);
}

.sidebar-wrapper .metismenu .mm-active > .has-arrow::after { border-color: #fff; }
.sidebar-wrapper .simplebar-scrollbar::before { background: rgba(255, 255, 255, .28); }
.sidebar-wrapper .simplebar-track.simplebar-vertical { width: 7px; }

.wrapper.toggled:not(.sidebar-hovered) .sidebar-wrapper .sidebar-brand-copy {
    display: none;
}

.wrapper.toggled:not(.sidebar-hovered) .sidebar-wrapper .sidebar-brand-mark {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
}

.wrapper.toggled:not(.sidebar-hovered) .sidebar-wrapper .metismenu > li > a {
    padding-right: 8px;
    padding-left: 8px;
}

.wrapper.toggled:not(.sidebar-hovered) .sidebar-wrapper .metismenu a:hover,
.wrapper.toggled:not(.sidebar-hovered) .sidebar-wrapper .metismenu a:focus-visible {
    transform: none;
}
.sidebar-wrapper .metismenu .mm-active > a { font-weight: 600; }

html[data-bs-theme] body .topbar {
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-border);
    box-shadow: none;
}
.topbar .user-box { border-color: var(--app-border); }
.topbar .user-box .user-name { color: var(--app-ink); font-weight: 600; }
.topbar .user-box .designattion { color: var(--app-muted); }

/* Notification center */
.topbar .notification-toggle {
    display: grid;
    width: 42px;
    height: 42px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 12px;
    color: var(--app-muted);
    background: transparent;
    font-size: 22px;
}

.topbar .notification-toggle:hover,
.topbar .notification-toggle:focus-visible,
.topbar .notification-toggle[aria-expanded="true"] {
    color: var(--app-primary);
    background: var(--app-primary-soft);
}

.topbar .notification-count {
    top: -2px;
    right: -3px;
    display: grid;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    place-items: center;
    border: 2px solid var(--app-surface);
    border-radius: 10px;
    color: #fff;
    background: #e33b4e;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
}

.topbar .notification-count[hidden] { display: none; }

.notification-menu {
    width: min(390px, calc(100vw - 24px));
    padding: 0;
    overflow: hidden;
}

.notification-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 17px 18px 13px;
    border-bottom: 1px solid var(--app-border);
}

.notification-menu-header .msg-header-title {
    color: var(--app-ink);
    font-size: 15px;
    font-weight: 700;
}

.notification-menu-header small {
    display: block;
    margin-top: 3px;
    color: var(--app-muted);
    font-size: 11px;
}

.notification-menu-header .btn-link,
.notification-menu-footer .btn-link {
    padding: 4px 6px;
    color: var(--app-primary);
    font-size: 11px;
    text-decoration: none;
}

.notification-permission {
    display: grid;
    grid-template-columns: 35px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin: 12px;
    padding: 11px;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: var(--app-canvas);
}

.notification-permission.is-enabled { border-color: rgba(32, 168, 102, .24); background: rgba(32, 168, 102, .08); }

.notification-permission__icon {
    display: grid;
    width: 35px;
    height: 35px;
    place-items: center;
    border-radius: 10px;
    color: var(--app-primary);
    background: var(--app-primary-soft);
    font-size: 19px;
}

.notification-permission.is-enabled .notification-permission__icon { color: #168554; background: rgba(32, 168, 102, .13); }
.notification-permission__copy { min-width: 0; }
.notification-permission__copy strong { display: block; color: var(--app-ink); font-size: 11px; }
.notification-permission__copy span { display: block; margin-top: 2px; color: var(--app-muted); font-size: 9px; line-height: 1.35; }
.notification-permission .btn { padding: 6px 10px; font-size: 10px; }
.notification-permission .btn[hidden] { display: none; }

.header-notifications-list {
    position: relative;
    max-height: 330px;
    overflow-x: hidden;
    overflow-y: auto;
}

.notification-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 11px;
    padding: 13px 17px;
    border-bottom: 1px solid var(--app-border);
    color: var(--app-ink);
    white-space: normal;
}

.notification-item:hover,
.notification-item:focus-visible { color: var(--app-ink); background: var(--app-canvas); }
.notification-item.is-unread { background: rgba(70, 86, 215, .055); }

.notification-item__icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    color: var(--app-primary);
    background: var(--app-primary-soft);
    font-size: 20px;
}

.notification-item__content,
.notification-item__top,
.notification-item__message,
.notification-item__status { display: block; }

.notification-item__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.notification-item__top strong { color: var(--app-ink); font-size: 12px; font-weight: 700; }
.notification-item__top time { flex: 0 0 auto; color: var(--app-muted); font-size: 9px; }
.notification-item__message { margin-top: 4px; color: var(--app-muted); font-size: 10px; line-height: 1.45; }
.notification-item__status { margin-top: 7px; color: var(--app-primary); font-size: 9px; font-weight: 700; text-transform: uppercase; }

.notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 36px 20px;
    color: var(--app-muted);
    text-align: center;
}

.notification-empty i { margin-bottom: 9px; color: var(--app-primary); font-size: 30px; }
.notification-empty strong { color: var(--app-ink); font-size: 12px; }
.notification-empty span { margin-top: 4px; font-size: 10px; }

.notification-menu-footer {
    padding: 8px 12px;
    border-top: 1px solid var(--app-border);
    text-align: center;
}

@media (max-width: 575.98px) {
    .app-notifications .notification-menu {
        position: fixed !important;
        top: 64px !important;
        right: 10px !important;
        left: 10px !important;
        width: auto;
        transform: none !important;
    }

    .header-notifications-list { max-height: min(390px, calc(100vh - 260px)); }
}

.page-wrapper .page-content { padding: 28px; }
.page-breadcrumb { color: var(--app-muted); font-size: 13px; }
.page-breadcrumb .breadcrumb-title { color: var(--app-ink); font-size: 17px; font-weight: 600; }

.page-content .card,
.modal-content,
.dropdown-menu {
    border: 1px solid var(--app-border);
    border-radius: 17px;
    background-color: var(--app-surface);
    box-shadow: var(--app-shadow);
}
.page-content .card { margin-bottom: 22px; }
.page-content .card > .card-body { padding: 24px; }
.page-content .card-header {
    padding: 18px 24px;
    background: transparent;
    border-bottom-color: var(--app-border);
}
.page-content .card h2,
.page-content .card h3,
.page-content .card h4,
.page-content .card h5 { color: var(--app-ink); }
.modal-header { padding: 20px 24px; border-bottom-color: var(--app-border); }
.modal-header.headerRegister,
.modal-header.headerUpdate { background: #4656d7; color: #fff; }
.modal-header:is(.headerRegister, .headerUpdate) .modal-title { color: #fff; }
.modal-header:is(.headerRegister, .headerUpdate) .btn-close { filter: invert(1); }
.modal-body { padding: 24px; }
.modal-footer { border-top-color: var(--app-border); }

.btn { border-radius: 10px; font-weight: 600; }
.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #4656d7;
    --bs-btn-border-color: #4656d7;
    --bs-btn-hover-bg: #3544bd;
    --bs-btn-hover-border-color: #3544bd;
    --bs-btn-active-bg: #3544bd;
    --bs-btn-active-border-color: #3544bd;
    --bs-btn-focus-shadow-rgb: 70, 86, 215;
    color: #fff;
    background-color: #4656d7;
    border-color: #4656d7;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:focus-visible,
.btn-primary:active,
.btn-primary.active,
.btn-check:checked + .btn-primary,
.btn-check:active + .btn-primary,
.btn-check:focus + .btn-primary,
.show > .btn-primary.dropdown-toggle { color: #fff; background-color: #3544bd; border-color: #3544bd; }
.btn-primary.disabled,
.btn-primary:disabled { background-color: #4656d7; border-color: #4656d7; }
.btn-outline-primary { color: var(--app-primary); border-color: var(--app-primary); --bs-btn-color: var(--app-primary); --bs-btn-border-color: var(--app-primary); --bs-btn-hover-bg: #4656d7; --bs-btn-hover-border-color: #4656d7; --bs-btn-active-bg: #3544bd; --bs-btn-active-border-color: #3544bd; }
.btn-outline-primary:hover,
.btn-outline-primary:active,
.btn-outline-primary.active,
.btn-outline-primary.dropdown-toggle.show,
.btn-check:checked + .btn-outline-primary,
.btn-check:active + .btn-outline-primary { color: #fff; background-color: #4656d7; border-color: #4656d7; }
.btn-outline-primary.disabled,
.btn-outline-primary:disabled { color: var(--app-primary); background-color: transparent; }
.form-control,
.form-select {
    border-radius: 10px;
    border-color: var(--app-border);
    color: var(--app-ink);
    background-color: var(--app-surface);
}
.form-control:focus,
.form-select:focus { border-color: #8b96eb; box-shadow: 0 0 0 3px rgba(70, 86, 215, .14); }
.form-label { color: var(--app-ink); font-size: 13px; font-weight: 500; }
.form-check-input:checked { background-color: #4656d7; border-color: #4656d7; }
.nav-pills .nav-link.active { background-color: #4656d7; }
.page-link { color: var(--app-primary); border-color: var(--app-border); background: var(--app-surface); }
.active > .page-link,
.page-link.active { background-color: #4656d7; border-color: #4656d7; color: #fff; }

.page-content .table {
    --bs-table-color: var(--app-ink);
    --bs-table-bg: var(--app-surface);
    --bs-table-striped-bg: var(--app-canvas);
    --bs-table-striped-color: var(--app-ink);
    --bs-table-hover-bg: var(--app-primary-soft);
    --bs-table-hover-color: var(--app-ink);
    border-color: var(--app-border);
}
.page-content .table > thead { --bs-table-bg: var(--app-canvas); --bs-table-color: var(--app-muted); }
.page-content .table > thead > tr > th { padding: 14px 12px; font-size: 12px; font-weight: 600; }
.page-content .table > tbody > tr > td { padding: 12px; font-size: 13px; }
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background-image: none !important;
    background-color: var(--app-primary-soft) !important;
    border-color: var(--app-border) !important;
}
.btn-element { border-radius: 9px; background: var(--app-primary-soft); color: var(--app-primary); border-color: var(--app-border); }

:where(a, button, input, select, textarea):focus-visible { outline: 2px solid var(--app-primary); outline-offset: 3px; }

/* Dashboard uses existing values and AJAX target IDs. */
.dashboard-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 180px;
    margin-bottom: 24px;
    padding: 32px;
    border-radius: 24px;
    color: #fff;
    background: linear-gradient(125deg, #283593 0%, #4b5dd8 55%, #6f7fe9 100%);
    box-shadow: 0 12px 30px rgba(50, 64, 180, .16);
}
.dashboard-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .13;
    background-image: radial-gradient(circle at 1px 1px, #fff 1px, transparent 0);
    background-size: 25px 25px;
    pointer-events: none;
}
.dashboard-hero::after {
    content: "";
    position: absolute;
    right: 20%;
    top: -130px;
    width: 250px;
    height: 250px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 50%;
    pointer-events: none;
}
.dashboard-hero > * { position: relative; z-index: 1; }
.dashboard-eyebrow { display: block; margin-bottom: 10px; color: #e9ebff; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.dashboard-hero h1 { margin: 0 0 10px; color: #fff; font-size: clamp(28px, 3vw, 42px); font-weight: 800; letter-spacing: -.04em; }
.dashboard-hero p { margin: 0; color: #e9ebff; font-size: 15px; line-height: 1.6; }
.dashboard-hero__action { flex-shrink: 0; padding: 13px 18px; background: #fff; color: #3544bd; border: 1px solid #fff; }
.dashboard-hero__action:hover,
.dashboard-hero__action:focus-visible { background: #eef0ff; color: #283593; border-color: #fff; }
.dashboard-hero__action i { margin-right: 8px; }
.dashboard-filters .form-control,
.dashboard-filters .btn { min-height: 44px; }
.dashboard-metrics > [class*="col-"] { display: flex; }
.dashboard-metrics .card { width: 100%; }
.dashboard-metric-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.dashboard-metric-heading h2 { margin: 0; font-size: 16px; font-weight: 700; }
.dashboard-metric-icon { width: 52px; height: 52px; flex: 0 0 52px; display: grid; place-items: center; border-radius: 15px; font-size: 23px; }
.dashboard-metric-icon--violet { color: #6850b5; background: #f2edff; }
.dashboard-metric-icon--green { color: #168465; background: #e5f7f1; }
.dashboard-metric-icon--orange { color: #bc6410; background: #fff2df; }
.dashboard-metrics h5 { font-size: clamp(18px, 1.8vw, 28px); font-weight: 700; letter-spacing: -.03em; overflow-wrap: anywhere; }
.dashboard-metrics small { display: block; margin-top: 6px; color: var(--app-muted); }
.dashboard-metrics .row > .col + .col { border-left: 1px solid var(--app-border); }
.dashboard-page canvas { margin: 18px auto 0; }

@media (max-width: 767.98px) {
    .page-wrapper .page-content { padding: 16px; }
    .page-content .card > .card-body { padding: 18px; }
    .dashboard-hero { flex-direction: column; align-items: flex-start; padding: 26px 22px; border-radius: 18px; }
    .dashboard-hero__action { width: 100%; text-align: center; }
    .dashboard-metrics h5 { font-size: 25px; }
    .modal-body { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar-wrapper,
    .sidebar-wrapper .metismenu a,
    .page-content .btn { transition: none; }
}
