/* ==========================================================================
   WHITE-LABEL THEME VARIABLES & DARK MODE CONFIGURATION
   ========================================================================== */
:root {
    /* Client Brand Colors (Dynamically overridable per tenant) */
    --brand-primary: #F15F4D;
    --brand-primary-rgb: 241, 95, 77;
    --brand-on-primary: #FFFFFF;

    /* Truck Load Ring Status Colors (Light Mode) */
    --load-low: #22C55E;      /* < 50% Soft Emerald */
    --load-medium: #06B6D4;   /* 50% - 80% Calm Cyan */
    --load-high: #EF4444;     /* > 80% Alert Coral Red */

    /* Light Mode Surface & Text Tokens */
    --bg-app: #F4F5F8;
    --bg-card: #FFFFFF;
    --bg-action-circle: #F8F9FB;
    --border-subtle: #E5E7EB;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;

    /* Semantic Colors */
    --color-positive: #16A34A;
    --color-negative: #DC2626;
    --shadow-card: 0 8px 24px rgba(17, 24, 39, 0.06);
    --shadow-nav: 0 -4px 16px rgba(17, 24, 39, 0.05);
}

/* Dark Mode Overrides */
[data-theme="dark"] {
    --bg-app: #0F1219;
    --bg-card: #181D27;
    --bg-action-circle: #222938;
    --border-subtle: #2A3241;
    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;

    /* Slightly brighter tones for dark backgrounds */
    --load-low: #34D399;
    --load-medium: #22D3EE;
    --load-high: #F87171;

    --color-positive: #34D399;
    --color-negative: #F87171;
    --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-nav: 0 -4px 16px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   BASE RESET & LAYOUT
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #E5E7EB;
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

[data-theme="dark"] body {
    background-color: #090B10;
}

/* Lock background scrolling when a Bottom Sheet or Modal is open */
body.modal-open {
    overflow: hidden;
    touch-action: none;
}

/* Isolate touch scrolling inside the sheet body */
.sheet-body {
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}



h1, h2, .cargo-total-value, .ring-percentage, .brand-name-placeholder {
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Mobile-First Responsive Container */
.app-container {
    width: 100%;
    max-width: 480px;
    background-color: var(--bg-app);
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    padding-bottom: 84px;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* ==========================================================================
   HEADER SECTION
   ========================================================================== */
.app-header {
    background-color: var(--brand-primary);
    color: var(--brand-on-primary);
    padding: 20px 20px 56px 20px;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    transition: background-color 0.3s ease;
}

.header-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.brand-logo-wrapper {
    background-color: transparent;
    padding: 4px 12px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.brand-logo-img {
    height: 28px;
    width: auto;
    max-width: 110px;
    object-fit: contain;
    display: block;
}

.brand-name-placeholder {
    color: var(--brand-primary);
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn, .theme-toggle-btn {
    background: rgba(255, 255, 255, 0.16);
    border: none;
    color: var(--brand-on-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: background 0.2s ease;
}

.icon-btn:hover, .theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}

.icon-btn svg, .theme-toggle-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

/* Toggle Icons Visibility */
[data-theme="light"] .icon-moon { display: block; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: block; }

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: #111827;
    color: #FFFFFF;
    font-size: 0.65rem;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.driver-greeting {
    display: flex;
    align-items: center;
    gap: 12px;
}

.driver-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.driver-avatar svg {
    width: 20px;
    height: 20px;
}

.greeting-text h1 {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
}

.greeting-text p {
    font-size: 0.8rem;
    opacity: 0.88;
    margin-top: 2px;
}

/* ==========================================================================
   MAIN CONTENT & SUMMARY CARD
   ========================================================================== */
.app-content {
    padding: 0 18px;
    margin-top: -38px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.summary-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-card);
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.summary-info {
    display: flex;
    flex-direction: column;
}

.summary-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.sales-today {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.sales-today strong {
    color: var(--color-positive);
    font-weight: 600;
}

.cargo-total-value {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 8px;
    letter-spacing: -0.5px;
}

.cargo-subtext {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Progress Ring Component */
.load-ring-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ring-wrapper {
    position: relative;
    width: 96px;
    height: 96px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: var(--border-subtle);
    stroke-width: 8;
}

.progress-ring-fill {
    fill: none;
    stroke: var(--load-medium);
    stroke-width: 8;
    stroke-linecap: round;
    /* Circumference = 2 * PI * 40 = 251.2 */
    stroke-dasharray: 251.2;
    stroke-dashoffset: 62.8;
    transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease, filter 0.3s ease;
}

/* Dynamic Ring States */
.progress-ring-fill.status-low {
    stroke: var(--load-low);
    filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.35));
}

.progress-ring-fill.status-medium {
    stroke: var(--load-medium);
    filter: drop-shadow(0 0 4px rgba(6, 182, 212, 0.35));
}

.progress-ring-fill.status-high {
    stroke: var(--load-high);
    filter: drop-shadow(0 0 5px rgba(239, 68, 68, 0.45));
}

.ring-center-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ring-percentage {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
}

.ring-units {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ==========================================================================
   QUICK ACTIONS SECTION
   ========================================================================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-header h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.link-action-btn {
    background: none;
    border: none;
    color: var(--brand-primary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.quick-action-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.action-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary);
    transition: transform 0.15s ease, background-color 0.2s ease;
}

.quick-action-item:active .action-circle {
    transform: scale(0.93);
}

.action-circle svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.75;
}

.quick-action-item span {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
}

/* ==========================================================================
   RECENT MOVEMENTS LIST
   ========================================================================== */
.movements-list {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 4px 14px;
}

.movement-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.movement-item:last-child {
    border-bottom: none;
}

.movement-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
background-color: var(--bg-action-circle);
display: flex;
align-items: center;
justify-content: center;
margin-right: 12px;
flex-shrink: 0;
}
.movement-icon svg {
width: 16px;
height: 16px;
stroke-width: 2;
}
.movement-icon.income { color: var(--color-positive); }
.movement-icon.expense { color: var(--color-negative); }
.movement-icon.return { color: var(--brand-primary); }
.movement-details {
flex: 1;
display: flex;
flex-direction: column;
min-width: 0;
}
.movement-title {
font-size: 0.88rem;
font-weight: 600;
color: var(--text-primary);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.movement-date {
font-size: 0.74rem;
color: var(--text-secondary);
margin-top: 2px;
}
.movement-amount {
font-size: 0.88rem;
font-weight: 700;
margin-left: 8px;
}
.movement-amount.positive { color: var(--color-positive); }
.movement-amount.negative { color: var(--color-negative); }
.movement-amount.neutral { color: var(--brand-primary); }
/* ==========================================================================
FIXED BOTTOM NAVIGATION
========================================================================== */
.bottom-nav {
position: fixed;
bottom: 0;
width: 100%;
max-width: 480px;
height: 68px;
background-color: var(--bg-card);
border-top: 1px solid var(--border-subtle);
box-shadow: var(--shadow-nav);
display: grid;
grid-template-columns: repeat(5, 1fr);
align-items: center;
padding: 0 8px;
z-index: 100;
}
.nav-item {
background: none;
border: none;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 4px;
color: var(--text-secondary);
cursor: pointer;
height: 100%;
}
.nav-item svg {
width: 20px;
height: 20px;
stroke-width: 1.75;
}
.nav-item span {
font-size: 0.7rem;
font-weight: 500;
}
.nav-item.active {
color: var(--brand-primary);
}
.nav-center-wrapper {
display: flex;
justify-content: center;
align-items: center;
position: relative;
}
.nav-center-btn {
width: 54px;
height: 54px;
border-radius: 50%;
background-color: var(--brand-primary);
color: var(--brand-on-primary);
border: 4px solid var(--bg-app);
display: flex;
align-items: center;
justify-content: center;
margin-top: -24px;
box-shadow: 0 6px 16px rgba(var(--brand-primary-rgb), 0.4);
cursor: pointer;
transition: transform 0.15s ease, background-color 0.3s ease;
}
.nav-center-btn:active {
transform: scale(0.94);
}
.nav-center-btn svg {
width: 24px;
height: 24px;
stroke-width: 2;
}


/* ==========================================================================
   SUB-VIEW HEADER & SETTINGS SCREEN STYLES
   ========================================================================== */
.subview-header {
    background-color: var(--brand-primary);
    color: var(--brand-on-primary);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

.subview-header h1 {
    font-size: 1.1rem;
    font-weight: 700;
}

.back-btn {
    background: rgba(255, 255, 255, 0.16);
    border: none;
    color: var(--brand-on-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.back-btn svg {
    width: 18px;
    height: 18px;
}

.header-spacer {
    width: 36px;
}

.subview-content {
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Profile Card */
.settings-profile-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-card);
}

.profile-avatar-large {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: rgba(var(--brand-primary-rgb), 0.12);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-avatar-large svg {
    width: 24px;
    height: 24px;
}

.profile-meta {
    flex: 1;
    min-width: 0;
}

.profile-meta h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-role-badge {
    display: inline-block;
    font-size: 0.74rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.edit-profile-btn {
    background-color: var(--bg-action-circle);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.edit-profile-btn svg {
    width: 16px;
    height: 16px;
}

/* Settings Groups & Rows */
.settings-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-group-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding-left: 4px;
}

.settings-list {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    overflow: hidden;
}

.settings-row, .settings-row-btn {
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.settings-row:last-child, .settings-row-btn:last-child {
    border-bottom: none;
}

.settings-row-btn {
    cursor: pointer;
}

.row-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background-color: var(--bg-action-circle);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.row-icon svg {
    width: 18px;
    height: 18px;
}

.row-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.row-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.row-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.row-arrow {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.sync-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--brand-primary);
    background-color: rgba(var(--brand-primary-rgb), 0.12);
    padding: 4px 10px;
    border-radius: 20px;
}

/* Custom iOS/Fintech Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--border-subtle);
    border-radius: 24px;
    transition: 0.25s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #FFFFFF;
    border-radius: 50%;
    transition: 0.25s;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--brand-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Logout Button */
.logout-btn {
    width: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--color-negative);
    padding: 14px;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    margin-top: 4px;
}

.logout-btn svg {
    width: 18px;
    height: 18px;
}


/* ==========================================================================
   INITIAL SPLASH & DATA PRELOAD SCREEN
   ========================================================================== */
.app-splash-overlay {
    position: fixed;
    inset: 0;
    background-color: var(--brand-primary);
    color: var(--brand-on-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 24px;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.app-splash-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-center-box {
    width: 100%;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.splash-logo-card {
    background-color: #FFFFFF;
    padding: 16px 24px;
    border-radius: 22px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: splashPulse 1.8s infinite ease-in-out;
}

.splash-logo-img {
    height: 54px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    display: block;
}


.splash-brand-text {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--brand-primary);
    letter-spacing: -0.6px;
}

@keyframes splashPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

/* Smooth Progress Track */
.splash-loader-track {
    width: 100%;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 14px;
}

.splash-loader-bar {
    width: 0%;
    height: 100%;
    background-color: #FFFFFF;
    border-radius: 10px;
    transition: width 0.25s ease-out;
}

.splash-status-msg {
    font-family: 'Inter', sans-serif;
    font-size: 0.86rem;
    font-weight: 600;
    opacity: 0.95;
    min-height: 20px;
}

.splash-percent-tag {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.76rem;
    font-weight: 800;
    opacity: 0.78;
    margin-top: 4px;
}

.splash-footer-note {
    position: absolute;
    bottom: 24px;
    font-size: 0.72rem;
    opacity: 0.75;
    letter-spacing: 0.3px;
}



/* ==========================================================================
   SALES CATALOG SCREEN (LIST & 3-COLUMN GRID MODES)
   ========================================================================== */
.sales-header {
    background-color: var(--brand-primary);
    color: var(--brand-on-primary);
    padding: 14px 16px 14px 16px;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.sales-top-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sales-search-box {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    padding: 0 10px;
    height: 38px;
    gap: 8px;
}

.sales-search-box svg {
    width: 16px;
    height: 16px;
    opacity: 0.85;
    flex-shrink: 0;
}

.sales-search-box input {
    width: 100%;
    background: none;
    border: none;
    color: var(--brand-on-primary);
    font-size: 0.9rem;
    outline: none;
}

.sales-search-box input::placeholder {
    color: rgba(255, 255, 255, 0.75);
}

/* Horizontal Category Filter Pills */
.category-pills-wrapper {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-top: 12px;
    scrollbar-width: none;
}

.category-pills-wrapper::-webkit-scrollbar {
    display: none;
}

.category-pill {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--brand-on-primary);
    font-size: 0.74rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 10px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-pill.active {
    background-color: #FFFFFF;
    color: var(--brand-primary);
    border-color: #FFFFFF;
}

/* Sales Main Area (Extra bottom padding for Cart Bar + Bottom Nav) */
.sales-content {
    padding: 14px 16px 76px 16px;
}

/* Green Price Pill Badge (Matches Android UI) */
.price-badge {
    background-color: var(--color-positive);
    color: #FFFFFF;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-block;
}

/* --- MODE A: LIST VIEW --- */
.products-container.list-mode {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.products-container.list-mode .product-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: transform 0.12s ease;
}

.products-container.list-mode .product-card:active {
    transform: scale(0.98);
}

.products-container.list-mode .product-thumb {
    width: 68px;
    height: 68px;
    border-radius: 10px;
    background-color: var(--bg-action-circle);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.products-container.list-mode .product-thumb svg {
    width: 28px;
    height: 28px;
    stroke-width: 1.5;
    margin-bottom: 12px;
}

.products-container.list-mode .price-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    right: 4px;
    text-align: center;
}

.products-container.list-mode .product-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.products-container.list-mode .product-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--brand-primary);
}

.products-container.list-mode .product-brand {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
}

.products-container.list-mode .product-pack {
    font-size: 0.74rem;
    color: var(--text-secondary);
}

/* --- MODE B: 3-COLUMN GRID VIEW --- */
.products-container.grid-mode {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.products-container.grid-mode .product-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: transform 0.12s ease;
}

.products-container.grid-mode .product-card:active {
    transform: scale(0.96);
}

.products-container.grid-mode .product-title {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-primary);
    order: 1;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.products-container.grid-mode .product-thumb {
    width: 100%;
    height: 74px;
    background-color: var(--bg-action-circle);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    order: 2;
    color: var(--text-secondary);
}

.products-container.grid-mode .product-thumb svg {
    width: 28px;
    height: 28px;
    stroke-width: 1.5;
    margin-bottom: 14px;
}

.products-container.grid-mode .price-badge {
    position: absolute;
    bottom: 4px;
    font-size: 0.68rem;
    padding: 1px 6px;
}

.products-container.grid-mode .product-info {
    display: contents;
}

.products-container.grid-mode .product-brand {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-secondary);
    order: 3;
    margin-top: 6px;
}

.products-container.grid-mode .product-pack {
    display: none;
}


/*    */
/* ==========================================================================
   PRODUCT IMAGE SCALING (LIST & 3-COLUMN GRID MODES)
   ========================================================================== */


/* Shared Image Frame Styling */
.product-thumb {
    background-color: #FFFFFF; /* Keeps commercial product photos crisp even in Dark Mode */
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.product-thumb .product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
}


/* --- MODE A: LIST VIEW THUMBNAIL --- */
.products-container.list-mode .product-thumb {
    width: 76px;
    height: 76px;
    border-radius: 12px;
    padding: 6px 6px 22px 6px; /* Extra bottom space so price badge never covers the product */
    flex-shrink: 0;
}

.products-container.list-mode .price-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 0;
    font-size: 0.72rem;
    padding: 2px 4px;
    text-align: center;
}

/* --- MODE B: 3-COLUMN GRID THUMBNAIL --- */
.products-container.grid-mode .product-card {
    padding: 8px 6px;
}

.products-container.grid-mode .product-thumb {
    width: 100%;
    aspect-ratio: 1 / 1.05; /* Balanced vertical proportion for bottles & packs */
    height: auto;
    border-radius: 10px;
    padding: 6px 6px 20px 6px;
    order: 2;
}

.products-container.grid-mode .price-badge {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/*    */


/* Sticky Floating "VER EL CARRITO" Bar (Sits flush at bottom when bottom-nav is hidden) */
.floating-cart-bar {
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: 480px;
    padding: 12px 16px 16px 16px;
    background: linear-gradient(to top, var(--bg-app) 85%, transparent);
    z-index: 90;
}

.view-cart-btn {
    width: 100%;
    height: 54px;
    background-color: var(--brand-primary);
    color: var(--brand-on-primary);
    border: none;
    border-radius: 16px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 6px 18px rgba(var(--brand-primary-rgb), 0.35);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.view-cart-btn:active {
    transform: scale(0.98);
}

.cart-btn-spacer {
    width: 38px;
}

.cart-btn-label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* Larger Bag Icon + Clear Centered Counter */
.cart-bag-badge {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
}

.cart-bag-badge svg {
    width: 32px;
    height: 32px;
    stroke-width: 1.75;
}

.bag-counter {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    color: var(--brand-on-primary);
}

/* ==========================================================================
   BOTTOM SHEET MODAL (PRODUCT VARIANTS)
   ========================================================================== */
.bottom-sheet-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.55);
    z-index: 150;
}

.bottom-sheet-panel {
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: 480px;
    max-height: 78vh;
    background-color: var(--bg-app);
    border-top-left-radius: 22px;
    border-top-right-radius: 22px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 160;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
}

.sheet-header {
    background-color: var(--brand-primary);
    color: var(--brand-on-primary);
    padding: 8px 20px 16px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-shrink: 0;
}

.sheet-close-handle {
    background: none;
    border: none;
    color: var(--brand-on-primary);
    width: 48px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.9;
}

.sheet-close-handle svg {
    width: 26px;
    height: 26px;
    stroke-width: 2.5;
}

.sheet-title {
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    margin-top: 2px;
}

.sheet-subtitle {
    font-size: 0.82rem;
    opacity: 0.9;
    margin-top: 2px;
}

.sheet-body {
    padding: 14px 16px 24px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Variant Item Card */
.variant-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.2s ease;
}

.variant-card:active {
    transform: scale(0.98);
}

.variant-card.added {
    border-color: var(--color-positive);
}

.variant-thumb {
    width: 74px;
    height: 74px;
    background-color: #FFFFFF;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 6px 6px 22px 6px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.variant-thumb .price-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 0;
    font-size: 0.72rem;
    padding: 2px 4px;
    text-align: center;
}

.variant-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.variant-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--brand-primary);
}

.variant-desc {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
}

.variant-sku {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.variant-status-tag {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--color-positive);
    margin-top: 2px;
}

/* ==========================================================================
   CART VIEW 1 (COLLAPSIBLE ITEM ACCORDION & FIXED TOTALS FOOTER)
   ========================================================================== */
.cart-header {
    background-color: var(--brand-primary);
    color: var(--brand-on-primary);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.cart-header-title {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cart-header-title h1 {
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    line-height: 1.15;
}

.cart-header-title span {
    font-size: 0.78rem;
    opacity: 0.9;
    margin-top: 2px;
}

.cart-content {
    padding: 14px 14px 145px 14px;
}

.cart-accordion-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cart-accordion-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.cart-accordion-item.expanded {
    border-color: rgba(var(--brand-primary-rgb), 0.45);
}

/* Top Compressed Summary Row */
.cart-row-summary {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.cart-row-qty {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-primary);
    min-width: 28px;
}

.cart-row-name {
    flex: 1;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.25;
}

.cart-row-subtotal {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Expanded Detail Area */
.cart-row-details {
    display: flex;
    align-items: stretch;
    border-top: 1px solid var(--border-subtle);
    background-color: var(--bg-action-circle);
    min-height: 88px;
}

.cart-delete-strip {
    width: 36px;
    background-color: var(--color-negative);
    color: #FFFFFF;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.cart-delete-strip svg {
    width: 17px;
    height: 17px;
}

.cart-detail-thumb {
    width: 64px;
    height: 64px;
    margin: auto 10px;
    background-color: #FFFFFF;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 4px;
    flex-shrink: 0;
}

.cart-detail-meta {
    flex: 1;
    padding: 10px 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    font-size: 0.74rem;
    color: var(--text-secondary);
}

.meta-price strong {
    color: var(--color-positive);
    font-weight: 700;
}

.meta-stock strong {
    color: var(--brand-primary);
    font-weight: 600;
}

/* Right Quantity Stepper Control */
.cart-stepper-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-right: 10px;
    gap: 4px;
}

.stepper-unit-label {
    font-size: 0.66rem;
    color: var(--text-secondary);
}

.stepper-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stepper-val {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    min-width: 22px;
    text-align: center;
}

.stepper-btn {
    width: 28px;
    height: 44px;
    background-color: var(--color-positive);
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 1.15rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.stepper-btn:active {
    opacity: 0.85;
}

/* Fixed Bottom Summary & Confirm CTA */
.cart-footer-summary {
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: 480px;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-nav);
    z-index: 95;
}

.cart-totals-box {
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.subtotal-val {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    color: var(--color-positive);
}

.discount-val {
    font-weight: 600;
    color: var(--text-primary);
}

.confirm-order-btn {
    width: 100%;
    height: 52px;
    background-color: var(--brand-primary);
    color: var(--brand-on-primary);
    border: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
}

.confirm-order-btn:active {
    opacity: 0.92;
}



/* ==========================================================================
   MODERN NUMERIC CALCULATOR BOTTOM SHEET (QUANTITY & PRICE MODES)
   ========================================================================== */
.numpad-sheet {
    background-color: var(--bg-card);
    padding: 8px 16px 20px 16px;
    z-index: 220;
}

.numpad-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
}

.numpad-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    width: 48px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.numpad-product-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90%;
}

/* Segmented Switcher (Cantidad / Precio) */
.numpad-mode-switcher {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background-color: var(--bg-app);
    padding: 4px;
    border-radius: 14px;
    border: 1px solid var(--border-subtle);
    margin-bottom: 12px;
    gap: 2px;
}

.display-suffix {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--brand-primary);
}

/* Discount Badge inside Cart Row Details */
.discount-pill-tag {
    display: inline-block;
    background-color: rgba(var(--brand-primary-rgb), 0.14);
    color: var(--brand-primary);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 6px;
    margin-left: 4px;
}

.mode-tab {
    background: none;
    border: none;
    padding: 9px 12px;
    border-radius: 10px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-tab svg {
    width: 16px;
    height: 16px;
}

.mode-tab.active {
    background-color: var(--brand-primary);
    color: var(--brand-on-primary);
    box-shadow: 0 2px 8px rgba(var(--brand-primary-rgb), 0.3);
}

/* Digital Display Screen */
.numpad-display-box {
    background-color: var(--bg-app);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-bottom: 14px;
}

.display-hint {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.display-value-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.display-prefix {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-positive);
}

.display-digits {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

/* 4-Column Tactile Keypad Grid */
.numpad-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.num-key {
    height: 54px;
    background-color: var(--bg-action-circle);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: transform 0.08s ease, background-color 0.15s ease;
}

.num-key:active:not(:disabled) {
    transform: scale(0.94);
    background-color: var(--border-subtle);
}

.num-key:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.num-key.action-key {
    color: var(--color-negative);
    font-size: 1.1rem;
}

.num-key.quick-add-key {
    color: var(--brand-primary);
    font-size: 1.05rem;
    font-weight: 800;
}

.num-key.confirm-key {
    background-color: var(--color-positive);
    border-color: var(--color-positive);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.num-key.confirm-key svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
}



/* ==========================================================================
   SCALABLE ANDROID-STYLE COLORED TOAST NOTIFICATIONS
   ========================================================================== */
:root {
    --toast-success: #16A34A;
    --toast-danger: #DC2626;
    --toast-warning: #F59E0B;
    --toast-info: #0284C7;
    --toast-primary: var(--brand-primary);
}

.toast-container {
    position: fixed;
    bottom: 84px; /* Sits cleanly above bottom action bars */
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 448px;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    z-index: 9999;
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    color: #FFFFFF;
    font-family: 'Inter', sans-serif;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.3;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
    cursor: pointer;
    opacity: 0;
    transform: translateY(16px) scale(0.96);
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toast-container,
#toast-container {
    position: fixed;
    z-index: 20000 !important;
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    z-index: 20001;
}


.toast-item.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast-item.hide {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.25;
}

.toast-message {
    flex: 1;
}

/* 5 Built-in Semantic Color Variants (Easily extensible) */
.toast-item.toast-success {
    background-color: var(--toast-success);
}

.toast-item.toast-danger {
    background-color: var(--toast-danger);
}

.toast-item.toast-warning {
    background-color: var(--toast-warning);
    color: #111827; /* High-contrast dark text on amber warning */
}

.toast-item.toast-info {
    background-color: var(--toast-info);
}

.toast-item.toast-primary {
    background-color: var(--toast-primary);
}


/* ==========================================================================
   ORDER SUMMARY & RESPONSIBILITY VALIDATION SCREEN
   ========================================================================== */
.summary-view-content {
    padding: 16px 16px 100px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.order-meta-card, .order-receipt-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: var(--shadow-card);
}

.order-meta-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.84rem;
}

.meta-label {
    color: var(--text-secondary);
}

.meta-value {
    color: var(--text-primary);
    font-weight: 700;
}

.meta-badge {
    background-color: rgba(var(--brand-primary-rgb), 0.12);
    color: var(--brand-primary);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 8px;
}

/* Receipt Breakdown */
.receipt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border-subtle);
}

.receipt-header h2 {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
}

.receipt-items-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    background-color: var(--bg-action-circle);
    padding: 3px 10px;
    border-radius: 20px;
}

.receipt-items-list {
    display: flex;
    flex-direction: column;
}

.receipt-line-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.receipt-line-item:last-child {
    border-bottom: none;
}

.receipt-line-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.receipt-line-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
}

.receipt-line-sub {
    font-size: 0.74rem;
    color: var(--text-secondary);
}

.receipt-line-right {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.receipt-totals {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.receipt-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.receipt-total-row.discount {
    color: var(--brand-primary);
    font-weight: 600;
}

.receipt-total-row.grand-total {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
}

.receipt-total-row.grand-total strong {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.2rem;
    color: var(--color-positive);
}

/* Responsibility Acceptance Card */
.responsibility-box {
    background-color: var(--bg-card);
    border: 1.5px solid var(--border-subtle);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.responsibility-box:has(input:checked) {
    border-color: var(--color-positive);
    background-color: rgba(22, 163, 74, 0.06);
}

.responsibility-box input {
    display: none;
}

.custom-checkbox {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    border: 2px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: transparent;
    transition: all 0.2s ease;
}

.custom-checkbox svg {
    width: 15px;
    height: 15px;
    stroke-width: 3;
}

.responsibility-box input:checked + .custom-checkbox {
    background-color: var(--color-positive);
    border-color: var(--color-positive);
    color: #FFFFFF;
}

.responsibility-text {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
}

/* Fixed Bottom Submit Footer */
.summary-submit-footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: 480px;
    padding: 12px 16px 16px 16px;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-subtle);
    z-index: 95;
}

.submit-order-btn {
    width: 100%;
    height: 52px;
    background-color: var(--brand-primary);
    color: var(--brand-on-primary);
    border: none;
    border-radius: 14px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(var(--brand-primary-rgb), 0.35);
    transition: opacity 0.2s ease, transform 0.12s ease;
}

.submit-order-btn.locked {
    opacity: 0.42;
    box-shadow: none;
}

.submit-order-btn:not(.locked):active {
    transform: scale(0.98);
}

.submit-order-btn svg {
    width: 18px;
    height: 18px;
}


/* ==========================================================================
   TRUCK LOADS BOTTOM SHEET (CONSIGNACIONES & PEDIDOS)
   ========================================================================== */
#truck-summary-card {
    cursor: pointer;
    transition: transform 0.14s ease, border-color 0.2s ease;
}

#truck-summary-card:active {
    transform: scale(0.985);
}

.loads-sheet-header {
    background-color: var(--brand-primary);
    color: var(--brand-on-primary);
    padding: 6px 18px 16px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.loads-header-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
}

.loads-title-group {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.new-load-btn {
    background-color: #FFFFFF;
    color: var(--brand-primary);
    border: none;
    border-radius: 12px;
    padding: 8px 14px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    transition: transform 0.12s ease;
}

.new-load-btn:active {
    transform: scale(0.95);
}

.new-load-btn svg {
    width: 17px;
    height: 17px;
    stroke-width: 2.5;
}

/* Load Item Card */
.load-item-card {
    background-color: var(--bg-card);
    border: 1.5px solid var(--border-subtle);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.12s ease;
}

.load-item-card:active {
    transform: scale(0.98);
}

.load-item-card.active-load {
    border-color: var(--brand-primary);
}

.load-type-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.load-type-icon svg {
    width: 20px;
    height: 20px;
}

.load-type-icon.consignment {
    background-color: rgba(6, 182, 212, 0.14);
    color: #06B6D4;
}

.load-type-icon.order {
    background-color: rgba(34, 197, 94, 0.14);
    color: var(--color-positive);
}

.load-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.load-code-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.load-code {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-primary);
}

.load-type-badge {
    font-size: 0.66rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    text-transform: uppercase;
}

.load-type-badge.consignment {
    background-color: rgba(6, 182, 212, 0.15);
    color: #0891B2;
}

[data-theme="dark"] .load-type-badge.consignment {
    color: #22D3EE;
}

.load-type-badge.order {
    background-color: rgba(22, 163, 74, 0.15);
    color: var(--color-positive);
}

.load-meta-sub {
    font-size: 0.74rem;
    color: var(--text-secondary);
}

.load-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex-shrink: 0;
}

.load-amount {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-primary);
}

.load-active-indicator {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--brand-primary);
}
/* ==========================================================================
   ACTIVE LOAD CONTEXT PILL & COLOR CODING (ALL / CONSIGNMENT / ORDER)
   ========================================================================== */
.summary-header-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.active-load-pill {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 8px;
    letter-spacing: 0.2px;
    transition: all 0.2s ease;
}

/* 1. All / General Consolidated (Brand Primary) */
.active-load-pill.badge-all,
.load-type-badge.all {
    background-color: rgba(var(--brand-primary-rgb), 0.14);
    color: var(--brand-primary);
}

.load-type-icon.all {
    background-color: rgba(var(--brand-primary-rgb), 0.14);
    color: var(--brand-primary);
}

/* 2. Consignment (Green) */
.active-load-pill.badge-consignment,
.load-type-badge.consignment {
    background-color: rgba(22, 163, 74, 0.16);
    color: var(--color-positive);
}

.load-type-icon.consignment {
    background-color: rgba(22, 163, 74, 0.16);
    color: var(--color-positive);
}

/* 3. Order / Pedidos (Amber-Orange Warning) */
.active-load-pill.badge-order,
.load-type-badge.order {
    background-color: rgba(245, 158, 11, 0.18);
    color: #D97706;
}

[data-theme="dark"] .active-load-pill.badge-order,
[data-theme="dark"] .load-type-badge.order {
    color: #FBBF24;
}

.load-type-icon.order {
    background-color: rgba(245, 158, 11, 0.18);
    color: #F59E0B;
}

/* 4. Return / Devolución (Blue Info) */
.active-load-pill.badge-return,
.load-type-badge.return {
    background-color: rgba(2, 132, 199, 0.16);
    color: var(--toast-info);
}

[data-theme="dark"] .active-load-pill.badge-return,
[data-theme="dark"] .load-type-badge.return {
    color: #38BDF8;
}

.load-type-icon.return {
    background-color: rgba(2, 132, 199, 0.16);
    color: var(--toast-info);
}


/* ==========================================================================
   MAIN DISPATCH ACTION MENU BOTTOM SHEET
   ========================================================================== */
.dispatch-options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dispatch-option-card {
    width: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 13px 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.2s ease;
}

.dispatch-option-card:active {
    transform: scale(0.98);
    border-color: var(--brand-primary);
}

.dispatch-option-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dispatch-option-icon svg {
    width: 21px;
    height: 21px;
    stroke-width: 2;
}

/* Color-coded Action Icons */
.dispatch-option-icon.sale {
    background-color: rgba(22, 163, 74, 0.14);
    color: var(--color-positive);
}

.dispatch-option-icon.order {
    background-color: rgba(245, 158, 11, 0.16);
    color: #F59E0B;
}

.dispatch-option-icon.route {
    background-color: rgba(2, 132, 199, 0.14);
    color: var(--toast-info);
}

.dispatch-option-icon.loads {
    background-color: rgba(var(--brand-primary-rgb), 0.14);
    color: var(--brand-primary);
}

.dispatch-option-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.option-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--text-primary);
}

.option-desc {
    font-size: 0.74rem;
    color: var(--text-secondary);
    line-height: 1.25;
}

.option-arrow {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ==========================================================================
   FINANCES & SETTLEMENT VIEW (2-METRIC HEADER & VERTICAL FOOTER)
   ========================================================================== */
.finance-header {
    background-color: var(--brand-primary);
    color: var(--brand-on-primary);
    padding: 16px 18px 24px 18px;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

.finance-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.finance-top-row h1 {
    font-size: 1.08rem;
    font-weight: 700;
}

.finance-balance-box {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 18px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.finance-context-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.context-caption {
    font-size: 0.74rem;
    opacity: 0.88;
}

.finance-load-pill {
    background-color: #FFFFFF;
    color: var(--brand-primary);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 8px;
    letter-spacing: 0.2px;
}

.finance-dual-metrics {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
}

.metric-divider {
    width: 1px;
    height: 38px;
    background-color: rgba(255, 255, 255, 0.25);
}

.metric-label {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    opacity: 0.88;
}

.metric-value {
    font-family: 'Plus Jakarta Sans', sans-serif;
    letter-spacing: -0.4px;
}

.metric-value.primary {
    font-size: 1.32rem;
    font-weight: 800;
}

.metric-value.secondary {
    font-size: 1.18rem;
    font-weight: 700;
    opacity: 0.92;
}

/* Main List & Filters */
.finance-content {
    padding: 14px 16px 265px 16px; /* Clears vertical footer + 68px bottom-nav */
}

.finance-filter-bar {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 12px;
    scrollbar-width: none;
}

.finance-filter-bar::-webkit-scrollbar {
    display: none;
}

.fin-pill {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 700;
    padding: 6px 13px;
    border-radius: 20px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fin-pill.active {
    background-color: var(--brand-primary);
    color: var(--brand-on-primary);
    border-color: var(--brand-primary);
}

.finance-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Compact Finance Card with Top-Right Status Badge */
.finance-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 11px;
}

.fin-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fin-icon svg {
    width: 19px;
    height: 19px;
}

.fin-icon.paid { background-color: rgba(22, 163, 74, 0.14); color: var(--color-positive); }
.fin-icon.pending { background-color: rgba(245, 158, 11, 0.16); color: #F59E0B; }
.fin-icon.credit { background-color: rgba(2, 132, 199, 0.14); color: var(--toast-info); }
.fin-icon.expense { background-color: rgba(220, 38, 38, 0.14); color: var(--color-negative); }

.fin-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fin-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fin-sub {
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fin-right-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 4px;
    flex-shrink: 0;
}

.fin-badge {
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.1;
}

.fin-badge.paid { background-color: rgba(22, 163, 74, 0.15); color: var(--color-positive); }
.fin-badge.pending { background-color: rgba(245, 158, 11, 0.16); color: #D97706; }
.fin-badge.credit { background-color: rgba(2, 132, 199, 0.15); color: var(--toast-info); }
.fin-badge.expense { background-color: rgba(220, 38, 38, 0.15); color: var(--color-negative); }

[data-theme="dark"] .fin-badge.pending { color: #FBBF24; }
[data-theme="dark"] .fin-badge.credit { color: #38BDF8; }

.fin-amount {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 800;
    white-space: nowrap;
}

.fin-amount.positive { color: var(--color-positive); }
.fin-amount.warning { color: #D97706; }
.fin-amount.info { color: var(--toast-info); }
.fin-amount.negative { color: var(--color-negative); }

[data-theme="dark"] .fin-amount.warning { color: #FBBF24; }
[data-theme="dark"] .fin-amount.info { color: #38BDF8; }

/* Vertical Office Settlement Footer (Sits flush above 68px Bottom Nav) */
.finance-summary-footer {
    position: fixed;
    bottom: 0px;
    width: 100%;
    max-width: 480px;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-subtle);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.12);
    padding: 12px 18px 14px 18px;
    z-index: 85;
}

.fin-vertical-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.fin-v-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.86rem;
}

.fin-v-row .v-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.fin-v-row .v-value {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    color: var(--text-primary);
}

.fin-grand-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
}

.fin-grand-total-row span {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
}

.fin-grand-total-row strong {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.18rem;
    font-weight: 800;
    color: var(--color-positive);
}


/* ==========================================================================
   ADD ROUTE EXPENSE BOTTOM SHEET FORM
   ========================================================================== */
.expense-sheet {
    background-color: var(--bg-card);
    z-index: 230;
}

.expense-form-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 18px 24px 18px;
}

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

.field-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
}

/* Auto-detected Load Banner */
.detected-load-banner {
    background-color: rgba(22, 163, 74, 0.1);
    border: 1px solid rgba(22, 163, 74, 0.35);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-positive);
}

.detected-load-banner svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.detected-load-text {
    display: flex;
    flex-direction: column;
}

.detected-caption {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.detected-load-text strong {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* Dropdown Select Wrapper */
.select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-select-input {
    width: 100%;
    height: 46px;
    background-color: var(--bg-app);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 0 36px 0 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-primary);
    appearance: none;
    outline: none;
}

.form-select-input:focus {
    border-color: var(--brand-primary);
}

.select-arrow-icon {
    position: absolute;
    right: 12px;
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    pointer-events: none;
}

/* Amount Input */
.amount-input-box {
    display: flex;
    align-items: center;
    height: 50px;
    background-color: var(--bg-app);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 0 14px;
    gap: 8px;
}

.amount-input-box:focus-within {
    border-color: var(--brand-primary);
}

.currency-tag {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--color-negative);
}

.amount-input-box input {
    width: 100%;
    background: none;
    border: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    outline: none;
}

/* Text Detail Input */
.form-text-input {
    width: 100%;
    height: 46px;
    background-color: var(--bg-app);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 0 14px;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    color: var(--text-primary);
    outline: none;
}

.form-text-input:focus {
    border-color: var(--brand-primary);
}

/* Save Expense CTA Button */
.save-expense-btn {
    width: 100%;
    height: 50px;
    background-color: var(--brand-primary);
    color: var(--brand-on-primary);
    border: none;
    border-radius: 14px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.94rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(var(--brand-primary-rgb), 0.3);
}

.save-expense-btn:active {
    transform: scale(0.98);
}

.save-expense-btn svg {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   RECORDS & ORDER HISTORY VIEW (3-PERIOD KPIS & DATE FILTER)
   ========================================================================== */
.records-header {
    background-color: var(--brand-primary);
    color: var(--brand-on-primary);
    padding: 16px 18px 22px 18px;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

.records-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.records-title-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.records-title-group h1 {
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.15;
}

.active-date-badge {
    font-size: 0.72rem;
    opacity: 0.88;
    margin-top: 2px;
}

/* 3-Column KPI Summary Box (Hoy / Ayer / Mes) */
.records-kpi-grid {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 18px;
    padding: 12px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rec-kpi-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 3px;
    min-width: 0;
}

.rec-kpi-divider {
    width: 1px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.25);
}

.rec-kpi-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    opacity: 0.86;
}

.rec-kpi-val {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.92rem;
    font-weight: 800;
    white-space: nowrap;
}

/* Content Area (No fixed footer, standard bottom spacing) */
.records-content {
    padding: 14px 16px 32px 16px;
}

.rec-pill {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 700;
    padding: 6px 13px;
    border-radius: 20px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rec-pill.active {
    background-color: var(--brand-primary);
    color: var(--brand-on-primary);
    border-color: var(--brand-primary);
}

.records-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.receipt-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 11px 12px;
    display: flex;
    align-items: center;
    gap: 11px;
    cursor: pointer;
    transition: transform 0.12s ease;
}

.receipt-card:active {
    transform: scale(0.985);
}

.rec-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rec-icon svg {
    width: 19px;
    height: 19px;
}

/* Status Colors: Pending, Delivered, Completed, Rejected */
.rec-icon.pending { background-color: rgba(245, 158, 11, 0.16); color: #F59E0B; }
.rec-icon.delivered { background-color: rgba(2, 132, 199, 0.14); color: var(--toast-info); }
.rec-icon.completed { background-color: rgba(22, 163, 74, 0.14); color: var(--color-positive); }
.rec-icon.rejected { background-color: rgba(220, 38, 38, 0.14); color: var(--color-negative); }

.receipt-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.receipt-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.receipt-sub {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.receipt-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.rec-badge {
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.rec-badge.pending { background-color: rgba(245, 158, 11, 0.16); color: #D97706; }
.rec-badge.delivered { background-color: rgba(2, 132, 199, 0.15); color: var(--toast-info); }
.rec-badge.completed { background-color: rgba(22, 163, 74, 0.15); color: var(--color-positive); }
.rec-badge.rejected { background-color: rgba(220, 38, 38, 0.15); color: var(--color-negative); }

[data-theme="dark"] .rec-badge.pending { color: #FBBF24; }
[data-theme="dark"] .rec-badge.delivered { color: #38BDF8; }

.rec-amount {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
}

.rec-amount.positive { color: var(--color-positive); }
.rec-amount.warning { color: #D97706; }
.rec-amount.negative { color: var(--color-negative); }

/* Date Range Modal Controls */
.date-presets-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.date-preset-btn {
    background-color: var(--bg-app);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 8px;
    border-radius: 10px;
    cursor: pointer;
}

.date-preset-btn.active {
    background-color: rgba(var(--brand-primary-rgb), 0.14);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.date-inputs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Load History Filter Pills (Reuses Finance & Records Tokens) */
.load-hist-pill {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 700;
    padding: 6px 13px;
    border-radius: 20px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.load-hist-pill.active {
    background-color: var(--brand-primary);
    color: var(--brand-on-primary);
    border-color: var(--brand-primary);
}


/* ==========================================================================
   CLIENTS DIRECTORY & 3/4-TAB INTERACTIVE CLIENT FORM
   ========================================================================== */
.client-pill {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 700;
    padding: 6px 13px;
    border-radius: 20px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.client-pill.active {
    background-color: var(--brand-primary);
    color: var(--brand-on-primary);
    border-color: var(--brand-primary);
}

/* 3-Line Client Card */
.client-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    cursor: pointer;
    transition: transform 0.12s ease;
}

.client-card:active {
    transform: scale(0.985);
}

.client-avatar-box {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.client-avatar-box svg {
    width: 20px;
    height: 20px;
}

.client-avatar-box.active { background-color: rgba(22, 163, 74, 0.14); color: var(--color-positive); }
.client-avatar-box.new { background-color: rgba(2, 132, 199, 0.14); color: var(--toast-info); }
.client-avatar-box.inactive { background-color: rgba(220, 38, 38, 0.14); color: var(--color-negative); }

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

/* Line 1: Código - Nombre y Apellido */
.client-line-1 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
}

/* Line 2: Teléfono */
.client-line-2 {
    font-size: 0.76rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.client-line-2 svg {
    width: 13px;
    height: 13px;
}

/* Line 3: Pedidos & Compras Counters */
.client-line-3 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.stat-chip {
    font-size: 0.72rem;
    color: var(--text-secondary);
    background-color: var(--bg-action-circle);
    padding: 2px 8px;
    border-radius: 6px;
}

.stat-chip strong {
    color: var(--text-primary);
    font-weight: 700;
}

.stat-chip.money strong {
    color: var(--color-positive);
}

.client-status-badge {
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.client-status-badge.active { background-color: rgba(22, 163, 74, 0.15); color: var(--color-positive); }
.client-status-badge.new { background-color: rgba(2, 132, 199, 0.15); color: var(--toast-info); }
.client-status-badge.inactive { background-color: rgba(220, 38, 38, 0.15); color: var(--color-negative); }

/* 3 or 4-Tab Client Form Sheet */
.client-form-sheet {
    background-color: var(--bg-card);
    max-height: 85vh;
    z-index: 240;
}

.client-form-tabs {
    display: flex;
    background-color: var(--bg-app);
    border-bottom: 1px solid var(--border-subtle);
    padding: 6px 8px 0 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.client-form-tabs::-webkit-scrollbar {
    display: none;
}

.c-form-tab {
    flex: 1;
    min-width: 82px;
    background: none;
    border: none;
    border-bottom: 2.5px solid transparent;
    padding: 10px 4px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.c-form-tab svg {
    width: 15px;
    height: 15px;
}

.c-form-tab.active {
    color: var(--brand-primary);
    border-bottom-color: var(--brand-primary);
}

.client-form-body {
    padding: 16px 18px 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.c-tab-pane {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.addresses-tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.client-addresses-list, .client-receipts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.address-mini-card {
    background-color: var(--bg-app);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.addr-pin-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background-color: rgba(var(--brand-primary-rgb), 0.14);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.addr-text-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.addr-text-col strong {
    font-size: 0.82rem;
    color: var(--text-primary);
}

.addr-text-col span {
    font-size: 0.73rem;
    color: var(--text-secondary);
}


/* ==========================================================================
   NOTIFICATIONS DROPDOWN POPOVER & FULL NOTIFICATIONS VIEW
   ========================================================================== */
.notification-menu-wrapper {
    position: relative;
}

.notifications-dropdown {
    position: absolute;
    top: 46px;
    right: -42px;
    width: 310px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
    overflow: hidden;
    z-index: 300;
    transform-origin: top right;
}

.notif-drop-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
}

.notif-unread-pill {
    background-color: rgba(var(--brand-primary-rgb), 0.14);
    color: var(--brand-primary);
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 10px;
}

.notif-drop-list {
    display: flex;
    flex-direction: column;
}

.notif-drop-item {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease, border-left-color 0.2s ease;
}

.notif-drop-item:last-child {
    border-bottom: none;
}

.notif-drop-item.unread {
    background-color: rgba(var(--brand-primary-rgb), 0.11);
    border-left: 3.5px solid var(--brand-primary);
}

[data-theme="dark"] .notif-drop-item.unread {
    background-color: rgba(var(--brand-primary-rgb), 0.18);
}

.notif-dot-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.notif-dot-icon svg {
    width: 16px;
    height: 16px;
}

.notif-dot-icon.info {
    background-color: rgba(2, 132, 199, 0.14);
    color: var(--toast-info);
}

.notif-dot-icon.success {
    background-color: rgba(22, 163, 74, 0.14);
    color: var(--color-positive);
}

.notif-dot-icon.warning {
    background-color: rgba(245, 158, 11, 0.16);
    color: #F59E0B;
}

.notif-drop-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notif-drop-text strong {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.notif-drop-text span {
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-drop-text small {
    font-size: 0.66rem;
    color: var(--text-muted);
}

.notif-drop-footer-btn {
    width: 100%;
    background-color: var(--bg-app);
    border: none;
    border-top: 1px solid var(--border-subtle);
    padding: 11px 14px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
}

.notif-drop-footer-btn svg {
    width: 15px;
    height: 15px;
}

/* Full Notifications View Cards */
.notifications-full-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notif-full-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.notif-full-card.unread {
    background-color: rgba(var(--brand-primary-rgb), 0.08);
    border-color: rgba(var(--brand-primary-rgb), 0.45);
    border-left: 4px solid var(--brand-primary);
}

[data-theme="dark"] .notif-full-card.unread {
    background-color: rgba(var(--brand-primary-rgb), 0.15);
}

.notif-full-card .fin-sub {
    white-space: normal;
    line-height: 1.35;
}

.unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--brand-primary);
    margin-top: 6px;
    flex-shrink: 0;
}

/* ==========================================================================
   LOGIN & PASSWORD RECOVERY BOTTOM SHEET (BLURRED BACKDROP)
   ========================================================================== */
.auth-blur-backdrop {
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(circle at 18% 15%, rgba(var(--brand-primary-rgb), 0.55) 0%, transparent 55%),
        radial-gradient(circle at 85% 35%, rgba(var(--brand-primary-rgb), 0.40) 0%, transparent 60%),
        linear-gradient(180deg, rgba(var(--brand-primary-rgb), 0.25) 0%, rgba(15, 18, 25, 0.72) 100%);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 10000;
}


.auth-sheet {
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0 !important;
    transform: none !important;
    background-color: var(--bg-card);
    z-index: 10010 !important;
    max-height: 90vh;
    border-top-left-radius: 26px;
    border-top-right-radius: 26px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
}


.auth-sheet-header {
    background-color: var(--brand-primary);
    color: var(--brand-on-primary);
    padding: 20px 20px 22px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.auth-logo-pill {
    background-color: #FFFFFF;
    padding: 8px 18px;
    border-radius: 14px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.auth-logo-img {
    height: 32px;
    width: auto;
    display: block;
    object-fit: contain;
}

.auth-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.22rem;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.auth-subtitle {
    font-size: 0.8rem;
    opacity: 0.9;
    margin-top: 3px;
}

.auth-sheet-body {
    padding: 20px 20px 28px 20px;
}

.auth-step-pane {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-input-box {
    display: flex;
    align-items: center;
    height: 48px;
    background-color: var(--bg-app);
    border: 1.5px solid var(--border-subtle);
    border-radius: 13px;
    padding: 0 12px;
    gap: 10px;
    transition: border-color 0.2s ease;
}

.auth-input-box:focus-within {
    border-color: var(--brand-primary);
}

.auth-input-box > svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.auth-input-box input {
    flex: 1;
    width: 100%;
    background: none;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    color: var(--text-primary);
    outline: none;
}

.toggle-pass-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 4px;
}

.toggle-pass-btn svg {
    width: 18px;
    height: 18px;
}

.auth-forgot-row {
    display: flex;
    justify-content: flex-end;
    margin-top: -4px;
}

.auth-submit-btn {
    margin-top: 4px;
    height: 50px;
}

.auth-info-banner {
    background-color: rgba(var(--brand-primary-rgb), 0.1);
    border: 1px solid rgba(var(--brand-primary-rgb), 0.28);
    border-radius: 12px;
    padding: 11px 13px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.78rem;
    color: var(--text-primary);
    line-height: 1.35;
}

.auth-info-banner svg {
    width: 20px;
    height: 20px;
    color: var(--brand-primary);
    flex-shrink: 0;
    margin-top: 1px;
}

.auth-secondary-back-btn {
    width: 100%;
    height: 44px;
    background-color: var(--bg-app);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    color: var(--text-secondary);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.84rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.auth-secondary-back-btn svg {
    width: 16px;
    height: 16px;
}
