:root {
    --theme-default: #65080F;
    --theme-secondary: #4A050A;
    --antique-maroon: #65080F;
    --antique-maroon-deep: #4A050A;
    --antique-maroon-dark: #2B0306;
    --antique-maroon-mid: #761922;
    --antique-gold: #65080F;
    --antique-ink: #2B0306;
    --antique-sand: #F7F1F1;
    --antique-moss: #4f7d6d;
    --antique-clay: #c06a48;
    --antique-rose: #761922;
}

body,
body.rtl,
.page-body,
.page-body h1, .page-body h2, .page-body h3, .page-body h4, .page-body h5,
.page-body p, .page-body a, .page-body span, .page-body td, .page-body th,
.page-body label, .page-body button, .page-sidebar,
.page-sidebar span, .page-sidebar a {
    font-family: 'Cairo', sans-serif;
    letter-spacing: 0 !important;
}

.page-body .card {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(101, 8, 15, 0.08);
}

.page-title h3 {
    font-weight: 800;
    color: var(--antique-ink);
}

.page-title .breadcrumb {
    background: var(--antique-sand);
    border-radius: 999px;
    padding: 8px 14px;
}

.page-title .breadcrumb-item a,
.page-title .svg-color {
    color: var(--antique-gold);
}

.page-body .btn-primary {
    background: var(--antique-maroon);
    border-color: var(--antique-maroon);
    border-radius: 999px;
    font-weight: 700;
    padding: 8px 18px;
}

.page-body .btn-primary:hover,
.page-body .btn-primary:focus {
    background: var(--antique-maroon-deep);
    border-color: var(--antique-maroon-deep);
    color: #fff;
}

.page-body .btn-secondary,
.page-body .btn-outline-primary {
    border-radius: 999px;
    font-weight: 700;
    border-color: #E8D4DA;
    color: var(--antique-ink);
}

.page-body .btn-success {
    background: var(--antique-moss);
    border-color: var(--antique-moss);
    border-radius: 999px;
    font-weight: 700;
}

.page-body .btn-danger {
    background: var(--antique-rose);
    border-color: var(--antique-rose);
    border-radius: 999px;
    font-weight: 700;
}

.page-body table thead th,
.page-body table.dataTable thead th {
    background: var(--antique-maroon) !important;
    color: #fff !important;
    border: 0 !important;
    font-weight: 700;
    white-space: nowrap;
}

.page-body table tbody td {
    vertical-align: middle;
    border-color: #E8D4DA !important;
}

.page-body table tbody tr {
    transition: background .15s ease;
}

.page-body table tbody tr:hover {
    background: #F8F1F3;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border-radius: 12px;
    border: 1px solid #E8D4DA;
    padding: 6px 10px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 999px !important;
    border: 0 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--antique-maroon) !important;
    color: #fff !important;
}

.action-div {
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-div a.show-icon,
.action-div a.edit-icon,
.action-div a.delete-svg {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease, box-shadow .2s ease;
}

.action-div a.show-icon { background: #dceee6; color: #2f6b57; }
.action-div a.edit-icon { background: #F3E8E8; color: #65080F; }
.action-div a.delete-svg { background: #f8d7da; color: #a12b36; }

.action-div a:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(101, 8, 15, 0.12);
}

.action-div svg,
.action-div i {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.status-pill {
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    display: inline-block;
}

.status-confirmed,
.status-paid { background: #dceee6; color: #2f6b57; }
.status-pending,
.status-draft,
.status-unpaid { background: #F3E8E8; color: #65080F; }
.status-cancelled { background: #f8d7da; color: #a12b36; }

.page-header .logo-wrapper {
    overflow: visible;
    min-height: 72px;
}

.page-header .logo-wrapper .brand-logo img {
    height: 62px;
}

.page-sidebar .sidebar-link .stroke-icon {
    color: var(--antique-gold);
}

.page-sidebar .sidebar-link:hover,
.page-sidebar .sidebar-submenu a:hover {
    background: var(--antique-sand);
    border-radius: 10px;
}

.page-sidebar .sidebar-submenu a.active,
.page-sidebar .sidebar-submenu li.active > a,
.page-sidebar .sidebar-link.active {
    background-color: rgba(101, 8, 15, 0.14) !important;
    border-radius: 10px;
}

.antique-form-head {
    padding: 18px 22px 0;
}

.hero-chip,
.antique-form-head .hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--antique-sand);
    color: var(--antique-ink);
    font-weight: 700;
}

.invoice-form-footer .btn-primary {
    background: #fff !important;
    color: var(--antique-ink) !important;
    border-color: #fff !important;
}

.invoice-form-footer .btn-primary:hover {
    background: var(--antique-maroon-deep) !important;
    border-color: var(--antique-maroon-deep) !important;
    color: #fff !important;
}

.antique-form .form-label {
    font-weight: 700;
    color: var(--antique-ink);
}

.antique-form .form-control,
.antique-form .form-select {
    border-radius: 12px;
    border-color: #E8D4DA;
    min-height: 44px;
}

.antique-form .form-control:focus,
.antique-form .form-select:focus {
    border-color: var(--antique-gold);
    box-shadow: 0 0 0 0.2rem rgba(101, 8, 15, 0.2);
}

.invoice-items-wrap {
    background: #FBF6F8;
    border: 1px solid #E8D4DA;
    border-radius: 16px;
    padding: 16px;
}

.invoice-items-wrap #add-item {
    background: #fff;
    border: 1px dashed var(--antique-gold);
    color: var(--antique-ink);
    border-radius: 999px;
    font-weight: 700;
}

.invoice-items-wrap #add-item:hover {
    background: var(--antique-sand);
}

.invoice-items-wrap .remove-row {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 12px;
}

.invoice-form-footer {
    margin-top: 20px;
    padding: 16px 18px;
    border-radius: 16px;
    background: linear-gradient(135deg, #2B0306 0%, #65080F 55%, #761922 160%);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.invoice-form-footer .form-check-label,
.invoice-form-footer strong {
    color: #fff;
}

.invoice-total-chip {
    background: rgba(255,255,255,0.12);
    border-radius: 999px;
    padding: 8px 16px;
    font-weight: 800;
    margin-inline-end: 10px;
}

.invoice-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.invoice-meta-chip {
    border-radius: 14px;
    padding: 12px 14px;
    background: #F8F1F3;
    border: 1px solid #E8D4DA;
}

.invoice-meta-chip small {
    display: block;
    color: #65080F;
    font-weight: 700;
}

.invoice-meta-chip strong {
    color: var(--antique-ink);
}

.btn-primary,
.login-card .btn-primary {
    --bs-btn-bg: var(--theme-default);
    --bs-btn-border-color: var(--theme-default);
    --bs-btn-hover-bg: var(--antique-maroon-deep);
    --bs-btn-hover-border-color: var(--antique-maroon-deep);
    --bs-btn-active-bg: var(--antique-maroon-dark);
    --bs-btn-active-border-color: var(--antique-maroon-dark);
    background-color: var(--theme-default);
    border-color: var(--theme-default);
}

.page-sidebar .sidebar-list .sidebar-link.active,
.page-sidebar .sidebar-list .sidebar-link:hover {
    color: var(--theme-default);
}

.page-header {
    border-bottom: 1px solid #E8D4DA;
}

.btn-primary:not(.btn-light),
.login-card .btn-primary,
.badge-primary,
.bg-primary {
    background-color: var(--theme-default) !important;
    border-color: var(--theme-default) !important;
}

.btn-primary:not(.btn-light):hover,
.btn-primary:not(.btn-light):focus {
    background-color: var(--antique-maroon-deep) !important;
    border-color: var(--antique-maroon-deep) !important;
}

.page-sidebar .sidebar-list .sidebar-title,
.page-sidebar .sidebar-list .sidebar-link.active i,
.page-sidebar .sidebar-list .sidebar-link.active svg {
    color: var(--theme-default);
}

.text-primary,
.font-primary,
a.text-primary {
    color: var(--theme-default) !important;
}

.product-cat-picker {
    background: #FBF6F8;
    border: 1px solid #E8D4DA;
    border-radius: 16px;
    padding: 14px;
}

.product-cat-picker.is-invalid {
    border-color: #dc3545;
}

.product-cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.product-cat-head .form-label {
    margin: 0;
    font-weight: 800;
    color: var(--antique-ink);
}

.product-cat-search {
    width: min(280px, 100%);
    border-radius: 12px;
    border-color: #E8D4DA;
    min-height: 40px;
    background: #fff;
}

.product-cat-search:focus {
    border-color: var(--antique-maroon);
    box-shadow: 0 0 0 0.2rem rgba(101, 8, 15, 0.15);
}

.product-cat-modes {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.product-cat-mode {
    border: 1px solid #E8D4DA;
    background: #fff;
    color: var(--antique-ink);
    border-radius: 999px;
    padding: 7px 14px;
    font-weight: 800;
}

.product-cat-mode.is-active {
    background: var(--antique-maroon);
    border-color: var(--antique-maroon);
    color: #fff;
}

.product-cat-components {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.product-cat-chip {
    border: 1px solid #E8D4DA;
    background: #fff;
    color: var(--antique-ink);
    border-radius: 999px;
    padding: 7px 14px;
    font-weight: 700;
}

.product-cat-chip:hover {
    background: #F8F1F3;
}

.product-cat-chip.is-selected {
    background: var(--antique-maroon);
    border-color: var(--antique-maroon);
    color: #fff;
}

.product-cat-path {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-height: 46px;
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #E8D4DA;
}

.product-cat-path-label {
    color: #8a6570;
    font-size: 12px;
    font-weight: 700;
}

.product-cat-path-value {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-weight: 800;
    color: var(--antique-ink);
}

.product-cat-path-value.is-empty {
    font-weight: 600;
    color: #8a6570;
}

.product-cat-path-value .sep {
    color: #c4a0a8;
    font-weight: 600;
}

.product-cat-clear {
    margin-inline-start: auto;
    border: 0;
    background: var(--antique-sand);
    color: var(--antique-maroon);
    border-radius: 999px;
    padding: 4px 12px;
    font-weight: 700;
    font-size: 13px;
}

.product-cat-columns {
    display: grid;
    gap: 10px;
}

.product-cat-columns[data-cols="1"] { grid-template-columns: minmax(0, 360px); }
.product-cat-columns[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.product-cat-columns[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.product-cat-col {
    background: #fff;
    border: 1px solid #E8D4DA;
    border-radius: 14px;
    overflow: hidden;
    min-height: 180px;
}

.product-cat-col-title {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 800;
    color: var(--antique-maroon);
    background: #F8F1F3;
    border-bottom: 1px solid #E8D4DA;
}

.product-cat-col-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    max-height: 280px;
    overflow: auto;
}

.product-cat-item,
.product-cat-result {
    border: 1px solid transparent;
    background: transparent;
    color: var(--antique-ink);
    border-radius: 10px;
    font-weight: 700;
    text-align: start;
}

.product-cat-item,
.product-cat-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
}

.product-cat-item:hover,
.product-cat-result:hover {
    background: #F8F1F3;
}

.product-cat-item.is-open {
    background: #F8EDEF;
    border-color: #E4C5CC;
    color: var(--antique-maroon);
    box-shadow: inset -3px 0 0 var(--antique-maroon);
}

.product-cat-item.is-selected,
.product-cat-result.is-selected {
    background: var(--antique-maroon);
    border-color: var(--antique-maroon);
    color: #fff;
}

.product-cat-chevron {
    flex: 0 0 auto;
    width: 0;
    height: 0;
    border-block: 5px solid transparent;
    border-inline-start: 6px solid currentColor;
    color: #b08993;
}

.product-cat-item.is-selected .product-cat-chevron {
    color: #fff;
}

.product-cat-results {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #fff;
    border: 1px solid #E8D4DA;
    border-radius: 14px;
    padding: 8px;
    max-height: 320px;
    overflow: auto;
}

.product-cat-result {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.product-cat-result small {
    color: #8a6570;
    font-weight: 600;
}

.product-cat-result.is-selected small {
    color: rgba(255, 255, 255, 0.82);
}

.product-cat-empty {
    padding: 16px 8px;
    text-align: center;
    color: #8a6570;
    font-weight: 700;
}

.build-panel {
    background: #FBF6F8;
    border: 1px solid #E8D4DA;
    border-radius: 16px;
    padding: 16px;
}

.build-panel.is-invalid {
    border-color: #dc3545;
}

.build-panel-title {
    font-weight: 800;
    font-size: 16px;
    color: var(--antique-ink);
}

.build-panel-hint {
    margin: 4px 0 0;
    color: #8a6570;
    font-size: 13px;
}

.build-kicker {
    margin: 14px 0 8px;
    font-size: 12px;
    font-weight: 800;
    color: var(--antique-maroon);
}

.build-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.build-chip {
    border: 1px solid #E8D4DA;
    background: #fff;
    color: var(--antique-ink);
    border-radius: 999px;
    padding: 7px 14px;
    font-weight: 700;
}

.build-chip:hover {
    background: #F8F1F3;
}

.build-chip.is-on {
    background: var(--antique-maroon);
    border-color: var(--antique-maroon);
    color: #fff;
}

.build-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.build-empty {
    padding: 16px;
    border: 1px dashed #E8D4DA;
    border-radius: 14px;
    background: #fff;
    text-align: center;
    color: #8a6570;
    font-weight: 700;
}

.build-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #E8D4DA;
    border-radius: 14px;
}

.build-row-name {
    flex: 1;
    font-weight: 800;
    color: var(--antique-ink);
}

.build-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #8a6570;
    font-size: 12px;
    font-weight: 700;
}

.build-qty .form-control {
    width: 96px;
    min-height: 40px;
    border-radius: 12px;
    border-color: #E8D4DA;
}

.build-remove {
    border: 0;
    background: #F8EDEF;
    color: var(--antique-maroon);
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: 700;
}

.build-remove:hover {
    background: var(--antique-maroon);
    color: #fff;
}

@media (max-width: 767px) {
    .build-row {
        flex-wrap: wrap;
    }

    .build-qty,
    .build-qty .form-control {
        width: 100%;
    }
}

@media (max-width: 767px) {
    .product-cat-head {
        flex-direction: column;
        align-items: stretch;
    }

    .product-cat-search {
        width: 100%;
    }

    .product-cat-columns[data-cols="1"],
    .product-cat-columns[data-cols="2"],
    .product-cat-columns[data-cols="3"] {
        grid-template-columns: 1fr;
    }
}
