/* Global font inherits the canonical family from theme-tokens.css. */
body, html {
    font-family: var(--brand-font-family);
}

/* Apply font to all elements for consistency */
* {
    font-family: inherit;
}

/* Yeastar Licenses specific styles */
.yeastar-get-code-btn {
    padding: 6px 12px !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    border-radius: 4px !important;
    border: none !important;
    background: var(--brand-primary) !important;
    color: white !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(8, 61, 86, 0.2) !important;
}

.yeastar-get-code-btn:hover {
    background: #06304a !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(8, 61, 86, 0.3) !important;
}

.yeastar-install-pbx-link {
    color: var(--brand-primary) !important;
    font-weight: 500 !important;
    text-decoration: none !important;
}

.yeastar-install-pbx-link:hover {
    color: #06304a !important;
}

/* Yeastar actions dropdown button */
.yeastar-actions-btn {
    padding: 8px 10px !important;
    font-size: 14px !important;
    line-height: 1 !important;
    border-radius: 4px !important;
    border: none !important;
    background: transparent !important;
    color: #6c757d !important;
    font-weight: normal !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.yeastar-actions-btn:hover {
    background: #f8f9fa !important;
    color: #495057 !important;
    transform: none !important;
    box-shadow: none !important;
}

.yeastar-actions-btn:focus {
    background: #f8f9fa !important;
    color: #495057 !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Dropdown menu styling for yeastar actions */
.yeastar-actions-btn + .dropdown-menu {
    border-radius: 6px !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    padding: 4px 0 !important;
    min-width: 140px !important;
}

.yeastar-actions-btn + .dropdown-menu .dropdown-item {
    padding: 8px 16px !important;
    font-size: 13px !important;
    color: #495057 !important;
    transition: all 0.2s ease !important;
}

.yeastar-actions-btn + .dropdown-menu .dropdown-item:hover {
    background-color: #f8f9fa !important;
    color: var(--brand-primary) !important;
}

/* Dark mode dropdown for actions menu (ensure visible text) */
[data-bs-theme="dark"] .yeastar-actions-btn + .dropdown-menu {
    background: var(--brand-surface) !important;
    border: 1px solid var(--brand-border) !important;
}
[data-bs-theme="dark"] .yeastar-actions-btn + .dropdown-menu .dropdown-item {
    color: #ffffff !important;
}
[data-bs-theme="dark"] .yeastar-actions-btn + .dropdown-menu .dropdown-item:hover {
    background-color: var(--brand-surface-muted) !important;
    color: #ffffff !important;
}

/* The dropdown menus still need dark mode support when page theme is dark */

/* Language dropdown menu dark mode (the dropdown that opens, not the button) */
[data-bs-theme="dark"] .language-dropdown .dropdown-menu {
    background: var(--brand-surface) !important;
    border: 1px solid var(--brand-border) !important;
}

[data-bs-theme="dark"] .language-dropdown .dropdown-item {
    color: #ffffff !important;
    background-color: transparent !important;
}

[data-bs-theme="dark"] .language-dropdown .dropdown-item:hover {
    background-color: var(--brand-surface-muted) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .language-dropdown .dropdown-item button {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .language-dropdown .dropdown-item button:hover {
    color: #ffffff !important;
}

/* Profile dropdown menu dark mode (the dropdown that opens, not the button) */
[data-bs-theme="dark"] .profile-dropdown .dropdown-menu {
    background: var(--brand-surface) !important;
    border: 1px solid var(--brand-border) !important;
}

[data-bs-theme="dark"] .profile-dropdown .dropdown-item {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .profile-dropdown .dropdown-item:hover {
    background-color: var(--brand-surface-muted) !important;
    color: #ffffff !important;
}

/* Button link inside dropdown items */
[data-bs-theme="dark"] .language-dropdown .dropdown-item .btn-link {
    color: #ffffff !important;
    text-decoration: none !important;
}

[data-bs-theme="dark"] .language-dropdown .dropdown-item .btn-link:hover {
    color: #ffffff !important;
    text-decoration: none !important;
}

/* All spans inside dropdown items */
[data-bs-theme="dark"] .language-dropdown .dropdown-item span,
[data-bs-theme="dark"] .language-dropdown .dropdown-item .btn-link span {
    color: #ffffff !important;
}

/* Chevron icon */
[data-bs-theme="dark"] .language-dropdown .nav-link i {
    color: #ffffff !important;
}

/* Minimal refresh icon button next to Unactivated */
.ys-refresh-btn {
    color: var(--brand-primary) !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 18px !important;
    height: 18px !important;
    border-radius: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.ys-refresh-btn:hover,
.ys-refresh-btn:focus,
.ys-refresh-btn:active {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
.ys-refresh-btn::before,
.ys-refresh-btn::after {
    display: none !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
.ys-refresh-btn:hover .ys-refresh-icon,
.ys-refresh-btn:focus .ys-refresh-icon,
.ys-refresh-btn:active .ys-refresh-icon {
    color: #06304a !important;
}
.ys-refresh-icon {
    font-size: 14px;
    line-height: 1;
}

/* Dark theme adjustments for refresh icon */
[data-bs-theme="dark"] .ys-refresh-btn {
    color: #ffffff !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
[data-bs-theme="dark"] .ys-refresh-icon { color: #ffffff !important; }
[data-bs-theme="dark"] .ys-refresh-btn:hover .ys-refresh-icon,
[data-bs-theme="dark"] .ys-refresh-btn:focus .ys-refresh-icon,
[data-bs-theme="dark"] .ys-refresh-btn:active .ys-refresh-icon {
    color: #b6dcff !important;
}


/* Yeastar activation status badges */
.yeastar-badge-activated {
    background-color: #198754 !important;
    color: white !important;
    border: 1px solid #198754 !important;
}

.yeastar-badge-unactivated {
    background-color: #d1ecf1 !important;
    color: #0c5460 !important;
    border: 1px solid #bee5eb !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.yeastar-badge-unactivated:hover {
    background-color: #b8dadf !important;
    border-color: #9fccdb !important;
    transform: translateY(-1px) !important;
}

/* Dark theme support for badges */
[data-bs-theme="dark"] .yeastar-badge-activated {
    background-color: #198754 !important;
    color: white !important;
    border-color: #198754 !important;
}

[data-bs-theme="dark"] .yeastar-badge-unactivated {
    background-color: #055160 !important;
    color: #9eeaf9 !important;
    border-color: #087990 !important;
}

[data-bs-theme="dark"] .yeastar-badge-unactivated:hover {
    background-color: #0a6c7d !important;
    border-color: #0aa2c0 !important;
}

/* Custom styles for activation code popup */
.swal2-popup-activation {
    width: 500px !important;
    max-width: 90vw !important;
    padding: 2rem !important;
}

.swal2-popup-activation .swal2-title {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    margin-bottom: 1.5rem !important;
    color: #333 !important;
}

.swal2-popup-activation .swal2-html-container {
    text-align: left !important;
    margin: 0 !important;
    padding: 0 !important;
}

.swal2-popup-activation .swal2-close {
    font-size: 2rem !important;
    color: #6c757d !important;
}

.swal2-popup-activation .swal2-close:hover {
    color: var(--brand-primary) !important;
}

/* Install PBX Modal Styles */
.install-step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.step-number {
    background: var(--brand-primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h6 {
    margin-bottom: 15px;
    font-weight: 600;
}

.platform-section {
    margin-bottom: 20px;
}

.section-title {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 10px;
    font-weight: 500;
}

.platform-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.platform-btn {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid var(--brand-primary);
    color: var(--brand-primary);
    background: transparent;
    transition: all 0.2s;
}

.platform-btn:hover {
    background: var(--brand-primary);
    color: white;
}

.platform-btn.btn-primary {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
}

.activation-status {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.server-info {
    margin-bottom: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.activation-code-section {
    margin-bottom: 15px;
}

.code-display {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    min-height: 40px;
    display: flex;
    align-items: center;
}

/* Customer dropdown styles */
.ys-customer-dropdown-wrapper {
    position: relative;
}

.ys-customer-selector {
    position: relative;
    width: 100%;
}

.ys-customer-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: var(--bs-body-bg, white);
    color: var(--bs-body-color, #333);
    cursor: pointer;
    transition: border-color 0.2s;
}

.ys-customer-trigger:hover {
    border-color: var(--brand-primary);
}

.ys-customer-trigger.open {
    border-color: var(--brand-primary);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.ys-customer-placeholder {
    color: #6c757d;
    font-size: 14px;
}

.ys-customer-trigger i {
    color: #6c757d;
    font-size: 12px;
    transition: transform 0.2s;
}

/* Dark mode: make selected customer look enabled/white while placeholder stays muted */
[data-bs-theme="dark"] .ys-customer-trigger {
    background: #1f2937 !important; /* slate-800 */
    border-color: #334155 !important; /* slate-700 */
    color: #e5e7eb !important;       /* slate-200 */
}
[data-bs-theme="dark"] .ys-customer-trigger .ys-customer-placeholder { /* placeholder appearance */
    color: #9ca3af !important;       /* slate-400 */
}
[data-bs-theme="dark"] .ys-customer-trigger.selected .ys-customer-placeholder { /* when value selected */
    color: #ffffff !important;
}
[data-bs-theme="dark"] .ys-customer-trigger.open {
    border-color: #93c5fd !important; /* light blue focus */
}
[data-bs-theme="dark"] .ys-customer-dropdown {
    background: #111827 !important;  /* slate-900 */
    color: #e5e7eb !important;
    border-color: #334155 !important;
}
[data-bs-theme="dark"] .ys-customer-item {
    color: #e5e7eb !important;
}
[data-bs-theme="dark"] .ys-customer-item:hover {
    background-color: rgba(255,255,255,0.08) !important;
}

.ys-customer-trigger.open i {
    transform: rotate(180deg);
}

.ys-customer-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bs-body-bg, white);
    color: var(--bs-body-color, #333);
    border: 1px solid var(--brand-primary);
    border-top: none;
    border-radius: 0 0 6px 6px;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.ys-customer-dropdown.open {
    display: block;
}

.ys-customer-search-wrapper {
    padding: 8px;
    border-bottom: 1px solid #f8f9fa;
}

.ys-customer-search {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    background: var(--bs-body-bg, white);
    color: var(--bs-body-color, #333);
}

.ys-customer-search:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px rgba(8, 61, 86, 0.1);
}

.ys-customer-list {
    max-height: 180px;
    overflow-y: auto;
}

.ys-customer-loading {
    padding: 12px;
    text-align: center;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ys-customer-item {
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid var(--bs-border-color, #f8f9fa);
    color: var(--bs-body-color, #333);
}

.ys-customer-item:hover {
    background-color: var(--bs-secondary-bg, #f8f9fa);
}

.ys-customer-item:last-child {
    border-bottom: none;
}

.ys-customer-item.selected {
    background-color: var(--brand-primary);
    color: white;
}

.ys-customer-name {
    font-weight: 500;
    font-size: 14px;
}

/* SN/License dropdown styles (similar to customer dropdown) */
.ys-sn-dropdown-wrapper {
    position: relative;
}

.ys-sn-selector {
    position: relative;
    width: 100%;
}

.ys-sn-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: var(--bs-body-bg, white);
    color: var(--bs-body-color, #333);
    cursor: pointer;
    transition: border-color 0.2s;
}

.ys-sn-trigger:hover {
    border-color: var(--brand-primary);
}

.ys-sn-trigger.open {
    border-color: var(--brand-primary);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.ys-sn-placeholder {
    color: #6c757d;
    font-size: 14px;
}

.ys-sn-trigger i {
    color: #6c757d;
    font-size: 12px;
    transition: transform 0.2s;
}

.ys-sn-trigger.open i {
    transform: rotate(180deg);
}

.ys-sn-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bs-body-bg, white);
    color: var(--bs-body-color, #333);
    border: 1px solid var(--brand-primary);
    border-top: none;
    border-radius: 0 0 6px 6px;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.ys-sn-dropdown.open {
    display: block;
}

.ys-sn-search-wrapper {
    padding: 8px;
    border-bottom: 1px solid #f8f9fa;
}

.ys-sn-search {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    background: var(--bs-body-bg, white);
    color: var(--bs-body-color, #333);
}

.ys-sn-search:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px rgba(8, 61, 86, 0.1);
}

.ys-sn-list {
    max-height: 180px;
    overflow-y: auto;
}

.ys-sn-loading {
    padding: 12px;
    text-align: center;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ys-sn-item {
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid var(--bs-border-color, #f8f9fa);
    color: var(--bs-body-color, #333);
}

.ys-sn-item:hover {
    background-color: var(--bs-secondary-bg, #f8f9fa);
}

.ys-sn-item:last-child {
    border-bottom: none;
}

.ys-sn-item.selected {
    background-color: var(--brand-primary);
    color: white;
}

.ys-sn-display {
    font-weight: 500;
    font-size: 14px;
}

/* Resizable table styles */
.resizable-table {
    table-layout: auto;
    width: auto;
    min-width: 100%;
}

.resizable-table th {
    position: relative;
    padding-right: 20px;
    user-select: none;
}

.resizable-table th:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20%;
    right: -1px;
    width: 2px;
    height: 60%;
    background: #dee2e6;
    cursor: col-resize;
    user-select: none;
    border-radius: 1px;
    transition: all 0.2s ease;
}

.resizable-table th:not(:last-child):hover::after {
    background: var(--brand-primary);
    width: 3px;
    right: -1.5px;
    top: 15%;
    height: 70%;
    box-shadow: 0 0 4px rgba(8, 61, 86, 0.3);
}

.resizable-table th,
.resizable-table td {
    white-space: nowrap;
    padding: 8px 12px;
}

.resizable-table .col-customer-name {
    min-width: 120px;
}

.resizable-table .col-yeastar-id {
    min-width: 200px;
}

.resizable-table .col-sn {
    min-width: 100px;
}

.resizable-table .col-created {
    min-width: 140px;
}

.resizable-table .col-plan-name {
    min-width: 120px;
}

.resizable-table .col-activation {
    min-width: 100px;
}

.resizable-table .col-plan-status {
    min-width: 100px;
}

.resizable-table .col-qty {
    min-width: 80px;
}

.resizable-table .col-plan-expiry {
    min-width: 120px;
}

.resizable-table .col-activation-code {
    min-width: 120px;
}

/* Remove text truncation to show full content */
.resizable-table td.text-truncate {
    max-width: none;
    overflow: visible;
    text-overflow: unset;
    white-space: nowrap;
}

/* Resizing state */
body.col-resizing {
    cursor: col-resize !important;
    user-select: none;
}

body.col-resizing * {
    cursor: col-resize !important;
}

/* Licenses table container */
.licenses-table-container {
    overflow-x: auto;
    width: 100%;
}

/* Horizontal scroll styling */
.table-responsive {
    scrollbar-width: thin;
    scrollbar-color: var(--brand-primary) #f8f9fa;
}

.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: var(--brand-primary);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #06304a;
}

.bg-standard-green {
    background-color: var(--brand-action-primary) !important;
}

/* Semantic utility backgrounds follow the canonical token layer. */
.bg-success {
    background-color: var(--brand-success-green) !important;
}

.bg-primary {
    background-color: var(--brand-primary) !important;
}

/* Custom primary background for CNDB forms */
.bg-custom-primary {
    background-color: var(--brand-primary) !important;
}

/* Ensure submit button uses the new color */
.btn-primary.bg-standard-green {
    background-color: var(--brand-action-primary) !important;
    border-color: var(--brand-action-primary) !important;
    color: var(--brand-action-primary-text) !important;
}

.btn-primary.bg-standard-green:hover,
.btn-primary.bg-standard-green:focus,
.btn-primary.bg-standard-green:active {
    background-color: var(--brand-action-primary-hover) !important;
    border-color: var(--brand-action-primary-hover) !important;
}

/* Remove button shadows and focus effects */
.btn,
.btn:focus,
.btn:active,
.btn:hover,
.btn.focus,
.btn.active,
.btn-primary,
.btn-primary:focus,
.btn-primary:active,
.btn-primary:hover,
.btn-primary.focus,
.btn-primary.active,
.btn-success,
.btn-success:focus,
.btn-success:active,
.btn-success:hover,
.btn-success.focus,
.btn-success.active {
    box-shadow: none !important;
    outline: none !important;
}

/* Remove focus ring and any other button outlines */
.btn:focus-visible,
.btn-primary:focus-visible,
.btn-success:focus-visible {
    box-shadow: none !important;
    outline: none !important;
}

/* Commission filter buttons */
.commission-filter-btn {
    border-color: var(--brand-border-strong) !important;
    color: var(--brand-text-heading) !important;
    background-color: transparent !important;
}

.commission-filter-btn:hover {
    background-color: transparent !important;
    border-color: var(--brand-icon-color) !important;
    color: var(--brand-icon-color) !important;
}

.btn-check:checked + .commission-filter-btn {
    background-color: transparent !important;
    border-color: var(--brand-icon-color) !important;
    box-shadow: 0 0 0 1px var(--brand-icon-color) !important;
    color: var(--brand-icon-color) !important;
}

.commission-custom-btn {
    border-color: #6c757d !important;
    color: #6c757d !important;
    background-color: transparent !important;
}

.commission-custom-btn:hover {
    background-color: transparent !important;
    border-color: var(--brand-icon-color) !important;
    color: var(--brand-icon-color) !important;
}

/* Dark mode commission filter buttons */
[data-bs-theme="dark"] .commission-filter-btn {
    border-color: var(--brand-border-strong) !important;
    color: var(--brand-text-heading) !important;
}

[data-bs-theme="dark"] .commission-filter-btn:hover {
    background-color: transparent !important;
    border-color: var(--brand-icon-color) !important;
    color: var(--brand-icon-color) !important;
}

[data-bs-theme="dark"] .btn-check:checked + .commission-filter-btn {
    background-color: transparent !important;
    border-color: var(--brand-icon-color) !important;
    box-shadow: 0 0 0 1px var(--brand-icon-color) !important;
    color: var(--brand-icon-color) !important;
}

[data-bs-theme="dark"] .commission-custom-btn {
    border-color: #adb5bd !important;
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .commission-custom-btn:hover {
    background-color: transparent !important;
    border-color: var(--brand-icon-color) !important;
    color: var(--brand-icon-color) !important;
}

/* ========================================= */
/* DARK MODE TEXT VISIBILITY IMPROVEMENTS */
/* ========================================= */

/* Dark mode statistics card text */
[data-bs-theme="dark"] .stats-title {
    color: #ffffff !important;
    font-weight: 600;
}

/* Dark mode table headers */
[data-bs-theme="dark"] .modern-table thead th {
    background: var(--brand-surface-muted) !important;
    color: #ffffff !important;
    border-bottom: 1px solid var(--brand-border-strong) !important;
}

/* Dark mode table body */
[data-bs-theme="dark"] .modern-table tbody tr {
    background: var(--brand-surface) !important;
}

[data-bs-theme="dark"] .modern-table tbody tr:nth-child(even) {
    background: var(--brand-surface-muted) !important;
}

[data-bs-theme="dark"] .modern-table tbody tr:nth-child(odd) {
    background: var(--brand-surface) !important;
}

[data-bs-theme="dark"] .modern-table tbody tr:hover {
    background: var(--brand-surface-tint) !important;
}

[data-bs-theme="dark"] .modern-table tbody td {
    border-bottom: 1px solid var(--brand-border) !important;
    color: #ffffff !important;
}

/* Dark mode customer name links */
[data-bs-theme="dark"] .customer-name-link {
    color: #ffffff !important;
    font-weight: 600;
}

[data-bs-theme="dark"] .customer-name-link:hover {
    color: #cfd4da !important;
}

/* Dark mode status badges */
[data-bs-theme="dark"] .status-badge.active {
    background: transparent !important;
    color: var(--brand-success-green) !important;
    border: 0 !important;
    text-shadow: none !important;
}

/* Dark mode pagination */
[data-bs-theme="dark"] .pagination-container {
    background: var(--brand-surface-muted) !important;
    border-top: 1px solid var(--brand-border-strong) !important;
}

[data-bs-theme="dark"] .pagination-info {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .modern-pagination .page-link {
    background: var(--brand-surface) !important;
    border: 1px solid var(--brand-border-strong) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .modern-pagination .page-link:hover {
    background: var(--brand-primary) !important;
    color: #ffffff !important;
    border-color: var(--brand-primary) !important;
}

[data-bs-theme="dark"] .modern-pagination .page-item.active .page-link {
    background: var(--brand-primary) !important;
    color: #ffffff !important;
    border-color: var(--brand-primary) !important;
}

[data-bs-theme="dark"] .modern-pagination .page-item.disabled .page-link {
    color: var(--brand-text-muted) !important;
    background: var(--brand-surface-muted) !important;
    border-color: var(--brand-border-strong) !important;
}

/* Dark mode empty state */
[data-bs-theme="dark"] .empty-state {
    color: var(--brand-text-muted) !important;
}

[data-bs-theme="dark"] .empty-state h5 {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .empty-state p {
    color: var(--brand-text-muted) !important;
}

[data-bs-theme="dark"] .empty-icon {
    background: var(--brand-surface-muted) !important;
}

[data-bs-theme="dark"] .empty-icon i {
    color: var(--brand-icon-color) !important;
}

/* Dark mode table containers */
[data-bs-theme="dark"] .table-container {
    background: var(--brand-surface) !important;
    border: 1px solid var(--brand-border) !important;
}

/* Dark mode cards */
[data-bs-theme="dark"] .stats-card {
    background: var(--brand-surface) !important;
    border: 1px solid var(--brand-border) !important;
}

/* Dark mode search input */
[data-bs-theme="dark"] .search-input {
    background: var(--brand-surface-muted) !important;
    border: 1px solid var(--brand-border-strong) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .search-input:focus {
    background: var(--brand-surface-muted) !important;
    border-color: var(--brand-primary) !important;
}

[data-bs-theme="dark"] .search-input::placeholder {
    color: var(--brand-text-muted) !important;
}

[data-bs-theme="dark"] .search-icon {
    color: var(--brand-text-muted) !important;
}

/* Dark mode general text colors */
[data-bs-theme="dark"] .text-muted {
    color: var(--brand-text-muted) !important;
}

[data-bs-theme="dark"] .small,
[data-bs-theme="dark"] small {
    color: #adb5bd !important;
}

/* Dark mode customer meta text */
[data-bs-theme="dark"] .customer-meta {
    color: var(--brand-text-muted) !important;
}

/* Breadcrumb links use the brand palette, not Bootstrap's default blue */
.breadcrumb,
.breadcrumb .breadcrumb-item,
.breadcrumb .breadcrumb-item span {
    color: var(--brand-text-heading);
}

.breadcrumb-item a {
    color: var(--brand-link-color);
    text-decoration: none;
}

.breadcrumb-item a:hover,
.breadcrumb-item a:focus {
    color: var(--brand-icon-color);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--brand-text-heading);
}

/* Dark mode breadcrumb and alert fixes. Cover spans as well as links:
 * django-dynamic-breadcrumbs renders many crumbs as <span>, not <a>. */
[data-bs-theme="dark"] .breadcrumb,
[data-bs-theme="dark"] .breadcrumb.alert,
[data-bs-theme="dark"] .breadcrumb.alert-success {
    color: #ffffff !important;
    background-color: var(--brand-surface-muted) !important;
    border-color: var(--brand-border) !important;
}

[data-bs-theme="dark"] .breadcrumb .breadcrumb-item,
[data-bs-theme="dark"] .breadcrumb .breadcrumb-item span,
[data-bs-theme="dark"] .breadcrumb .breadcrumb-item a,
[data-bs-theme="dark"] .breadcrumb .breadcrumb-item.active {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .breadcrumb-item a:hover,
[data-bs-theme="dark"] .breadcrumb-item a:focus {
    color: var(--brand-icon-color) !important;
}

[data-bs-theme="dark"] .breadcrumb-item + .breadcrumb-item::before {
    color: var(--brand-text-muted) !important;
}

[data-bs-theme="dark"] .alert {
    color: #ffffff !important;
}

/* Dark mode general heading colors */
[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6 {
    color: #ffffff !important;
}

/* Dark mode general body text */
[data-bs-theme="dark"] body,
[data-bs-theme="dark"] p {
    color: #ffffff !important;
}

/* Dark mode label colors */
[data-bs-theme="dark"] .form-label,
[data-bs-theme="dark"] label {
    color: #ffffff !important;
}

/* ========================================= */
/* DARK MODE CUSTOMER DETAIL PAGE FIXES */
/* ========================================= */

/* Dark mode customer header */
[data-bs-theme="dark"] .customer-header {
    background: var(--brand-surface) !important;
    border: 1px solid var(--brand-border) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .customer-header h4 {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .customer-header .subtitle {
    color: var(--brand-text-muted) !important;
}

/* Dark mode customer info */
[data-bs-theme="dark"] .customer-info {
    color: #ffffff !important;
}

/* Dark mode detail cards */
[data-bs-theme="dark"] .detail-card {
    background: var(--brand-surface) !important;
    border: 1px solid var(--brand-border) !important;
}

[data-bs-theme="dark"] .detail-card .card-header {
    background: var(--brand-surface-muted) !important;
    border-bottom: 1px solid var(--brand-border-strong) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .detail-card .card-header i {
    color: var(--brand-icon-color) !important;
}

[data-bs-theme="dark"] .detail-card .card-body {
    background: var(--brand-surface) !important;
}

/* Dark mode detail fields */
[data-bs-theme="dark"] .detail-field {
    border-bottom: 1px solid var(--brand-border) !important;
}

[data-bs-theme="dark"] .detail-field .field-label {
    color: var(--brand-text-muted) !important;
}

[data-bs-theme="dark"] .detail-field .field-value {
    color: #ffffff !important;
}

/* Dark mode navigation tabs */
[data-bs-theme="dark"] .nav-tabs .nav-link {
    background: var(--brand-surface) !important;
    border: 1px solid var(--brand-border) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .nav-tabs .nav-link.active {
    background: var(--brand-primary) !important;
    color: #ffffff !important;
    border-color: var(--brand-primary) !important;
}

[data-bs-theme="dark"] .nav-tabs .nav-link:hover:not(.active) {
    background: var(--brand-surface-muted) !important;
    color: #ffffff !important;
    border-color: var(--brand-border-strong) !important;
}

/* Dark mode data tables */
[data-bs-theme="dark"] .data-table {
    background: var(--brand-surface) !important;
    border: 1px solid var(--brand-border) !important;
}

[data-bs-theme="dark"] .data-table th {
    background: var(--brand-surface-muted) !important;
    color: #ffffff !important;
    border-bottom: 1px solid var(--brand-border-strong) !important;
}

[data-bs-theme="dark"] .data-table td {
    color: #ffffff !important;
    border-bottom: 1px solid var(--brand-border) !important;
}

[data-bs-theme="dark"] .data-table tbody tr:nth-child(even) {
    background: var(--brand-surface-muted) !important;
}

[data-bs-theme="dark"] .data-table tbody tr:hover {
    background: var(--brand-surface-tint) !important;
}

/* Dark mode information alerts */
[data-bs-theme="dark"] .information-alert {
    background: var(--brand-surface-muted) !important;
    border-left: 4px solid var(--brand-icon-color) !important;
    color: #ffffff !important;
    border: 1px solid var(--brand-border-strong) !important;
}

/* ========================================= */
/* DARK MODE: GLOBAL ALERT & SWEETALERT FIXES */
/* ========================================= */

/* Improve readability of alerts in dark theme */
[data-bs-theme="dark"] .alert-danger{
  color: #ffe5e8 !important;
  background: linear-gradient(180deg, rgba(220,53,69,.18), rgba(220,53,69,.10)) !important;
  border-color: rgba(255,255,255,.22) !important;
}
[data-bs-theme="dark"] .alert-warning{
  color: #fff3cd !important;
  background: linear-gradient(180deg, rgba(255,193,7,.18), rgba(255,193,7,.10)) !important;
  border-color: rgba(255,255,255,.22) !important;
}
[data-bs-theme="dark"] .alert-info{
  color: #e6f4fb !important;
  background: linear-gradient(180deg, rgba(45,149,204,.18), rgba(45,149,204,.10)) !important;
  border-color: rgba(255,255,255,.18) !important;
}

/* SweetAlert readability in dark mode */
[data-bs-theme="dark"] .swal2-popup{
  background: #ffffff !important;
  color: #1e293b !important;
}
[data-bs-theme="dark"] .swal2-title,
[data-bs-theme="dark"] .swal2-html-container{
  color: #1e293b !important;
}
[data-bs-theme="dark"] .swal2-popup p,
[data-bs-theme="dark"] .swal2-popup span,
[data-bs-theme="dark"] .swal2-popup li{
  color: #1e293b !important;
}
[data-bs-theme="dark"] .swal2-popup a{
  color: #0a4ea3 !important; /* readable link on light bg */
}
[data-bs-theme="dark"] .swal2-loader{
  border-color: #1e293b transparent #1e293b transparent !important;
}

/* Dark mode DataTables wrapper */
[data-bs-theme="dark"] .dataTables_wrapper {
    background: var(--brand-surface) !important;
    border: 1px solid var(--brand-border) !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length select,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter input {
    background: var(--brand-surface-muted) !important;
    border: 1px solid var(--brand-border-strong) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_info {
    color: var(--brand-text-muted) !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button {
    background: var(--brand-surface) !important;
    border: 1px solid var(--brand-border) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--brand-primary) !important;
    color: #ffffff !important;
    border-color: var(--brand-primary) !important;
}

.text-danger {
    font-size: 0.95em;
}

/* Call Forwarding Custom Condition UI Styles */
#time-range-slider {
    height: 15px;
    background: #e9e9e9;
    border-radius: 5px;
}

#time-range-slider .noUi-connect {
    background: var(--brand-primary);
}

.logo {
    z-index: 2000;
}

#time-range-slider .noUi-handle {
    height: 20px;
    width: 20px;
    top: -3px;
    right: -10px;
    border-radius: 50%;
    background: var(--brand-primary);
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

#time-range-slider .noUi-handle:before, 
#time-range-slider .noUi-handle:after {
    display: none;
}

.time-condition-container {
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    padding: 1rem;
    margin-bottom: 1rem;
    overflow: visible !important;
    max-height: none !important;
    z-index: 10;
}

/* Remove the default display:none so it can be controlled by JavaScript */
/* #time-conditions-container {
    display: none;
} */

#time-conditions-container.show-container {
    display: block !important;
}

.condition-panel .btn {
    margin: 0.2rem;
}

.condition-panel .btn.selected {
    background-color: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
}

#start-time-display, #end-time-display {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--brand-primary);
}

#condition-rules {
    background-color: #fff;
    border: 1px solid #ced4da;
    color: #343a40;
}

/* CNDB Form Styles */
.required-asterisk {
    color: red;
    margin-left: 4px;
}

.rejection-box {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.rejection-title {
    color: #721c24;
    font-weight: bold;
    margin-bottom: 10px;
}

.rejection-message {
    color: #721c24;
}

/* Password Reset Page Styles */
.back-to-login-link {
    color: #083c58 !important;
    text-decoration: none;
}

.back-to-login-link:hover {
    color: #0a4663 !important;
    text-decoration: underline;
}

.back-to-login-btn {
    background-color: #083c58 !important;
    border-color: #083c58 !important;
    color: white !important;
}

.back-to-login-btn:hover {
    background-color: #0a4663 !important;
    border-color: #0a4663 !important;
    color: white !important;
}

.swal2-popup,
.swal2-title,
.swal2-html-container,
.swal2-actions,
.swal2-confirm,
.swal2-cancel {
  font-family: inherit !important;
}

/* SweetAlert2 theming - align info modal with brand color */
.swal2-icon.swal2-info {
  border-color: #0d3d55 !important;
  color: #0d3d55 !important;
}

.swal2-styled.swal2-confirm {
  background-color: #0d3d55 !important;
  border-color: #0d3d55 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.swal2-styled.swal2-confirm:hover,
.swal2-styled.swal2-confirm:focus {
  background-color: #0b3348 !important;
  border-color: #0b3348 !important;
}

.swal2-actions .swal2-styled:focus {
  box-shadow: 0 0 0 3px rgba(13, 61, 85, 0.25) !important;
}

/* SweetAlert2 title sizing (all themes) */
.swal2-title {
  font-size: 1.2rem !important; /* slightly smaller than default */
  font-weight: 600 !important;
}

/* SweetAlert2 content sizing (all themes) */
.swal2-html-container {
  font-size: 0.95rem !important;
}

/* Global SweetAlert2 dark theme overrides */
html[data-bs-theme="dark"] .swal2-popup { background: var(--brand-surface) !important; color: var(--brand-text-heading) !important; border: 1px solid var(--brand-border) !important; }
html[data-bs-theme="dark"] .swal2-title { color: #ffffff !important; }
html[data-bs-theme="dark"] .swal2-html-container { color: var(--brand-text-body) !important; }
html[data-bs-theme="dark"] .swal2-styled.swal2-confirm { background: var(--brand-icon-color) !important; color: #0b1720 !important; border: none !important; }
html[data-bs-theme="dark"] .swal2-styled.swal2-cancel { background: var(--brand-border-strong) !important; color: #ffffff !important; border: none !important; }
html[data-bs-theme="dark"] .swal2-loader {
    border-color: var(--brand-icon-color) transparent var(--brand-icon-color) transparent !important;
}

/* Sidebar custom headers and separators */
.menu-header-green {
	padding: 6px 12px;
	font-weight: 700;
	color: #39c82b;
	text-align: center;
	font-size: 1rem;
	text-shadow: -0.5px 0 0 #0a2d3c, 0 0.5px 0 #0a2d3c, 0.5px 0 0 #0a2d3c, 0 -0.5px 0 #0a2d3c; /* subtle outline for contrast */
	border: 1px solid #39c82b;
	border-radius: 999px;
	display: block; /* allow auto margins to center */
	width: max-content; /* shrink to content */
	max-width: calc(100% - 28px); /* keep inside sidebar with left/right breathing room */
	margin: 6px auto; /* center horizontally */
	padding: 6px 14px; /* extra horizontal breathing room */
	white-space: normal; /* allow wrapping */
	word-break: break-word; /* break long words */
	overflow-wrap: anywhere; /* ensure no overflow on small widths */
}

/* The Canva sidebar logo includes transparent padding around the artwork.
 * Crop that canvas visually so the expanded logo remains crisp and balanced. */
.leftside-menu .logo.logo-light .logo-lg {
	position: relative;
	display: block;
	width: 235px;
	height: 73px;
	margin: 0 auto;
	overflow: hidden;
}

.leftside-menu .logo.logo-light .logo-lg .logo-image {
	position: absolute;
	top: -169px;
	left: -46px;
	width: 310px !important;
	height: auto !important;
	max-width: none;
}

/* Compact sidebar: context names are useful only in the expanded menu.
 * Without this, long VAR/sub-customer names wrap vertically in the icon rail. */
html[data-sidenav-size="condensed"]:not([data-layout="topnav"]) .leftside-menu .menu-header-green,
html[data-sidenav-size="sm-hover"]:not([data-layout="topnav"]) .leftside-menu:not(:hover) .menu-header-green {
    display: none !important;
}

/* A collapsed rail is icon-only. Never render or scroll submenu content until
 * the user expands the sidebar. SimpleBar's JS is not loaded on this page, so
 * `#leftside-menu-container` itself (not just its `.simplebar-*` wrapper
 * classes) is the element that actually scrolls - it must be targeted
 * directly, otherwise the browser computes its unset overflow-x as "auto"
 * (per spec, whenever overflow-y is constrained) and a horizontal scrollbar
 * appears from the hidden nav-item labels. */
html[data-sidenav-size="condensed"]:not([data-layout="topnav"]) .wrapper .leftside-menu,
html[data-sidenav-size="condensed"]:not([data-layout="topnav"]) #leftside-menu-container,
html[data-sidenav-size="condensed"]:not([data-layout="topnav"]) #leftside-menu-container .simplebar-content-wrapper,
html[data-sidenav-size="sm-hover"]:not([data-layout="topnav"]) .wrapper .leftside-menu:not(:hover),
html[data-sidenav-size="sm-hover"]:not([data-layout="topnav"]) .leftside-menu:not(:hover) #leftside-menu-container,
html[data-sidenav-size="sm-hover"]:not([data-layout="topnav"]) .leftside-menu:not(:hover) #leftside-menu-container .simplebar-content-wrapper {
    overflow-x: hidden !important;
}

/* The vendor theme reserves a fixed 2000px minimum height on `.content-page`
 * while condensed (to make room for its hover-flyout submenus). Those
 * flyouts are disabled above, so that reserved height only leaves a huge
 * blank area and makes every page scroll far longer than its content. */
html[data-sidenav-size="condensed"]:not([data-layout="topnav"]) .wrapper .content-page {
    min-height: calc(100vh - var(--ct-topbar-height) - 2px) !important;
}

html[data-sidenav-size="condensed"]:not([data-layout="topnav"]) .wrapper .leftside-menu .side-nav .side-nav-item > :is(.collapse, .collapsing),
html[data-sidenav-size="sm-hover"]:not([data-layout="topnav"]) .wrapper .leftside-menu:not(:hover) .side-nav .side-nav-item > :is(.collapse, .collapsing) {
    display: none !important;
}

html[data-sidenav-size="condensed"]:not([data-layout="topnav"]) .leftside-menu :is(.side-nav-second-level, .side-nav-third-level),
html[data-sidenav-size="sm-hover"]:not([data-layout="topnav"]) .leftside-menu:not(:hover) :is(.side-nav-second-level, .side-nav-third-level) {
    display: none !important;
}

html[data-sidenav-size="condensed"]:not([data-layout="topnav"]) #leftside-menu-container :is(.simplebar-mask, .simplebar-offset, .simplebar-content-wrapper, .simplebar-content),
html[data-sidenav-size="sm-hover"]:not([data-layout="topnav"]) .leftside-menu:not(:hover) #leftside-menu-container :is(.simplebar-mask, .simplebar-offset, .simplebar-content-wrapper, .simplebar-content) {
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* Keep the compact brand mark visually balanced in the 70px icon rail. */
html[data-sidenav-size="condensed"]:not([data-layout="topnav"]) .leftside-menu .logo .logo-sm,
html[data-sidenav-size="sm-hover"]:not([data-layout="topnav"]) .leftside-menu:not(:hover) .logo .logo-sm {
    position: relative;
    width: 36px;
    height: 36px;
    margin: 0 auto;
    overflow: hidden;
    line-height: normal;
}

html[data-sidenav-size="condensed"]:not([data-layout="topnav"]) .leftside-menu .logo .logo-sm img,
html[data-sidenav-size="sm-hover"]:not([data-layout="topnav"]) .leftside-menu:not(:hover) .logo .logo-sm img {
    position: absolute;
    top: -163px;
    left: -110px;
    width: 255px !important;
    height: auto !important;
    max-width: none;
}

/* Keep condensed-menu hover and active states on the shared blue palette
 * instead of the vendor's legacy purple/navy treatment. */
html[data-sidenav-size="condensed"]:not([data-layout="topnav"]) .wrapper .leftside-menu .side-nav .side-nav-item:hover > .side-nav-link,
html[data-sidenav-size="condensed"]:not([data-layout="topnav"]) .wrapper .leftside-menu .side-nav .side-nav-item > .side-nav-link:is(:hover, :focus, :active),
html[data-sidenav-size="sm-hover"]:not([data-layout="topnav"]) .wrapper .leftside-menu:not(:hover) .side-nav .side-nav-item > .side-nav-link:is(:hover, :focus, :active) {
    background: var(--brand-surface-tint) !important;
    color: var(--brand-icon-color) !important;
}

html[data-sidenav-size="condensed"]:not([data-layout="topnav"]) .wrapper .leftside-menu .side-nav .side-nav-item:hover > .side-nav-link :is(i, .mdi),
html[data-sidenav-size="condensed"]:not([data-layout="topnav"]) .wrapper .leftside-menu .side-nav .side-nav-item > .side-nav-link:is(:hover, :focus, :active) :is(i, .mdi),
html[data-sidenav-size="sm-hover"]:not([data-layout="topnav"]) .wrapper .leftside-menu:not(:hover) .side-nav .side-nav-item > .side-nav-link:is(:hover, :focus, :active) :is(i, .mdi) {
    color: var(--brand-icon-color) !important;
}

html[data-sidenav-size="condensed"]:not([data-layout="topnav"]) .wrapper .leftside-menu .side-nav .side-nav-item:hover > .collapse > ul,
html[data-sidenav-size="condensed"]:not([data-layout="topnav"]) .wrapper .leftside-menu .side-nav .side-nav-item:hover > .collapsing > ul {
    background: var(--brand-surface) !important;
    border: 1px solid var(--brand-menu-border) !important;
    box-shadow: var(--brand-shadow-card) !important;
}

/* Expanded sidebar hierarchy: outline the open group and accent the selected
 * destination without filling the entire navigation row. */
html:not([data-sidenav-size="condensed"]) .leftside-menu .side-nav > .side-nav-item.menuitem-active:has(> .collapse):not(:has(.side-nav-second-level > .side-nav-item > .side-nav-link[aria-expanded="true"])) > .side-nav-link,
html[data-sidenav-size="sm-hover"] .leftside-menu:hover .side-nav > .side-nav-item.menuitem-active:has(> .collapse):not(:has(.side-nav-second-level > .side-nav-item > .side-nav-link[aria-expanded="true"])) > .side-nav-link {
    margin: 0 0.6rem;
    padding-right: calc(var(--ct-menu-item-padding-x) - 0.6rem);
    padding-left: calc(var(--ct-menu-item-padding-x) - 0.6rem);
    border: 1px solid var(--brand-menu-border);
    border-radius: var(--brand-radius-md);
    background: transparent;
    color: var(--ct-menu-item-active-color);
}

html:not([data-sidenav-size="condensed"]) .leftside-menu .side-nav > .side-nav-item.menuitem-active:has(> .collapse):not(:has(.side-nav-second-level > .side-nav-item > .side-nav-link[aria-expanded="true"])) > .side-nav-link .menu-arrow,
html[data-sidenav-size="sm-hover"] .leftside-menu:hover .side-nav > .side-nav-item.menuitem-active:has(> .collapse):not(:has(.side-nav-second-level > .side-nav-item > .side-nav-link[aria-expanded="true"])) > .side-nav-link .menu-arrow {
    right: 0.7rem;
}

/* A selected leaf destination is highlighted, never wrapped in a container. */
.leftside-menu .side-nav > .side-nav-item > .side-nav-link.active:not([aria-expanded]) {
    color: var(--brand-success) !important;
    font-weight: 700;
}

.leftside-menu .side-nav > .side-nav-item > .side-nav-link.active:not([aria-expanded]) :is(i, .mdi) {
    color: var(--brand-success) !important;
}

.leftside-menu .side-nav :is(.side-nav-second-level, .side-nav-third-level) .side-nav-link.active,
.leftside-menu .side-nav :is(.side-nav-second-level, .side-nav-third-level) .side-nav-item.active > .side-nav-link {
    color: var(--brand-success) !important;
    font-weight: 700;
}

.leftside-menu .side-nav :is(.side-nav-second-level, .side-nav-third-level) .side-nav-link.active :is(i, .mdi),
.leftside-menu .side-nav :is(.side-nav-second-level, .side-nav-third-level) .side-nav-item.active > .side-nav-link :is(i, .mdi) {
    color: var(--brand-success) !important;
}

/* A selected nested service (for example CloudSIM) contains its own child
 * navigation, so keep its label and child destinations inside one outline. */
html:not([data-sidenav-size="condensed"]) .leftside-menu .side-nav .side-nav-second-level > .side-nav-item:has(> .side-nav-link[aria-expanded="true"]):has(.side-nav-link.active),
html[data-sidenav-size="sm-hover"] .leftside-menu:hover .side-nav .side-nav-second-level > .side-nav-item:has(> .side-nav-link[aria-expanded="true"]):has(.side-nav-link.active) {
    margin: 0.35rem 0.45rem;
    border: 1px solid var(--brand-menu-border);
    border-radius: var(--brand-radius-md);
    overflow: hidden;
}

html:not([data-sidenav-size="condensed"]) .leftside-menu .side-nav .side-nav-second-level > .side-nav-item:has(> .side-nav-link[aria-expanded="true"]):has(.side-nav-link.active) > .side-nav-link,
html[data-sidenav-size="sm-hover"] .leftside-menu:hover .side-nav .side-nav-second-level > .side-nav-item:has(> .side-nav-link[aria-expanded="true"]):has(.side-nav-link.active) > .side-nav-link {
    padding-right: 0.7rem !important;
    padding-left: 0.7rem !important;
    color: var(--ct-menu-item-active-color);
}

html:not([data-sidenav-size="condensed"]) .leftside-menu .side-nav .side-nav-second-level > .side-nav-item:has(> .side-nav-link[aria-expanded="true"]):has(.side-nav-link.active) > .collapse > .side-nav-third-level,
html[data-sidenav-size="sm-hover"] .leftside-menu:hover .side-nav .side-nav-second-level > .side-nav-item:has(> .side-nav-link[aria-expanded="true"]):has(.side-nav-link.active) > .collapse > .side-nav-third-level {
    padding-right: 0;
    padding-bottom: 0.35rem;
    padding-left: 0.7rem !important;
}

/* Top-level groups with direct destinations (CNDB, User management) use the
 * same contained hierarchy. Groups with a selected nested service keep the
 * two-level treatment above instead. */
html:not([data-sidenav-size="condensed"]) .leftside-menu .side-nav > .side-nav-item:has(> .side-nav-link[aria-expanded="true"]):has(.side-nav-link.active):not(:has(.side-nav-second-level > .side-nav-item > .side-nav-link[aria-expanded="true"])),
html[data-sidenav-size="sm-hover"] .leftside-menu:hover .side-nav > .side-nav-item:has(> .side-nav-link[aria-expanded="true"]):has(.side-nav-link.active):not(:has(.side-nav-second-level > .side-nav-item > .side-nav-link[aria-expanded="true"])) {
    margin: 0.35rem 0.45rem;
    border: 1px solid var(--brand-menu-border);
    border-radius: var(--brand-radius-md);
    overflow: hidden;
}

html:not([data-sidenav-size="condensed"]) .leftside-menu .side-nav > .side-nav-item:has(> .side-nav-link[aria-expanded="true"]):has(.side-nav-link.active):not(:has(.side-nav-second-level > .side-nav-item > .side-nav-link[aria-expanded="true"])) > .side-nav-link,
html[data-sidenav-size="sm-hover"] .leftside-menu:hover .side-nav > .side-nav-item:has(> .side-nav-link[aria-expanded="true"]):has(.side-nav-link.active):not(:has(.side-nav-second-level > .side-nav-item > .side-nav-link[aria-expanded="true"])) > .side-nav-link {
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding-right: 0.7rem !important;
    padding-left: 0.7rem !important;
}

html:not([data-sidenav-size="condensed"]) .leftside-menu .side-nav > .side-nav-item:has(> .side-nav-link[aria-expanded="true"]):has(.side-nav-link.active):not(:has(.side-nav-second-level > .side-nav-item > .side-nav-link[aria-expanded="true"])) > .collapse > .side-nav-second-level,
html[data-sidenav-size="sm-hover"] .leftside-menu:hover .side-nav > .side-nav-item:has(> .side-nav-link[aria-expanded="true"]):has(.side-nav-link.active):not(:has(.side-nav-second-level > .side-nav-item > .side-nav-link[aria-expanded="true"])) > .collapse > .side-nav-second-level {
    padding-right: 0;
    padding-bottom: 0.35rem;
    padding-left: 0.7rem !important;
}

/* Sidebar support entry: a clear, compact call to action instead of a plain
 * navigation row. */
.leftside-menu .support-menu-item {
    margin: 0.75rem 0.65rem 1.75rem;
}

.leftside-menu .support-menu-item .support-menu-link {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 0.25rem 0.65rem;
    padding: 0.8rem !important;
    border: 1px solid var(--brand-menu-border);
    border-radius: var(--brand-radius-lg);
    background: rgba(255, 255, 255, 0.03);
    color: var(--ct-menu-item-active-color);
    white-space: normal;
}

.leftside-menu .support-menu-item .support-menu-link:hover,
.leftside-menu .support-menu-item .support-menu-link:focus {
    background: rgba(12, 168, 225, 0.08);
    color: var(--ct-menu-item-active-color);
}

.leftside-menu .support-menu-icon {
    display: inline-flex;
    grid-row: span 2;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--brand-success);
    color: var(--brand-primary);
}

.leftside-menu .support-menu-icon i {
    width: auto;
    min-width: 0;
    color: inherit;
    font-size: 1.25rem;
    line-height: 1;
}

.leftside-menu .support-menu-copy {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.leftside-menu .support-menu-copy strong {
    color: var(--ct-menu-item-active-color);
    font-size: 0.9rem;
}

.leftside-menu .support-menu-copy small {
    color: var(--ct-menu-item-color);
    font-size: 0.75rem;
}

.leftside-menu .support-menu-action {
    display: inline-flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--brand-success);
    border-radius: var(--brand-radius-sm);
    color: var(--ct-menu-item-active-color);
    font-size: 0.76rem;
    font-weight: 700;
}

.leftside-menu .support-menu-action i {
    width: auto;
    min-width: 0;
    color: var(--brand-success);
    font-size: 1rem;
}

html[data-sidenav-size="condensed"] .leftside-menu .support-menu-item,
html[data-sidenav-size="sm-hover"] .leftside-menu:not(:hover) .support-menu-item {
    display: none;
}

.menu-separator-green {
	border-top: 3px solid #39c82b;
	margin: 10px 14px;
	border-radius: 999px;
}

/* Sidebar nested submenu spacing/alignment improvements */
/* Keep submenus within the blue panel and avoid excessive indentation from theme defaults */
.side-nav .side-nav-second-level {
	padding-left: 16px !important;
	margin-top: 0;
}

.side-nav .side-nav-third-level {
	padding-left: 32px !important;
}

/* Reset anchor padding to the theme default so it doesn't drift right */
.side-nav .side-nav-second-level .side-nav-item > a,
.side-nav .side-nav-third-level .side-nav-item > a {
	padding-left: calc(var(--ct-menu-item-padding-x) * 1.5) !important;
	padding-right: 0.75rem !important;
	white-space: nowrap;
	font-size: 0.82rem;
}

/* Subtle elevation for tables (matches stats-card feel) */
.table-elevated {
	border-radius: 1rem;
	box-shadow: 0 8px 24px rgba(154, 161, 171, 0.25);
	border: 1px solid #eef2f7;
	background: #ffffff;
}

.table-elevated .modern-table thead th {
	border-bottom: 1px solid #eef2f7 !important;
}

/* Dark mode variant */
[data-bs-theme="dark"] .table-elevated {
	background: var(--brand-surface) !important;
	border: 1px solid var(--brand-border) !important;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] .table-elevated .modern-table thead th {
	border-bottom: 1px solid var(--brand-border) !important;
}

/* Improve badge look inside modern tables */
.modern-table .badge {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	border-radius: 999px;
	padding: 0.35rem 0.6rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	font-size: 0.78rem;
	line-height: 1.2;
	border: 1px solid transparent;
}

/* Soft color variants for light theme */
.modern-table .badge.bg-secondary { background-color: #e9ecef !important; color: #495057 !important; border-color: #ced4da !important; }
.modern-table .badge.bg-success { background-color: #d1f7e8 !important; color: #0f5132 !important; border-color: #a3e4cf !important; }
.modern-table .badge.bg-info { background-color: #d7f1ff !important; color: #0c5460 !important; border-color: #9bd9ff !important; }
.modern-table .badge.bg-danger { background-color: #fde2e1 !important; color: #842029 !important; border-color: #f5c2c7 !important; }

/* Dark mode badge adjustments */
[data-bs-theme="dark"] .modern-table .badge.bg-secondary { background-color: var(--brand-surface-muted) !important; color: #ffffff !important; border-color: var(--brand-border-strong) !important; }
[data-bs-theme="dark"] .modern-table .badge.bg-success { background-color: #0f5132 !important; color: #d1f7e8 !important; border-color: #198754 !important; }
[data-bs-theme="dark"] .modern-table .badge.bg-info { background-color: #0c5460 !important; color: #d7f1ff !important; border-color: #0ea5c0 !important; }
[data-bs-theme="dark"] .modern-table .badge.bg-danger { background-color: #842029 !important; color: #fde2e1 !important; border-color: #dc3545 !important; }

/* Compact styling for upgrade options card */
#upgrade-subscribed-options .ys-card,
#upgrade-trial-options .ys-card {
    padding: 12px 16px !important;
    border-radius: 8px !important;
}
#upgrade-subscribed-options,
#upgrade-trial-options {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}
@media (min-width: 768px) {
    #upgrade-subscribed-options,
    #upgrade-trial-options { max-width: 540px; }
}
@media (min-width: 992px) {
    #upgrade-subscribed-options,
    #upgrade-trial-options { max-width: 720px; }
}
#upgrade-subscribed-options .ys-card-header,
#upgrade-trial-options .ys-card-header {
    margin-bottom: 8px !important;
}
#upgrade-subscribed-options .ys-card-title,
#upgrade-trial-options .ys-card-title {
    font-size: 1rem !important;
    font-weight: 600 !important;
}
#upgrade-subscribed-options .ys-card-sub,
#upgrade-trial-options .ys-card-sub {
    font-size: 0.85rem !important;
    color: var(--bs-secondary-color, #6c757d) !important;
}
#upgrade-subscribed-options .ys-card-price,
#upgrade-trial-options .ys-card-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 4px 0 10px 0 !important;
}
#upgrade-subscribed-options .ys-card-price .label,
#upgrade-trial-options .ys-card-price .label {
    font-size: 0.85rem !important;
    color: var(--bs-secondary-color, #6c757d) !important;
}
#upgrade-subscribed-options .ys-card-price .price,
#upgrade-trial-options .ys-card-price .price {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
}
#upgrade-subscribed-options .ys-card-actions .btn,
#upgrade-trial-options .ys-card-actions .btn {
    padding: 8px 12px !important;
    font-size: 0.95rem !important;
}

/* Keep the sidebar scrollable and make the available scroll position clear. */
#leftside-menu-container[data-simplebar] {
	overflow-y: auto !important;
	scrollbar-width: thin;
	scrollbar-color: var(--brand-menu-border) transparent;
}
#leftside-menu-container[data-simplebar]::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}
#leftside-menu-container[data-simplebar]::-webkit-scrollbar-thumb {
	background: var(--brand-menu-border);
	border: 2px solid var(--ct-menu-bg);
	border-radius: 999px;
}
#leftside-menu-container[data-simplebar]::-webkit-scrollbar-thumb:hover {
	background: var(--brand-menu-border);
}
#leftside-menu-container[data-simplebar] .simplebar-track.simplebar-vertical {
	width: 10px;
	right: 2px;
}
#leftside-menu-container[data-simplebar] .simplebar-track.simplebar-horizontal {
	display: none !important;
}
#leftside-menu-container[data-simplebar] .simplebar-scrollbar::before {
	background: var(--brand-menu-border);
	opacity: 0.58;
}
#leftside-menu-container[data-simplebar] .simplebar-scrollbar:hover::before {
	opacity: 1;
}
#leftside-menu-container[data-simplebar] .simplebar-scrollbar.simplebar-visible::before {
	opacity: 0.58;
}
#leftside-menu-container[data-simplebar] .simplebar-scrollbar.simplebar-visible:hover::before {
	opacity: 1;
}

/* Use the same restrained brand scrollbar in every scrollable application
 * surface, including native browser scrollbars and SimpleBar components. */
* {
	scrollbar-width: thin;
	scrollbar-color: var(--brand-menu-border) transparent;
}

*::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}

*::-webkit-scrollbar-track {
	background: transparent;
}

*::-webkit-scrollbar-thumb {
	background: var(--brand-menu-border);
	border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
	background: var(--brand-menu-border);
}

.simplebar-scrollbar::before {
	background: var(--brand-menu-border);
	opacity: 0.58;
}

.simplebar-scrollbar.simplebar-visible::before {
	opacity: 0.58;
}

.simplebar-scrollbar:hover::before,
.simplebar-scrollbar.simplebar-visible:hover::before {
	opacity: 1;
}

/* ===================================================== */
/* Checkbox / radio brand color overrides (native + Bootstrap) */
/* =========================================================== */
input[type="checkbox"] {
    accent-color: var(--brand-primary);
}

input[type="radio"] {
    accent-color: #0BA8E1;
}

.form-check-input {
    accent-color: var(--brand-primary);
}

.form-check-input:checked {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
}

/* Bootstrap 5 renders the radio as a coloured ring + white dot via SVG.
   background-color = ring fill, SVG fill = white dot inside. */
.form-check-input[type="radio"]:checked {
    background-color: #0BA8E1 !important;
    border-color: #0BA8E1 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e") !important;
}

.form-check-input:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 0.2rem var(--brand-focus-ring) !important;
}

[data-bs-theme="dark"] input[type="checkbox"],
[data-bs-theme="dark"] .form-check-input {
    accent-color: var(--brand-success-green);
}

[data-bs-theme="dark"] .form-check-input:checked {
    background-color: var(--brand-success-green) !important;
    border-color: var(--brand-success-green) !important;
}

/* ===================================================== */
/* Dashboard & Stats Cards Styling                       */
/* ===================================================== */

/* Stats icon wrapper for dashboard cards */
.stats-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: none;
}

.stats-icon-wrapper i {
    font-size: 1.25rem;
    color: var(--brand-icon-color);
}

/* Dashboard empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.empty-icon i {
    font-size: 2.5rem;
    color: #adb5bd;
}

.empty-state h5 {
    color: #495057;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.empty-state p {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* Dark mode adjustments for stats icon wrapper */
[data-bs-theme="dark"] .stats-icon-wrapper {
    background: transparent;
    box-shadow: none;
}

/* Dashboard stat cards with hover effect */
.dashboard-stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.dashboard-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
    border-color: rgba(8, 61, 86, 0.15);
}

[data-bs-theme="dark"] .dashboard-stat-card {
    border-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .dashboard-stat-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
    border-color: rgba(10, 77, 109, 0.3);
}

/* Dashboard card typography - optimized for scanning */
.dashboard-card-label {
    font-size: 0.813rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.dashboard-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--brand-primary);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.dashboard-card-sublabel {
    font-size: 0.75rem;
    color: #adb5bd;
    font-weight: 400;
}

.dashboard-card-currency {
    font-size: 2rem;
    font-weight: 700;
    color: #6c757d;
    margin-left: 0.5rem;
    line-height: 1.2;
}

.dashboard-card-value-large {
    font-size: 3rem;
    font-weight: 700;
    color: var(--brand-primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

/* Balance card specific spacing */
.balance-amount-section {
    margin-top: 0.5rem;
    padding-left: 60px;
    display: flex;
    align-items: baseline;
}

[data-bs-theme="dark"] .dashboard-card-label {
    color: #adb5bd;
}

[data-bs-theme="dark"] .dashboard-card-value {
    color: #ffffff;
}

[data-bs-theme="dark"] .dashboard-card-sublabel {
    color: #6c757d;
}

[data-bs-theme="dark"] .dashboard-card-currency {
    color: #adb5bd;
}

[data-bs-theme="dark"] .dashboard-card-value-large {
    color: #ffffff;
}

/* Stats grid for CNDB and Porting cards - scannable layout */
.cndb-stats-grid,
.porting-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding-left: 60px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 0.938rem;
    color: #6c757d;
    font-weight: 500;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-primary);
    font-variant-numeric: tabular-nums;
}

[data-bs-theme="dark"] .stat-row {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .stat-label {
    color: #adb5bd;
}

[data-bs-theme="dark"] .stat-value {
    color: #ffffff;
}

/* Interconnects page - period selector and chart layout */
.interconnects-period-select {
    min-width: 180px;
}

.interconnects-stat-value {
    font-size: 1.1rem;
}

.chart-container-line {
    height: 320px;
}

/* Sortable table headers */
th.sortable {
    user-select: none;
    white-space: nowrap;
}

th.sortable:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

th.sortable .sort-icon {
    font-size: 0.85rem;
    opacity: 0.45;
    margin-left: 2px;
    transition: opacity 0.15s;
}

th.sortable:hover .sort-icon,
th.sortable .sort-icon.text-primary {
    opacity: 1;
}

.footer {
    border-top: 0;
}

/* Footer trust signals sit beside the copyright without disrupting its center. */
.footer .footer-brand-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    min-height: 38px;
    gap: 0.8rem;
    color: var(--brand-text-muted);
    font-size: 0.68rem;
}

.footer .footer-copyright-group {
    display: inline-flex;
    align-items: center;
    grid-column: 2;
    justify-self: center;
    gap: 0.55rem;
}

.footer .footer-compliance-image {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.footer .footer-copyright {
    white-space: nowrap;
}

.footer .footer-europe {
    display: block !important;
    grid-column: 3;
    justify-self: end;
    color: var(--brand-text-body);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.footer .footer-europe span {
    color: var(--brand-danger);
    font-size: 0.82rem;
}

@media (max-width: 767.98px) {
    .footer .footer-brand-bar {
        grid-template-columns: 1fr;
        justify-items: center;
        padding: 0.5rem 0;
    }

    .footer .footer-copyright-group,
    .footer .footer-copyright,
    .footer .footer-europe {
        grid-column: auto;
        justify-self: center;
    }
}
/* Privacy policy / terms pages: long-form legal text. */
.legal-document {
    max-width: 60rem;
    color: var(--brand-text-body);
    line-height: 1.7;
}

.legal-document p,
.legal-document ul,
.legal-document ol {
    margin-bottom: 1rem;
}

.legal-document h1,
.legal-document h2,
.legal-document h3,
.legal-document h4,
.legal-document h5,
.legal-document h6 {
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.legal-document ul,
.legal-document ol {
    padding-left: 1.5rem;
}

.legal-document a {
    text-decoration: underline;
}
