/* PosCRM custom styles — uses variables from variables.css */

body {
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    background: var(--app-bg);
    color: var(--app-text);
}

.turbo-progress-bar {
    background-color: var(--brand-deep);
    height: 3px;
}

/* ---------- Login ---------- */
.login-page {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 20% 20%, rgba(157, 193, 237, 0.55), transparent 42%),
        radial-gradient(circle at 80% 80%, rgba(110, 161, 222, 0.45), transparent 40%),
        linear-gradient(160deg, var(--brand-soft) 0%, var(--brand-light) 45%, var(--brand-mid) 100%);
    color: #fff;
}

.login-shell {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.login-panel {
    width: 100%;
    max-width: 300px;
    text-align: center;
}

.login-title {
    margin: 0 0 1.85rem;
    font-size: 2.15rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #fff;
}

.login-alert {
    margin: 0 0 0.85rem;
    padding: 0.65rem 0.85rem;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: #b42318;
    font-size: 0.8rem;
    text-align: left;
}

.login-field.is-invalid {
    box-shadow: inset 0 0 0 1px rgba(180, 35, 24, 0.45);
}

.login-field.is-invalid input {
    color: #b42318;
}

.login-fields {
    overflow: hidden;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(12, 82, 166, 0.12);
}

.login-field {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
}

.login-field + .login-field {
    border-top: 1px solid #eceff1;
}

.login-field-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    color: #c5c9ce;
    pointer-events: none;
}

.login-fields input {
    display: block;
    flex: 1;
    width: 100%;
    min-width: 0;
    height: 54px;
    padding: 0 1rem 0 0;
    border: 0;
    border-radius: 0;
    background: #fff;
    color: #4a5568;
    font-size: 1rem;
    box-shadow: none !important;
    outline: none;
}

.login-fields input:-webkit-autofill,
.login-fields input:-webkit-autofill:hover,
.login-fields input:-webkit-autofill:focus,
.login-fields input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
    box-shadow: 0 0 0 1000px #fff inset !important;
    -webkit-text-fill-color: #4a5568;
    caret-color: #4a5568;
    transition: background-color 9999s ease-out 0s;
}

.login-field-password input {
    padding-right: 2.75rem;
}

.login-password-toggle {
    position: absolute;
    top: 50%;
    right: 0.45rem;
    transform: translateY(-50%);
    color: #c5c9ce;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

.login-password-toggle:hover,
.login-password-toggle:focus,
.login-password-toggle:focus-visible,
.login-password-toggle:active {
    color: var(--brand-deep);
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

.login-fields input::placeholder {
    color: #c5c9ce;
}

.login-fields input:focus,
.login-fields input:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border: 0;
    background: #fff;
}

.login-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 52px;
    margin-top: 0.95rem;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: var(--brand-deep);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    box-shadow: none;
}

.login-submit:hover,
.login-submit:focus,
.login-submit:focus-visible,
.login-submit:active {
    background: var(--brand-dark);
    color: #fff;
    box-shadow: none !important;
    outline: none !important;
}

.login-footer {
    padding: 0.85rem 1rem 1.25rem;
    text-align: center;
}

.login-footer p {
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.78rem;
    letter-spacing: 0.01em;
}

.password-field {
    position: relative;
}

.password-field .form-control {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.65rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--app-text-muted, #6b7280);
    cursor: pointer;
    border-radius: 0.4rem;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--brand-deep);
    outline: none;
}

.password-toggle .icon-20 {
    width: 1.25rem;
    height: 1.25rem;
}

.btn-brand {
    background-color: var(--brand-deep);
    border-color: var(--brand-deep);
    color: #fff;
}

.btn-brand:hover,
.btn-brand:focus {
    background-color: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}

.btn-close-app {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    color: var(--app-text);
}

.btn-close-app:hover,
.btn-close-app:focus {
    background: var(--app-surface-soft);
    border-color: var(--brand-light);
    color: var(--brand-deep);
}

.form-label-app {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--app-muted);
    margin-bottom: 0.4rem;
}

.form-control-app,
.form-select.form-control-app {
    border: 1px solid var(--app-border);
    border-radius: 0.55rem;
    min-height: 42px;
    color: var(--app-text);
    background-color: var(--app-surface);
}

.form-control-app:focus,
.form-select.form-control-app:focus {
    border-color: var(--brand-mid);
    box-shadow: 0 0 0 0.2rem rgba(157, 193, 237, 0.45);
}

textarea.form-control-app {
    min-height: 110px;
    resize: vertical;
}

.input-group-app .form-control-app,
.input-group-app .form-select.form-control-app {
    border-radius: 0;
}

.input-group-app > :first-child.form-control-app,
.input-group-app > :first-child.form-select.form-control-app {
    border-top-left-radius: 0.55rem;
    border-bottom-left-radius: 0.55rem;
}

.input-group-app > :last-child.form-control-app,
.input-group-app > :last-child.form-select.form-control-app,
.input-group-app > :last-child.btn {
    border-top-right-radius: 0.55rem;
    border-bottom-right-radius: 0.55rem;
}

.input-group-app > :not(:first-child) {
    margin-left: -1px;
}

.input-group-app .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    z-index: 1;
}

.input-group-app .input-group-addon-select {
    max-width: 140px;
    flex: 0 0 auto;
    background: var(--app-surface-soft);
}

.inventory-image-box {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.inventory-image-preview {
    width: 120px;
    height: 120px;
    border: 1px dashed var(--app-border);
    border-radius: 0.7rem;
    background: var(--app-surface-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    overflow: hidden;
}

.inventory-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.icon-32 { width: 32px; height: 32px; }

/* ========== Shared list toolbar (search / dates / filters / actions) ========== */
.list-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
}

.page-search,
.filter-field,
.date-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    box-sizing: border-box;
    height: 38px;
    min-height: 38px;
    max-height: 38px;
    padding: 0 0.85rem;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    line-height: 1;
    font-size: 0.8rem;
    font-weight: 600;
    background: #fff;
    color: var(--app-muted);
}

.page-search {
    display: flex;
    width: 100%;
}

.page-search .form-control,
.dashboard-date-input {
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    height: 100%;
    min-height: 0 !important;
    max-height: none;
    padding: 0 !important;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    color: var(--brand-dark);
}

.filter-select {
    border: 0 !important;
    box-shadow: none !important;
    background-color: transparent !important;
    height: 100%;
    min-height: 0 !important;
    padding: 0 1.15rem 0 0 !important;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    color: var(--brand-dark);
    cursor: pointer;
    max-width: 100%;
}

.page-search .form-control:focus,
.filter-select:focus,
.dashboard-date-input:focus {
    box-shadow: none !important;
    outline: none;
}

.page-search .icon-18,
.filter-field .icon-16 {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.toolbar-search {
    order: 1;
    flex: 0 1 260px;
    min-width: 180px;
    max-width: 280px;
}

.toolbar-export {
    order: 4;
    display: flex;
    justify-content: flex-end;
    flex: 0 0 auto;
    margin-left: auto;
}

.toolbar-date-range {
    order: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.toolbar-filters {
    order: 3;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    flex: 0 1 auto;
}

.toolbar-filters-first {
    order: 1;
}

.toolbar-entity-select {
    min-width: 220px;
    max-width: 340px;
    flex: 0 1 300px;
}

.toolbar-entity-select .select2-container {
    width: 100% !important;
}

.toolbar-entity-select .select2-container--default .select2-selection--single {
    height: 38px !important;
    min-height: 38px !important;
    border-radius: 999px !important;
    border: 1px solid var(--app-border) !important;
    background: #fff !important;
}

.toolbar-entity-select .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px !important;
    padding-left: 0.85rem !important;
    padding-right: 2.25rem !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    color: var(--brand-dark) !important;
    pointer-events: none;
}

.toolbar-entity-select .select2-container--default .select2-selection--single .select2-selection__placeholder {
    line-height: 36px !important;
    color: var(--app-muted) !important;
}

.toolbar-entity-select .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
    right: 0.65rem !important;
}

.toolbar-entity-select .select2-container--default .select2-selection--single .select2-selection__clear {
    top: 50% !important;
    right: 2rem !important;
    width: 1.35rem !important;
    height: 1.35rem !important;
    margin-top: 0 !important;
    transform: translateY(-50%);
    border-radius: 999px !important;
    font-size: 0.95rem !important;
    line-height: 1 !important;
    z-index: 2;
    cursor: pointer;
    pointer-events: auto;
}

.toolbar-entity-select .select2-container--default .select2-selection--single .select2-selection__clear:hover {
    background: rgba(157, 193, 237, 0.22) !important;
    color: var(--brand-deep) !important;
}

.toolbar-entity-select .select2-container--default.select2-container--focus .select2-selection--single,
.toolbar-entity-select .select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--brand-mid) !important;
    box-shadow: 0 0 0 0.15rem rgba(157, 193, 237, 0.35) !important;
}

html.dark .toolbar-entity-select .select2-container--default .select2-selection--single {
    background: var(--app-surface) !important;
    border-color: var(--app-border) !important;
}

.toolbar-filters .filter-field {
    min-width: 148px;
}

.toolbar-actions {
    order: 4;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    margin-left: auto;
    flex: 0 0 auto;
}

.toolbar-action,
.list-toolbar .btn.toolbar-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    gap: 0.35rem;
    box-sizing: border-box;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    padding: 0 0.9rem !important;
    line-height: 1 !important;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 0.65rem !important;
}

.toolbar-date-range .filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    box-sizing: border-box;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    padding: 0 0.9rem !important;
    line-height: 1 !important;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 999px !important;
}

.toolbar-action.btn-brand,
.list-toolbar .btn-brand.toolbar-action {
    border-color: transparent;
}

.toolbar-action.btn-outline-brand,
.list-toolbar .btn-outline-brand.toolbar-action {
    background: #fff;
}

.toolbar-action .icon-16,
.toolbar-action .icon-18 {
    width: 14px;
    height: 14px;
}

.toolbar-actions .btn-brand {
    box-shadow: 0 6px 14px rgba(12, 82, 166, 0.18);
}

.toolbar-card {
    border: 1px solid rgba(157, 193, 237, 0.55);
}

.toolbar-card .card-body {
    padding: 0.85rem 1rem;
}

.btn-outline-brand {
    background: var(--app-surface);
    border: 1px solid var(--brand-mid);
    color: var(--brand-deep);
}

.btn-outline-brand:hover,
.btn-outline-brand:focus {
    background: rgba(157, 193, 237, 0.2);
    border-color: var(--brand-deep);
    color: var(--brand-deep);
}

@media (max-width: 1199.98px) {
    .toolbar-search {
        flex: 1 1 180px;
        max-width: none;
    }
}

@media (max-width: 991.98px) {
    .toolbar-actions {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }
}

@media (max-width: 767.98px) {
    .toolbar-search,
    .toolbar-filters,
    .toolbar-filters .filter-field,
    .toolbar-entity-select,
    .toolbar-actions,
    .toolbar-action {
        width: 100%;
        max-width: none;
        margin-left: 0;
    }

    .toolbar-date-range .date-chip {
        flex: 1 1 calc(50% - 0.25rem);
    }

    .toolbar-date-range .dashboard-date-input {
        max-width: none;
        width: 100%;
        flex: 1 1 auto;
    }
}

.table-app {
    --bs-table-bg: transparent;
    color: var(--app-text);
}

.table-app thead th {
    background: var(--app-surface-soft);
    color: var(--brand-deep);
    font-size: 0.8rem;
    font-weight: 600;
    border-bottom: 1px solid var(--app-border);
    white-space: nowrap;
    padding: 0.85rem 1rem;
}

.table-app tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--app-border);
    font-size: 0.9rem;
}

.table-app tbody tr:last-child td {
    border-bottom: 0;
}

.table-app tbody tr:hover {
    background: rgba(157, 193, 237, 0.12);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-active {
    background: rgba(157, 193, 237, 0.35);
    color: var(--brand-deep);
}

.status-inactive {
    background: #f1f5f9;
    color: #64748b;
}

.status-pending {
    background: rgba(157, 193, 237, 0.35);
    color: var(--brand-deep);
}

.status-processing {
    background: rgba(110, 161, 222, 0.35);
    color: var(--brand-dark);
}

.order-summary {
    background: var(--app-surface-soft);
    border: 1px solid var(--app-border);
    border-radius: 12px;
}

.order-total-row {
    padding-top: 0.65rem;
    margin-top: 0.35rem;
    border-top: 1px solid var(--app-border);
}

.text-warning-balance {
    color: #b45309 !important;
}

html.dark .text-warning-balance {
    color: #fdba74 !important;
}

.payment-order-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.payment-order-row:hover {
    background: rgba(157, 193, 237, 0.18);
}

.payment-order-row.is-selected-order {
    background: rgba(12, 82, 166, 0.1);
}

.payment-full-total {
    text-align: right;
}

.payment-full-total strong {
    font-size: 1.15rem;
    line-height: 1.2;
}

html.dark .payment-order-row:hover {
    background: rgba(157, 193, 237, 0.12);
}

html.dark .payment-order-row.is-selected-order {
    background: rgba(157, 193, 237, 0.2);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--app-border);
}

.detail-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.customer-detail-tabs .nav-link {
    border: 1px solid var(--app-border);
    background: transparent;
    color: var(--app-text-muted, #6b7280);
    border-radius: 0.55rem;
    padding: 0.45rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.customer-detail-tabs .nav-link:hover {
    color: var(--brand-deep);
    border-color: var(--brand-deep);
}

.customer-detail-tabs .nav-link.active {
    background: var(--brand-deep);
    border-color: var(--brand-deep);
    color: #fff;
}

html.dark .customer-detail-tabs .nav-link.active {
    color: #fff;
}

.customer-stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 0.9rem;
    padding: 0.95rem 1rem;
    height: 100%;
    box-shadow: 0 8px 20px rgba(30, 58, 95, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.customer-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(30, 58, 95, 0.08);
}

.customer-stat-top {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.customer-stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.customer-stat-label {
    color: var(--app-muted);
    font-size: 0.8rem;
    font-weight: 560;
    line-height: 1.2;
}

.customer-stat-value {
    color: var(--brand-dark);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
    word-break: break-word;
    padding-left: 0.1rem;
}

.customer-stat-total .customer-stat-icon {
    background: rgba(74, 134, 206, 0.14);
    color: var(--brand-mid);
}

.customer-stat-paid .customer-stat-icon {
    background: rgba(16, 185, 129, 0.14);
    color: #059669;
}

.customer-stat-paid .customer-stat-value {
    color: #059669;
}

.customer-stat-remaining .customer-stat-icon {
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
}

.customer-stat-remaining .customer-stat-value {
    color: #b45309;
}

.customer-stat-return-amount .customer-stat-icon {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.customer-stat-return-amount .customer-stat-value {
    color: #dc2626;
}

.customer-receivable-banner {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 0.9rem;
    padding: 1rem 1.1rem;
}

.customer-receivable-label {
    font-weight: 700;
    color: #b45309;
    font-size: 0.95rem;
}

.customer-receivable-hint {
    color: var(--app-text-muted);
    font-size: 0.8rem;
    margin-top: 0.15rem;
}

.customer-receivable-value {
    font-size: 1.45rem;
    font-weight: 700;
    color: #b45309;
    line-height: 1.1;
}

html.dark .customer-receivable-banner {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.4);
}

.customer-stat-orders .customer-stat-icon {
    background: rgba(99, 102, 241, 0.14);
    color: #4f46e5;
}

.customer-stat-returns .customer-stat-icon {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

html.dark .customer-stat-card {
    background: var(--app-surface-soft);
    box-shadow: none;
}

html.dark .customer-stat-card:hover {
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
}

html.dark .customer-stat-paid .customer-stat-value,
html.dark .customer-stat-paid .customer-stat-icon {
    color: #34d399;
}

html.dark .customer-stat-remaining .customer-stat-value,
html.dark .customer-stat-remaining .customer-stat-icon {
    color: #fdba74;
}

html.dark .customer-stat-return-amount .customer-stat-value,
html.dark .customer-stat-return-amount .customer-stat-icon {
    color: #f87171;
}

html.dark .customer-stat-orders .customer-stat-icon {
    color: #a5b4fc;
}

html.dark .customer-stat-returns .customer-stat-icon {
    color: #f87171;
}

html.dark .status-pending {
    background: rgba(157, 193, 237, 0.2);
    color: var(--brand-soft);
}

html.dark .status-processing {
    background: rgba(110, 161, 222, 0.22);
    color: var(--brand-light);
}

.modal-app {
    border: 0;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 24px 50px rgba(12, 82, 166, 0.2);
}

.modal-app .modal-header {
    border-bottom: 1px solid var(--app-border);
    padding: 1.1rem 1.25rem;
    background: linear-gradient(180deg, var(--app-surface-soft) 0%, var(--app-surface) 100%);
}

.modal-title-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: rgba(157, 193, 237, 0.35);
    color: var(--brand-deep);
}

.modal-subtitle {
    margin-top: 0.15rem;
    font-size: 0.8rem;
    color: var(--app-muted);
}

.modal-app .modal-body {
    padding: 1.25rem;
}

.role-permissions-modal .modal-dialog {
    max-height: calc(100% - var(--bs-modal-margin) * 2);
}

.role-permissions-modal .modal-content {
    max-height: calc(100vh - var(--bs-modal-margin) * 2);
}

.role-permissions-modal form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.role-permissions-modal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal-app .modal-footer {
    border-top: 1px solid var(--app-border);
    padding: 1rem 1.25rem;
    gap: 0.5rem;
    justify-content: flex-start;
}

.text-brand {
    color: var(--brand-deep) !important;
}

.text-brand-muted {
    color: var(--brand-mid) !important;
}

/* ---------- App shell ---------- */
.app-shell {
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0a4a96 0%, var(--brand-deep) 55%, #083f82 100%);
    color: #fff;
    position: sticky;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    z-index: 1040;
}

.sidebar-brand {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(157, 193, 237, 0.22);
    color: var(--brand-soft);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.sidebar-nav {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
    margin: 0.35rem 0;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    border: 1px solid transparent;
    background-clip: padding-box;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.48);
    background-clip: padding-box;
}

.sidebar-nav::-webkit-scrollbar-corner {
    background: transparent;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 42px;
    padding: 0.65rem 0.85rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    text-align: left;
    line-height: 1.2;
    transition: background 0.15s, color 0.15s;
}

.sidebar-link:hover {
    background: rgba(157, 193, 237, 0.14);
    color: #fff;
}

.sidebar-link.active {
    background: var(--brand-mid);
    color: #fff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.sidebar-link-row {
    display: flex;
    align-items: stretch;
    border-radius: 10px;
    overflow: hidden;
}

.sidebar-link-row.active,
.sidebar-link-row.is-open {
    background: rgba(157, 193, 237, 0.16);
}

.sidebar-link-row.active {
    background: var(--brand-mid);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.sidebar-link-row .sidebar-link-main {
    flex: 1 1 auto;
    min-width: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

.sidebar-link-row .sidebar-link-main.active,
.sidebar-link-row .sidebar-link-main:hover {
    background: transparent;
    box-shadow: none;
    color: #fff;
}

.sidebar-link-row:not(.active) .sidebar-link-main:hover {
    color: #fff;
}

.nav-chevron-btn {
    width: 36px;
    flex-shrink: 0;
    border: 0;
    background: transparent;
    color: inherit;
    display: grid;
    place-items: center;
    padding: 0;
}

.nav-chevron-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.nav-chevron-btn .chevron {
    transition: transform 0.2s ease;
    opacity: 0.85;
}

.nav-chevron-btn.is-open .chevron,
.nav-chevron-btn[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
}

.sidebar-link-icon {
    width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
}

.icon-16 { width: 16px; height: 16px; }
.icon-18 { width: 18px; height: 18px; }
.icon-20 { width: 20px; height: 20px; }
.icon-22 { width: 22px; height: 22px; }

.sidebar-link-text {
    flex: 1 1 auto;
    min-width: 0;
}

.sidebar-link .chevron {
    margin-left: auto;
    flex-shrink: 0;
    opacity: 0.85;
    transition: transform 0.2s ease;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.nav-submenu {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin: 0.15rem 0 0.25rem 0.85rem;
    padding: 0.35rem 0 0.35rem 0.85rem;
    border-left: 2px solid rgba(157, 193, 237, 0.28);
}

.sidebar-sublink {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.84rem;
    font-weight: 500;
    text-decoration: none;
    line-height: 1.3;
    transition: background 0.15s, color 0.15s;
}

.sidebar-sublink:hover {
    background: rgba(157, 193, 237, 0.14);
    color: #fff;
}

.sidebar-sublink.active {
    background: var(--brand-mid);
    color: #fff;
}

.sidebar-footer {
    border-top: 1px solid rgba(157, 193, 237, 0.2);
}

.user-role {
    color: var(--brand-soft);
    font-size: 0.75rem;
}

.logout-btn {
    background: rgba(157, 193, 237, 0.14);
    color: #fff;
    border: 0;
}

.logout-btn:hover {
    background: rgba(157, 193, 237, 0.24);
    color: #fff;
}

.main-area {
    min-width: 0;
    background: var(--app-bg);
}

.topbar {
    background: var(--app-topbar);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--app-border);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--brand-deep);
}

.page-sub {
    font-size: 0.85rem;
    color: var(--app-muted);
}

.icon-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    border-radius: 11px;
    color: var(--brand-dark);
    position: relative;
    flex-shrink: 0;
}

.icon-btn svg {
    display: block;
    flex-shrink: 0;
}

#themeToggle .theme-icon-moon,
#themeToggle .theme-icon-sun {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}

.icon-btn:hover {
    border-color: var(--brand-light);
    background: var(--app-surface-soft);
}

.search-box {
    min-width: 220px;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: var(--app-surface);
}

.search-box .form-control {
    border: 0;
    box-shadow: none;
    background: transparent;
}

.search-box .form-control:focus {
    box-shadow: none;
}

.badge-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    display: grid;
    place-items: center;
    padding: 0 4px;
}

.badge-alert { background: #c2410c; }
.badge-ok { background: var(--brand-dark); }

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(157, 193, 237, 0.45);
}

/* Cards */
.card-soft {
    border: 1px solid var(--app-border);
    border-radius: 14px;
    box-shadow: var(--card-shadow);
    background: var(--app-surface);
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--brand-deep);
}

.text-muted-app {
    color: var(--app-muted) !important;
}

/* Filters */
.filter-btn {
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    color: var(--brand-dark);
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--brand-deep);
    border-color: var(--brand-deep);
    color: #fff;
}

.date-chip {
    /* size aligned with .page-search / .filter-field in toolbar */
    font-size: 0.8rem;
}

.dashboard-date-input {
    border: 0;
    background: transparent;
    color: var(--brand-dark);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0;
    max-width: 9.5rem;
}

.dashboard-date-input:focus {
    outline: none;
}

/* KPI */
.kpi-label {
    font-size: 0.78rem;
    color: var(--app-muted);
    font-weight: 500;
}

.kpi-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--brand-deep);
    letter-spacing: -0.02em;
}

.kpi-trend {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--brand-mid);
}

.kpi-trend.down {
    color: #b45309;
}

.kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: rgba(157, 193, 237, 0.35);
    color: var(--brand-deep);
}

.kpi-icon.tone-2 { background: rgba(110, 161, 222, 0.35); color: var(--brand-dark); }
.kpi-icon.tone-3 { background: rgba(74, 134, 206, 0.28); color: var(--brand-deep); }
.kpi-icon.tone-4 { background: rgba(43, 110, 190, 0.22); color: var(--brand-dark); }
.kpi-icon.tone-5 { background: rgba(12, 82, 166, 0.15); color: var(--brand-deep); }
.kpi-icon.tone-alert { background: rgba(12, 82, 166, 0.12); color: #9a3412; }

/* Dashboard cash flow widgets */
.dashboard-cash-card {
    border-left: 3px solid transparent;
}

.dashboard-cash-in {
    border-left-color: #16a34a;
}

.dashboard-cash-out {
    border-left-color: #dc2626;
}

.dashboard-cash-net {
    border-left-color: var(--brand-mid);
}

.dashboard-cash-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
}

.dashboard-cash-badge-in {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

.dashboard-cash-badge-out {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
}

.dashboard-cash-badge-net {
    background: rgba(74, 134, 206, 0.18);
    color: var(--brand-deep);
}

.dashboard-cash-hint {
    margin-top: 0.35rem;
    font-size: 0.72rem;
    color: var(--app-muted);
    line-height: 1.35;
}

html.dark .dashboard-cash-badge-in {
    background: rgba(34, 197, 94, 0.18);
    color: #4ade80;
}

html.dark .dashboard-cash-badge-out {
    background: rgba(248, 113, 113, 0.18);
    color: #f87171;
}

html.dark .dashboard-cash-hint {
    color: rgba(255, 255, 255, 0.55);
}

.chart-box {
    position: relative;
    height: 280px;
    width: 100%;
}

.chart-box canvas {
    width: 100% !important;
    height: 100% !important;
}

.donut-box {
    position: relative;
    height: 220px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.thumb {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--brand-soft);
}

.product-bar {
    height: 7px;
    border-radius: 999px;
    background: #e4eef8;
    overflow: hidden;
}

.product-bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand-light), var(--brand-deep));
}

.crm-tile,
.inv-tile {
    background: var(--app-surface-soft);
    border: 1px solid var(--app-border);
    border-radius: 12px;
}

.crm-tile .label,
.inv-tile .label {
    font-size: 0.72rem;
    color: var(--app-muted);
}

.inv-tile .label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--brand-deep);
}

.crm-tile .value,
.inv-tile .value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--brand-deep);
}

.inv-tile .value {
    font-size: 1.2rem;
}

.inv-tile a {
    font-size: 0.72rem;
    color: var(--brand-mid);
    font-weight: 600;
    text-decoration: none;
}

.activity-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(157, 193, 237, 0.35);
    color: var(--brand-deep);
    flex-shrink: 0;
}

/* Mobile sidebar */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-105%);
        transition: transform 0.2s ease;
    }

    .app-shell.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(8, 40, 82, 0.45);
        z-index: 1030;
    }

    .app-shell.sidebar-open .sidebar-backdrop {
        display: block;
    }
}

@media (min-width: 992px) {
    .sidebar-backdrop {
        display: none !important;
    }
}

/* ---------- Dark mode extras ---------- */
html.dark,
html.dark body {
    color: var(--app-text);
    background: var(--app-bg);
}

html.dark .main-area,
html.dark .content,
html.dark .card-soft,
html.dark .card-body,
html.dark .modal-body,
html.dark .modal-footer,
html.dark .table,
html.dark .table td,
html.dark .table th,
html.dark .form-label,
html.dark .form-label-app,
html.dark .form-control,
html.dark .form-select,
html.dark .form-check-label,
html.dark p,
html.dark small,
html.dark span:not(.badge-dot):not(.status-badge):not(.legend-dot),
html.dark strong,
html.dark h1,
html.dark h2,
html.dark h3,
html.dark h4,
html.dark h5,
html.dark h6 {
    color: var(--app-text);
}

html.dark .text-muted,
html.dark .text-muted-app,
html.dark .modal-subtitle,
html.dark .page-sub,
html.dark .kpi-label,
html.dark .form-label-app {
    color: var(--app-muted) !important;
}

html.dark .text-brand,
html.dark .page-title,
html.dark .section-title,
html.dark .kpi-value,
html.dark .modal-title {
    color: var(--brand-soft) !important;
}

html.dark .text-brand-muted {
    color: var(--brand-light) !important;
}

html.dark .search-box .form-control,
html.dark .page-search .form-control,
html.dark .filter-select,
html.dark .form-control-app,
html.dark .form-select.form-control-app {
    color: var(--app-text) !important;
    background-color: var(--app-surface) !important;
    border-color: var(--app-border);
}

html.dark .page-search .form-control,
html.dark .filter-select,
html.dark .search-box .form-control {
    background-color: transparent !important;
}

html.dark .form-control::placeholder,
html.dark .form-control-app::placeholder {
    color: var(--app-muted);
    opacity: 0.85;
}

html.dark .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%239dc1ed' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

html.dark .date-chip,
html.dark .page-search,
html.dark .filter-field {
    background: var(--app-surface);
    border-color: var(--app-border);
    color: var(--app-muted);
}

html.dark .dashboard-date-input {
    color: var(--app-text);
    color-scheme: dark;
}

html.dark .modal-app {
    background: var(--app-surface);
    color: var(--app-text);
}

html.dark .modal-app .btn-close {
    filter: invert(1) grayscale(1);
    opacity: 0.7;
}

html.dark .btn-close-app {
    background: var(--app-surface-soft);
    color: var(--app-text);
    border-color: var(--app-border);
}

html.dark .product-bar {
    background: #24364d;
}

html.dark .status-active {
    background: rgba(157, 193, 237, 0.2);
    color: var(--brand-soft);
}

html.dark .status-inactive {
    background: #1a2a3d;
    color: #9bb0c9;
}

html.dark .table-app {
    --bs-table-color: var(--app-text);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--app-border);
    color: var(--app-text);
}

html.dark .table-app tbody tr:hover {
    background: rgba(157, 193, 237, 0.08);
}

html.dark .table-app thead th {
    color: var(--brand-soft);
}

html.dark .kpi-icon,
html.dark .kpi-icon.tone-2,
html.dark .kpi-icon.tone-3,
html.dark .kpi-icon.tone-4,
html.dark .kpi-icon.tone-5 {
    background: rgba(157, 193, 237, 0.18);
    color: var(--brand-soft);
}

html.dark .kpi-icon.tone-alert {
    background: rgba(180, 83, 9, 0.25);
    color: #fdba74;
}

html.dark .activity-icon {
    background: rgba(157, 193, 237, 0.18);
    color: var(--brand-soft);
}

html.dark .icon-btn {
    color: var(--brand-soft);
}

html.dark #themeToggle {
    border-color: var(--brand-mid);
    color: var(--brand-soft);
}

html.dark .btn-outline-brand {
    color: var(--brand-soft);
    border-color: var(--brand-mid);
    background: transparent;
}

html.dark .btn-outline-brand:hover,
html.dark .btn-outline-brand:focus {
    color: #fff;
    background: rgba(157, 193, 237, 0.2);
    border-color: var(--brand-soft);
}

.border-top-app {
    border-top: 1px solid var(--app-border);
}

.app-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
}

.app-pagination-info {
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: var(--app-muted);
    margin: 0;
}

.app-pagination-info span {
    font-weight: 600;
    color: var(--app-text);
}

.pagination {
    margin-bottom: 0;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.page-link {
    border-radius: 0.5rem !important;
    border-color: var(--app-border);
    color: var(--brand-dark);
    background: var(--app-surface);
    min-width: 36px;
    height: 36px;
    padding: 0 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.page-link:hover,
.page-link:focus {
    color: var(--brand-deep);
    background: var(--app-surface-soft);
    border-color: var(--brand-light);
    box-shadow: none;
}

.page-item.active .page-link {
    background: var(--brand-deep);
    border-color: var(--brand-deep);
    color: #fff;
}

.page-item.disabled .page-link {
    background: var(--app-surface);
    border-color: var(--app-border);
    color: var(--app-muted);
}

html.dark .app-pagination-info {
    color: var(--app-muted);
}

html.dark .app-pagination-info span {
    color: var(--app-text);
}

html.dark .page-link {
    color: var(--brand-soft);
}

html.dark .page-item.active .page-link {
    background: var(--brand-mid);
    border-color: var(--brand-mid);
    color: #fff;
}

/* Select2 — clean form-control look */
.select2-container {
    width: 100% !important;
    font-family: inherit;
}

.select2-container .select2-selection--single {
    height: 42px !important;
}

.select2-container--default .select2-selection--single {
    position: relative;
    border: 1px solid var(--app-border) !important;
    border-radius: 0.55rem !important;
    background-color: var(--app-surface) !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    display: block;
    color: var(--app-text) !important;
    line-height: 40px !important;
    padding-left: 0.85rem !important;
    padding-right: 2.5rem !important;
    font-size: 0.9375rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--app-muted) !important;
    line-height: 40px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    position: absolute !important;
    top: 1px !important;
    right: 0.55rem !important;
    width: 1.25rem !important;
    height: 40px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border: none !important;
    width: 1rem !important;
    height: 1rem !important;
    margin: 0 !important;
    left: auto !important;
    top: auto !important;
    position: static !important;
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b849e' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 1rem;
    transition: transform 0.15s ease;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border: none !important;
    transform: rotate(180deg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234a86ce' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
}

.select2-container--default .select2-selection--single .select2-selection__clear {
    float: none !important;
    position: absolute !important;
    right: 2.15rem;
    top: 0 !important;
    bottom: 0;
    height: 40px !important;
    width: 1.25rem;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: var(--app-muted) !important;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    background: transparent;
    border-radius: 0;
    opacity: 0.8;
    z-index: 2;
    cursor: pointer;
    pointer-events: auto;
}

.select2-container--default .select2-selection--single .select2-selection__clear:hover {
    color: var(--brand-deep) !important;
    opacity: 1;
    background: transparent;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--brand-mid) !important;
    box-shadow: 0 0 0 0.2rem rgba(157, 193, 237, 0.45);
}

.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,
.select2-container--default.select2-container--open.select2-container--above .select2-selection--single {
    border-radius: 0.55rem !important;
}

.select2-dropdown {
    border: 1px solid var(--app-border) !important;
    border-radius: 0.75rem !important;
    background-color: var(--app-surface) !important;
    color: var(--app-text);
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(12, 82, 166, 0.12);
    z-index: 1060;
}

.select2-container--open .select2-dropdown--below {
    margin-top: 6px;
    border-top-width: 1px !important;
    border-top-left-radius: 0.75rem !important;
    border-top-right-radius: 0.75rem !important;
}

.select2-container--open .select2-dropdown--above {
    margin-bottom: 6px;
    border-bottom-width: 1px !important;
    border-bottom-left-radius: 0.75rem !important;
    border-bottom-right-radius: 0.75rem !important;
}

/* Search row — same vibe as .page-search */
.select2-container--default .select2-search--dropdown {
    padding: 0.7rem;
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-border);
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    width: 100% !important;
    height: 40px;
    margin: 0;
    border: 1px solid var(--app-border) !important;
    border-radius: 0.65rem !important;
    color: var(--app-text);
    background-color: var(--app-surface-soft) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b849e' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-4.35-4.35M11 18a7 7 0 100-14 7 7 0 000 14z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.75rem center;
    background-size: 1.05rem;
    padding: 0.5rem 0.85rem 0.5rem 2.35rem !important;
    font-size: 0.9rem;
    line-height: 1.3;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.select2-container--default .select2-search--dropdown .select2-search__field::placeholder {
    color: var(--app-muted);
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--brand-mid) !important;
    background-color: var(--app-surface) !important;
    box-shadow: 0 0 0 0.15rem rgba(157, 193, 237, 0.4) !important;
}

.select2-container--default .select2-results > .select2-results__options {
    max-height: 250px;
    padding: 0.4rem;
}

.select2-container--default .select2-results__option {
    padding: 0.6rem 0.8rem;
    border-radius: 0.5rem;
    margin-bottom: 2px;
    font-size: 0.9rem;
    line-height: 1.35;
}

.select2-container--default .select2-results__option:last-child {
    margin-bottom: 0;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--brand-mid) !important;
    color: #fff !important;
}

.select2-container--default .select2-results__option--selected {
    background-color: rgba(157, 193, 237, 0.2) !important;
    color: var(--brand-deep) !important;
    font-weight: 600;
}

.select2-container--default .select2-results__option--selected.select2-results__option--highlighted {
    background-color: var(--brand-mid) !important;
    color: #fff !important;
}

.select2-container--default .select2-results__message {
    color: var(--app-muted);
    padding: 1rem 0.75rem;
    text-align: center;
    font-size: 0.875rem;
}

.select2-container--default .select2-results__option--disabled {
    color: var(--app-muted);
}

html.dark .select2-container--default .select2-selection--single {
    background-color: var(--app-surface) !important;
    border-color: var(--app-border) !important;
}

html.dark .select2-dropdown {
    background-color: var(--app-surface) !important;
    border-color: var(--app-border) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

html.dark .select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: var(--app-surface-soft) !important;
    border-color: var(--app-border) !important;
    color: var(--app-text);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239bb0c9' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-4.35-4.35M11 18a7 7 0 100-14 7 7 0 000 14z'/%3E%3C/svg%3E");
}

html.dark .select2-container--default .select2-search--dropdown .select2-search__field:focus {
    background-color: var(--app-surface) !important;
}

html.dark .select2-container--default .select2-selection--single .select2-selection__arrow b {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239bb0c9' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
}

html.dark .select2-container--default .select2-results__option--selected {
    background-color: rgba(74, 134, 206, 0.25) !important;
    color: var(--brand-soft) !important;
}

html.dark .select2-container--default .select2-selection--single .select2-selection__clear {
    background: var(--app-surface-soft);
    color: var(--app-muted) !important;
}

/* Company settings logo */
.settings-logo-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    border: 1px dashed var(--app-border);
    border-radius: 0.7rem;
    background: var(--app-surface-soft);
    padding: 1rem;
}

.settings-logo-img {
    max-width: 100%;
    max-height: 140px;
    object-fit: contain;
}

.settings-logo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--app-muted);
    font-size: 0.9rem;
}

.settings-favicon-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 96px;
    border: 1px dashed var(--app-border);
    border-radius: 0.7rem;
    background: var(--app-surface-soft);
    padding: 0.85rem;
}

.settings-favicon-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.file-upload-app {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    min-height: 42px;
}

.file-upload-app-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.file-upload-app-btn {
    margin: 0;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 1rem;
    cursor: pointer;
}

.file-upload-app-name {
    color: var(--app-muted);
    font-size: 0.9rem;
    line-height: 1.3;
    word-break: break-all;
}

.profile-avatar-preview {
    width: 88px;
    height: 88px;
    border-radius: 999px;
    border: 1px dashed var(--app-border);
    background: var(--app-surface-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--app-muted);
}

/* ---------- Reports ---------- */
.report-stat-label {
    font-size: 0.78rem;
    color: var(--app-muted);
    margin-bottom: 0.35rem;
}

.report-stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--brand-deep);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.report-stat-hint {
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: var(--app-muted);
}
