.login-page, .register-page { background: #eef2f7; }
.modal-backdrop {
    background-color: rgba(33, 37, 41, 0.22);
}
.modal-backdrop.show {
    opacity: 1;
}
.brand-link .brand-text { font-weight: 600 !important; }
.sidebar-brand-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    padding: 3px;
}
.app-header-inner {
    display: flex;
    align-items: center;
    width: 100%;
}
.app-header-left,
.app-header-right {
    flex-shrink: 0;
}
.app-header-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex: 1 1 auto;
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 1rem;
}
.app-header-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    padding: 4px;
}
.app-header-logo--fallback {
    font-size: 1rem;
}
.table td, .table th { vertical-align: middle; }
.badge-status { font-size: .85rem; }

.status-multi-select {
    position: relative;
}

.status-multi-select-toggle {
    width: 100%;
    min-height: 38px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
    background-color: #fff;
    color: #212529;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    padding: 0.5rem 0.75rem;
    line-height: 1.4;
}

.status-multi-select-toggle:hover,
.status-multi-select-toggle:focus,
.status-multi-select-toggle.show {
    border-color: rgba(13, 110, 253, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
    background-color: #fff;
}

.status-multi-select-toggle:after {
    display: none;
}

.status-multi-select-label {
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: 0;
    color: inherit;
}

.status-multi-select-menu {
    min-width: 100%;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.6rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.12);
    padding: 0.5rem !important;
    background: #fff;
}

.status-multi-select-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.7rem;
    border-radius: 0.45rem;
    color: #2b2b2b;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.status-multi-select-item:hover,
.status-multi-select-item:focus-within {
    background-color: rgba(13, 110, 253, 0.06);
    color: #0d6efd;
}

.status-multi-select-item .form-check-input {
    width: 1rem;
    height: 1rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.status-multi-select-item span {
    line-height: 1.35;
}

.category-select-custom {
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
    background-color: #fff;
    color: #212529;
    min-height: 38px;
    padding: 0.5rem 2.5rem 0.5rem 0.75rem;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%236c757d' d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.482a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 0.9rem) center;
    background-size: 0.8rem 0.8rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.category-select-custom:hover,
.category-select-custom:focus {
    border-color: rgba(13, 110, 253, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
    background-color: #fff;
}

.category-select-custom option {
    padding: 0.5rem 0.75rem;
}

.equipment-table {
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
}

.equipment-table thead th {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: #f8f9fa;
    color: #495057;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    white-space: nowrap;
}

.equipment-table thead th:nth-child(1) { width: 230px; }
.equipment-table thead th:nth-child(2) { width: 160px; }
.equipment-table thead th:nth-child(3) { width: 180px; }
.equipment-table thead th:nth-child(4) { width: 180px; }
.equipment-table thead th:nth-child(5) { width: 160px; }
.equipment-table thead th:nth-child(6) { width: 150px; }

.equipment-table tbody td {
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.equipment-table tbody tr:hover {
    background: rgba(13, 110, 253, 0.02);
}

.equipment-table .category-cell {
    min-width: 180px;
}

.equipment-table .category-content {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.equipment-table .category-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 6px;
    background: rgba(13, 110, 253, 0.04);
    padding: 2px;
}

.equipment-table .category-placeholder {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(108, 117, 125, 0.08);
    color: var(--bs-secondary-color);
    flex-shrink: 0;
}

.equipment-table .category-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    color: #2f2f2f;
}

.equipment-table .badge-status {
    display: inline-block;
    min-width: 110px;
    text-align: center;
    font-weight: 600;
    border-radius: 0.35rem;
    padding: 0.42rem 0.7rem;
}

.equipment-table .btn-outline-primary,
.equipment-table .btn-outline-info,
.equipment-table .btn-outline-danger {
    border-radius: 0.35rem;
    padding: 0.28rem 0.5rem;
}

.theme-option {
    position: relative;
    display: inline-flex;
    width: 40px;
    height: 40px;
    cursor: pointer;
}

.theme-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.lte-chip {
    align-items: center;
    justify-content: center;
    padding: 2px;
    border: 2px solid transparent;
    border-radius: .35rem;
    flex: 0 0 40px;
}

.lte-chip:focus-within {
    outline: 2px solid var(--bs-info);
    outline-offset: 2px;
}

.theme-option input:checked + .theme-swatch {
    border-color: transparent;
}

.theme-option:has(input:checked) {
    border-color: var(--bs-primary);
}

.theme-swatch {
    width: 32px;
    height: 32px;
    display: block;
    border: 0;
    border-radius: .35rem;
}

.theme-surface-light,
.theme-surface-light .nav-link,
.theme-surface-light .brand-link,
.theme-surface-light .nav-link:hover,
.theme-surface-light .nav-link:focus,
.theme-surface-light .nav-link.active {
    color: #212529 !important;
}

.theme-surface-light .brand-text,
.theme-surface-light .brand-image {
    color: #212529 !important;
}

.theme-surface-dark,
.theme-surface-dark .nav-link,
.theme-surface-dark .brand-link,
.theme-surface-dark .nav-link:hover,
.theme-surface-dark .nav-link:focus,
.theme-surface-dark .nav-link.active {
    color: #fff !important;
}

.theme-surface-dark .brand-text,
.theme-surface-dark .brand-image {
    color: #fff !important;
}

.theme-color-picker {
    scrollbar-width: thin;
}

.theme-preview {
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    font-size: .78rem;
}

.theme-preview-card.is-floating {
    position: fixed;
    z-index: 1020;
    margin: 0;
}

.theme-preview-header {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-height: 2.75rem;
    padding: .65rem .8rem;
}

.theme-preview-brand {
    margin-bottom: .75rem;
    padding: .35rem .55rem;
    font-weight: 600;
}

.theme-preview-layout {
    display: flex;
    min-height: 13rem;
}

.theme-preview-sidebar {
    width: 37%;
    padding: .75rem .45rem;
}

.theme-preview-main {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.theme-preview-menu-item {
    margin-bottom: .3rem;
    padding: .45rem .55rem;
    border-radius: .25rem;
    opacity: .88;
}

.theme-preview-menu-item.active {
    background: rgba(255, 255, 255, .2);
    opacity: 1;
}

.theme-preview-content {
    flex: 1;
    padding: 1rem;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
}

.theme-preview-panel {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .7rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .3rem;
    background: var(--bs-tertiary-bg);
}

.table-sort-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.table-sort-button:hover,
.table-sort-button:focus-visible {
    color: var(--bs-primary);
}

.table-sort-button i {
    font-size: 0.75rem;
    opacity: 0.65;
}

/* Sidebar premium nesting */
.app-sidebar .sidebar-menu {
    --submenu-indent: 1.1rem;
    --submenu-border: rgba(255, 255, 255, 0.12);
}

.app-sidebar .nav-treeview {
    position: relative;
    margin-left: var(--submenu-indent);
    padding-left: 0.9rem;
    border-left: 1px solid var(--submenu-border);
    background: linear-gradient(90deg, rgba(255,255,255,0.02), transparent 32%);
}

.app-sidebar .nav-treeview .nav-item {
    margin: 0.08rem 0;
}

.app-sidebar .nav-treeview .nav-link {
    display: flex;
    align-items: center;
    padding-left: 1rem;
    border-radius: 0.55rem;
    transition: background-color .2s ease, transform .2s ease;
}

.app-sidebar .nav-treeview .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    transform: translateX(2px);
}

.app-sidebar .nav-treeview .nav-link .nav-icon {
    min-width: 1.1rem;
    margin-right: 0.6rem;
    opacity: 0.9;
}

.app-sidebar .nav-treeview .nav-link p {
    margin: 0;
    font-size: 0.94rem;
}

.app-sidebar .nav-treeview .nav-item:first-child {
    margin-top: 0.25rem;
}

.app-sidebar .nav-treeview .nav-item:last-child {
    margin-bottom: 0.15rem;
}
