* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #F3F4F6;
    min-height: 100vh;
}

.container-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 15px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 15px;
    padding-bottom: 24px;
}

/* Login Styles */
.login-container {
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background:
        radial-gradient(ellipse 120% 80% at 50% 110%, #4A5868 0%, transparent 60%),
        linear-gradient(160deg, #4B5563 0%, #374151 55%, #2B3440 100%);
}

/* Fondo del login: taller — acero cepillado, panal de tuercas y luz de faro */
.aurora-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    /* Acero cepillado: vetas horizontales muy finas */
    background: repeating-linear-gradient(
        0deg,
        rgba(255, 255, 255, 0.03) 0px,
        rgba(255, 255, 255, 0.03) 1px,
        transparent 1px,
        transparent 3px
    );
}

/* Panal de hexágonos (tuercas), más visible al centro y desvanecido en las orillas */
.aurora-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cpath d='M28 66L0 50V16L28 0l28 16v34L28 66zm0 0v34' fill='none' stroke='%23CBD5E1' stroke-opacity='.22' stroke-width='1.5'/%3E%3C/svg%3E");
    background-size: 56px 100px;
    -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 0%, transparent 85%);
    mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 0%, transparent 85%);
}

/* Luz de faro azul (la del logo) que barre lento, con reflejo ámbar abajo */
.aurora-bg::after {
    content: "";
    position: absolute;
    inset: -20%;
    background:
        radial-gradient(ellipse 45% 30% at 30% 35%, rgba(42, 147, 213, 0.45) 0%, transparent 70%),
        radial-gradient(ellipse 35% 22% at 75% 80%, rgba(245, 158, 11, 0.14) 0%, transparent 70%),
        linear-gradient(115deg, transparent 40%, rgba(42, 147, 213, 0.10) 50%, transparent 60%);
    filter: blur(40px);
    animation: headlightSweep 16s ease-in-out infinite alternate;
}

@media (prefers-reduced-motion: reduce) {
    .aurora-bg::after {
        animation: none;
    }
}

.login-card {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.95);
    padding: 48px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.35), 0 0 80px rgba(17, 125, 194, 0.08);
    width: 100%;
    max-width: 400px;
    animation: slideUp 0.6s ease-out;
    backdrop-filter: blur(4px);
}

@keyframes headlightSweep {
    0%   { transform: translate3d(-6%, 0, 0);  opacity: 0.85; }
    50%  { transform: translate3d(4%, -3%, 0); opacity: 1; }
    100% { transform: translate3d(8%, 2%, 0);  opacity: 0.9; }
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-header h1 {
    color: #117DC2;
    margin-bottom: 10px;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.login-header p {
    color: #999;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 600;
    font-size: 14px;
}

.required-star {
    color: #e74c3c;
}

.form-group input {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid #E5E7EB;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #F9FAFB;
}

.form-group input:focus {
    outline: none;
    border-color: #117DC2;
    box-shadow: 0 0 0 3px rgba(17, 125, 194, 0.08);
    background: white;
}

.clients-search-bar {
    margin: 18px 0;
}

.client-search-input {
    width: 100%;
    max-width: 480px;
    padding: 12px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 6px;
    background: #F9FAFB;
    color: #111827;
    font-size: 15px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.client-search-input:focus {
    outline: none;
    border-color: #117DC2;
    box-shadow: 0 0 0 4px rgba(17, 125, 194, 0.14);
    transform: translateY(-1px);
}

.btn {
    width: 100%;
    padding: 13px 20px;
    background: #117DC2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(17, 125, 194, 0.25);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(17, 125, 194, 0.35);
    background: #0E6AA6;
}

.btn:active {
    transform: translateY(-1px);
}

.error-message {
    background: #FEE2E2;
    color: #DC2626;
    padding: 13px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #FCA5A5;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

.error-message i {
    font-size: 17px;
}

/* App Layout */
.app-header {
    position: sticky;
    top: 0;
    z-index: 900;
    background: white;
    border-bottom: 1px solid #E5E7EB;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 10px;
}

.app-header .container-header {
    padding: 6px 8px;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 4px;
}

.logo {
    flex: 1;
    min-width: 0;
    font-size: 18px;
    font-weight: bold;
    color: #117DC2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-icon-btn {
    position: relative;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #374151;
    font-size: 20px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.header-icon-btn:active {
    background: #F3F4F6;
}

/* Badge for cart counter */
.badge {
    background: #EF4444;
    color: white;
    border-radius: 10px;
    padding: 1px 5px;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
}

.header-icon-btn .badge {
    position: absolute;
    top: 3px;
    right: 1px;
    border: 2px solid white;
}

/* Navigation Drawer */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.5);
    z-index: 1100;
}

.drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(84vw, 320px);
    display: flex;
    flex-direction: column;
    background: white;
    z-index: 1101;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    padding-bottom: env(safe-area-inset-bottom);
}

.drawer-header {
    display: flex;
    align-items: center;
    padding: 10px 8px 10px 20px;
}

.drawer-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 12px;
}

.drawer-item {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 13px 14px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #374151;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.drawer-item i {
    width: 22px;
    font-size: 17px;
    text-align: center;
}

.drawer-item .badge {
    margin-left: auto;
}

.drawer-item.active {
    background: #EAF4FB;
    color: #117DC2;
    font-weight: 600;
}

.drawer-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #E5E7EB;
    color: #6B7280;
    font-size: 13px;
}

.drawer-logout {
    background: transparent;
    border: 1px solid #FCA5A5;
    border-radius: 8px;
    padding: 9px 14px;
    color: #DC2626;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.drawer-version {
    font-size: 11px;
    color: #9CA3AF;
}

.drawer-enter-active,
.drawer-leave-active {
    transition: transform 0.22s ease;
}

.drawer-enter-from,
.drawer-leave-to {
    transform: translateX(-100%);
}

.fade-enter-active,
.fade-leave-active {
    transition: opacity 0.18s ease;
}

.fade-enter-from,
.fade-leave-to {
    opacity: 0;
}

/* Product filters */
.product-search {
    position: relative;
    margin-bottom: 12px;
}

.product-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    pointer-events: none;
}

.product-search .search-input {
    padding-left: 40px;
}

.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    overflow-x: auto;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    max-width: 60vw;
    padding: 9px 14px;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    color: #374151;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.filter-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-chip.active {
    background: #117DC2;
    border-color: #117DC2;
    color: white;
    font-weight: 600;
}

/* Sale customer step */
.customer-picker h2 {
    margin-bottom: 4px;
}

.customer-picker-hint {
    margin-bottom: 14px;
    color: #6B7280;
    font-size: 14px;
}

.customer-picker-general {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    margin-bottom: 14px;
    padding: 14px 16px;
    background: white;
    border: 1px solid #C2DEF2;
    border-radius: 10px;
    color: #117DC2;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.customer-picker-general span {
    flex: 1;
    display: flex;
    flex-direction: column;
    color: #111827;
}

.customer-picker-general small,
.filter-option-name small {
    display: block;
    color: #6B7280;
    font-size: 12px;
    font-weight: normal;
}

.customer-picker-general.field-error {
    border-color: #DC2626;
}

.customer-picker-title {
    margin: 12px 0 4px;
    color: #6B7280;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.customer-picker-status {
    padding: 12px 0;
    color: #6B7280;
    font-size: 14px;
    text-align: center;
}

.customer-picker .filter-option {
    background: white;
}

.customer-picker-cancel {
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    color: #374151;
    font-size: 15px;
    cursor: pointer;
}

.customer-picker-title + .customer-picker-hint {
    margin-bottom: 8px;
    font-size: 13px;
}

.customer-picker-preview {
    flex-wrap: wrap;
}

.sale-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px 8px 8px 14px;
    background: #EAF4FB;
    border: 1px solid #C2DEF2;
    border-radius: 8px;
    color: #117DC2;
    font-size: 14px;
}

.sale-bar-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: #374151;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sale-bar-change {
    flex-shrink: 0;
    margin-left: auto;
    padding: 7px 12px;
    background: white;
    border: 1px solid #C2DEF2;
    border-radius: 6px;
    color: #117DC2;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.sale-promos {
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    border-radius: 8px;
    color: #047857;
    font-size: 13px;
}

/* Quotations */
.quotation-btn {
    background: white;
    border: 1px solid #117DC2;
    border-radius: 6px;
    padding: 9px 14px;
    flex: 1;
    color: #117DC2;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.quotation-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cart-actions {
    flex-wrap: wrap;
}

.quotation-editing {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 8px 8px 8px 14px;
    background: #FEF3C7;
    border: 1px solid #FDE68A;
    border-radius: 8px;
    color: #92400E;
    font-size: 14px;
}

.quotation-editing span {
    flex: 1;
}

.quotation-lines-toggle {
    margin-top: 8px;
    padding: 6px 0;
    background: transparent;
    border: none;
    color: #117DC2;
    font-size: 14px;
    cursor: pointer;
}

.quotation-lines {
    margin: 4px 0 8px;
    border-top: 1px solid #F3F4F6;
}

.quotation-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid #F3F4F6;
    font-size: 14px;
}

.quotation-line small {
    color: #9CA3AF;
}

/* Discounts & promotions */
.discounts-link {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 6px 0;
    background: transparent;
    border: none;
    color: #117DC2;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

.discounts-context {
    margin-bottom: 12px;
    font-size: 14px;
}

.discounts-badge,
.discounts-tag {
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.discounts-badge {
    background: #F3F4F6;
    color: #6B7280;
}

.discounts-tag {
    background: #D1FAE5;
    color: #047857;
}

.discounts-section {
    margin-top: 16px;
}

.discounts-section h4 {
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #E5E7EB;
    color: #111827;
    font-size: 15px;
}

.discounts-section h4 i {
    width: 20px;
    color: #117DC2;
}

.discounts-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.discounts-stats div {
    padding: 8px;
    background: #F9FAFB;
    border-radius: 6px;
    text-align: center;
}

.discounts-stats small,
.discounts-item small {
    display: block;
    color: #6B7280;
    font-size: 12px;
}

.discounts-stats strong {
    font-size: 14px;
}

.discounts-next {
    margin-bottom: 8px;
    padding: 8px 10px;
    background: #EAF4FB;
    border-radius: 6px;
    font-size: 13px;
}

.discounts-item {
    padding: 8px 0;
    border-bottom: 1px solid #F3F4F6;
}

.discounts-item-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-size: 14px;
    font-weight: 600;
}

.discounts-item .statistics-progress {
    height: 6px;
    margin: 6px 0 4px;
}

/* Price ladder */
.price-ladder-link {
    margin-top: 4px;
    font-size: 13px;
}

.price-ladder-note {
    margin-bottom: 8px;
    color: #6B7280;
    font-size: 13px;
}

.price-ladder {
    list-style: none;
}

.price-ladder-step {
    padding: 10px 12px;
    border-bottom: 1px solid #F3F4F6;
}

.price-ladder-step small {
    display: block;
    color: #047857;
    font-size: 12px;
}

.price-ladder-step .fa-arrow-up {
    color: #117DC2;
}

.price-ladder-step.current {
    background: #EAF4FB;
    border-radius: 6px;
}

/* Product applications */
.applications-list {
    list-style: none;
    max-height: 55vh;
    overflow-y: auto;
}

.applications-list li {
    padding: 8px 12px;
    border-bottom: 1px solid #F3F4F6;
    font-size: 14px;
    text-transform: uppercase;
}

.applications-list .fa-check {
    color: #117DC2;
    margin-right: 6px;
}

/* Customer pricing */
.volume-tiers {
    list-style: none;
    color: #047857;
    font-size: 13px;
}

.volume-tiers li {
    padding: 1px 0;
}

.sale-price-discounts {
    list-style: none;
    margin: -4px 0 8px;
    color: #B45309;
    font-size: 13px;
}

.sale-price-discounts li {
    padding: 1px 0;
}

.sale-price-discount-amount {
    color: #9CA3AF;
    margin-left: 4px;
}

.price-was {
    margin-left: 6px;
    color: #9CA3AF;
    font-size: 13px;
    font-weight: normal;
    text-decoration: line-through;
}

.cart-discount {
    color: #047857;
}

.discount-help {
    padding: 4px 6px;
    background: transparent;
    border: none;
    color: #117DC2;
    font-size: 16px;
    cursor: pointer;
}

.discount-breakdown {
    margin: 2px 0 8px;
    padding: 8px 10px;
    background: white;
    border: 1px solid #A7F3D0;
    border-radius: 6px;
    font-size: 13px;
}

.discount-breakdown-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
    color: #374151;
}

.discount-breakdown-row + .discount-breakdown-row {
    border-top: 1px solid #F3F4F6;
}

.discount-breakdown-row small {
    display: block;
    color: #6B7280;
}

.discount-breakdown-row span:last-child {
    white-space: nowrap;
}

.cart-pricing-note {
    margin-top: 8px;
    color: #6B7280;
    font-size: 12px;
    text-align: right;
}

/* Anchored to the top so the on-screen keyboard never covers the options */
.filter-popover-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 72px 12px 12px;
    background: rgba(17, 24, 39, 0.5);
    z-index: 1100;
}

.filter-popover {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 420px;
    max-height: min(70vh, 520px);
    background: white;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.filter-popover-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 8px 8px 20px;
    color: #111827;
    font-size: 18px;
}

.filter-popover-header h3 {
    flex: 1;
    font-size: 17px;
    font-weight: 700;
}

.filter-popover-search {
    width: auto;
    margin: 0 16px 8px;
}

.filter-popover-list {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 12px 12px;
}

.filter-popover-empty {
    padding: 20px;
    text-align: center;
    color: #6B7280;
    font-size: 14px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 10px;
    background: transparent;
    border: none;
    border-bottom: 1px solid #F3F4F6;
    border-radius: 8px;
    color: #111827;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.filter-option > .fas {
    color: #9CA3AF;
    font-size: 12px;
}

.filter-option-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #EAF4FB;
    border-radius: 8px;
    color: #117DC2;
    font-size: 14px;
    font-weight: 700;
}

.filter-option-name {
    flex: 1;
    min-width: 0;
}

.filter-option.selected {
    background: #EAF4FB;
    color: #117DC2;
    font-weight: 600;
}

.filter-option.selected > .fas {
    color: #117DC2;
    font-size: 14px;
}

/* Product Cards */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.product-card {
    position: relative;
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid #E5E7EB;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: auto;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(17, 125, 194, 0.12);
    border-color: #CDE5F5;
}

.product-card.is-clearance {
    border-color: #FCD34D;
}

.clearance-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
    background: #D97706;
    color: white;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.3);
}

.client-card {
    background: white;
    border-radius: 10px;
    border: 1px solid #E5E7EB;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
}

.client-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.client-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #E5E7EB;
}

.client-info-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.client-visit-day {
    display: inline-block;
    background: #eff6ff;
    color: #1d4ed8;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.client-card h3 {
    margin: 0;
    font-size: 18px;
    color: #111827;
}

.client-card p {
    margin: 5px 0;
    color: #4B5563;
    font-size: 14px;
}

.clients-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.btn-small {
    width: auto;
    padding: 10px 16px;
    font-size: 14px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #374151;
}

.form-group select {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid #E5E7EB;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #F9FAFB;
}

.form-group select:focus {
    outline: none;
    border-color: #117DC2;
    box-shadow: 0 0 0 3px rgba(17, 125, 194, 0.08);
    background: white;
}

.product-info h3 {
    color: #111827;
    margin-bottom: 4px;
    margin-top: 8px;
    font-size: 16px;
    font-weight: 700;
}

.product-info {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-price {
    font-size: 26px;
    font-weight: 700;
    color: #117DC2;
    margin-bottom: 15px;
    margin-top: 8px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.quantity-btn {
    background: #117DC2;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(17, 125, 194, 0.2);
}

.quantity-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 10px rgba(17, 125, 194, 0.3);
    background: #0E6AA6;
}

.quantity-input {
    width: 60px;
    text-align: center;
    border: 2px solid #E5E7EB;
    border-radius: 4px;
    padding: 6px;
    font-weight: 600;
    color: #374151;
}

.add-to-cart-btn {
    background: #10B981;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    margin-top: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
    min-width: 150px;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    background: #059669;
}

/* New Product Styles */
.product-image {
    text-align: center;
    margin-bottom: 8px;
}

.product-card .product-image {
    text-align: left;
    margin-bottom: 0;
}

/* Overrides the 15px gap that .product-info gets from the order-line styles */
.product-card .product-info {
    gap: 4px;
}

.product-card .product-info h3 {
    margin: 4px 0 2px;
}

.product-card .price-selection {
    margin: 6px 0;
    padding: 10px 12px;
}

.product-card .price-option {
    margin-bottom: 6px;
}

.product-card .selected-price,
.product-card .quantity-controls {
    margin-bottom: 8px;
}

.product-card .selected-price {
    padding: 9px 12px;
}

.product-meta-link {
    display: flex;
    align-items: center;
    gap: 10px;
    align-self: flex-start;
    max-width: 100%;
    padding: 3px 0;
    background: transparent;
    border: none;
    color: #4B5563;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.product-meta-link i:first-child {
    width: 18px;
    color: #117DC2;
    text-align: center;
}

.product-meta-link .fa-chevron-right {
    color: #9CA3AF;
    font-size: 11px;
}

.product-card .product-sku,
.product-card .product-stock {
    margin-top: 2px;
    font-size: 14px;
    text-align: left;
}

.stock-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-left: 4px;
    background: currentColor;
    border-radius: 50%;
}

.product-image img {
    max-width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
}

.product-sku, .product-brand, .product-category, .product-stock {
    font-size: 13px;
    color: #666;
    margin-bottom: 1px;
    margin-top: 1px;
    line-height: 1.2;
    padding: 0;
    text-align: right;
}

.product-sku {
    font-size: 16px;
    font-weight: normal;
}

/* Stock color coding */
.product-stock.stock-zero {
    color: #DC2626 !important;
    font-weight: bold;
}

.product-stock.stock-low {
    color: #D97706 !important;
    font-weight: bold;
}

.product-stock.stock-good {
    color: #10B981 !important;
    font-weight: bold;
}

.price-selection {
    margin: 15px 0;
    padding: 15px;
    background: #F9FAFB;
    border-radius: 4px;
    border: 1px solid #E5E7EB;
}

.price-option {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.price-option:last-child {
    margin-bottom: 0;
}

.price-option input[type="radio"] {
    margin-right: 10px;
}

.price-option label {
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.clearance-price {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #B45309;
    text-align: center;
    padding: 8px 10px;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 6px;
}

.selected-price {
    font-weight: 700;
    color: #117DC2;
    font-size: 16px;
    margin-bottom: 15px;
    text-align: center;
    padding: 12px 15px;
    background: #EAF4FB;
    border-radius: 6px;
    border: 1px solid #C2DEF2;
}

.loading-message, .empty-message {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 18px;
}

.loading-message i {
    margin-right: 10px;
}

/* Cart */
.cart-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid #E5E7EB;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.cart-summary {
    margin-top: 20px;
    padding: 20px;
    background: #EEF6FC;
    border-radius: 6px;
    border: 1px solid #CDE5F5;
}

.cart-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 16px;
    color: #666;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0 0;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    border-top: 2px solid #117DC2;
    margin-top: 10px;
}

.checkout-btn {
    background: #117DC2;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    flex: 1 1 100%;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(17, 125, 194, 0.25);
}

.checkout-btn:disabled {
    background: #CDE5F5;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
}

.checkout-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(17, 125, 194, 0.35);
    background: #0E6AA6;
}

/* Order Type Selection */
.order-type-selection {
    margin: 20px 0;
    padding: 16px;
    background: #EEF6FC;
    border-radius: 6px;
    border: 1px solid #CDE5F5;
}

.order-type-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 14px;
}

.order-type-select {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid #E5E7EB;
    border-radius: 6px;
    font-size: 15px;
    background: white;
    color: #374151;
    transition: all 0.3s ease;
    font-weight: 500;
}

.order-type-select:focus {
    outline: none;
    border-color: #117DC2;
    box-shadow: 0 0 0 3px rgba(17, 125, 194, 0.1);
}

/* Customer Selection */
.customer-selection {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.customer-label {
    display: block;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.customer-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background: white;
    color: #333;
}

.customer-select:focus {
    outline: none;
    border-color: #117DC2;
    box-shadow: 0 0 0 3px rgba(17, 125, 194, 0.08);
}

/* Custom Customer Search Styling */
.customer-search-container {
    position: relative;
}

.customer-search-input {
    width: 100%;
    padding: 10px 40px 10px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background: white;
    color: #333;
}

.customer-search-input:focus {
    outline: none;
    border-color: #117DC2;
    box-shadow: 0 0 0 3px rgba(17, 125, 194, 0.08);
}

.search-loading {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #117DC2;
}

.customer-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

.dropdown-option {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dropdown-option:hover {
    background: #F3F4F6;
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-no-results {
    padding: 10px;
    color: #666;
    font-style: italic;
    text-align: center;
}

.customer-company {
    color: #666;
    font-size: 0.9em;
}

.customer-email {
    color: #888;
    font-size: 0.8em;
}

.selected-customer {
    margin-top: 10px;
    padding: 10px;
    background: #D1FAE5;
    border: 1px solid #A7F3D0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.selected-customer i {
    color: #10B981;
}

.clear-customer-btn {
    background: none;
    border: none;
    color: #DC2626;
    cursor: pointer;
    padding: 2px;
    margin-left: auto;
}

.clear-customer-btn:hover {
    color: #991B1B;
}

.loading-text {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

/* Required field styling */
.required-asterisk {
    color: #DC2626;
    font-weight: bold;
    margin-left: 3px;
}

.field-error {
    border-color: #DC2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

.error-message-field {
    color: #DC2626;
    font-size: 14px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.info-message-field {
    color: #117DC2;
    font-size: 14px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.cart-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.clear-cart-btn {
    background: #EF4444;
    color: white;
    border: none;
    padding: 9px 14px;
    border-radius: 6px;
    cursor: pointer;
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.clear-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    background: #DC2626;
}

.checkout-btn:hover {
    background: #0E6AA6;
}

/* Products */
.products-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid #E5E7EB;
}

/* Orders */
.orders-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid #E5E7EB;
}

.order-card {
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.order-status {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
}

.order-status {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 5px;
    display: inline-block;
}

.order-sub-status {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
}

.status-pending { background: #FEF3C7; color: #D97706; }
.status-completed { background: #D1FAE5; color: #10B981; }
.status-cancelled { background: #FEE2E2; color: #DC2626; }
.status-success { background: #D1FAE5; color: #10B981; }
.status-warning { background: #FEF3C7; color: #D97706; }
.status-danger { background: #FEE2E2; color: #DC2626; }
.status-info { background: #DBEAFE; color: #2563EB; }
.status-secondary { background: #F3F4F6; color: #6B7280; }

.collection-badges {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.collection-reason {
    color: #6B7280;
}

.collection-late {
    color: #DC2626;
}

.print-btn {
    background: #0984E3;
    color: white;
    border: none;
    padding: 7px 13px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    flex: 0 0 auto;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(9, 132, 227, 0.2);
}

.print-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(9, 132, 227, 0.3);
    background: #0073BD;
}

.order-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

.details-btn {
    background: #117DC2;
    color: white;
    border: none;
    padding: 7px 13px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    flex: 0 0 auto;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(17, 125, 194, 0.2);
}

.details-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(17, 125, 194, 0.3);
    background: #0E6AA6;
}

.print-btn:hover {
    box-shadow: 0 4px 12px rgba(9, 132, 227, 0.3);
}

/* Order Details Modal */
.order-details-modal {
    max-width: 800px;
    max-height: 90vh;
}

.order-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.order-status-badges {
    display: flex;
    gap: 8px;
    flex-direction: column;
}

.order-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-item strong {
    color: #666;
    font-size: 14px;
}

.contact-details-modal .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.contact-details-modal .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.contact-details-modal .form-group label {
    font-weight: 600;
    color: #374151;
}

.contact-details-modal .form-group input,
.contact-details-modal .form-group select {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid #E5E7EB;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #F9FAFB;
}

.contact-details-modal .form-group input:focus,
.contact-details-modal .form-group select:focus {
    outline: none;
    border-color: #117DC2;
    box-shadow: 0 0 0 3px rgba(17, 125, 194, 0.08);
    background: white;
}

.contact-details-modal .contact-address-card {
    padding: 12px;
    background: #F8FAFC;
    border-radius: 8px;
    margin-top: 8px;
}

.modal-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: #334155;
    font-weight: 600;
}

.modal-checkbox input {
    width: auto;
    margin-right: 8px;
}

.contact-details-modal .info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.paid {
    color: #00b894;
    font-weight: bold;
}

.unpaid {
    color: #e17055;
    font-weight: bold;
}

.order-lines {
    margin-bottom: 25px;
}

.order-lines h5 {
    margin-bottom: 15px;
    color: #333;
}

.order-line-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 10px;
}

.product-info {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
}

.product-image-small {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.product-details {
    min-width: 0;
    flex: 1;
}

.product-details h6 {
    margin: 0 0 5px 0;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    max-height: 3rem;
}

.product-sku, .product-price, .product-discount {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.product-sku, .product-price, .product-discount {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.product-discount {
    color: #00b894;
}

.line-total {
    text-align: right;
}

.packing-status {
    font-size: 12px;
    color: #fdcb6e;
    margin: 5px 0 0 0;
}

.order-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.total-line {
    font-size: 18px;
    border-top: 2px solid #0E6AA6;
    padding-top: 10px;
    margin-top: 10px;
}

.due-line {
    color: #e17055;
    font-size: 16px;
}

.payments-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.payments-section h5 {
    margin-bottom: 15px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.payments-section h5:before {
    content: "\f3d1";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: #00b894;
}

.payment-item-simple {
    background: #00b894;
    color: white;
    border-radius: 6px;
    margin-bottom: 12px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 184, 148, 0.15);
    transition: transform 0.2s, background 0.2s;
}

.payment-item-simple:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 184, 148, 0.3);
}

.payment-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    opacity: 0.9;
}

.payment-date i {
    font-size: 16px;
}

.payment-amount-simple {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
}

.payment-amount-simple i {
    font-size: 20px;
}

/* Payment due date styling */
.payment-good {
    color: #27ae60 !important;
    font-weight: bold;
}

.payment-warning {
    color: #f39c12 !important;
    font-weight: bold;
}

.payment-overdue {
    color: #DC2626 !important;
    font-weight: bold;
}

/* Commissions */
.commissions-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid #E5E7EB;
}

.commission-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.commission-card {
    background: #117DC2;
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(17, 125, 194, 0.2);
    transition: all 0.3s ease;
}

.commission-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(17, 125, 194, 0.3);
}

.commission-amount {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.commission-status {
    margin-top: 5px;
}

.commission-status .status-badge {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: bold;
}

.commission-status .status-badge.pending {
    background-color: #ffa726;
    color: white;
}

.commission-status .status-badge.completed {
    background-color: #66bb6a;
    color: white;
}

.commission-status .status-badge.cancelled {
    background-color: #ef5350;
    color: white;
}

/* Search */
.search-container {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e8e8e8;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #2A93D5;
    box-shadow: 0 0 0 3px rgba(17, 125, 194, 0.1);
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    gap: 10px;
}

.pagination-info {
    color: #666;
    font-size: 14px;
    margin-right: 20px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination-btn {
    background: white;
    border: 1px solid #e8e8e8;
    color: #666;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    min-width: 40px;
    text-align: center;
    transition: all 0.3s;
    text-decoration: none;
    font-weight: 500;
}

.pagination-btn:hover:not(.disabled):not(.active) {
    background: #EEF6FC;
    border-color: #2A93D5;
    color: #2A93D5;
}

.pagination-btn.active {
    background: #117DC2;
    border-color: transparent;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(17, 125, 194, 0.2);
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #F3F4F6;
}

.pagination-ellipsis {
    color: #666;
    padding: 8px 4px;
    font-size: 14px;
}

/* Mapa */
.mapa-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid #E5E7EB;
}
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.map-section {
    margin-top: 20px;
}

.map-container-inner {
    margin-bottom: 30px;
}

.map-legend {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.map-legend h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

.legend-items {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #333;
}

.legend-icon.grey {
    background-color: #9e9e9e;
}

.legend-icon.red {
    background-color: #f44336;
}

.legend-icon.blue {
    background-color: #2196f3;
}

.map-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stat-card {
    background: #117DC2;
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(17, 125, 194, 0.15);
    transition: all 0.3s ease;
}

.statistics-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 14px;
}

.statistics-container h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.statistics-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin-top: 30px;
    padding-bottom: 8px;
    border-bottom: 1px solid #E5E7EB;
}

.statistics-section-title i {
    color: #117DC2;
    font-size: 13px;
}

.statistics-card {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 18px;
    padding: 20px 18px;
    box-shadow: 0 6px 18px rgba(17, 24, 39, 0.06);
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.statistics-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 26px rgba(17, 125, 194, 0.16);
}

.statistics-card--critical {
    border-color: rgba(220, 38, 38, 0.25);
}

.statistics-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.statistics-icon-badge {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: rgba(17, 125, 194, 0.12);
    color: #117DC2;
}

.statistics-icon-badge--good {
    background: rgba(0, 184, 148, 0.14);
    color: #00966e;
}

.statistics-icon-badge--critical {
    background: rgba(220, 38, 38, 0.12);
    color: #DC2626;
}

.statistics-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #64748B;
}

.statistics-label small {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
    color: #94A3B8;
}

.statistics-number {
    font-size: clamp(26px, 5vw, 48px);
    line-height: 1.05;
    font-weight: 800;
    color: #111827;
    margin-bottom: 10px;
    overflow-wrap: break-word;
}

.statistics-number--compact {
    font-size: clamp(22px, 4vw, 36px);
}

.statistics-number--large-centered {
    font-size: clamp(32px, 6vw, 60px);
    text-align: center;
    width: 100%;
}

.statistics-number--critical {
    color: #DC2626;
}

.statistics-subtext {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #475569;
    font-size: 13px;
    margin-bottom: 10px;
}

.statistics-subtext i {
    width: 14px;
    text-align: center;
    color: #94A3B8;
    font-size: 11px;
}

.statistics-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px dashed #E5E7EB;
    font-size: 13px;
    color: #64748B;
}

.statistics-meta-row strong {
    color: #111827;
    font-weight: 700;
}

.statistics-subtext--goal {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #E5E7EB;
}

.statistics-progress-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.statistics-progress {
    width: 100%;
    height: 8px;
    background: #EEF0F6;
    border-radius: 999px;
    overflow: hidden;
}

.statistics-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #117DC2, #0E6AA6);
    border-radius: 999px;
    transition: width 0.45s ease;
}

.statistics-progress-fill--achieved {
    background: linear-gradient(90deg, #00b894, #00966e);
}

.statistics-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #64748B;
    font-size: 12px;
    font-weight: 600;
}

.statistics-progress-percent {
    padding: 2px 9px;
    border-radius: 999px;
    background: rgba(17, 125, 194, 0.12);
    color: #117DC2;
    font-weight: 700;
}

.statistics-progress-percent--achieved {
    background: rgba(0, 184, 148, 0.14);
    color: #00966e;
}

.statistics-detail-link {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #117DC2;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 0;
}

.statistics-detail-link:hover {
    text-decoration: underline;
}

.statistics-detail-link i {
    font-size: 11px;
}

.pending-balance-modal {
    max-width: 520px;
    width: 100%;
}

.pending-balance-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pending-balance-customer {
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
}

.pending-balance-customer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    cursor: pointer;
    background: white;
}

.pending-balance-customer-row:hover {
    background: #F9FAFB;
}

.pending-balance-customer-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.pending-balance-customer-info i {
    color: #94A3B8;
    font-size: 12px;
    flex-shrink: 0;
}

.pending-balance-customer-name {
    font-weight: 700;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pending-balance-customer-count {
    color: #94A3B8;
    font-size: 12px;
    flex-shrink: 0;
}

.pending-balance-customer-total {
    color: #111827;
    flex-shrink: 0;
}

.pending-balance-customer-total--overdue {
    color: #DC2626;
}

.pending-balance-orders {
    display: flex;
    flex-direction: column;
    border-top: 1px solid #E5E7EB;
    background: #F9FAFB;
}

.pending-balance-order-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 10px 34px;
    background: none;
    border: none;
    border-bottom: 1px solid #E5E7EB;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    text-align: left;
    width: 100%;
}

.pending-balance-order-row:last-child {
    border-bottom: none;
}

.pending-balance-order-row:hover {
    background: #F1F2F6;
    color: #111827;
}

.pending-balance-order-amount--overdue {
    color: #DC2626;
    font-weight: 700;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(17, 125, 194, 0.25);
}

.stat-number {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

/* Responsive */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 5px 10px;
        padding-bottom: 24px;
    }

    .legend-items {
        flex-direction: column;
        gap: 10px;
    }

    .map-stats {
        grid-template-columns: 1fr;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
}

.modal-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 8px 8px 0 0;
    position: relative;
}

.modal-header.modal-success {
    background: #00b894;
    color: white;
}

.modal-header.modal-error {
    background: #DC2626;
    color: white;
}

.modal-header.modal-warning {
    background: #D97706;
    color: white;
}

.modal-header.modal-info {
    background: #117DC2;
    color: white;
}

.modal-header i {
    font-size: 24px;
}

.modal-header h3 {
    margin: 0;
    flex: 1;
}

.modal-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
    color: #333;
}

.modal-body p {
    margin: 0;
    line-height: 1.6;
}

.modal-body .form-group {
    margin-bottom: 18px;
}

.modal-body textarea {
    width: 100%;
    min-height: 140px;
    padding: 14px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    font-size: 15px;
    background: #F9FAFB;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    resize: vertical;
}

.modal-body textarea:focus {
    outline: none;
    border-color: #117DC2;
    box-shadow: 0 0 0 3px rgba(17, 125, 194, 0.08);
    background: white;
}

.modal-body input[type="file"] {
    margin-top: 8px;
}

.modal-footer {
    padding: 20px;
    text-align: right;
    border-top: 1px solid #E5E7EB;
}

.modal-btn {
    background: #117DC2;
    color: white;
    border: none;
    padding: 11px 22px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-left: 10px;
    box-shadow: 0 2px 8px rgba(17, 125, 194, 0.2);
}

.modal-btn:hover {
    background: #0E6AA6;
    box-shadow: 0 4px 12px rgba(17, 125, 194, 0.3);
}
    box-shadow: 0 4px 12px rgba(17, 125, 194, 0.2);
}

.modal-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(17, 125, 194, 0.3);
}

.modal-btn-secondary {
    background: #ffeaa7;
    color: #2d3436;
}

.modal-btn-secondary:hover {
    background: #fdcb6e;
}

.modal-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.modal-btn:disabled:hover {
    transform: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-footer .modal-btn + .modal-btn {
    margin-left: 8px;
}

/* Aviso de visitas pendientes de sincronizar */
.pending-visits-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 14px;
    margin-bottom: 12px;
    border-radius: 8px;
    background: #fff4e5;
    color: #8a5300;
    border: 1px solid #f5c37a;
}

.pending-visits-banner span {
    flex: 1;
}

/* Inicio: tiles con las secciones del menú */
/* Logo de la marca junto al nombre */
.brand-logo {
    height: 1.2em;
    width: auto;
    vertical-align: -0.2em;
    margin-right: 4px;
}

.logo-btn {
    background: transparent;
    border: none;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.home {
    padding-top: 6px;
}

.home-greeting {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 16px;
}

.home-greeting-hello {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
}

.home-greeting-sub {
    font-size: 15px;
    color: #6B7280;
}

.home-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (min-width: 640px) {
    .home-tiles {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (min-width: 1024px) {
    .home-tiles {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.home-tile {
    --tile-from: #117DC2;
    --tile-to: #2A93D5;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    aspect-ratio: 1 / 0.92;
    padding: 16px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(145deg, var(--tile-from), var(--tile-to));
    color: white;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 6px 16px -6px var(--tile-from);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

/* Brillo suave tipo aurora en la esquina */
.home-tile::after {
    content: "";
    position: absolute;
    top: -40%;
    right: -30%;
    width: 80%;
    height: 80%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 70%);
    pointer-events: none;
}

.home-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px -8px var(--tile-from);
}

.home-tile:active {
    transform: scale(0.97);
}

.home-tile:focus-visible {
    outline: 3px solid #111827;
    outline-offset: 2px;
}

.home-tile--0 { --tile-from: #0E6AA6; --tile-to: #2A93D5; }
.home-tile--1 { --tile-from: #047E5C; --tile-to: #0B9469; }
.home-tile--2 { --tile-from: #0B7A93; --tile-to: #0B8CA6; }
.home-tile--3 { --tile-from: #1F2937; --tile-to: #334155; }
.home-tile--4 { --tile-from: #0B5A8E; --tile-to: #117DC2; }
.home-tile--5 { --tile-from: #0F766E; --tile-to: #118F84; }

.home-tile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 22px;
}

/* Ilustración a la derecha, siempre arriba de la etiqueta para no taparla */
.home-tile-art {
    position: absolute;
    right: 5%;
    bottom: 40px;
    height: 55%;
    max-width: 70%;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.home-tile:hover .home-tile-art {
    transform: translateY(-3px) scale(1.03);
}

.home-tile-icon,
.home-tile-label {
    position: relative;
}

.home-tile-label {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}

.home-tile-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    min-width: 24px;
    padding: 2px 8px;
    border-radius: 12px;
    background: white;
    color: #111827;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

/* ===== Rutas: ruta de hoy ===== */
.route-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.route-title h2 {
    margin: 0;
}

.route-date {
    margin: 2px 0 16px;
    color: #6B7280;
    font-size: 14px;
    text-transform: capitalize;
}

.route-updated {
    text-transform: none;
}

/* "Actualizado hace X" de los datos guardados en el teléfono (js/dataCache.js) */
.section-updated {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin: -6px 0 14px;
    color: #6B7280;
    font-size: 13px;
}

.section-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    border: none;
    background: none;
    color: #117DC2;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.section-refresh-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.route-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.route-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 8px;
    border-radius: 12px;
    background: #EAF4FB;
    text-align: center;
}

.route-summary-item strong {
    font-size: 22px;
    line-height: 1.1;
    color: #0B5A8E;
}

.route-summary-item span {
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.route-progress {
    height: 8px;
    margin-bottom: 18px;
    border-radius: 4px;
    background: #E5E7EB;
    overflow: hidden;
}

.route-progress-bar {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #117DC2, #10B981);
    transition: width 0.3s ease;
}

.order-card.route-stop {
    position: relative;
    padding: 16px 16px 16px 20px;
    border: 1px solid #E5E7EB;
    border-radius: 14px;
    background: white;
    box-shadow: 0 2px 8px -4px rgba(17, 24, 39, 0.12);
}

/* Franja de color a la izquierda: azul pendiente, verde visitado */
.route-stop::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: #117DC2;
}

.route-stop--visited::before {
    background: #10B981;
}

.route-stop--visited {
    opacity: 0.75;
}

.route-stop .order-header {
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.route-stop h4 {
    margin: 0;
    font-size: 16px;
    color: #111827;
}

.route-company {
    display: block;
    margin-top: 2px;
    color: #6B7280;
    font-size: 13px;
}

.route-stop .order-status {
    margin-bottom: 0;
    white-space: nowrap;
}

.route-purposes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.route-address {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
    margin: 0 0 6px;
    color: #374151;
    font-size: 14px;
}

.route-address i {
    color: #117DC2;
}

.route-address small {
    flex-basis: 100%;
    padding-left: 20px;
    color: #6B7280;
}

.route-muted {
    margin: 0 0 6px;
    color: #9CA3AF;
    font-size: 13px;
}

.route-detail {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #F9FAFB;
    font-size: 13px;
    color: #374151;
}

.route-detail p {
    margin: 0;
}

.route-detail i {
    color: #6B7280;
    margin-right: 4px;
}

.route-delivery {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
}

.route-delivery small {
    flex-basis: 100%;
    color: #6B7280;
}

.route-link {
    padding: 0;
    border: none;
    background: none;
    color: #117DC2;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.route-due {
    color: #D97706;
    font-weight: 600;
}

.route-overdue {
    margin: 8px 0;
    padding: 8px 12px;
    border-radius: 10px;
    background: #FEE2E2;
    color: #DC2626;
    font-size: 13px;
    font-weight: 600;
}

.route-stop .order-actions {
    flex-wrap: wrap;
    margin-top: 14px;
}

.route-stop .order-actions > a,
.route-stop .order-actions > button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 10px;
    font-size: 13px;
    text-decoration: none;
}

/* Llamar en verde para distinguirlo de las otras acciones */
.route-stop .order-actions > .print-btn {
    background: #047E5C;
}

.route-stop .order-actions > .print-btn:hover {
    background: #036B4E;
    box-shadow: 0 4px 12px rgba(4, 126, 92, 0.3);
}

/* Cómo llegar como acción secundaria, Registrar visita como la principal */
.route-stop .order-actions > a.details-btn {
    background: white;
    color: #117DC2;
    box-shadow: inset 0 0 0 1.5px #117DC2;
}

.route-stop .order-actions > a.details-btn:hover {
    background: #EAF4FB;
}

@media (max-width: 480px) {
    .route-stop .order-actions > a,
    .route-stop .order-actions > button {
        flex: 1 1 auto;
        justify-content: center;
    }
}

/* ===== Checar visita: siguiente actividad ===== */
.next-activity {
    margin-top: 6px;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.next-activity--open {
    border-color: #C2DEF2;
    background: #F6FAFD;
}

.next-activity-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    font-weight: 600;
    color: #111827;
    cursor: pointer;
}

.next-activity-toggle input {
    width: 18px;
    height: 18px;
    accent-color: #117DC2;
}

.next-activity-toggle i {
    color: #117DC2;
    margin-right: 4px;
}

.next-activity-fields {
    padding: 0 14px 12px;
}

.next-activity-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.next-activity-fields .form-group {
    margin-bottom: 10px;
}

.next-activity-fields select,
.next-activity-fields input[type="datetime-local"],
.next-activity-fields textarea {
    width: 100%;
    min-width: 0;
}

.next-activity-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: -2px 0 10px;
}

.next-activity-shortcuts button {
    padding: 5px 12px;
    border: 1px solid #C2DEF2;
    border-radius: 999px;
    background: white;
    color: #0E6AA6;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.next-activity-shortcuts button:hover {
    background: #EAF4FB;
}

@media (max-width: 420px) {
    .next-activity-row {
        grid-template-columns: 1fr;
    }
}
