@font-face {
    font-family: "Lato";
    src: url("../fonts/lato/Lato-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Lato";
    src: url("../fonts/lato/Lato-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Lato";
    src: url("../fonts/lato/Lato-Italic.ttf") format("truetype");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "Lato";
    src: url("../fonts/lato/Lato-BoldItalic.ttf") format("truetype");
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "Roslindale Display";
    src: url("../fonts/roslindale/Roslindale-DisplayLight.otf") format("opentype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Roslindale Display Condensed";
    src: url("../fonts/roslindale/Roslindale-DisplayCondensedMedium.ttf") format("truetype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Roslindale Display Condensed";
    src: url("../fonts/roslindale/Roslindale-DisplayCondensedItalic.ttf") format("truetype");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "Roslindale Display Condensed";
    src: url("../fonts/roslindale/Roslindale-DisplayCondensedMediumItalic.ttf") format("truetype");
    font-weight: 500;
    font-style: italic;
    font-display: swap;
}

/* Casa Patrizia: borgoña, marfil y azul empolvado. */
:root {
    --cp-burgundy: #5f292f;
    --cp-burgundy-hover: #472027;
    --cp-ivory: #e9e2da;
    --cp-blue: #b5c5d4;
    --cp-ink: #30272a;
    --cp-muted: #756a6d;
    --cp-border: #e2d8d0;
    --cp-paper: #faf8f5;
    --cp-shadow: 0 5px 22px rgba(67, 37, 42, 0.045);
    --bs-primary: #5f292f;
    --bs-primary-rgb: 95, 41, 47;
    --bs-link-color: #5f292f;
    --bs-link-hover-color: #472027;
    --bs-body-color: #30272a;
    --bs-border-color: #e2d8d0;
    --cp-font-body: "Lato", system-ui, sans-serif;
    --cp-font-heading: "Roslindale Display", Georgia, serif;
    --bs-font-sans-serif: "Lato", system-ui, sans-serif;
}

html body {
    font-family: var(--cp-font-body);
    color: var(--cp-ink);
    background-color: #f5f1ec;
    accent-color: var(--cp-burgundy);
    -webkit-font-smoothing: antialiased;
}

body .sidebar {
    background: var(--cp-paper);
    border-right: 1px solid var(--cp-border);
    box-shadow: 3px 0 20px rgba(67, 37, 42, 0.025);
}

body .sidebar-logo {
    padding: 8px 0 20px;
    border-bottom: 1px solid var(--cp-border);
}

body .sidebar-section {
    border-color: transparent;
    border-radius: 12px;
}

body .sidebar-section-toggle {
    color: var(--cp-burgundy);
    letter-spacing: 0.025em;
}

body .sidebar-item {
    border-radius: 9px;
    transition: background-color 160ms ease, color 160ms ease;
}

body .sidebar-item:hover {
    background: var(--cp-ivory);
    color: var(--cp-burgundy);
}

body .sidebar-item.active {
    background: var(--cp-burgundy);
    color: #fff;
    box-shadow: 0 3px 10px rgba(95, 41, 47, 0.14);
}

body .sidebar-item.active svg { color: #fff; }
body .topbar { background: var(--cp-paper); border-color: var(--cp-border); }
body .store-pill { background: #edf1f5; color: #354956; border-color: var(--cp-blue); }
body .main-area { min-width: 0; }

body .page-title {
    color: var(--cp-burgundy);
    font-family: var(--cp-font-heading);
    font-size: clamp(20px, 1.7vw, 24px);
    font-weight: 300;
    letter-spacing: -0.025em;
    text-transform: uppercase;
    line-height: 1.2;
}

body .page-subtitle { color: var(--cp-muted); line-height: 1.6; margin-top: 8px; }
body .page-header { margin-bottom: 28px; }

body .card, body .card-soft, body .stat-card {
    border: 1px solid var(--cp-border);
    border-radius: 14px;
    box-shadow: var(--cp-shadow);
    background-color: #fff;
}

body .stat-card {
    border-top: 3px solid var(--cp-blue);
}

body .stat-card:first-child { border-top-color: var(--cp-burgundy); }
body .stat-value { color: var(--cp-burgundy); font-variant-numeric: tabular-nums; }
body .card-title { color: var(--cp-burgundy); font-weight: 600; }

body .primary-button, body .btn-primary, body .btn-casa_patrizia-primary {
    --bs-btn-bg: #5f292f;
    --bs-btn-border-color: #5f292f;
    --bs-btn-hover-bg: #472027;
    --bs-btn-hover-border-color: #472027;
    --bs-btn-active-bg: #472027;
    --bs-btn-active-border-color: #472027;
    --bs-btn-disabled-bg: #5f292f;
    --bs-btn-disabled-border-color: #5f292f;
    background: var(--cp-burgundy);
    border-color: var(--cp-burgundy);
    color: #fff;
    border-radius: 9px;
    transition: background-color 160ms ease, box-shadow 160ms ease;
}

body .primary-button:hover, body .btn-primary:hover, body .btn-casa_patrizia-primary:hover {
    background: var(--cp-burgundy-hover);
    border-color: var(--cp-burgundy-hover);
    color: #fff;
    box-shadow: 0 4px 12px rgba(95, 41, 47, 0.16);
    filter: none;
}

body .btn-secondary {
    --bs-btn-disabled-bg: #e9e2da;
    --bs-btn-disabled-color: #5d5155;
    background: var(--cp-paper);
    color: var(--cp-burgundy);
    border: 1px solid var(--cp-border);
    border-radius: 9px;
}

body .btn-secondary:hover { background: var(--cp-ivory); color: var(--cp-burgundy-hover); border-color: #cfc2ba; }
body .form-input, body .form-select, body .form-control { border-color: #cfc2ba; border-radius: 8px; }
body .form-input:focus, body .form-select:focus, body .form-control:focus {
    border-color: var(--cp-burgundy);
    box-shadow: 0 0 0 3px rgba(95, 41, 47, 0.12);
    outline: none;
}

body :is(button, a, input, select, textarea):focus-visible {
    outline: 2px solid var(--cp-burgundy);
    outline-offset: 3px;
}

body table[class] thead th,
body table[class] thead td {
    background: var(--cp-ivory);
    color: var(--cp-burgundy);
    border-bottom: 2px solid var(--cp-burgundy);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.035em;
    --bs-table-bg: var(--cp-ivory);
    --bs-table-color: var(--cp-burgundy);
}

body .data-table tbody tr:hover, body table.dataTable tbody tr:hover { background-color: #faf6f2; }
body .data-table td, body table.dataTable td { border-bottom-color: #eee7e1; }
body .dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--cp-burgundy) !important;
    color: #fff !important;
    border: 1px solid var(--cp-burgundy) !important;
    border-radius: 7px;
}

body .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--cp-ivory) !important;
    color: var(--cp-burgundy) !important;
    border-color: var(--cp-border) !important;
}

body .modal-header, body .modal-footer { border-color: var(--cp-border); }
body .modal-title { color: var(--cp-burgundy); }
body .select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--cp-burgundy); }
body .select2-container--default .select2-selection--single { border-color: #cfc2ba; }

body.login-page { isolation: isolate; background-color: var(--cp-ink); }
body.login-page .overlay { background: linear-gradient(120deg, rgba(48, 25, 30, 0.25), rgba(48, 25, 30, 0.55)); }
body.login-page .login-card {
    border: 1px solid rgba(233, 226, 218, 0.8);
    border-top: 4px solid var(--cp-burgundy);
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(40, 20, 25, 0.28);
}
body.login-page .login-title {
    color: var(--cp-burgundy);
    font-family: var(--cp-font-heading);
    font-weight: 300;
    letter-spacing: 0;
    text-transform: uppercase;
    font-size: 23px;
    line-height: 1.25;
}
body.login-page .btn-submit { background: var(--cp-burgundy); border-radius: 9px; padding: 13px 16px; }
body.login-page .btn-submit:hover { background: var(--cp-burgundy-hover); }
body.login-page .footer-help { color: var(--cp-muted); }

@media (prefers-reduced-motion: reduce) {
    body .sidebar-item, body .primary-button, body .btn-primary, body .btn-casa_patrizia-primary { transition: none; }
}
