/* --------------------------------------------------------------------------
   Auchan Admin — brand overrides (aligned with https://www.auchan.ro)
   -------------------------------------------------------------------------- */

:root,
[data-bs-theme="light"] {
    /* Auchan brand palette */
    --auchan-red: #ed002e;
    --auchan-red-dark: #c40026;
    --auchan-red-light: #fde8ec;
    --auchan-green: #00ac6c;
    --auchan-green-dark: #008f59;
    --auchan-green-light: #e6f7f0;
    --auchan-navy: #02182b;
    --auchan-muted: #6b879e;
    --auchan-border: #d6e1ec;
    --auchan-surface: #eef5fb;

    /* Inspinia / Bootstrap theme tokens */
    --theme-primary: var(--auchan-red);
    --theme-primary-rgb: 237, 0, 46;
    --theme-primary-text-emphasis: var(--auchan-red-dark);
    --theme-primary-bg-subtle: var(--auchan-red-light);
    --theme-primary-border-subtle: #f5b8c4;

    --theme-success: var(--auchan-green);
    --theme-success-rgb: 0, 172, 108;
    --theme-success-text-emphasis: var(--auchan-green-dark);
    --theme-success-bg-subtle: var(--auchan-green-light);
    --theme-success-border-subtle: #99dfc4;

    --theme-link-color: var(--auchan-red);
    --theme-link-hover-color: var(--auchan-red-dark);

    --theme-body-color: #4c4c5c;
    --theme-body-bg: #f1f2f7;
    --theme-border-color: var(--auchan-border);
    --theme-secondary-color: var(--auchan-muted);

    --theme-logo-lg-height: 42px;
}

/* Dark sidenav — Auchan navy */
html[data-menu-color="dark"] {
    --theme-sidenav-bg: var(--auchan-navy);
    --theme-sidenav-border-color: #032949;
    --theme-sidenav-item-color: #8fa8bc;
    --theme-sidenav-item-hover-color: #ffffff;
    --theme-sidenav-item-hover-bg: rgba(255, 255, 255, 0.06);
    --theme-sidenav-item-active-color: #ffffff;
    --theme-sidenav-item-active-bg: rgba(237, 0, 46, 0.18);
}

html[data-menu-color="dark"] .side-nav-link.active .menu-icon,
html[data-menu-color="dark"] .side-nav-link:hover .menu-icon {
    color: var(--auchan-red);
}

/* Primary buttons & focus rings */
.btn-primary {
    --bs-btn-bg: var(--auchan-red);
    --bs-btn-border-color: var(--auchan-red);
    --bs-btn-hover-bg: var(--auchan-red-dark);
    --bs-btn-hover-border-color: var(--auchan-red-dark);
    --bs-btn-active-bg: var(--auchan-red-dark);
    --bs-btn-active-border-color: var(--auchan-red-dark);
    --bs-btn-disabled-bg: var(--auchan-red);
    --bs-btn-disabled-border-color: var(--auchan-red);
}

.btn-success {
    --bs-btn-bg: var(--auchan-green);
    --bs-btn-border-color: var(--auchan-green);
    --bs-btn-hover-bg: var(--auchan-green-dark);
    --bs-btn-hover-border-color: var(--auchan-green-dark);
    --bs-btn-active-bg: var(--auchan-green-dark);
    --bs-btn-active-border-color: var(--auchan-green-dark);
}

.btn-outline-primary {
    --bs-btn-color: var(--auchan-red);
    --bs-btn-border-color: var(--auchan-red);
    --bs-btn-hover-bg: var(--auchan-red);
    --bs-btn-hover-border-color: var(--auchan-red);
    --bs-btn-active-bg: var(--auchan-red-dark);
    --bs-btn-active-border-color: var(--auchan-red-dark);
}

.text-bg-primary {
    background-color: var(--auchan-red) !important;
}

.badge-soft-success,
.badge-label.badge-soft-success {
    color: var(--auchan-green-dark);
    background-color: var(--auchan-green-light);
}

.badge-soft-danger {
    color: var(--auchan-red-dark);
    background-color: var(--auchan-red-light);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--auchan-red);
    box-shadow: 0 0 0 0.2rem rgba(237, 0, 46, 0.15);
}

.page-title-box h4,
.card-title {
    color: var(--auchan-navy);
}

/* Logo sizing */
.sidenav-menu .logo-lg img,
.logo-topbar .logo-lg img {
    height: var(--theme-logo-lg-height);
    width: auto;
    max-width: calc(var(--theme-sidenav-width) - 24px);
    object-fit: contain;
}

.logo-topbar .logo-lg img {
    max-width: 160px;
}

/* Full-width detail pages */
.page-detail-dl dt {
    color: var(--auchan-muted);
    font-weight: 500;
}

.page-detail-pre {
    max-height: 420px;
    overflow: auto;
    font-size: 0.8125rem;
}

.traceability-summary {
    background-color: var(--auchan-surface);
}

.traceability-performer-panel {
    background: linear-gradient(180deg, #ffffff 0%, var(--auchan-surface) 100%);
}

.traceability-performer-avatar {
    width: 3rem;
    height: 3rem;
    font-size: 0.95rem;
    font-weight: 700;
}

.traceability-performer-avatar-sm {
    width: 2rem;
    height: 2rem;
    font-size: 0.7rem;
    font-weight: 700;
}

.traceability-performer-date {
    min-width: 6.5rem;
}

.traceability-changes-panel {
    background: linear-gradient(180deg, #fff9f0 0%, #ffffff 100%);
}

.traceability-status-compare {
    background-color: #fff;
    border: 1px solid rgba(237, 0, 46, 0.12);
}

.traceability-change-badge {
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
}

.traceability-change-badge-old {
    box-shadow: inset 0 0 0 1px rgba(237, 0, 46, 0.15);
}

.traceability-change-badge-new {
    box-shadow: inset 0 0 0 2px rgba(25, 135, 84, 0.25);
}

.traceability-changes-table .traceability-row-changed {
    background-color: #fff9f0;
}

.traceability-value-old {
    color: var(--auchan-red-dark);
    text-decoration: line-through;
    text-decoration-color: rgba(237, 0, 46, 0.45);
}

.traceability-value-new {
    color: var(--auchan-green-dark);
    font-weight: 600;
}

.document-status-panel {
    background-color: var(--auchan-surface);
}

.document-status-badge-lg {
    font-size: 0.95rem;
    padding: 0.55rem 0.85rem;
}

.reconciliation-alert-btn {
    color: #d97706;
    white-space: nowrap;
}

.reconciliation-alert-btn .ti-alert-triangle {
    font-size: 1.1rem;
    vertical-align: middle;
}

.reconciliation-alert-btn:hover,
.reconciliation-alert-btn:focus {
    color: #b45309;
    background-color: #fff7ed;
}

.reconciliation-stat-card-alerts {
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.reconciliation-stat-card-alerts:hover {
    box-shadow: 0 0.25rem 0.75rem rgba(237, 0, 46, 0.12);
    transform: translateY(-1px);
}

.list-toolbar-search {
    flex: 1 1 auto;
    min-width: 0;
}

.select2-toolbar-field {
    flex: 0 1 auto;
    max-width: 100%;
}

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

.select2-field-full {
    width: 100%;
    max-width: 100%;
}

.select2-field-full .select2-container {
    width: 100% !important;
}

.modal .select2-container {
    z-index: 1060;
}

.select2-dropdown--app-sized .select2-results__option {
    white-space: nowrap;
}

.select2-dropdown--app-sized .select2-results__options {
    max-width: 100%;
}
