:root,
[data-bs-theme="light"] {
    --brand: #a91006;
    --brand-rgb: 169, 16, 6;
    --brand-deep: #870d06;
    --brand-soft: #fceeea;
    --brand-focus: #efa49e;
    --navy: #11243b;
    --navy-rgb: 17, 36, 59;
    --navy-soft: #edf1f5;
    --navy-mid: #324a63;
    --ink: var(--navy);
    --muted: #647181;
    --line: #dfe4e9;
    --bg: #f5f6f8;
    --card: #ffffff;
    --success: #198754;
    --warning: #d48a22;
    --danger: #dc3545;
    --sidebar-top: var(--navy);
    --sidebar-bottom: #0d1b2b;
    --bs-primary: var(--brand);
    --bs-primary-rgb: var(--brand-rgb);
    --bs-primary-text-emphasis: var(--brand-deep);
    --bs-primary-bg-subtle: var(--brand-soft);
    --bs-primary-border-subtle: #efc3be;
    --bs-body-color: var(--ink);
    --bs-body-color-rgb: var(--navy-rgb);
    --bs-link-color: var(--brand);
    --bs-link-color-rgb: var(--brand-rgb);
    --bs-link-hover-color: var(--brand-deep);
    --bs-link-hover-color-rgb: 135, 13, 6;
    --bs-focus-ring-color: rgba(var(--brand-rgb), 0.2);
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body.admin-body {
    overflow-x: hidden;
}

body.login-body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(var(--brand-rgb), 0.12), transparent 32%),
        radial-gradient(circle at bottom right, rgba(var(--navy-rgb), 0.16), transparent 38%),
        linear-gradient(135deg, #fafafa 0%, var(--navy-soft) 100%);
    color: var(--ink);
}

a {
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
    transition: grid-template-columns 0.25s ease;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.15rem 1rem;
    background: linear-gradient(180deg, var(--sidebar-top), var(--sidebar-bottom));
    color: #fff;
    position: sticky;
    top: 0;
    min-height: 100vh;
    transition: transform 0.25s ease, opacity 0.25s ease;
    z-index: 1030;
}

.sidebar-profile {
    min-width: 0;
    padding: 0.9rem 0.8rem;
    border-radius: 1rem;
    background: #fff;
    border: 1px solid var(--line);
}

.sidebar-profile__logo {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.sidebar-profile__details {
    min-width: 0;
    overflow-wrap: anywhere;
    margin-top: 0.75rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--line);
}

.sidebar-profile__name {
    color: var(--navy);
    font-weight: 600;
    font-size: 0.82rem;
    line-height: 1.4;
}

.sidebar-profile__role {
    margin-top: 0.15rem;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.4;
}

.page-title {
    margin: 0;
}

.page-kicker {
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
}

.sidebar-nav {
    gap: 0.35rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.72rem 0.82rem;
    border-radius: 0.85rem;
    color: #d9e7f7;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 1.05rem;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

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

.sidebar-section {
    border-radius: 0.85rem;
}

.sidebar-section__heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 44px;
    padding: 0.72rem 0.82rem;
    border-radius: 0.85rem;
    color: #d9e7f7;
    font-size: 0.88rem;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
}

.sidebar-section__heading::-webkit-details-marker {
    display: none;
}

.sidebar-section__heading > i:first-child {
    width: 20px;
    flex-shrink: 0;
    text-align: center;
    font-size: 1.05rem;
}

.sidebar-section__heading:hover,
.sidebar-section--active > .sidebar-section__heading {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-section__heading:focus-visible,
.sidebar-link:focus-visible {
    outline: 2px solid var(--brand-focus);
    outline-offset: -2px;
}

.sidebar-section__chevron {
    margin-left: auto;
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.sidebar-section[open] > .sidebar-section__heading .sidebar-section__chevron {
    transform: rotate(180deg);
}

.sidebar-submenu {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin: 0.3rem 0 0.55rem 1.4rem;
    padding-left: 0.4rem;
    border-left: 1px solid rgba(255, 255, 255, 0.18);
}

.sidebar-submenu .sidebar-link {
    min-height: 44px;
    padding: 0.58rem 0.65rem;
    gap: 0.6rem;
    border-radius: 0.6rem;
    font-size: 0.83rem;
    font-weight: 500;
}

.sidebar-submenu .sidebar-link.active {
    background: var(--brand);
    box-shadow: inset 3px 0 0 var(--brand-focus);
    font-weight: 700;
}

.sidebar .btn {
    border-radius: 0.9rem;
    font-weight: 600;
}

.sidebar-toggle-btn,
.sidebar-reopen-btn {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: var(--brand-deep);
    box-shadow: 0 10px 24px rgba(14, 40, 76, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.sidebar-toggle-btn:hover,
.sidebar-reopen-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(14, 40, 76, 0.22);
    background: #f6fbff;
}

.sidebar-toggle-btn {
    position: absolute;
    top: 1.35rem;
    right: -19px;
    z-index: 3;
}

.sidebar-reopen-btn {
    position: fixed;
    top: 1.35rem;
    left: 0.9rem;
    z-index: 1040;
}

.admin-sidebar-collapsed .app-shell--admin {
    grid-template-columns: 0 minmax(0, 1fr);
}

.admin-sidebar-collapsed .app-shell--admin .sidebar {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

.admin-sidebar-collapsed .app-shell--admin .main-shell > .container-fluid {
    padding-left: 1.25rem !important;
}

.main-shell {
    min-width: 0;
}

.main-shell > .container-fluid {
    margin-top: 1.2rem;
    max-width: 100%;
}

.admin-content {
    display: grid;
    gap: 1rem;
}

.page-topbar {
    background: linear-gradient(135deg, #fff 0%, var(--navy-soft) 100%);
    border: 1px solid var(--line);
    border-radius: 1.25rem;
    box-shadow: 0 10px 30px rgba(24, 49, 79, 0.06);
    padding: 1.15rem 1.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.page-kicker {
    color: var(--brand);
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.page-title {
    font-size: clamp(1.3rem, 2vw, 1.85rem);
    font-weight: 700;
}

.page-topbar__meta {
    text-align: right;
    color: var(--muted);
    font-weight: 600;
}

.page-topbar__role {
    font-size: 0.9rem;
}

.content-card,
.page-section {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 1.25rem;
    box-shadow: 0 10px 30px rgba(24, 49, 79, 0.06);
    overflow: hidden;
    max-width: 100%;
}

.content-card--nested {
    border-radius: 1rem;
    box-shadow: none;
    background: #f8fbff;
}

.compatibility-table > tbody > tr > td {
    vertical-align: top;
}

.compatibility-remarks {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.compatibility-vehicle-choices {
    max-height: 280px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 0.5rem;
}

.compatibility-vehicle-choice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    cursor: pointer;
}

.compatibility-vehicle-choice:has(input:checked) {
    background: var(--brand-soft);
    border-color: var(--brand);
}

.card-head,
.crud-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem 1.35rem;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}

.card-head__title h3,
.crud-toolbar h2,
.crud-toolbar h3 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--ink);
}

.crud-meta,
.card-head__title p {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.content-card > .table-responsive,
.page-section > .table-responsive,
.content-card > .p-4,
.page-section > .p-4 {
    padding: 1.15rem 1.35rem;
}

.content-card > .table-responsive,
.page-section > .table-responsive {
    padding-top: 0;
}

.table-responsive,
.dataTables_wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

/* Parts list: compact multi-filter panel above the register. */
.part-filter-bar {
    margin: 0 1.35rem 1.2rem;
    padding: 1rem 1.15rem;
    border: 1px solid #d7e5f2;
    border-radius: 1rem;
    background: linear-gradient(135deg, #f8fbff, #f1f8fb);
}

.part-filter-bar__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.part-filter-bar h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--ink);
}

.part-filter-bar p {
    margin: 0.18rem 0 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.part-filter-bar__count {
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    color: var(--brand-deep);
    background: var(--brand-soft);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.table {
    margin-bottom: 0;
    font-size: 0.84rem;
}

.table thead th {
    background: #f6f9fd;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom-width: 1px;
    white-space: nowrap;
}

.table > :not(caption) > * > * {
    padding: 0.68rem 0.7rem;
    vertical-align: middle;
}

.thumb-preview {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 0.75rem;
    box-shadow: 0 6px 18px rgba(24, 49, 79, 0.12);
}

.thumb-preview--large {
    width: 88px;
    height: 88px;
}

.placeholder-thumb {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: #edf2f7;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.status-badge--active {
    background: rgba(25, 135, 84, 0.12);
    color: var(--success);
}

.status-badge--inactive {
    background: rgba(108, 117, 125, 0.14);
    color: #5c6670;
}

.action-row,
.action-group {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn {
    border-radius: 0.85rem;
    font-weight: 600;
}

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--brand-deep);
    --bs-btn-hover-border-color: var(--brand-deep);
    --bs-btn-focus-shadow-rgb: var(--brand-rgb);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--brand-deep);
    --bs-btn-active-border-color: var(--brand-deep);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
    box-shadow: 0 6px 16px rgba(var(--brand-rgb), 0.16);
}

.btn-outline-primary {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-focus-shadow-rgb: var(--brand-rgb);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--brand-deep);
    --bs-btn-active-border-color: var(--brand-deep);
    --bs-btn-disabled-color: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--brand-focus);
    box-shadow: 0 0 0 0.2rem rgba(var(--brand-rgb), 0.15);
}

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

.pagination {
    --bs-pagination-color: var(--brand);
    --bs-pagination-hover-color: var(--brand-deep);
    --bs-pagination-focus-color: var(--brand-deep);
    --bs-pagination-focus-box-shadow: 0 0 0 0.2rem rgba(var(--brand-rgb), 0.15);
    --bs-pagination-active-bg: var(--brand);
    --bs-pagination-active-border-color: var(--brand);
}

.nav-pills {
    --bs-nav-pills-link-active-bg: var(--brand);
}

.swal2-popup .swal2-styled.swal2-confirm {
    background-color: var(--brand);
}

.swal2-popup .swal2-styled.swal2-confirm:focus {
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.2);
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--navy);
}

.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--brand-focus) !important;
}

.table-modal .modal-content {
    border: 0;
    border-radius: 1.2rem;
    overflow: hidden;
    box-shadow: 0 22px 60px rgba(17, 24, 39, 0.18);
}

.table-modal .modal-header,
.table-modal .modal-footer {
    padding: 1rem 1.25rem;
}

.table-modal .modal-header {
    background: #f8fbff;
    border-bottom: 1px solid var(--line);
}

.table-modal .modal-footer {
    background: #fff;
    border-top: 1px solid var(--line);
}

.modal-form-body {
    max-height: min(72vh, 820px);
    overflow-y: auto;
    padding: 1.25rem;
}

.form-preview {
    margin-top: 1rem;
}

.data-note {
    border-radius: 1rem;
    padding: 0.95rem 1rem;
    background: var(--navy-soft);
    border: 1px solid var(--line);
    color: var(--navy);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.9rem;
}

.summary-chip {
    border: 1px solid var(--line);
    border-radius: 1rem;
    padding: 0.9rem 1rem;
    background: #f8fbff;
}

.summary-chip__label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 0.3rem;
}

.summary-chip__value {
    font-weight: 700;
    color: var(--ink);
}

.dashboard-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.95fr);
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-radius: 1.4rem;
    background:
        radial-gradient(circle at top right, rgba(var(--brand-rgb), 0.55), transparent 48%),
        linear-gradient(135deg, var(--navy) 0%, #223b54 100%);
    color: #fff;
    box-shadow: 0 18px 40px rgba(18, 54, 93, 0.22);
}

.dashboard-hero::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    right: -70px;
    bottom: -90px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.dashboard-hero__content,
.dashboard-hero__aside {
    position: relative;
    z-index: 1;
}

.dashboard-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-hero h2 {
    margin: 0.6rem 0 0.4rem;
    font-size: clamp(1.55rem, 2.4vw, 2.2rem);
    line-height: 1.05;
    font-weight: 800;
}

.dashboard-hero p {
    max-width: 640px;
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.94rem;
}

.dashboard-hero__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-weight: 600;
    font-size: 0.88rem;
}

.dashboard-hero__aside {
    display: grid;
    gap: 0.6rem;
}

.hero-metric-card {
    padding: 0.65rem 0.85rem;
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
}

.hero-metric-card__label {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.hero-metric-card__value {
    margin-top: 0.2rem;
    font-size: 1.35rem;
    font-weight: 800;
}

.hero-metric-card__meta {
    margin-top: 0.1rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
}

.kpi-card {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.95rem;
    align-items: center;
    padding: 1.15rem 1.2rem;
    border-radius: 1.2rem;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 10px 30px rgba(24, 49, 79, 0.06);
    overflow: hidden;
}

.kpi-card::after {
    content: "";
    position: absolute;
    inset: auto -26px -26px auto;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    opacity: 0.18;
}

.kpi-card__icon {
    width: 52px;
    height: 52px;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    box-shadow: 0 10px 22px rgba(24, 49, 79, 0.12);
}

.kpi-card__label {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.kpi-card__value {
    margin-top: 0.2rem;
    font-size: 1.45rem;
    line-height: 1.15;
    font-weight: 800;
    color: var(--ink);
}

.kpi-card--blue .kpi-card__icon,
.kpi-card--blue::after {
    background: var(--brand);
}

.kpi-card--sky .kpi-card__icon,
.kpi-card--sky::after {
    background: var(--navy-mid);
}

.kpi-card--green .kpi-card__icon,
.kpi-card--green::after {
    background: var(--navy);
}

.kpi-card--amber .kpi-card__icon,
.kpi-card--amber::after {
    background: var(--navy-mid);
}

.kpi-card--navy .kpi-card__icon,
.kpi-card--navy::after {
    background: var(--navy);
}

.kpi-card--teal .kpi-card__icon,
.kpi-card--teal::after {
    background: var(--brand);
}

.kpi-card--violet .kpi-card__icon,
.kpi-card--violet::after {
    background: var(--navy-mid);
}

.kpi-card--rose .kpi-card__icon,
.kpi-card--rose::after {
    background: var(--brand);
}

.chart-panel,
.snapshot-panel {
    overflow: hidden;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.35rem;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}

.panel-head h3 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 700;
}

.panel-head p {
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.panel-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-deep);
    font-weight: 700;
    font-size: 0.8rem;
}

.chart-panel__body {
    padding: 1rem 1.2rem 1.2rem;
    height: 320px;
}

.snapshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.95rem;
    padding: 1.2rem;
}

.snapshot-card {
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.snapshot-card--link {
    color: inherit;
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.snapshot-card--link:hover,
.snapshot-card--link:focus-visible {
    color: inherit;
    transform: translateY(-2px);
    border-color: rgba(var(--brand-rgb), 0.45);
    box-shadow: 0 10px 22px rgba(24, 49, 79, 0.1);
}

.serial-number-column {
    width: 1%;
    white-space: nowrap;
}

.vendor-profile {
    overflow: hidden;
    border: 1px solid #c9dbea;
    border-radius: 1.2rem;
    box-shadow: 0 12px 28px rgba(24, 49, 79, 0.08);
}

.vendor-profile__head {
    align-items: center;
    padding: 1.2rem 1.4rem;
    color: #fff;
    background: linear-gradient(115deg, var(--navy), var(--navy-mid));
}

.vendor-profile__head .card-head__title h3,
.vendor-profile__head .card-head__title p {
    color: #fff;
}

.vendor-profile__head .card-head__title p {
    color: rgba(255, 255, 255, 0.72);
}

.vendor-profile__head .btn {
    border-color: transparent;
    color: var(--navy);
    background: #fff;
}

.vendor-profile__identity {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.vendor-profile__mark {
    display: inline-flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.16);
    font-size: 1.3rem;
}

.vendor-profile__details > div {
    padding: 0.85rem 1rem;
    border-left: 3px solid #e4eff9;
    color: var(--ink);
}

.vendor-profile__details {
    background: #fff;
}

.vendor-profile__details .text-muted {
    color: #66788d !important;
}

.vendor-profile__details .text-uppercase {
    color: #39526d !important;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
}

.vendor-profile__details > div:hover {
    border-left-color: #198754;
    background: #f8fbff;
}

.vendor-detail-page .page-section {
    border: 1px solid #d7e3ee;
    box-shadow: 0 8px 20px rgba(24, 49, 79, 0.05);
}

.vendor-detail-page .table tbody tr {
    transition: background-color 140ms ease;
}

.vendor-detail-page .table tbody tr:hover {
    background: #edf6ff;
}

/* Products are now shown on their dedicated purchase detail page. */
.vendor-detail-page .page-section:has(#vendorPurchaseItems) {
    display: none;
}

@media (max-width: 575.98px) {
    .vendor-profile__head {
        align-items: flex-start;
        flex-direction: column;
    }

    .part-filter-bar {
        margin-right: 1rem;
        margin-left: 1rem;
    }

    .part-filter-bar__head {
        flex-direction: column;
    }
}

.snapshot-card__label {
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.snapshot-card__value {
    margin-top: 0.3rem;
    color: var(--ink);
    font-size: 1.22rem;
    font-weight: 800;
}

.inventory-mix {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.95rem;
    padding: 0 1.2rem 1.2rem;
}

.inventory-mix__item {
    border-radius: 1rem;
    padding: 0.95rem 1rem;
    color: #fff;
}

.inventory-mix__item.is-available {
    background: linear-gradient(135deg, #198754, #27b36f);
}

.inventory-mix__item.is-reserved {
    background: linear-gradient(135deg, #d48a22, #f0ad19);
}

.inventory-mix__item.is-damaged {
    background: linear-gradient(135deg, #c93c4a, #dc3545);
}

.inventory-mix__label {
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
    font-weight: 700;
}

.inventory-mix__value {
    margin-top: 0.28rem;
    font-size: 1.2rem;
    font-weight: 800;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 1.15fr) minmax(320px, 0.85fr);
}

.login-shell__panel {
    padding: 2rem;
}

.login-shell__panel--brand {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-shell__panel--form {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-brand-card {
    width: min(100%, 640px);
    padding: 2.3rem;
    border-radius: 1.8rem;
    background:
        linear-gradient(140deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.78)),
        linear-gradient(135deg, #ffffff, #eef4fb);
    border: 1px solid rgba(221, 231, 242, 0.95);
    box-shadow: 0 28px 70px rgba(24, 49, 79, 0.12);
}

.login-brand-card__kicker {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-brand-card h1 {
    margin: 1rem 0 0.8rem;
    font-size: clamp(2rem, 4vw, 3.35rem);
    line-height: 1.02;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.login-brand-card p {
    margin: 0;
    max-width: 560px;
    color: #53657a;
    font-size: 1.02rem;
}

.login-brand-card__highlights {
    display: grid;
    gap: 0.9rem;
    margin-top: 1.6rem;
}

.login-highlight {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    background: #f8fbff;
    border: 1px solid #dde7f2;
    color: var(--ink);
    font-weight: 600;
}

.login-highlight i {
    width: 42px;
    height: 42px;
    border-radius: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--navy), var(--navy-mid));
    color: #fff;
    font-size: 1.15rem;
    flex: 0 0 auto;
}

.login-card {
    width: min(100%, 520px);
    padding: 2rem;
    border-radius: 1.8rem;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(221, 231, 242, 0.95);
    box-shadow: 0 28px 70px rgba(24, 49, 79, 0.14);
}

.login-card__header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo {
    width: min(100%, 340px);
    height: auto;
    display: block;
    margin: 0 auto 1rem;
}

.login-card__title-wrap h2 {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 800;
}

.login-card__title-wrap p {
    margin: 0.45rem 0 0;
    color: #607285;
}

.login-input-group {
    margin-bottom: 1rem;
}

.login-input-wrap {
    position: relative;
}

.login-input-wrap i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #607285;
    font-size: 1rem;
    z-index: 2;
}

.login-input-wrap .form-control {
    min-height: 52px;
    padding-left: 2.9rem;
    border-radius: 1rem;
    border-color: #d5dfeb;
    background: #fbfdff;
}

.login-submit-btn {
    width: 100%;
    min-height: 52px;
    margin-top: 0.55rem;
    border-radius: 1rem;
    font-size: 1rem;
    font-weight: 700;
    background: var(--brand);
    border: 0;
    box-shadow: 0 12px 24px rgba(var(--brand-rgb), 0.2);
}

.login-submit-btn:hover,
.login-submit-btn:focus {
    background: var(--brand-deep);
}

.login-support-note {
    margin-top: 1.25rem;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    background: var(--navy-soft);
    border: 1px solid var(--line);
    color: var(--navy);
    text-align: center;
}

.login-support-note__label {
    margin-bottom: 0.3rem;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.login-support-text {
    margin-top: 0.9rem;
    color: #607285;
    text-align: center;
    font-size: 0.92rem;
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.permission-module-card {
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: #fff;
    overflow: hidden;
}

.permission-module-card__head {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid var(--line);
    background: #f8fbff;
}

.permission-module-card__head h4 {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
}

.permission-module-card__body {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
}

.permission-check {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.92rem;
    color: var(--ink);
}

.permission-check input {
    margin-top: 0.18rem;
}

.dataTables_wrapper .row {
    margin-left: 0;
    margin-right: 0;
    row-gap: 0.8rem;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select,
.select2-container .select2-selection--single,
.select2-container .select2-selection--multiple {
    border-radius: 0.75rem !important;
    border-color: #ced7e5 !important;
    min-height: 40px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 0.7rem !important;
}

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

.complaint-dropdown-option {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.complaint-dropdown-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    border: 1px solid #7b8796;
    border-radius: 3px;
    background: #fff;
}

.select2-results__option[aria-selected="true"] .complaint-dropdown-checkbox,
.select2-results__option--selected .complaint-dropdown-checkbox {
    background: var(--brand);
    border-color: var(--brand);
}

.select2-results__option[aria-selected="true"] .complaint-dropdown-checkbox::after,
.select2-results__option--selected .complaint-dropdown-checkbox::after {
    content: '';
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: translateY(-1px) rotate(45deg);
}

.select2-container--default .select2-selection--multiple {
    padding: 0.25rem 0.35rem;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px;
}

@media (max-width: 991.98px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-shell__panel {
        padding: 1.2rem;
    }

    .dashboard-hero {
        grid-template-columns: 1fr;
    }

    .inventory-mix {
        grid-template-columns: 1fr;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 272px;
        max-width: 86vw;
        transform: translateX(0);
        box-shadow: 18px 0 40px rgba(14, 40, 76, 0.18);
    }

    .main-shell > .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .admin-sidebar-collapsed .app-shell--admin .sidebar,
    .app-shell--admin .sidebar.is-mobile-hidden {
        transform: translateX(-100%);
        opacity: 0;
        pointer-events: none;
    }

    .admin-sidebar-collapsed .app-shell--admin {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .login-brand-card,
    .login-card {
        padding: 1.4rem;
        border-radius: 1.35rem;
    }

    .login-brand-card h1 {
        font-size: 2rem;
    }

    .login-logo {
        width: min(100%, 300px);
    }

    .dashboard-hero,
    .snapshot-grid,
    .inventory-mix {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .chart-panel__body {
        height: 280px;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .page-topbar,
    .card-head,
    .crud-toolbar {
        padding: 1rem;
    }

    .page-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-topbar__meta {
        text-align: left;
    }

    .content-card > .table-responsive,
    .page-section > .table-responsive,
    .content-card > .p-4,
    .page-section > .p-4,
    .modal-form-body {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .crud-toolbar .d-flex,
    .action-row,
    .action-group {
        width: 100%;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 0.4rem;
    }

    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: left !important;
    }
}
.customer-modal .modal-header {
    padding: 1.25rem 1.5rem;
    background: var(--card);
    gap: 1rem;
}

.customer-modal-heading {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    min-width: 0;
}

.customer-modal-icon {
    display: grid;
    place-items: center;
    flex: 0 0 2.75rem;
    height: 2.75rem;
    border-radius: 0.875rem;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 1.35rem;
}

.customer-modal-heading p,
.customer-section-heading p,
.customer-status-row p,
.customer-footer-note {
    color: var(--muted);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.customer-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.customer-form .modal-body {
    padding: 1.25rem 1.5rem;
    background: var(--bg);
}

.customer-required-note {
    margin: 0 0 0.875rem;
    font-size: 0.75rem;
    color: var(--muted);
}

.customer-required-note span,
.customer-required-mark {
    color: var(--brand);
}

.customer-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.customer-form--editing .customer-form-grid {
    grid-template-columns: minmax(0, 1fr);
}

.customer-form-section {
    min-width: 0;
    padding: 1.125rem;
    border: 1px solid var(--line);
    border-radius: 0.875rem;
    background: var(--card);
}

.customer-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin-bottom: 1rem;
}

.customer-section-heading > i {
    margin-top: 0.125rem;
    color: var(--brand);
    font-size: 1.1rem;
}

.customer-section-heading h4 {
    margin: 0 0 0.25rem;
    font-size: 0.9375rem;
    font-weight: 700;
}

.customer-section-heading p {
    margin: 0;
}

.customer-form .form-label {
    font-size: 0.8125rem;
    font-weight: 600;
}

.customer-optional {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 400;
}

.customer-form .form-control {
    min-height: 2.75rem;
    font-size: 0.875rem;
}

.customer-form .form-text {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    line-height: 1.5;
}

.customer-login-section {
    border-top: 3px solid var(--brand);
}

.customer-pin-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.customer-pin-label .btn {
    padding: 0.25rem 0;
    font-size: 0.75rem;
    text-decoration: none;
}

.customer-pin-digits {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    flex: 1;
    max-width: 13.5rem;
    min-width: 0;
    width: 100%;
}

.customer-form .customer-pin-digits .form-control {
    min-width: 0;
    font-size: 1.5rem;
    padding: 0.5rem 0;
}

.customer-additional-section {
    margin-top: 1rem;
}

.customer-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.875rem 1.125rem;
    border: 1px solid var(--line);
    border-radius: 0.875rem;
    background: var(--card);
}

.customer-status-row .form-switch {
    flex-shrink: 0;
}

.customer-status-row .form-check-input {
    width: 2.5rem;
    height: 1.375rem;
    cursor: pointer;
}

.customer-modal .modal-footer {
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    flex-shrink: 0;
}

.customer-form-actions {
    display: flex;
    gap: 0.625rem;
}

@media (min-width: 576px) {
    .customer-modal .modal-dialog {
        width: calc(100% - 3rem);
        max-width: 860px;
    }
}

@media (max-width: 767.98px) {
    .customer-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .customer-modal .modal-header,
    .customer-modal .modal-footer,
    .customer-form .modal-body {
        padding: 1rem;
    }

    .customer-footer-note {
        display: none;
    }

    .customer-form-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }
}

