
:root {
    --dh-body-bg: #eef3f8;
    --dh-surface-bg: #ffffff;
    --dh-surface-alt: #f7f9fc;
    --dh-border-color: #dbe3ef;
    --dh-border-strong: #cbd5e1;
    --dh-text-color: #223047;
    --dh-text-muted: #66758c;
    --dh-brand-dark: #252d3a;
    --dh-brand-dark-alt: #2d3645;
    --dh-brand-dark-hover: #333d4d;
    --dh-sidebar-width: 280px;
    --dh-sidebar-collapsed-width: 72px;
    --dh-topbar-height: 60px;
    --dh-primary: #2f7df6;
    --dh-primary-hover: #1967de;
    --dh-danger: #ef5350;
    --dh-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
}

html,
body {
    height: 100%;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--dh-text-color);
    background-color: var(--dh-body-bg);
}

a {
    color: #3d7ef0;
    text-decoration: none;
}

a:hover {
    color: #2f68cc;
}

.no-transitions *,
.no-transitions *::before,
.no-transitions *::after {
    transition: none !important;
}

.navbar.navbar-dark.navbar-static {
    min-height: var(--dh-topbar-height);
    padding: 0;
    background: var(--dh-brand-dark);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: none;
}

.navbar.navbar-dark.navbar-static .container-fluid {
    min-height: var(--dh-topbar-height);
    padding-right: 1rem;
    padding-left: 1rem;
}

.navbar-brand {
    margin-right: 2rem;
    padding-top: 0;
    padding-bottom: 0;
}

.navbar-brand a {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.navbar-brand img {
    height: 36px;
    width: auto;
}

.link-white {
    color: #ffffff;
}

.navbar-nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.navbar-nav-link:hover,
.navbar-nav-link:focus {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
}

.navbar-toggler {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    min-height: 2.25rem;
    padding: 0.375rem;
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 0.375rem;
    box-shadow: none;
}

.navbar-toggler:hover,
.navbar-toggler:focus {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.34);
    box-shadow: 0 0 0 0.15rem rgba(255, 255, 255, 0.08);
}

.navbar-toggler i {
    font-size: 0.95rem;
}

.navbar-environment-badge {
    display: inline-flex;
    align-items: center;
}

@media (min-width: 992px) {
    .navbar-environment-badge {
        margin-left: 8rem !important;
        font-size: 1.5rem;
    }
}

.page-content {
    display: flex;
    min-height: calc(100vh - var(--dh-topbar-height));
    background: var(--dh-body-bg);
}

.sidebar {
    position: relative;
    width: var(--dh-sidebar-width);
    min-width: var(--dh-sidebar-width);
    color: rgba(255, 255, 255, 0.9);
    background: var(--dh-brand-dark);
    transition: width 0.2s ease, min-width 0.2s ease, transform 0.2s ease;
    z-index: 1030;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: calc(100vh - var(--dh-topbar-height));
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-section:last-child {
    border-bottom: 0;
}

.sidebar-section-body {
    min-height: 58px;
    padding: 0.875rem 0.75rem;
    color: #ffffff;
}

.sidebar-section-body h5 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar-control,
.sidebar-mobile-main-toggle,
.sidebar-main-toggle {
    color: rgba(255, 255, 255, 0.9);
}

.sidebar-control:hover,
.sidebar-mobile-main-toggle:hover,
.sidebar-main-toggle:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
}

.nav-sidebar {
    padding: 0.5rem 0;
}

.nav-sidebar > .nav-item,
.nav-sidebar > .nav-item-header {
    width: 100%;
}

.nav-sidebar .nav-item-header {
    display: block;
    padding: 0.75rem 0.75rem 0.35rem;
    color: rgba(255, 255, 255, 0.98);
    font-size: 0.8125rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.nav-sidebar .nav-item-header > div {
    margin: 0;
}

.nav-sidebar .sidebar-resize-show {
    display: none;
}

.nav-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 40px;
    padding: 0.625rem 1rem;
    color: rgba(255, 255, 255, 0.88);
    font-size: 1rem;
    font-weight: 500;
    border-radius: 0;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-sidebar .nav-link:hover,
.nav-sidebar .nav-link:focus {
    color: #ffffff;
    background-color: var(--dh-brand-dark-hover);
}

.nav-sidebar .nav-link i {
    width: 1rem;
    text-align: center;
    font-size: 0.875rem;
    flex: 0 0 auto;
}

.nav-sidebar .nav-link span {
    flex: 1 1 auto;
}

.chosen-container {
    width: 100% !important;
    font-size: 1rem;
}

.chosen-container .chosen-drop {
    border: 1px solid var(--dh-border-strong);
    border-top: 0;
    border-radius: 0 0 0.375rem 0.375rem;
    box-shadow: var(--dh-shadow-sm);
}

.chosen-container-single .chosen-single {
    display: flex;
    align-items: center;
    min-height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 2.5rem 0.375rem 0.75rem;
    color: var(--dh-text-color);
    background: #fff;
    border: 1px solid var(--dh-border-strong);
    border-radius: 0.375rem;
    box-shadow: none;
    line-height: 1.5;
}

.chosen-container-single .chosen-single span {
    margin-right: 0;
}

.chosen-container-single .chosen-single div {
    width: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chosen-container-single .chosen-single div b {
    display: none;
}

.chosen-container-single .chosen-single div::after {
    content: "";
    width: 0;
    height: 0;
    border-left: 0.3rem solid transparent;
    border-right: 0.3rem solid transparent;
    border-top: 0.35rem solid #6c757d;
}

.chosen-container-active.chosen-with-drop .chosen-single {
    border-color: #86b7fe;
    border-radius: 0.375rem 0.375rem 0 0;
}

.chosen-container-active .chosen-single,
.chosen-container-active .chosen-choices {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.chosen-container .chosen-results {
    margin: 0;
    padding: 0.25rem 0;
    color: var(--dh-text-color);
}

.chosen-container .chosen-results li {
    padding: 0.375rem 0.75rem;
    line-height: 1.5;
}

.chosen-container .chosen-results li.highlighted {
    background: var(--dh-primary);
    color: #fff;
}

.chosen-container-single .chosen-search {
    padding: 0.5rem;
}

.chosen-container-single .chosen-search input[type="text"] {
    height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--dh-border-strong);
    border-radius: 0.375rem;
    background-image: none !important;
}

.nav-sidebar .nav-item-submenu > .nav-link::after {
    content: "\203A";
    margin-left: auto;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.7;
    transform: rotate(0deg);
    transition: transform 0.15s ease;
}

.nav-sidebar .nav-item-open > .nav-link::after {
    transform: rotate(90deg);
}

.nav-sidebar .nav-item-open > .nav-link,
.nav-sidebar .nav-item-expanded > .nav-link {
    background-color: #4b5563;
    color: #ffffff;
}

.nav-group-sub {
    margin: 0;
    padding: 0;
    list-style: none;
    background-color: rgba(255, 255, 255, 0.04);
}

.nav-group-sub .nav-link {
    min-height: 38px;
    gap: 0.625rem;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    padding-left: 2.2rem;
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.86);
}

.nav-group-sub .nav-link i {
    width: 0.95rem;
    font-size: 0.75rem;
    opacity: 0.9;
}

.nav-group-sub .nav-link.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.16);
    box-shadow: inset 3px 0 0 #9fb4cf;
}

.nav-item-divider {
    margin: 0.35rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-main.sidebar-main-resized,
.sidebar-main.sidebar-collapsed {
    width: var(--dh-sidebar-collapsed-width);
    min-width: var(--dh-sidebar-collapsed-width);
}

.sidebar-main.sidebar-main-resized:not(.sidebar-main-unfold) .sidebar-resize-hide,
.sidebar-main.sidebar-collapsed:not(.sidebar-main-unfold) .sidebar-resize-hide,
.sidebar-main.sidebar-main-resized:not(.sidebar-main-unfold) .nav-link span,
.sidebar-main.sidebar-collapsed:not(.sidebar-main-unfold) .nav-link span,
.sidebar-main.sidebar-main-resized:not(.sidebar-main-unfold) .nav-item-submenu > .nav-link::after,
.sidebar-main.sidebar-collapsed:not(.sidebar-main-unfold) .nav-item-submenu > .nav-link::after,
.sidebar-main.sidebar-main-resized:not(.sidebar-main-unfold) .nav-group-sub,
.sidebar-main.sidebar-collapsed:not(.sidebar-main-unfold) .nav-group-sub {
    display: none !important;
}

.sidebar-main.sidebar-main-resized:not(.sidebar-main-unfold) .sidebar-section-body,
.sidebar-main.sidebar-collapsed:not(.sidebar-main-unfold) .sidebar-section-body,
.sidebar-main.sidebar-main-resized:not(.sidebar-main-unfold) .nav-sidebar .nav-link,
.sidebar-main.sidebar-collapsed:not(.sidebar-main-unfold) .nav-sidebar .nav-link {
    justify-content: center;
}

.sidebar-main.sidebar-main-resized:not(.sidebar-main-unfold) .nav-sidebar .sidebar-resize-show,
.sidebar-main.sidebar-collapsed:not(.sidebar-main-unfold) .nav-sidebar .sidebar-resize-show {
    display: block;
    text-align: center;
    color: rgba(255, 255, 255, 0.45);
}

.sidebar-main.sidebar-main-resized.sidebar-main-unfold,
.sidebar-main.sidebar-collapsed.sidebar-main-unfold {
    width: var(--dh-sidebar-width);
    min-width: var(--dh-sidebar-width);
    box-shadow: 12px 0 24px rgba(15, 23, 42, 0.16);
}

.content-wrapper {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    background: var(--dh-body-bg);
}

.content-inner {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    min-height: calc(100vh - var(--dh-topbar-height));
    overflow: visible;
}

#webAlertContainer {
    position: sticky;
    top: 0;
    z-index: 1040;
}

.page-header {
    margin: 0;
    background: var(--dh-surface-bg);
    border-bottom: 1px solid var(--dh-border-color);
    box-shadow: none !important;
}

.page-header-light {
    background: var(--dh-surface-bg);
}

.page-header-content {
    padding: 0.9rem 1rem;
}

.page-header .page-title {
    margin: 0;
    color: var(--dh-text-color);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.page-header .page-title .fw-normal {
    font-weight: 500 !important;
}

.page-header .text-danger {
    color: var(--dh-danger) !important;
}

.page-header .breadcrumb {
    margin-bottom: 0;
    background: transparent;
    font-size: 0.9375rem;
}

.page-header .breadcrumb-item,
.page-header .breadcrumb-item a {
    color: #5f8ddf;
}

.page-header .breadcrumb-item.active {
    color: var(--dh-text-muted);
}

.page-header .border-top {
    border-top: 1px solid var(--dh-border-color) !important;
}

.content {
    flex: 1 1 auto;
    padding: 0.9rem;
}

.card {
    border: 1px solid var(--dh-border-color);
    border-radius: 0.375rem;
    box-shadow: var(--dh-shadow-sm);
}

.card-header {
    padding: 0.75rem 1rem;
    background: var(--dh-surface-bg);
    border-bottom: 1px solid var(--dh-border-color);
}

.card-header h5,
.card-header .h5 {
    margin: 0;
    font-size: 1.20rem;
    font-weight: 700;
    color: var(--dh-text-color);
}

.card-body {
    padding: 1rem 1.25rem 1.25rem;
}

.form-control,
.form-select {
    min-height: 36px;
    border-color: var(--dh-border-strong);
    font-size: 0.9375rem;
    color: var(--dh-text-color);
    box-shadow: none;
}

.form-control:focus,
.form-select:focus {
    border-color: #8db4ff;
    box-shadow: 0 0 0 0.15rem rgba(47, 125, 246, 0.12);
}

.col-form-label {
    color: var(--dh-text-color);
    font-size: 0.9375rem;
    font-weight: 500;
}

.btn {
    font-size: 0.9375rem;
    font-weight: 500;
}

.btn-primary {
    color: #ffffff;
    background-color: var(--dh-primary);
    border-color: var(--dh-primary);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    color: #ffffff;
    background-color: var(--dh-primary-hover);
    border-color: var(--dh-primary-hover);
}

.btn-light {
    color: #41536d;
    background-color: #f8fafc;
    border-color: var(--dh-border-color);
}

.btn-light:hover,
.btn-light:focus,
.btn-light:active {
    color: #2f3e52;
    background-color: #eef3f8;
    border-color: var(--dh-border-strong);
}

.text-danger,
.validation-summary-errors,
.field-validation-error {
    color: var(--dh-danger) !important;
}

.navbar-footer {
    margin-top: auto;
    min-height: 34px;
    padding: 0;
    color: var(--dh-text-muted);
    background: rgba(255, 255, 255, 0.45);
    border-top: 1px solid var(--dh-border-color) !important;
}

.navbar-footer .container-fluid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.9rem;
    font-size: 0.875rem;
}

.pull-left,
.pull-right {
    float: none;
}

.btn-to-top {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.btn-to-top-visible {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 991.98px) {
    body {
        overflow: auto;
    }

    .page-content {
        min-height: auto;
    }

    .sidebar {
        position: fixed;
        top: var(--dh-topbar-height);
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
    }

    .sidebar.sidebar-mobile-expanded {
        transform: translateX(0);
    }

    .sidebar.sidebar-mobile-expanded + .content-wrapper::before {
        content: "";
        position: fixed;
        inset: var(--dh-topbar-height) 0 0 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 1020;
    }

    .content-inner {
        min-height: auto;
    }

    .page-header-content,
    .content {
        padding-right: 0.75rem;
        padding-left: 0.75rem;
    }

    .navbar-footer .container-fluid {
        gap: 0.75rem;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
    }

    .navbar-footer .pull-left,
    .navbar-footer .pull-right {
        white-space: nowrap;
    }

    .navbar-footer .pull-right {
        margin-left: auto;
        text-align: right;
    }
}
