/* Domach Technologies – Modern LAN / Networking Portal Theme */

:root {
    --domach-primary: #0d4a8f;
    --domach-primary-dark: #083366;
    --domach-primary-light: #1a6fd4;
    --domach-accent: #00b4d8;
    --domach-accent-soft: #e8f6fc;
    --domach-surface: #f4f7fb;
    --domach-card: #ffffff;
    --domach-text: #1e293b;
    --domach-text-muted: #64748b;
    --domach-border: #e2e8f0;
    --domach-shadow: 0 4px 24px rgba(13, 74, 143, 0.08);
    --domach-shadow-lg: 0 12px 40px rgba(13, 74, 143, 0.15);
    --domach-radius: 12px;
    --domach-header-height: 64px;
    --domach-font: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Global ─────────────────────────────────────────────── */
body.layoutCSS {
    font-family: var(--domach-font) !important;
    color: var(--domach-text);
    background-color: var(--domach-surface) !important;
}

.page-content {
    background: linear-gradient(180deg, #eef3f9 0%, var(--domach-surface) 120px) !important;
}

/* ── Top Header / Navigation ───────────────────────────── */
.domach-topbar {
    background: linear-gradient(135deg, var(--domach-primary-dark) 0%, var(--domach-primary) 55%, var(--domach-primary-light) 100%) !important;
    box-shadow: var(--domach-shadow-lg);
    border: none !important;
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    overflow: visible !important;
}

.domach-topbar + .main-content .page-content {
    padding-top: calc(var(--domach-header-offset, 70px) + 16px) !important;
    padding-bottom: var(--domach-footer-offset, 48px) !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
}

.domach-header-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding: 0.5rem 1.25rem;
    min-height: var(--domach-header-height);
}

.domach-header-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding-left: 1.25rem;
    padding-right: 0.5rem;
}

.domach-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none !important;
    padding: 0.35rem 0.5rem 0.35rem 0;
    border-radius: 10px;
    transition: background 0.2s ease;
}

.domach-logo:hover {
    background: rgba(255, 255, 255, 0.08);
}

.domach-logo img {
    height: 42px;
    width: 42px;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
    padding: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.domach-logo-text {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.domach-header-center {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 0.3rem 0.35rem 0.3rem 0.85rem;
    backdrop-filter: blur(4px);
}

.domach-company-label {
    color: #fff !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

.domach-change-company-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 34px;
    height: 34px;
    padding: 0 0.65rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #00b4d8 0%, #1a6fd4 100%);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff !important;
    text-decoration: none !important;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    box-shadow: 0 2px 10px rgba(0, 180, 216, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    cursor: pointer;
}

.domach-change-company-btn i {
    font-size: 0.85rem;
    color: #fff !important;
}

.domach-change-company-btn:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #00c9f2 0%, #2584e8 100%);
    box-shadow: 0 4px 14px rgba(0, 180, 216, 0.45);
    color: #fff !important;
}

.domach-change-company-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 180, 216, 0.3);
}

.domach-change-company-text {
    font-size: 0.7rem;
    font-weight: 700;
}

.domach-header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    padding-right: 1.25rem;
    padding-left: 0.5rem;
}

.domach-header-right .header-item {
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    height: auto;
    min-height: 42px;
    padding: 0.4rem 0.75rem;
}

.domach-header-right .header-item:hover,
.domach-header-right .header-item:focus,
.domach-header-right .header-item:active,
.domach-topbar .navbar-header .dropdown .show.header-item,
.domach-header-right .dropdown.show .header-item {
    background: rgba(255, 255, 255, 0.22) !important;
    color: #fff !important;
    box-shadow: none !important;
}

.domach-header-right .header-item span,
.domach-header-right .header-item i,
.domach-header-right .header-item:hover span,
.domach-header-right .header-item:hover i,
.domach-topbar .navbar-header .dropdown .show.header-item span,
.domach-topbar .navbar-header .dropdown .show.header-item i {
    color: #fff !important;
}

.domach-header-right .dropdown-menu {
    border-radius: var(--domach-radius);
    border: 1px solid var(--domach-border);
    box-shadow: var(--domach-shadow-lg);
    margin-top: 0.5rem;
    min-width: 180px;
}

.domach-header-right .dropdown-menu .dropdown-item {
    color: var(--domach-text) !important;
    font-weight: 500 !important;
    padding: 0.6rem 1rem;
}

.domach-header-right .dropdown-menu .dropdown-item:hover,
.domach-header-right .dropdown-menu .dropdown-item:focus {
    background: var(--domach-accent-soft);
    color: var(--domach-primary) !important;
}

.domach-header-right .dropdown-menu .dropdown-item.text-danger {
    color: #dc3545 !important;
}

.domach-header-right .dropdown-menu .dropdown-item.text-danger:hover {
    background: #fff5f5;
    color: #b02a37 !important;
}

/* Hamburger – hidden on desktop */
.domach-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    flex-shrink: 0;
}

.domach-menu-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.domach-menu-toggle.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.domach-menu-toggle.is-active span:nth-child(2) {
    opacity: 0;
}

.domach-menu-toggle.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Horizontal Menu ───────────────────────────────────── */
.domach-nav.horizontal-menu {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
}

.horizontal-menu .menu-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.25rem 0.5rem;
    margin: 0;
    padding: 0;
}

.horizontal-menu .menu-item {
    position: relative;
}

/* Invisible bridge so pointer can reach submenu without losing hover */
.horizontal-menu .menu-item.dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 12px;
    background: transparent;
    z-index: 1099;
}

.horizontal-menu .menu-item > a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.92) !important;
    font-size: 0.875rem;
    font-weight: 600 !important;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.horizontal-menu .menu-item > a:hover,
.horizontal-menu .menu-item > a:focus {
    background: rgba(255, 255, 255, 0.18);
    color: #fff !important;
}

.horizontal-menu .menu-item i.fa-chevron-down {
    font-size: 0.65rem;
    opacity: 0.85;
    transition: transform 0.25s ease;
}

.horizontal-menu .menu-item.dropdown.is-expanded i.fa-chevron-down,
.horizontal-menu .menu-item.dropdown:hover i.fa-chevron-down {
    transform: rotate(180deg);
}

/* Dropdown submenu */
.menu-item.dropdown {
    cursor: pointer;
}

.menu-item .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: var(--domach-card);
    box-shadow: var(--domach-shadow-lg);
    padding: 0.35rem 0;
    border-radius: var(--domach-radius);
    z-index: 1100;
    list-style: none;
    min-width: 200px;
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid var(--domach-border);
}

/* Extends hover hit area above visible submenu panel */
.menu-item .dropdown-menu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
    background: transparent;
}

.menu-item .dropdown-menu li {
    padding: 0;
    border-bottom: 1px solid var(--domach-border);
}

.menu-item .dropdown-menu li:last-child {
    border-bottom: none;
}

.menu-item .dropdown-menu li a {
    color: var(--domach-text) !important;
    display: block;
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    font-weight: 500 !important;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.menu-item .dropdown-menu li a:hover {
    background: var(--domach-accent-soft);
    color: var(--domach-primary) !important;
}

.menu-item.dropdown:hover .dropdown-menu,
.menu-item.dropdown.is-hover .dropdown-menu,
.menu-item.dropdown.is-expanded .dropdown-menu {
    display: block;
}

@media (min-width: 992px) {
    .menu-item.dropdown.is-hover > a {
        background: rgba(255, 255, 255, 0.18);
        color: #fff !important;
    }

    .menu-item.dropdown.is-hover i.fa-chevron-down {
        transform: rotate(180deg);
    }
}

/* ── Mobile Navigation ─────────────────────────────────── */
@media (max-width: 991.98px) {
    .domach-topbar#page-topbar {
        height: auto !important;
        min-height: var(--domach-header-height);
    }

    .domach-topbar .navbar-header.domach-header-inner {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        align-items: center;
        gap: 0.5rem 0.65rem;
        height: auto !important;
        min-height: var(--domach-header-height);
        padding: 0.5rem 0.75rem !important;
        position: relative;
        width: 100%;
    }

    .domach-menu-toggle {
        display: flex;
        grid-column: 1;
        grid-row: 1;
        z-index: 1070;
        position: relative;
        margin: 0;
        pointer-events: auto;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .domach-header-inner #mainNav {
        display: none !important;
    }

    .domach-header-left {
        grid-column: 2;
        grid-row: 1;
        flex: none;
        min-width: 0;
        padding-left: 0;
        padding-right: 0;
    }

    .domach-header-left .domach-logo img {
        height: 36px;
        width: 36px;
    }

    .domach-header-center {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        justify-content: center;
        margin: 0;
        padding: 0.35rem 0.35rem 0.35rem 0.75rem;
        border-radius: 12px;
    }

    .domach-company-label {
        max-width: none;
        flex: 1;
        text-align: center;
    }

    .domach-header-right {
        grid-column: 3;
        grid-row: 1;
        margin-left: 0;
        padding-right: 0;
        padding-left: 0;
    }

    .domach-header-right .header-item {
        min-height: 36px;
        height: auto;
        padding: 0.3rem 0.5rem;
    }

    .domach-header-right .header-profile-user {
        height: 30px;
        width: 30px;
    }

    .domach-nav-backdrop {
        display: none;
        position: fixed;
        top: var(--domach-mobile-header-offset, 70px);
        left: 0;
        right: 0;
        bottom: var(--domach-footer-offset, 48px);
        background: rgba(0, 0, 0, 0.45);
        z-index: 1050;
        border: none;
        padding: 0;
        margin: 0;
        cursor: pointer;
    }

    .domach-nav-backdrop.is-visible {
        display: block;
    }

    body.domach-mobile-nav-open {
        overflow: hidden;
    }

    /* Fixed vertical menu panel (mounted on body via JS on mobile) */
    #mainNav.domach-nav.horizontal-menu {
        display: none !important;
        position: fixed !important;
        top: var(--domach-mobile-header-offset, 70px) !important;
        left: 0 !important;
        right: 0 !important;
        bottom: var(--domach-footer-offset, 48px) !important;
        width: 100% !important;
        z-index: 1065 !important;
        background: linear-gradient(180deg, #083366 0%, #0d4a8f 100%);
        border-radius: 0;
        padding: 0.75rem 0.85rem 2rem;
        margin: 0 !important;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        flex: none;
    }

    #mainNav.domach-nav.horizontal-menu.is-open {
        display: block !important;
    }

    .horizontal-menu .menu-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
        width: 100%;
    }

    .horizontal-menu .menu-item {
        width: 100%;
    }

    .horizontal-menu .menu-item > a {
        width: 100%;
        justify-content: space-between;
        padding: 0.85rem 1rem;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.08);
        font-size: 0.95rem !important;
    }

    .horizontal-menu .menu-item > a:active {
        background: rgba(255, 255, 255, 0.18);
    }

    .menu-item .dropdown-menu {
        position: static !important;
        display: none !important;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.15);
        border: none;
        border-radius: 8px;
        margin: 0.35rem 0 0.5rem 0;
        max-height: none;
        width: 100%;
        padding: 0.25rem 0;
    }

    .menu-item .dropdown-menu li a {
        color: rgba(255, 255, 255, 0.95) !important;
        padding: 0.7rem 1rem 0.7rem 1.75rem;
        font-size: 0.9rem !important;
    }

    .menu-item .dropdown-menu li a:hover,
    .menu-item .dropdown-menu li a:active {
        background: rgba(255, 255, 255, 0.12);
        color: #fff !important;
    }

    .menu-item.dropdown.is-expanded > .dropdown-menu {
        display: block !important;
    }

    .menu-item.dropdown:hover > .dropdown-menu,
    .menu-item.dropdown.is-hover > .dropdown-menu {
        display: none !important;
    }

    .menu-item.dropdown.is-expanded:hover > .dropdown-menu,
    .menu-item.dropdown.is-expanded.is-hover > .dropdown-menu {
        display: block !important;
    }

    .horizontal-menu .menu-item.dropdown::after {
        display: none;
    }
}

@media (min-width: 992px) {
    .domach-topbar#page-topbar {
        height: auto !important;
    }

    .domach-topbar .domach-header-inner {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        width: 100%;
        height: auto !important;
        min-height: var(--domach-header-height);
        gap: 0.5rem 0.75rem;
        padding: 0.5rem 1.25rem !important;
    }

    .domach-menu-toggle {
        display: none !important;
    }

    .domach-header-left {
        flex: 0 0 auto;
        padding-left: 1.25rem;
    }

    .domach-header-center {
        flex: 0 0 auto;
    }

    #mainNav.domach-nav.horizontal-menu {
        display: flex !important;
        flex: 1 1 auto;
        position: static !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: auto !important;
        z-index: auto !important;
        padding: 0;
        margin: 0;
        background: transparent;
        overflow: visible;
    }

    .domach-header-right {
        flex: 0 0 auto;
        margin-left: auto;
    }

    .domach-nav-backdrop {
        display: none !important;
    }
}

/* Legacy header overrides */
#page-topbar .navbar-header {
    padding: 0 !important;
    max-width: 100%;
}

.navbar-brand-box {
    display: none;
}

.main-content {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* ── Cards & Content ───────────────────────────────────── */
.card {
    border: 1px solid var(--domach-border) !important;
    border-radius: var(--domach-radius) !important;
    box-shadow: var(--domach-shadow) !important;
    overflow: hidden;
}

.card .card-body {
    padding: 1.25rem !important;
}

.Heading_Main {
    color: var(--domach-primary) !important;
    font-weight: 700 !important;
    font-size: 1.05rem !important;
}

.md-tabs .nav-link.active {
    border-bottom: 3px solid var(--domach-primary-light) !important;
    color: var(--domach-primary) !important;
}

.page-title-box h4 {
    color: var(--domach-primary-dark);
    font-weight: 700;
}

.breadcrumb-item a {
    color: var(--domach-primary-light);
}

.btn-primary {
    background: linear-gradient(135deg, var(--domach-primary) 0%, var(--domach-primary-light) 100%) !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(13, 74, 143, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--domach-primary-dark) 0%, var(--domach-primary) 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 74, 143, 0.35);
}

.btn-outline-primary {
    color: var(--domach-primary) !important;
    border-color: var(--domach-primary) !important;
    border-radius: 8px !important;
}

.form-control,
.select2-container--default .select2-selection--single {
    border-radius: 8px !important;
    border-color: var(--domach-border) !important;
}

.form-control:focus {
    border-color: var(--domach-primary-light) !important;
    box-shadow: 0 0 0 0.2rem rgba(26, 111, 212, 0.15) !important;
}

.dt-search {
    border: 1px solid rgba(13, 74, 143, 0.2) !important;
    border-radius: 8px !important;
}

.dt-search:focus {
    border-color: var(--domach-primary-light) !important;
}

/* ── Footer (fixed at bottom, consistent on all pages) ─ */
body.layoutCSS .footer.domach-footer,
body .footer.domach-footer {
    position: fixed !important;
    bottom: 0 !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 1040;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-top: 1px solid var(--domach-border);
    box-shadow: 0 -4px 20px rgba(13, 74, 143, 0.06);
    color: var(--domach-text-muted);
}

.footer.domach-footer .container-fluid {
    padding: 0 1.25rem !important;
    margin: 0 !important;
}

.domach-footer::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, var(--domach-primary-dark) 0%, var(--domach-primary-light) 50%, var(--domach-accent) 100%);
}

.domach-footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    padding: 0.5rem 0 0 !important;
    margin: 0 !important;
}

.domach-footer-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 0 1 auto;
    min-width: 0;
}

.domach-footer-brand img {
    height: 30px;
    width: 30px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    padding: 2px;
    box-shadow: 0 2px 6px rgba(13, 74, 143, 0.12);
    flex-shrink: 0;
}

.domach-footer-brand span {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--domach-primary-dark);
    line-height: 1.3;
}

.domach-footer-copy {
    flex: 1 1 auto;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--domach-text-muted);
    line-height: 1.4;
    min-width: 0;
}

body.vertical-collpsed .footer.domach-footer,
body[data-layout=horizontal] .footer.domach-footer,
body[data-sidebar-size=small] .footer.domach-footer,
body[data-layout-size=boxed] .footer.domach-footer {
    right: 0 !important;
    left: 0 !important;
    padding: 0 !important;
    height: auto !important;
}

@media (max-width: 991.98px) {
    .footer.domach-footer .container-fluid {
        padding: 0 1rem !important;
    }

    .domach-footer-inner {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        padding: 0.5rem 0 0 !important;
        gap: 0.25rem;
    }

    .domach-footer-brand {
        justify-content: center;
    }

    .domach-footer-copy {
        width: 100%;
    }
}

/* Closed Select2 in page content scrolls under the fixed header */
#layout-wrapper .main-content .select2-container:not(.select2-container--open) {
    z-index: auto !important;
}

/* Open dropdown (attached to body via dropdownParent) stays below fixed header (1050) */
body > .select2-container.select2-container--open {
    z-index: 1061 !important;
}

.select2-dropdown {
    z-index: 1061 !important;
}

/* Page select2 stays below modal when any modal is open */
body.modal-open #layout-wrapper .select2-container,
body.modal-open #layout-wrapper .select2-dropdown {
    z-index: 1040 !important;
}

body.modal-open .modal-backdrop.show {
    z-index: 1100 !important;
}

body.modal-open .modal {
    z-index: 1110 !important;
}

body.modal-open .modal .select2-container,
body.modal-open #access-modal .select2-container {
    z-index: 1120 !important;
}

body.modal-open .modal .select2-dropdown,
body.modal-open #access-modal .select2-dropdown {
    z-index: 1121 !important;
}

/* ── Login Page ────────────────────────────────────────── */
html.domach-login-html,
body.domach-login-body {
    height: 100%;
    margin: 0;
    overflow: hidden !important;
    overscroll-behavior: none;
}

body.domach-login-body {
    position: fixed;
    inset: 0;
    width: 100%;
}

.domach-login-page {
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    display: flex;
    font-family: var(--domach-font);
    background: var(--domach-surface);
    overflow: hidden;
}

.domach-login-brand {
    flex: 1 1 55%;
    min-height: 0;
    background: linear-gradient(145deg, var(--domach-primary-dark) 0%, var(--domach-primary) 40%, #0e5cad 100%);
    color: #fff;
    padding: 2.5rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.domach-login-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(0, 180, 216, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 40%);
    pointer-events: none;
}

.domach-login-brand-inner {
    position: relative;
    z-index: 1;
    max-width: 520px;
}

.domach-login-brand .brand-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
    padding: 6px;
    margin-bottom: 1.5rem;
}

.domach-login-brand h1 {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.domach-login-brand .tagline {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--domach-accent);
    margin-bottom: 1.25rem;
}

.domach-login-brand .description {
    font-size: 0.95rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 1.75rem;
}

.domach-login-services {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.domach-login-service-item {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.domach-login-service-item i {
    color: var(--domach-accent);
    font-size: 1rem;
}

.domach-login-contact {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
}

.domach-login-contact a {
    color: var(--domach-accent);
    text-decoration: none;
}

.domach-login-form-panel {
    flex: 1 1 45%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: hidden;
}

.domach-login-card {
    width: 100%;
    max-width: 420px;
    background: var(--domach-card);
    border-radius: 16px;
    box-shadow: var(--domach-shadow-lg);
    padding: 2.5rem 2rem;
    border: 1px solid var(--domach-border);
}

.domach-login-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--domach-primary-dark);
    margin-bottom: 0.35rem;
    text-align: center;
}

.domach-login-card .subtitle {
    text-align: center;
    color: var(--domach-text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
}

.domach-login-card .form-control {
    padding: 0.75rem 1rem;
    height: auto;
    font-size: 0.95rem;
}

.domach-login-card .input-group-icon {
    position: relative;
}

.domach-login-card .input-group-icon i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--domach-text-muted);
    z-index: 4;
}

.domach-login-card .input-group-icon .form-control {
    padding-left: 2.5rem;
}

.domach-login-card .btn-login {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--domach-primary) 0%, var(--domach-primary-light) 100%);
    border: none;
    color: #fff;
    margin-top: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.domach-login-card .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 74, 143, 0.35);
    color: #fff;
}

.domach-login-card .forgot-link {
    color: var(--domach-primary-light);
    font-size: 0.875rem;
    text-decoration: none;
    font-weight: 500;
}

.domach-login-card .forgot-link:hover {
    color: var(--domach-primary-dark);
    text-decoration: underline;
}

.domach-login-footer-note {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--domach-text-muted);
}

/* ── DataTables & Tables ───────────────────────────────── */
.table {
    border-radius: var(--domach-radius);
    overflow: hidden;
}

.table thead th {
    background: linear-gradient(180deg, #f8fafc 0%, #eef3f9 100%);
    color: var(--domach-primary-dark);
    font-weight: 700 !important;
    border-bottom: 2px solid var(--domach-border) !important;
}

.dataTables_wrapper .dataTables_filter input {
    border-radius: 8px !important;
}

/* Mobile: horizontal scroll for all tables */
@media (max-width: 991.98px) {
    .page-content,
    #DivContent,
    .container-fluid {
        max-width: 100%;
        overflow-x: hidden;
    }

    .domach-table-scroll,
    .dataTables_wrapper,
    .table-responsive,
    #divTable .card-block,
    #divTable .card-body,
    .card-block:has(table),
    .card-body:has(table) {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        max-width: 100%;
    }

    .dataTables_wrapper table.dataTable,
    .domach-table-scroll > table,
    .table-responsive > table,
    .card-block > table,
    .card-body > table,
    table.table.dataTable,
    table.table-bordered,
    table.table-striped {
        width: max-content !important;
        min-width: 100%;
    }

    table.table-responsive {
        display: block;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    .table {
        overflow: visible;
    }

    .dataTables_wrapper > .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100%;
    }

    .dataTables_wrapper .dataTables_scroll,
    .dataTables_wrapper .dataTables_scrollBody {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .dataTables_wrapper .dt-buttons {
        justify-content: flex-end;
    }
}

@media (max-width: 991.98px) {
    .domach-login-page {
        flex-direction: column;
        overflow: hidden;
    }

    .domach-login-brand {
        flex: 0 0 auto;
        max-height: 34vh;
        padding: 1rem 1.25rem;
        overflow: hidden;
    }

    .domach-login-brand .brand-logo {
        width: 48px;
        height: 48px;
        margin-bottom: 0.65rem;
    }

    .domach-login-brand h1 {
        font-size: 1.1rem;
        margin-bottom: 0.35rem;
    }

    .domach-login-brand .tagline {
        font-size: 0.85rem;
        margin-bottom: 0;
    }

    .domach-login-brand .description,
    .domach-login-services,
    .domach-login-contact {
        display: none;
    }

    .domach-login-form-panel {
        flex: 1 1 auto;
        min-height: 0;
        padding: 0.75rem 1rem 1rem;
        overflow: hidden;
    }

    .domach-login-card {
        padding: 1.25rem 1rem;
        max-height: 100%;
        overflow: hidden;
    }

    .domach-login-card h2 {
        font-size: 1.25rem;
    }

    .domach-login-card .subtitle {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }

    .domach-login-footer-note {
        margin-top: 0.75rem;
        font-size: 0.75rem;
    }
}

/* ── Modal Popups (global) ─────────────────────────────── */
.modal-backdrop.show {
    opacity: 1;
    background: rgba(8, 51, 102, 0.55) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1100 !important;
}

.modal.domach-modal {
    z-index: 1110 !important;
}

.modal.fade .modal-dialog {
    transform: scale(0.94) translateY(-12px);
    transition: transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.28s ease;
}

.modal.show .modal-dialog {
    transform: scale(1) translateY(0);
}

.modal .modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(8, 51, 102, 0.22), 0 8px 24px rgba(0, 0, 0, 0.12);
    background: #fff;
}

.modal .modal-header {
    background: linear-gradient(135deg, var(--domach-primary-dark) 0%, var(--domach-primary) 55%, var(--domach-primary-light) 100%);
    color: #fff;
    border-bottom: none;
    padding: 1.1rem 1.5rem;
    align-items: center;
}

.modal .modal-header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--domach-accent), transparent);
    opacity: 0.6;
}

.modal .modal-header {
    position: relative;
}

.modal .modal-title {
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
}

.modal .modal-title i {
    color: var(--domach-accent);
    font-size: 1rem;
}

.modal .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.9;
    box-shadow: none !important;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.modal .btn-close:hover {
    opacity: 1;
    transform: scale(1.08);
}

.modal .modal-header .close,
.modal .modal-header button.close {
    color: #fff;
    opacity: 0.9;
    text-shadow: none;
    font-size: 1.5rem;
    font-weight: 300;
    transition: opacity 0.2s ease;
}

.modal .modal-header .close:hover {
    opacity: 1;
    color: #fff;
}

.modal .modal-body {
    padding: 1.5rem 1.5rem 1.25rem;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    color: var(--domach-text);
}

.modal .modal-body label {
    color: var(--domach-text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.35rem;
}

.modal .modal-body .form-control,
.modal .modal-body .form-select {
    border-radius: 10px;
    border-color: var(--domach-border);
    padding: 0.65rem 0.85rem;
}

.modal .modal-body .form-control:focus,
.modal .modal-body .form-select:focus {
    border-color: var(--domach-primary-light);
    box-shadow: 0 0 0 0.2rem rgba(26, 111, 212, 0.12);
}

.modal .modal-footer {
    border-top: 1px solid var(--domach-border);
    padding: 1rem 1.5rem;
    background: #fff;
    gap: 0.5rem;
}

.modal .modal-footer .btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    min-width: 90px;
}

.modal .modal-footer .btn-primary {
    box-shadow: 0 4px 12px rgba(13, 74, 143, 0.25);
}

.modal .modal-footer .btn-light {
    background: #f1f5f9;
    border-color: var(--domach-border);
    color: var(--domach-text);
}

.modal .modal-footer .btn-light:hover {
    background: #e2e8f0;
}

.modal .modal-footer .btn-danger {
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

/* Scrollable modals */
.modal-dialog-scrollable .modal-body {
    scrollbar-width: thin;
    scrollbar-color: var(--domach-primary-light) #eef3f9;
}

.modal-dialog-scrollable .modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-dialog-scrollable .modal-body::-webkit-scrollbar-thumb {
    background: var(--domach-primary-light);
    border-radius: 6px;
}

/* Size variants */
.modal-sm .modal-content {
    border-radius: 14px;
}

.modal-sm .modal-header {
    padding: 0.9rem 1.15rem;
}

.modal-sm .modal-title {
    font-size: 1rem !important;
}

.modal-sm .modal-body {
    padding: 1.15rem;
}

.modal-xl .modal-content,
.modal-lg .modal-content {
    border-radius: 16px;
}

/* DataTables responsive modal */
.modal.dtr-bs-modal .modal-content {
    border-radius: 14px;
}

/* Modal tables */
.modal .table {
    margin-bottom: 0;
    border-radius: 10px;
}

.modal .table thead th {
    font-size: 0.85rem;
}

/* Buttons inside modal body (no footer) */
.modal .modal-body > .text-end,
.modal .modal-body .text-end:last-child {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--domach-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.modal .modal-body .btn {
    border-radius: 10px;
    font-weight: 600;
}

@media (max-width: 575.98px) {
    .modal .modal-dialog {
        margin: 0.75rem;
    }

    .modal .modal-header {
        padding: 1rem 1.15rem;
    }

    .modal .modal-body {
        padding: 1.15rem;
    }

    .modal .modal-footer {
        padding: 0.85rem 1.15rem;
        flex-wrap: wrap;
    }

    .modal .modal-footer .btn {
        flex: 1 1 auto;
    }
}
