@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Color Palette */
    --primary: #f97316;       /* Pakki Orange */
    --primary-hover: #ea580c;
    --primary-light: #ffedd5;
    --secondary: #4f46e5;     /* Indigo Accent */
    --secondary-hover: #4338ca;
    
    --bg-app: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a;    /* Dark Navy Sidebar */
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #f8fafc;
    
    --border-color: #e2e8f0;
    
    /* Status Colors */
    --success: #10b981;       /* Green */
    --success-light: #d1fae5;
    --warning: #f59e0b;       /* Yellow */
    --warning-light: #fef3c7;
    --danger: #ef4444;        /* Red */
    --danger-light: #fee2e2;
    --info: #06b6d4;          /* Cyan */
    --info-light: #ecfeff;
    
    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Shadows & Transitions */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Dashboard Layout */
.app-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    background-color: var(--bg-sidebar);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    padding: 0.5rem;
}

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

.brand-logo {
    background: linear-gradient(135deg, var(--primary), #fb923c);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    color: white;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.brand-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-tag {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--primary);
    display: block;
    margin-top: -4px;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
}

.menu-item a:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.05);
}

.menu-item.active a {
    color: white;
    background-color: var(--primary);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
}

.menu-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
    border: 2px solid var(--primary);
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-role {
    font-size: 0.75rem;
    color: #64748b;
}

/* Main Content Styles */
.main-content {
    display: flex;
    flex-direction: column;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Header */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header-title h1 {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.header-title p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.date-badge {
    background-color: var(--bg-card);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Tab Sections */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.tab-content.active {
    display: block;
}

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

/* Cards & Grid Layouts */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.metric-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.metric-card-cta {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.metric-card-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
}

.metric-cta-hint {
    position: absolute;
    bottom: 0.6rem;
    right: 0.9rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.metric-card-cta:hover .metric-cta-hint {
    opacity: 1;
}

.metric-data h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.metric-data .value {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
}

.metric-data .trend {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.trend.up {
    color: var(--success);
}

.trend.down {
    color: var(--danger);
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-icon.primary {
    background-color: var(--primary-light);
    color: var(--primary);
}

.metric-icon.secondary {
    background-color: #e0e7ff;
    color: var(--secondary);
}

.metric-icon.success {
    background-color: var(--success-light);
    color: var(--success);
}

.metric-icon.warning {
    background-color: var(--warning-light);
    color: var(--warning);
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

input, select, textarea {
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: #ffffff;
    color: var(--text-main);
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
}

.btn-secondary {
    background-color: white;
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: #f1f5f9;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

/* ── Columnas ocultables por breakpoint (usadas en tabla Casilleros) ── */
.col-hide-900,
.col-hide-700,
.col-hide-500 { display: table-cell; }   /* visible por defecto */

@media (max-width: 900px) { .col-hide-900 { display: none !important; } }
@media (max-width: 700px) { .col-hide-700 { display: none !important; } }
@media (max-width: 500px) { .col-hide-500 { display: none !important; } }

/* Tabla Casilleros: padding compacto */
#tab-casillero-list .table-container th,
#tab-casillero-list .table-container td {
    padding: 0.65rem 0.75rem;
    font-size: 0.83rem;
    white-space: nowrap;
}

/* Tabla Prealertas: más compacta, th sin wrap, td puede envolver */
#tab-prealertas .table-container th {
    padding: 0.5rem 0.55rem;
    font-size: 0.78rem;
    white-space: nowrap;
}
#tab-prealertas .table-container td {
    padding: 0.5rem 0.55rem;
    font-size: 0.8rem;
    white-space: normal;
}
/* Tracking: truncar con ellipsis y mostrar completo en title */
#tab-prealertas .table-container .cell-tracking {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: monospace;
    font-size: 0.78rem;
}
/* Casillero y Fecha: siempre en una línea */
#tab-prealertas .table-container .cell-nowrap {
    white-space: nowrap;
}

/* Tabla Inventario de Bodega: compacta sin scroll horizontal */
#tab-bodega .table-container th {
    padding: 0.5rem 0.55rem;
    font-size: 0.78rem;
    white-space: nowrap;
}
#tab-bodega .table-container td {
    padding: 0.5rem 0.55rem;
    font-size: 0.8rem;
    white-space: normal;
}
#tab-bodega .table-container .cell-nowrap {
    white-space: nowrap;
}

/* Paginadores de tablas */
#lockers-pagination,
#prealerts-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.75rem 0.25rem 0.25rem;
    margin-top: 0.5rem;
}
#lockers-pagination button:hover:not([disabled]),
#prealerts-pagination button:hover:not([disabled]) {
    background: var(--surface-hover, #f1f5f9) !important;
    border-color: var(--primary) !important;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin-top: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    background-color: white;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #f8fafc;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    width: fit-content;
}

.badge-success {
    background-color: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background-color: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background-color: var(--danger-light);
    color: var(--danger);
}

.badge-info {
    background-color: var(--info-light);
    color: var(--info);
}

.badge-neutral {
    background-color: #f1f5f9;
    color: #475569;
}

.badge-bodega-bog {
    background-color: #d1fae5;
    color: #065f46;
}

/* Grid splits */
.dashboard-split {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.full-split {
    grid-template-columns: 1fr;
}

/* Section Card Header */
.section-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-card-header h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
}

/* Custom layout modules */
.miami-address-card {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: white;
    border: none;
}

.miami-address-card h3 {
    color: var(--primary);
    font-family: var(--font-heading);
    font-size: 1.15rem;
    margin-bottom: 1rem;
}

.miami-address-card p {
    font-size: 0.85rem;
    color: #cbd5e1;
    margin-bottom: 0.75rem;
}

.miami-address-card pre {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: var(--radius-md);
    font-family: monospace;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: pre-wrap;
    word-break: break-all;
}

/* Filter controls */
.filters-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-input-wrapper {
    position: relative;
    flex-grow: 1;
}

.search-input-wrapper svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.search-input-wrapper input {
    width: 100%;
    padding-left: 2.75rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background-color: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 95%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background-color: #f8fafc;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

/* Invoice details styling */
.invoice-detail {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px dashed var(--border-color);
    padding-bottom: 1rem;
}

.invoice-header-left h4 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--primary);
}

.invoice-header-right {
    text-align: right;
}

.invoice-section-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.25rem;
}

.invoice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.invoice-grid-item span {
    font-weight: 600;
}

.invoice-table {
    width: 100%;
    margin-top: 0.5rem;
}

.invoice-table th {
    padding: 0.5rem;
    font-size: 0.75rem;
}

.invoice-table td {
    padding: 0.5rem;
    font-size: 0.8rem;
}

.invoice-total-section {
    background-color: #f8fafc;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.invoice-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.invoice-total-row.grand-total {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
    border-top: 1px solid var(--border-color);
    padding-top: 0.5rem;
    margin-top: 0.25rem;
}

/* Cotizador - 3-column rows */
.cot-total-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    align-items: center;
    gap: 0.5rem;
}

.cot-total-row span:not(:first-child) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.cot-total-row.header {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
}

.cot-total-row.grand-total {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--secondary);
    border-bottom: none;
    border-top: 2px solid var(--secondary);
    padding-top: 0.75rem;
    margin-top: 0.25rem;
}

/* Alert Boxes */
.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background-color: var(--success-light);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-info {
    background-color: var(--info-light);
    color: var(--info);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.alert-warning {
    background-color: var(--warning-light);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Lógica Configuration Panel */
.config-card {
    border: 1px solid var(--border-color);
}

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

/* Ocultar elementos del hamburger (ya no se usan) */
.mobile-topbar, .mobile-overlay, .hamburger-btn { display: none !important; }

/* Sidebar siempre scrolleable cuando hay muchos items */
.sidebar {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

/* Tablas: siempre con scroll horizontal para columnas extra */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Laptop/Tablet grande (901px – 1200px): sidebar ligeramente más estrecho ── */
@media (max-width: 1200px) {
    .app-container {
        grid-template-columns: 220px 1fr;
    }
    .sidebar { width: 220px; padding: 1.25rem 1rem; }
    .main-content { padding: 1.5rem; }
    .metrics-grid { gap: 1rem; }
}

/* ── Tablet (601px – 900px): sidebar estrecho ── */
@media (max-width: 900px) {

    .app-container {
        grid-template-columns: 180px 1fr;
    }

    .sidebar {
        width: 180px;
        padding: 1rem 0.65rem;
        height: 100vh;
    }

    .sidebar-brand  { margin-bottom: 1.25rem; }
    .sidebar-logo-img { width: 120px; }

    .menu-item a {
        padding: 0.55rem 0.65rem;
        font-size: 0.8rem;
        gap: 0.45rem;
    }
    .menu-item svg { width: 18px; height: 18px; }

    .main-content {
        padding: 1rem;
        max-width: 100%;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
        margin-bottom: 1rem;
    }

    .header-title h1   { font-size: 1.25rem; }
    .date-badge        { display: none; }
    .header-actions    { width: 100%; flex-wrap: wrap; gap: 0.5rem; }
    .dashboard-split   { grid-template-columns: 1fr; }
    .metrics-grid      { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .form-grid         { grid-template-columns: 1fr; }
    .client-info-bar   { flex-direction: column; align-items: flex-start; }
    .filters-bar       { flex-direction: column; align-items: stretch; }
    .table-container   { font-size: 0.8rem; }
    .card              { padding: 1.1rem; }
    .modal-footer      { flex-wrap: wrap; }
    .modal-footer .btn { flex: 1; min-width: 100px; }

    td, th { padding: 0.55rem 0.65rem; }
}

/* ── Móvil (≤ 600px): sidebar de solo iconos ── */
@media (max-width: 600px) {

    .app-container {
        grid-template-columns: 50px 1fr;
    }

    .sidebar {
        width: 50px;
        padding: 0.85rem 0.3rem;
        align-items: center;
    }

    .brand-name, .brand-tag, .user-info,
    .menu-item a span { display: none; }

    .sidebar-logo-img {
        width: 30px;
        height: 30px;
        object-fit: contain;
    }

    .sidebar-brand {
        flex-direction: column;
        gap: 0;
        margin-bottom: 1.25rem;
        padding: 0;
        justify-content: center;
    }

    .brand-logo { width: 32px; height: 32px; font-size: 0.85rem; }

    .menu-item a {
        justify-content: center;
        padding: 0.65rem 0;
        gap: 0;
        border-radius: 10px;
    }

    .menu-item svg { width: 20px; height: 20px; }

    .sidebar-footer {
        flex-direction: column;
        gap: 0.3rem;
        padding-top: 0.65rem;
    }
    .user-avatar { width: 28px; height: 28px; font-size: 0.7rem; }

    /* Tooltip al hacer hover */
    .menu-item { position: relative; }
    .menu-item a::after {
        content: attr(data-label);
        position: absolute;
        left: 56px;
        top: 50%;
        transform: translateY(-50%);
        background: #1e293b;
        color: #fff;
        font-size: 0.72rem;
        font-weight: 600;
        padding: 0.25rem 0.55rem;
        border-radius: 6px;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.15s;
        z-index: 500;
        box-shadow: var(--shadow-md);
    }
    .menu-item a:hover::after { opacity: 1; }

    .main-content { padding: 0.65rem; }
    .card { padding: 0.9rem; border-radius: var(--radius-md); }

    .metrics-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 1rem; }
    .metric-data .value { font-size: 1.3rem; }
    .metric-data h3 { font-size: 0.75rem; }
    .metric-icon { width: 38px; height: 38px; }

    td, th { padding: 0.45rem 0.5rem; font-size: 0.74rem; white-space: nowrap; }
    .btn   { font-size: 0.78rem; padding: 0.55rem 0.8rem; }

    .header-title h1 { font-size: 1.1rem; }
    .header-title p  { font-size: 0.78rem; }

    .section-card-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .section-card-header h2 { font-size: 1rem; }

    .modal-container {
        max-height: 92vh;
        border-radius: var(--radius-md) var(--radius-md) 0 0;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        width: 100%; max-width: 100%;
    }
    .modal-overlay { align-items: flex-end; }

    .invoice-header       { flex-direction: column; gap: 0.5rem; }
    .invoice-header-right { text-align: left; }
    .invoice-grid         { grid-template-columns: 1fr; }

    /* Bulk bar en móvil */
    #lockers-bulk-bar { flex-direction: column; align-items: stretch; gap: 0.5rem; }
    #bulk-type-select { max-width: 100%; }
}

/* ── Teléfono pequeño (≤ 420px): ajustes finos ── */
@media (max-width: 420px) {

    .app-container { grid-template-columns: 44px 1fr; }
    .sidebar { width: 44px; padding: 0.75rem 0.2rem; }
    .sidebar-logo-img { width: 26px; height: 26px; }
    .menu-item svg { width: 18px; height: 18px; }
    .menu-item a { padding: 0.6rem 0; }

    .main-content { padding: 0.5rem; }
    .card { padding: 0.75rem; }

    .metrics-grid { grid-template-columns: 1fr; gap: 0.4rem; }
    .metric-card  { padding: 0.75rem; }
    .metric-data .value { font-size: 1.15rem; }

    .header-title h1 { font-size: 0.95rem; }
    .btn { font-size: 0.74rem; padding: 0.5rem 0.65rem; }

    td, th { padding: 0.4rem 0.45rem; font-size: 0.7rem; }
}

/* ==========================================================================
   Client Portal - Login & Timeline Styles
   ========================================================================== */

/* Login Wrapper & Card */
.login-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    background-color: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), #fb923c);
    border-radius: var(--radius-lg);
    color: white;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.75rem;
    margin-bottom: 1rem;
    box-shadow: 0 8px 16px rgba(249, 115, 22, 0.3);
}

.login-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.login-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Timeline Tracking Style */
.timeline-container {
    padding: 1.5rem 0.5rem;
    margin: 1.5rem 0;
    border-radius: var(--radius-md);
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
}

.timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-top: 1rem;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 10%;
    right: 10%;
    height: 3px;
    background-color: #cbd5e1;
    z-index: 1;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 20%;
    position: relative;
    z-index: 2;
    text-align: center;
}

.step-node {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 3px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    color: #64748b;
    transition: var(--transition);
}

.step-label {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    transition: var(--transition);
}

/* Timeline Active / Completed States */
.timeline-step.completed .step-node {
    background-color: var(--success-light);
    border-color: var(--success);
    color: var(--success);
}

.timeline-step.completed .step-label {
    color: var(--success);
}

.timeline-step.active .step-node {
    background-color: #ffffff;
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.timeline-step.active .step-label {
    color: var(--primary);
}

/* Client Top Bar Banner */
.client-info-bar {
    background-color: var(--primary-light);
    border: 1px solid rgba(249, 115, 22, 0.15);
    padding: 1rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.client-info-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.client-info-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: #7c2d12;
}

.client-info-code {
    background-color: var(--primary);
    color: white;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
}

/* ── 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:var(--border-color); border-radius:24px; transition:.25s;
}
.toggle-slider:before {
    content:''; position:absolute;
    height:18px; width:18px; left:3px; bottom:3px;
    background:#fff; border-radius:50%; transition:.25s;
}
.toggle-switch input:checked + .toggle-slider { background:var(--primary); }
.toggle-switch input:checked + .toggle-slider:before { transform:translateX(20px); }

/* ── Bodegas internacionales ───────────────────────────────────────────────── */
.bodega-filter-btn {
    padding: 0.4rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.bodega-filter-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.bodega-filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.bodega-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.2rem;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: box-shadow 0.2s;
}
.bodega-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.bodega-card.hidden { display: none; }

.bodega-card-header { display: flex; align-items: center; gap: 0.75rem; }
.bodega-flag { font-size: 2rem; line-height: 1; }
.bodega-title { font-size: 1rem; font-weight: 700; color: var(--text-primary, var(--text-main)); }
.bodega-subtitle { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.1rem; }

.bodega-address {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--text-muted);
    background: var(--bg-app);
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    white-space: pre-wrap;
    border: 1px solid var(--border-color);
}

.bodega-copy-btn {
    align-self: flex-start;
    padding: 0.35rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.bodega-copy-btn:hover { background: var(--primary); color: #fff; }
.bodega-copy-btn.copied { background: #22c55e; border-color: #22c55e; color: #fff; }

