/* ============================
   CTH Compras — Estilos v2.0
   ============================ */

:root {
    --primary: #0c84ff;
    --primary-dark: #0066cc;
    --primary-light: #e0f2fe;
    --accent: #7dd3fc;
    --bg-dark: #0f172a;
    --bg-surface: #f8fafc;
    --text-main: #334155;
    --text-light: #64748b;
    --text-dark: #1e293b;
    --border: #e2e8f0;
    --glass: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.12);
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.08);
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 24px;
    --radius-xl: 28px;
    --success: #16a34a;
    --success-bg: #f0fdf4;
    --warning: #f59e0b;
    --warning-bg: #fefce8;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Auth Loading Splash ─── */
.auth-loading-screen {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
.auth-loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.auth-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}
.auth-loading-logo {
    width: 120px;
    height: auto;
    opacity: 0.9;
    animation: authLogoPulse 1.8s ease-in-out infinite;
}
.auth-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(0,0,0,0.1);
    border-top-color: #0c84ff;
    border-radius: 50%;
    animation: authSpin 0.8s linear infinite;
}
@keyframes authSpin {
    to { transform: rotate(360deg); }
}
@keyframes authLogoPulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.06); }
}

/* ─── Login Screen ─── */
.app-container.visible {
    opacity: 1;
}

.login-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    transition: opacity 0.5s, visibility 0.5s;
}
.login-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.login-screen::before {
    content: '';
    position: absolute;
    top: 20%; left: 30%;
    width: 400px; height: 400px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0.15;
    filter: blur(80px);
    animation: pulseGlow 6s ease-in-out infinite alternate;
}
.login-screen::after {
    content: '';
    position: absolute;
    bottom: 20%; right: 20%;
    width: 300px; height: 300px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    opacity: 0.1;
    filter: blur(60px);
    animation: pulseGlow 8s ease-in-out 2s infinite alternate;
}
.login-card {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
    animation: fadeInScale 0.6s ease;
}
@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.login-logo {
    width: 90px;
    height: 90px;
    margin-bottom: 16px;
    border-radius: 20px;
    object-fit: contain;
    box-shadow: none;
}
.login-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 4px;
}
.login-subtitle {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 28px;
}
.login-info {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 20px;
}
.btn-google-login {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    background: #f1f5f9;
    color: #1e293b;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    width: 100%;
    justify-content: center;
}
.btn-google-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    background: #e2e8f0;
}
.btn-google-login:active {
    transform: translateY(0);
}
.btn-google-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.google-icon {
    flex-shrink: 0;
}
.login-error {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #dc2626;
    font-size: 0.85rem;
    line-height: 1.4;
}
.login-domains {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}
.login-domains p {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.login-domains span {
    display: inline-block;
    padding: 4px 10px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 0.78rem;
    font-weight: 500;
    border-radius: 6px;
    margin: 3px 2px;
}

/* ─── Avatar con foto ─── */
.avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(12, 132, 255, 0.25);
}

/* ─── Botón Logout ─── */
.btn-logout {
    background: none;
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.6;
}
.btn-logout:hover {
    opacity: 1;
    background: var(--danger-bg);
    border-color: var(--danger);
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f1f5f9;
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Background Glass */
.glass-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    z-index: -1;
}

.glass-bg::after {
    content: '';
    position: absolute;
    top: 20%; right: 10%;
    width: 300px; height: 300px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0.2;
    filter: blur(50px);
    animation: pulseGlow 6s ease-in-out infinite alternate;
}

.glass-bg::before {
    content: '';
    position: absolute;
    bottom: 15%; left: 5%;
    width: 250px; height: 250px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    opacity: 0.15;
    filter: blur(60px);
    animation: pulseGlow 8s ease-in-out 2s infinite alternate;
}

@keyframes pulseGlow {
    from { transform: scale(1); opacity: 0.15; }
    to { transform: scale(1.15); opacity: 0.25; }
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    padding: 20px;
    gap: 20px;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.app-container.visible {
    opacity: 1;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 28px; left: 20px;
    z-index: 1100;
    background: var(--primary);
    border: none;
    border-radius: 10px;
    width: 40px; height: 40px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: 0 4px 12px rgba(12, 132, 255, 0.3);
    transition: var(--transition);
}

.mobile-menu-toggle span {
    display: block;
    width: 20px; height: 2px;
    background: white;
    border-radius: 2px;
    transition: var(--transition);
}

.mobile-menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity var(--transition);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Sidebar */
.sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo img {
    height: 45px;
    width: 45px;
    object-fit: contain;
    border-radius: 12px;
}

.logo h2 {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--bg-dark);
    letter-spacing: -0.5px;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    background: transparent;
    border: none;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    text-align: left;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-item:hover {
    background: rgba(12, 132, 255, 0.08);
    color: var(--primary);
    transform: translateX(4px);
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(12, 132, 255, 0.35);
    transform: translateX(0);
}

.nav-item.active:hover {
    background: var(--primary-dark);
    color: white;
}

.nav-icon { font-size: 1.1rem; }

.sidebar-footer {
    font-size: 0.78rem;
    color: var(--text-light);
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Main Content */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.top-bar {
    height: 70px;
    min-height: 70px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: var(--shadow);
}

.top-bar h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.avatar {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(12, 132, 255, 0.25);
}

/* View Container */
.view-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.4s ease;
    padding-bottom: 20px;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.stat-card {
    background: white;
    padding: 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid transparent;
    text-align: center;
}


.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}
.stat-card-clickable {
    cursor: pointer;
}
.stat-card-clickable:active {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.stat-card-warning {
    border-color: #fcd34d;
    background: #fffbeb;
}
.stat-card-warning:hover {
    border-color: #f59e0b;
}

.stat-card h3 {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 10px;
    font-weight: 600;
}

.stat-card .value {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.stat-card .trend {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 8px;
    background: var(--bg-surface);
    display: inline-block;
}

.stat-card .trend.green { color: var(--success); background: var(--success-bg); }
.stat-card .trend.red { color: #e11d48; background: #ffe4e6; }
.stat-card .trend.yellow-badge { color: #92400e; background: #fef3c7; font-weight: 700; }
.stat-alert { font-size: 1.3rem; vertical-align: middle; margin-left: 4px; }

.stat-card.stat-card-inversion {
    background: #fff1f2;
    border: 1px solid #fecdd3;
}
.stat-card.stat-card-inversion h3 { color: #be123c; }
.stat-card.stat-card-inversion .value { color: #9f1239; }
.stat-card .trend.blue { color: var(--primary); background: var(--primary-light); }
.stat-card .trend.orange { color: var(--warning); background: var(--warning-bg); }

/* Stat Icon (enhanced dashboard) */
.stat-icon {
    font-size: 1.6rem;
    margin-bottom: 6px;
}

/* ─── Enhanced Dashboard Panels ─── */
.dash-panel {
    background: white;
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid transparent;
    transition: var(--transition);
}

.dash-panel:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.dash-panel-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.dash-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.dash-panel-header .dash-panel-title {
    margin-bottom: 0;
}

.dash-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.dash-empty {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    padding: 30px 0;
}

/* Small button (dashboard "Nueva") */
.btn-sm {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(12, 132, 255, 0.2);
}

.btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(12, 132, 255, 0.3);
}

/* ─── Monthly Chart ─── */
.month-chart {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 200px;
    padding-top: 10px;
}

.month-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    gap: 6px;
}

.month-bar-value {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-light);
    text-align: center;
    white-space: nowrap;
    min-height: 16px;
}

.month-bar-track {
    flex: 1;
    width: 100%;
    max-width: 52px;
    background: var(--bg-surface);
    border-radius: 8px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.month-bar-fill {
    width: 100%;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 8px;
    min-height: 4px;
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.month-bar-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: capitalize;
}

/* ─── Top Providers List ─── */
.top-prov-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.top-prov-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    border: 1px solid transparent;
}

.top-prov-item:hover {
    border-color: var(--primary-light);
    background: white;
}

.top-prov-rank {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
}

.top-prov-item:nth-child(1) .top-prov-rank {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.top-prov-item:nth-child(2) .top-prov-rank {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

.top-prov-item:nth-child(3) .top-prov-rank {
    background: linear-gradient(135deg, #c2884d 0%, #a16207 100%);
}

.top-prov-info {
    flex: 1;
    min-width: 0;
}

.top-prov-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-dark);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-prov-meta {
    font-size: 0.72rem;
    color: var(--text-light);
    display: block;
}

.top-prov-amount {
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--primary);
    white-space: nowrap;
}

/* ─── Sidebar Backup Buttons ─── */
.sidebar-backup-btns {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.sidebar-btn {
    flex: 1;
    background: rgba(12, 132, 255, 0.08);
    border: 1px solid rgba(12, 132, 255, 0.15);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

.sidebar-btn:hover {
    background: rgba(12, 132, 255, 0.15);
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* ─── History Search Bar ─── */
.history-search-bar {
    margin-bottom: 16px;
}

/* ─── Elegant Confirm Modal ─── */
.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: cmFadeIn 0.2s ease;
}

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

.confirm-modal {
    background: white;
    border-radius: var(--radius-md);
    padding: 36px 32px 28px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
    animation: cmSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.cm-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.cm-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.cm-message {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 24px;
}

.cm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.cm-btn {
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: inherit;
}

.cm-cancel {
    background: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.cm-cancel:hover {
    background: var(--border);
}

.cm-confirm.danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.cm-confirm.danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.cm-confirm.info {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(12, 132, 255, 0.3);
}

.cm-confirm.info:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(12, 132, 255, 0.4);
}

/* Recent Requests */
.recent-requests {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    flex: 1;
    box-shadow: var(--shadow-sm);
}

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

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

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
    cursor: default;
}

.recent-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.recent-item .ri-icon { font-size: 1.3rem; }
.recent-item .ri-info { flex: 1; }
.recent-item .ri-title { font-weight: 700; font-size: 0.9rem; color: var(--text-dark); margin-bottom: 2px; }
.recent-item .ri-desc { font-size: 0.78rem; color: var(--text-light); margin-bottom: 2px; }
.recent-item .ri-meta { font-size: 0.78rem; color: var(--text-light); }
.recent-item .ri-amount { font-weight: 800; font-size: 1rem; color: var(--primary); }
.recent-item .ri-amount.pending { color: var(--primary); }
.recent-item .ri-amount.approved { color: var(--success); }
.recent-item .ri-amount.sent { color: var(--warning); }
.recent-item .ri-amount.paid { color: #15803d; }
.recent-item .ri-amount.rejected { color: var(--danger); }

.recent-item .ri-status {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ri-status.pending { background: var(--primary-light); color: var(--primary); }
.ri-status.approved { background: var(--success-bg); color: var(--success); }
.ri-status.sent { background: var(--warning-bg); color: var(--warning); }
.ri-status.rejected { background: var(--danger-bg); color: var(--danger); }
.ri-status.in-payment { background: #eff6ff; color: #2563eb; }
.ri-status.paid { background: #f0fdf4; color: #15803d; }
.ri-status.delivered { background: #ecfdf5; color: #047857; }

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(12, 132, 255, 0.25);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(12, 132, 255, 0.35); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 2px solid var(--border);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.btn-secondary:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-secondary:active { transform: scale(0.97); }

.btn-text {
    background: transparent;
    border: none;
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    padding: 10px;
    font-size: 0.9rem;
    transition: var(--transition);
    font-family: inherit;
}

.btn-text:hover { color: var(--primary-dark); text-decoration: underline; }

.btn-icon { font-size: 0.9rem; }

.btn-danger {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: var(--transition);
    line-height: 1;
}

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

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-light);
    text-align: center;
}

.empty-icon { font-size: 4rem; margin-bottom: 20px; opacity: 0.5; }
.empty-sub { font-size: 0.9rem; margin-top: 10px; }

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 24px; right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 420px;
    animation: toastIn 0.4s ease, toastOut 0.4s ease 3.2s forwards;
    pointer-events: auto;
    border-left: 4px solid var(--primary);
}

.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.error { border-left-color: var(--danger); }

.toast-icon { font-size: 1.3rem; flex-shrink: 0; }
.toast-content { flex: 1; }
.toast-title { font-weight: 700; font-size: 0.9rem; color: var(--text-dark); margin-bottom: 2px; }
.toast-message { font-size: 0.8rem; color: var(--text-light); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(30px); }
}

/* Form Card & Sections */
.card-form {
    background: white;
    padding: 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.card-form.full-sheet { max-width: 1200px; }
.card-form.full-width  { max-width: 100%; }

/* ─── Encabezado Oficial Orden de Compra ─── */
.order-header-official {
    width: 100%;
    margin-bottom: 24px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--bg-surface);
    background: #fff;
}

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

@media (max-width: 768px) {
    .order-header-official {
        margin-bottom: 12px;
        border-radius: 8px;
    }
}

/* ─── Barra Título "ORDEN DE COMPRA N°." ─── */
.order-title-bar {
    text-align: center;
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #6b7280;
    padding: 14px 0;
    margin-bottom: 0;
    border-bottom: 2px solid #e5e7eb;
}

/* ─── Fila horizontal de metadatos ─── */
.order-meta-row {
    display: flex;
    align-items: stretch;
    border-bottom: 2px solid #e5e7eb;
    background: #f9fafb;
}

.order-meta-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 10px;
    border-right: 1px solid #e5e7eb;
}

.order-meta-item:last-child {
    border-right: none;
}

.meta-label {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #1e3a5f;
    margin-bottom: 6px;
}

.meta-input {
    width: 100%;
    max-width: 140px;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: var(--text-dark);
    background: #fff;
    transition: border-color 0.2s;
}

.meta-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.08);
}

select.meta-input {
    cursor: pointer;
    appearance: auto;
}

/* Selector de moneda — resalte visual */
select.currency-select {
    font-weight: 700;
    transition: border-color 0.2s, background-color 0.3s;
}
select.currency-select:focus {
    border-color: var(--primary);
}

@media (max-width: 768px) {
    .order-title-bar {
        font-size: 0.95rem;
        padding: 10px 0;
        letter-spacing: 1px;
    }

    .order-meta-row {
        flex-wrap: wrap;
    }

    .order-meta-item {
        flex: 1 1 calc(50% - 1px);
        min-width: 0;
        padding: 10px 8px;
        border-bottom: 1px solid #e5e7eb;
    }

    .order-meta-item:nth-child(even) {
        border-right: none;
    }

    .order-meta-item:last-child {
        flex: 1 1 100%;
        border-right: none;
        border-bottom: none;
    }
}

@media (max-width: 480px) {
    .order-meta-item {
        flex: 1 1 100%;
        border-right: none;
    }

    .meta-input {
        max-width: 100%;
    }
}

/* ─── Bloque FACTURAR A ─── */
.billing-info-box {
    margin-top: 0;
    margin-bottom: 28px;
    padding: 14px 24px;
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.billing-title {
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #1e3a5f;
    padding-bottom: 6px;
    margin-bottom: 8px;
    border-bottom: 1px solid #d1d5db;
}

.billing-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1px 28px;
    font-size: 0.76rem;
    color: var(--text-dark);
    line-height: 1.35;
}

.billing-details span {
    white-space: nowrap;
}

.billing-details strong {
    color: var(--text-dark);
    font-weight: 600;
}

.billing-note {
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px solid #e5e7eb;
    font-size: 0.74rem;
    color: #1e3a5f;
}

@media (max-width: 768px) {
    .billing-info-box {
        padding: 14px 16px;
    }

    .billing-details {
        flex-direction: column;
        gap: 4px;
    }

    .billing-details span {
        white-space: normal;
    }
}

.form-header-main {
    margin-top: 20px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--bg-surface);
    padding-bottom: 20px;
}

.form-header-main h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.form-header-main .subtitle { color: var(--text-light); font-size: 0.9rem; }

.sheet-section { margin-bottom: 36px; }
.sheet-section:first-of-type { margin-top: 20px; }

.section-title {
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Form Grid */
.form-row-grid { display: grid; gap: 20px; margin-bottom: 20px; }
.six-cols { grid-template-columns: repeat(6, 1fr); gap: 14px; }
.five-cols { grid-template-columns: repeat(5, 1fr); }
.four-cols { grid-template-columns: repeat(4, 1fr); }
.three-cols { grid-template-columns: repeat(3, 1fr); }
.two-cols { grid-template-columns: repeat(2, 1fr); }

/* Fields */
.field-group { display: flex; flex-direction: column; }

.field-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.field-group input,
.field-group select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
    background: white;
    color: var(--text-dark);
}

.field-group input::placeholder { color: #cbd5e1; }

.field-group input:focus,
.field-group select:focus {
    border-color: var(--primary);
    background: #fafcff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(12, 132, 255, 0.08);
}

.field-group input.error,
.field-group select.error { border-color: var(--danger); background: var(--danger-bg); }

.field-group .field-error { font-size: 0.75rem; color: var(--danger); margin-top: 4px; display: none; }
.field-group .field-error.visible { display: block; }

.input-with-icon { position: relative; }
.input-with-icon input { padding-right: 40px; }

.dropdown-icon {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    width: 20px; height: 20px;
    color: #94a3b8;
    pointer-events: auto;
    cursor: pointer;
    transition: var(--transition);
}

.dropdown-icon:hover { color: var(--primary); }

/* Autocomplete */
.custom-autocomplete { position: relative; }

.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0; right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    max-height: 260px;
    overflow-y: auto;
    z-index: 1000;
}

.autocomplete-dropdown.hidden { display: none; }

.dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--bg-surface);
    transition: var(--transition);
}

.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { background: #f0f7ff; padding-left: 20px; }
.dropdown-item.empty { color: #94a3b8; font-style: italic; cursor: default; }
.dropdown-item.empty:hover { background: white; padding-left: 16px; }
.dropdown-item .prov-name { font-weight: 600; color: var(--text-dark); margin-bottom: 3px; font-size: 0.88rem; }
.dropdown-item .prov-nit { font-size: 0.75rem; color: var(--text-light); font-weight: 500; }

.dropdown-item .highlight {
    color: var(--primary);
    font-weight: 900;
    background: var(--primary-light);
    padding: 1px 4px;
    border-radius: 4px;
}

/* Items Table */
.table-scroll {
    overflow-x: auto;
    margin-bottom: 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.items-table-sheet { width: 100%; border-collapse: collapse; background: white; }

.items-table-sheet th {
    background: var(--bg-surface);
    padding: 14px 16px;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text-light);
    border-bottom: 2px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.items-table-sheet td {
    padding: 8px 12px;
    border-bottom: 1px solid #f8fafc;
    vertical-align: middle;
}

.items-table-sheet tbody tr:hover { background: #fafcff; }

.sheet-input-cell {
    width: 100%;
    border: none;
    padding: 10px 8px;
    outline: none;
    background: transparent;
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
    border-radius: 8px;
}

.sheet-input-cell:focus { background: var(--bg-surface); }
.sheet-input-cell.price-input { text-align: right; }
.cell-total { font-weight: 700; color: var(--primary); text-align: right; white-space: nowrap; }
.row-actions { text-align: center; }

/* Sheet Footer */
.sheet-footer {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 40px;
    margin-top: 30px;
}

.observations-box label { display: block; font-weight: 700; margin-bottom: 10px; color: #475569; font-size: 0.85rem; }

.observations-box textarea {
    width: 100%;
    height: 110px;
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: none;
    outline: none;
    transition: var(--transition);
}

.observations-box textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(12, 132, 255, 0.08); }

.totals-panel {
    background: var(--bg-surface);
    padding: 25px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    align-self: start;
}

/* Totals table layout — professional invoice style */
.totals-table .total-row {
    display: grid;
    grid-template-columns: 1fr 24px 140px;
    align-items: center;
    gap: 0;
    margin-bottom: 0;
    padding: 10px 16px;
    font-size: 0.92rem;
    border-bottom: 1px solid var(--border);
}
.totals-table .total-row:last-child { border-bottom: none; }

.total-label {
    text-align: right;
    font-weight: 600;
    color: var(--text-dark);
    padding-right: 12px;
    white-space: nowrap;
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.total-currency {
    font-weight: 500;
    color: var(--text-muted, #8893a7);
    text-align: right;
    padding-right: 6px;
    font-size: 0.82rem;
}

.total-value {
    text-align: right;
    font-weight: 600;
    color: var(--text-dark);
    font-variant-numeric: tabular-nums;
    font-size: 0.93rem;
}

.total-input {
    text-align: right;
    font-weight: 500;
    color: var(--text-dark);
    width: 100%;
    font-variant-numeric: tabular-nums;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.92rem;
    font-family: inherit;
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.total-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(12, 132, 255, 0.08); }

/* IVA input wrapper con botón de recalcular */
.iva-input-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}
.iva-input-wrap .total-input {
    flex: 1;
    min-width: 0;
}
.btn-recalc-iva {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--primary);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s, transform 0.25s;
    padding: 0;
    line-height: 1;
}
.btn-recalc-iva:hover {
    background: rgba(12, 132, 255, 0.08);
    border-color: var(--primary);
    transform: rotate(180deg);
}
.btn-recalc-iva:active {
    transform: rotate(360deg);
}

.totals-table .subtotal-neto {
    background: rgba(0,0,0,0.02);
}

.totals-table .grand-total {
    border-top: 2px solid var(--text-dark);
    border-bottom: none;
    margin-top: 0;
    padding-top: 14px;
    padding-bottom: 14px;
    background: var(--bg-surface);
}
.totals-table .grand-total .total-label { font-weight: 700; font-size: 1rem; }
.totals-table .grand-total .total-currency { font-weight: 700; font-size: 1.05rem; color: var(--text-dark); }
.totals-table .grand-total .total-value { font-size: 1.15rem; color: var(--primary); font-weight: 700; }

.total-row { display: flex; justify-content: space-between; margin-bottom: 14px; font-size: 0.95rem; align-items: center; }
.total-row span { color: var(--text-light); font-weight: 500; }
.total-row strong { color: var(--text-dark); }
.total-row.grand-total { border-top: 2px solid var(--border); margin-top: 14px; padding-top: 14px; }
.grand-total strong { font-size: 1.4rem; color: var(--primary); }

/* Form Actions */
.form-actions-footer {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 30px;
    padding-top: 24px;
    border-top: 2px solid var(--bg-surface);
}

/* Quotes */
.quotes-uploader-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 12px;
}

.quote-single-upload {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}
.quote-single-upload .quote-card {
    width: 100%;
    max-width: 420px;
}

.quotes-caption {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0 0 32px;
    font-style: italic;
    letter-spacing: 0.2px;
}

.quote-card {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
    background: #fbfcfe;
    overflow: hidden;
}

.quote-card:hover { border-color: var(--primary); background: #f0f7ff; transform: translateY(-3px); }

.quote-header {
    padding: 14px;
    text-align: center;
    font-weight: 800;
    color: var(--text-dark);
    font-size: 0.9rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}

.drop-zone {
    height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-align: center;
    padding: 20px;
    transition: var(--transition);
}

.drop-zone p { font-size: 0.85rem; color: var(--text-light); font-weight: 500; }
.drop-zone.uploaded { border: none; background: var(--success-bg); height: 100px; }
.drop-icon { font-size: 2.5rem; margin-bottom: 10px; }

/* History View */
.history-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid var(--border);
    background: white;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.filter-chip:hover,
.filter-chip.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.history-table { width: 100%; border-collapse: collapse; }

.history-table th {
    text-align: left;
    padding: 14px 16px;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-surface);
    border-bottom: 2px solid var(--border);
}

.history-table td {
    padding: 14px 16px;
    font-size: 0.88rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-main);
}

.history-table tbody tr { transition: var(--transition); }
.history-table tbody tr:hover { background: #fafcff; }

/* Descripción de ítems en la columna de proveedor */
.cell-provider-name { font-weight: 600; color: var(--text-dark); }
.cell-items-desc {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 2px;
    white-space: normal;
    word-break: break-word;
}
.cell-obs-desc {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 3px;
    white-space: normal;
    word-break: break-word;
}
/* Botón eliminar en tabla */
.cell-delete { text-align: center; padding: 0 4px !important; }
.cell-delete .ri-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #94a3b8;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.15s;
    line-height: 1;
}
.cell-delete .ri-delete:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

.status-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.pending { background: var(--primary-light); color: var(--primary); }
.status-badge.approved { background: var(--success-bg); color: var(--success); }
.status-badge.sent { background: var(--warning-bg); color: var(--warning); }
.status-badge.rejected { background: var(--danger-bg); color: var(--danger); }
.status-badge.in-payment { background: #eff6ff; color: #2563eb; }
.status-badge.paid { background: #f0fdf4; color: #15803d; }
.status-badge.voucher { background: #f0fdf4; color: #15803d; }
.status-badge.delivered { background: #ecfdf5; color: #047857; }
.status-badge.anulada { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; text-decoration: line-through; }
.status-badge.revision { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }
.status-badge.revision-correccion { background: #f59e0b; color: #fff; border: 1px solid #d97706; font-weight: 700; }

/* ─── Anulada Banner ─── */
.anulada-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 16px;
}
.anulada-banner-icon { font-size: 1.5rem; line-height: 1; }
.anulada-banner-info { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: #7f1d1d; }
.anulada-banner-info strong { font-size: 14px; color: #991b1b; }

/* ─── Banner de Corrección Solicitada ─── */
.correccion-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fffbeb;
    border: 1.5px solid #fbbf24;
    border-left: 4px solid #f59e0b;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 16px;
}
.correccion-banner-icon { font-size: 1.5rem; line-height: 1; flex-shrink: 0; }
.correccion-banner-info { display: flex; flex-direction: column; gap: 5px; }
.correccion-banner-info strong { font-size: 14px; color: #92400e; }
.correccion-motivo {
    font-size: 0.875rem;
    color: #78350f;
    background: #fef3c7;
    border-radius: 7px;
    padding: 8px 12px;
    white-space: pre-wrap;
    line-height: 1.5;
    border: 1px solid #fde68a;
}
.correccion-meta { font-size: 0.75rem; color: #92400e; opacity: 0.75; }

/* ─── Botón Revisión de Factura ─── */
.btn-revision {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fcd34d;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-revision:hover {
    background: #fef3c7;
    color: #78350f;
    border-color: #f59e0b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

/* ─── Botón Solicitar Corrección ─── */
.btn-solicitar-correccion {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fdba74;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-solicitar-correccion:hover {
    background: #ffedd5;
    color: #9a3412;
    border-color: #fb923c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.2);
}

/* Animación pulso para paso activo en revisión */
@keyframes pulse-revision {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.5); }
    50% { transform: scale(1.12); box-shadow: 0 0 0 8px rgba(217, 119, 6, 0); }
}
.step-dot-revision {
    animation: pulse-revision 1.4s ease-in-out infinite;
}

/* ─── Botón Anular ─── */
.btn-anular {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-anular:hover {
    background: #fee2e2;
    color: #7f1d1d;
    border-color: #f87171;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-edit-order {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-edit-order:hover {
    background: #dbeafe;
    color: #1e3a8a;
    border-color: #60a5fa;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

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

.animate-in { animation: fadeIn 0.4s ease both; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.2s; }

/* Responsive — Tablet */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .dash-row { grid-template-columns: 1fr; }
    .six-cols { grid-template-columns: repeat(3, 1fr); }
    .five-cols { grid-template-columns: repeat(3, 1fr); }
    .three-cols { grid-template-columns: repeat(2, 1fr); }
    .four-cols { grid-template-columns: repeat(2, 1fr); }
    .sheet-footer { grid-template-columns: 1fr; }
    .quotes-uploader-grid { grid-template-columns: repeat(2, 1fr); }
    .card-form { padding: 30px 24px; }
}

/* Responsive — Mobile */
@media (max-width: 768px) {
    .app-container { padding: 12px; gap: 12px; }
    .mobile-menu-toggle { display: flex; }

    .sidebar {
        position: fixed;
        top: 0; left: 0;
        height: 100vh;
        z-index: 1000;
        border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
        transform: translateX(-100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar.open { transform: translateX(0); }

    .top-bar {
        padding: 0 16px 0 65px;
        height: 60px;
        min-height: 60px;
        border-radius: 16px;
    }

    .top-bar h1 { font-size: 1rem; }
    .user-name { display: none; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .stat-card { padding: 16px 12px; }
    .stat-card .value { font-size: 1.5rem; }
    .dash-row { grid-template-columns: 1fr; gap: 14px; }
    .dash-panel { padding: 20px 16px; }
    .month-chart { height: 160px; gap: 8px; }
    .month-bar-value { font-size: 0.58rem; }
    .recent-requests { padding: 20px 16px; }
    .section-header { flex-direction: column; align-items: flex-start; }

    .two-cols,
    .three-cols,
    .four-cols,
    .five-cols,
    .six-cols { grid-template-columns: 1fr; }

    .card-form { padding: 24px 16px; border-radius: var(--radius-md); }
    .sheet-footer { grid-template-columns: 1fr; gap: 24px; }
    .quotes-uploader-grid { grid-template-columns: 1fr; }
    .form-actions-footer { flex-direction: column; }
    .form-actions-footer button { width: 100%; justify-content: center; }
    .history-table { font-size: 0.8rem; }
    .history-table th, .history-table td { padding: 10px 8px; }
    /* Ocultar columna Sede en tablet */
    .history-table .col-sede { display: none; }
    .toast { min-width: unset; max-width: calc(100vw - 48px); }
    .toast-container { right: 12px; left: 12px; }
}

@media (max-width: 480px) {
    .app-container { padding: 8px; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat-card { padding: 14px 10px; }
    .stat-card h3 { font-size: 0.8rem; }
    .stat-card .value { font-size: 1.35rem; }
    .stat-card .trend { font-size: 0.72rem; padding: 4px 8px; }
    .items-table-sheet th, .items-table-sheet td { padding: 8px 6px; font-size: 0.82rem; }
    .grand-total strong { font-size: 1.2rem; }
    .signature-row { flex-direction: column; gap: 32px; }
    .order-contact-info { padding: 14px; }
    .order-contact-info .contact-line { font-size: 0.75rem; }

    /* Tabla historial: ocultar fecha y sede, solo N°, Proveedor, Total, Estado */
    .history-table { font-size: 0.78rem; }
    .history-table th, .history-table td { padding: 8px 6px; }
    .history-table .col-fecha,
    .history-table .col-sede { display: none; }

    /* Barra de aprobación masiva en columna */
    .bulk-approve-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 14px;
    }
    .bulk-approve-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 360px) {
    .stats-grid { grid-template-columns: 1fr; }
}

/* ============================
   Pie de Página — Firmas y Contacto
   ============================ */
.order-signatures {
    margin-top: 40px;
    padding: 0 10px;
}

.signature-row {
    display: flex;
    justify-content: space-between;
    gap: 60px;
    margin-top: 50px;
}

.signature-row.single {
    justify-content: center;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.signature-block {
    flex: 1;
    text-align: center;
}

.signature-line {
    display: none;
}

.signature-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Signature Pad ─── */
.signature-pad-wrap {
    position: relative;
    width: 100%;
    height: 100px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    cursor: crosshair;
    margin-bottom: 8px;
    transition: border-color var(--transition);
}

.signature-pad-wrap:hover {
    border-color: #94a3b8;
}

.signature-canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

.sig-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #94a3b8;
    font-size: 0.85rem;
    font-style: italic;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sig-clear-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-radius: 6px;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    z-index: 2;
}

.signature-pad-wrap:hover .sig-clear-btn,
.sig-clear-btn:focus {
    opacity: 1;
}

.sig-clear-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ─── Firma de Aprobación — Tabs Digital/Manual ─── */
.sig-approval-options {
    width: 100%;
}

.sig-option-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 4px;
}

.sig-tab {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.25s ease;
}

.sig-tab:hover {
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-main);
}

.sig-tab.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sig-mode-panel {
    animation: fadeInSig 0.25s ease;
}

.sig-mode-panel.active {
    display: block;
}

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

.sig-digital-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border: 2px dashed var(--border);
    border-radius: 12px;
    background: #fafbfc;
    min-height: 120px;
    transition: border-color 0.2s;
}

.sig-digital-preview:hover {
    border-color: var(--primary);
}

.sig-digital-img {
    max-height: 90px;
    max-width: 100%;
    object-fit: contain;
}

.sig-digital-name {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
    text-align: center;
}

.sig-not-authorized {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    padding: 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    text-align: center;
}

.sig-not-authorized p {
    color: #b91c1c;
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0;
}

/* ─── Selector de firma digital (admin con múltiples firmas) ─── */
.sig-digital-selector {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.sig-digital-option {
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 10px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: #fafbfc;
    cursor: pointer;
    transition: all 0.25s ease;
}

.sig-digital-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.sig-digital-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(12, 132, 255, 0.15);
}

.sig-digital-img-sm {
    max-height: 70px;
    max-width: 100%;
    object-fit: contain;
    margin-bottom: 6px;
}

/* ─── Aprobación Masiva — Barra y Modal ─── */
.bulk-approve-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #0c84ff, #0066cc);
    color: #fff;
    padding: 10px 18px;
    border-radius: 12px;
    margin-bottom: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    animation: slideDown 0.25s ease;
    box-shadow: 0 4px 16px rgba(12, 132, 255, 0.25);
}

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

.bulk-approve-actions {
    display: flex;
    gap: 8px;
}

.bulk-approve-bar .btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.bulk-approve-bar .btn-secondary.btn-sm {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.bulk-approve-bar .btn-secondary.btn-sm:hover {
    background: rgba(255, 255, 255, 0.35);
}

.bulk-approve-bar .btn-success.btn-sm {
    background: #16a34a;
    color: #fff;
}

.bulk-approve-bar .btn-success.btn-sm:hover {
    background: #15803d;
}

.cell-checkbox {
    text-align: center;
    width: 40px;
}

.cell-checkbox input[type="checkbox"],
#bulk-select-all {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.bulk-approve-modal {
    max-width: 520px;
    width: 90vw;
}

.bulk-orders-list {
    max-height: 160px;
    overflow-y: auto;
    margin: 12px 0;
    padding: 8px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.bulk-order-item {
    padding: 6px 8px;
    font-size: 0.82rem;
    color: var(--text-main);
    border-bottom: 1px solid #f1f5f9;
}

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

.bulk-sig-section {
    margin: 16px 0 12px;
    text-align: left;
}

/* ─── Clickable Items ─── */
.recent-item.clickable { cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.recent-item.clickable:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(12, 132, 255, 0.1); }

.ri-delete {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #cbd5e1;
    font-size: 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.ri-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

tr.clickable { cursor: pointer; transition: background 0.15s ease; }
tr.clickable:hover { background: var(--primary-light) !important; }

/* ─── Order Detail View ─── */
.detail-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    margin-bottom: 28px;
    border: 1px solid var(--border);
}

.detail-order-id { display: flex; flex-direction: column; gap: 2px; }
.detail-order-id .detail-label { font-size: 0.75rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 1px; }
.detail-order-id strong { font-size: 1.3rem; color: var(--text-dark); }

.status-badge.large {
    font-size: 0.85rem;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 700;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.detail-section {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
}

.detail-section.full-width {
    margin-bottom: 28px;
}

.detail-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.detail-fields { display: flex; flex-direction: column; gap: 8px; }
.detail-field { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.df-label { font-size: 0.8rem; color: var(--text-light); font-weight: 500; }
.df-value { font-size: 0.8rem; color: var(--text-dark); font-weight: 600; text-align: right; }

.detail-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.detail-items-table th {
    background: var(--bg-dark);
    color: #fff;
    padding: 10px 14px;
    font-weight: 600;
    text-align: left;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.detail-items-table th:first-child { border-radius: 10px 0 0 0; }
.detail-items-table th:last-child { border-radius: 0 10px 0 0; text-align: right; }
.detail-items-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}
.detail-items-table td:last-child { text-align: right; }
.detail-items-table td:first-child { text-align: center; color: var(--text-light); }
.detail-no-items { color: var(--text-light); font-style: italic; padding: 16px 0; }

.detail-totals-row {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 30px;
    margin-bottom: 28px;
}

.detail-obs { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 20px; }
.detail-obs p { font-size: 0.85rem; color: var(--text-main); line-height: 1.6; margin-top: 4px; }

.detail-totals-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
}
.dt-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.85rem; color: var(--text-main); }
.dt-row.grand { border-top: 2px solid var(--primary); margin-top: 8px; padding-top: 12px; }
.dt-row.grand span { font-weight: 800; color: var(--text-dark); }
.dt-row.grand strong { color: var(--primary); font-size: 1.1rem; }

/* Cotización link sutil en detalle */
.detail-quote-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(12,132,255,0.06);
    border: 1px solid rgba(12,132,255,0.15);
    border-radius: 10px;
    margin-bottom: 20px;
}
.dql-icon { font-size: 1.1rem; }
.dql-text {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s;
}
.dql-text:hover { color: #3b82f6; text-decoration: underline; }
.dql-filename {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Quote Preview Modal */
.quote-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}
.quote-modal {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.qm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
}
.qm-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #64748b;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}
.qm-close:hover { background: #e2e8f0; color: #1e293b; }
.qm-body {
    padding: 20px;
    overflow: auto;
    max-height: calc(90vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
}

.detail-signatures {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 28px;
    align-items: stretch;
}

.detail-sig-block {
    flex: 1;
    text-align: center;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sig-preview-img {
    max-width: 180px;
    height: 70px;
    object-fit: contain;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.sig-empty {
    color: var(--text-light);
    font-style: italic;
    font-size: 0.82rem;
    padding: 20px 0;
}

.detail-actions { margin-top: 10px; }

.btn-success {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--success);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}
.btn-success:hover { background: #15803d; transform: translateY(-1px); }
.btn-success:active { transform: translateY(0); }

.btn-pdf {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #a11b1b 0%, #d42b2b 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}
.btn-pdf:hover { background: linear-gradient(135deg, #8a1515 0%, #b52222 100%); transform: translateY(-1px); }
.btn-pdf:active { transform: translateY(0); }

.btn-print {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #475569 0%, #64748b 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}
.btn-print:hover { background: linear-gradient(135deg, #334155 0%, #475569 100%); transform: translateY(-1px); }
.btn-print:active { transform: translateY(0); }

.btn-excel {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
    flex-shrink: 0;
}
.btn-excel:hover { background: linear-gradient(135deg, #15803d 0%, #16a34a 100%); transform: translateY(-1px); }
.btn-excel:active { transform: translateY(0); }

.history-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-send {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.btn-send:hover { background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%); transform: translateY(-1px); }
.btn-send:active { transform: translateY(0); }

@media (max-width: 900px) {
    .detail-grid { grid-template-columns: 1fr; }
    .detail-totals-row { grid-template-columns: 1fr; }
    .detail-signatures { flex-direction: column; gap: 16px; }
}

.order-contact-info {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f1f5f9 0%, #f8fafc 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: left;
}

/* ─── Nota de política de cotizaciones ─── */
.order-policy-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 16px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-left: 4px solid #0c84ff;
    border-radius: var(--radius-sm);
}

.policy-note-icon {
    font-size: 1.3rem;
    margin: 0;
    flex-shrink: 0;
    line-height: 1.4;
}

.policy-note-text {
    flex: 1;
}

.policy-note-text p {
    font-size: 0.82rem;
    color: #334155;
    margin: 0 0 4px 0;
    line-height: 1.6;
}

.policy-note-text p:last-child {
    margin-bottom: 0;
}

.policy-note-text strong {
    color: #0c84ff;
    font-weight: 700;
}

.order-contact-info .contact-title {
    font-size: 0.85rem;
    color: #1e293b;
    margin-bottom: 10px;
    font-weight: 500;
}

.order-contact-info .contact-line {
    font-size: 0.8rem;
    color: #334155;
    margin-bottom: 3px;
    line-height: 1.7;
}

.order-contact-info .contact-line strong {
    color: #1e293b;
    font-weight: 700;
}

/* ─── PDF Capture Mode: fuerza fondos sólidos ─── */
.pdf-capture-mode {
    background: #ffffff !important;
    color: #1e293b !important;
    box-shadow: none !important;
    border: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.pdf-capture-mode * {
    color: #1e293b !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

.pdf-capture-mode .detail-section,
.pdf-capture-mode .detail-sig-block,
.pdf-capture-mode .detail-obs,
.pdf-capture-mode .detail-totals-panel {
    background: #f8fafc !important;
    border-color: #d1d5db !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

.pdf-capture-mode .detail-section-title {
    color: #1e293b !important;
    border-bottom-color: #d1d5db !important;
}

.pdf-capture-mode .df-label { color: #64748b !important; }
.pdf-capture-mode .df-value { color: #1e293b !important; }

.pdf-capture-mode .detail-items-table th {
    background: #1e293b !important;
    color: #ffffff !important;
}

.pdf-capture-mode .detail-items-table td {
    color: #1e293b !important;
    border-color: #d1d5db !important;
}

.pdf-capture-mode .dt-row span,
.pdf-capture-mode .dt-row strong {
    color: #1e293b !important;
}

.pdf-capture-mode .dt-row.grand strong {
    color: #0c84ff !important;
}

.pdf-capture-mode .signature-label {
    color: #1e293b !important;
}

.pdf-capture-mode .sig-preview-img {
    border-bottom-color: #1e293b !important;
}

.pdf-capture-mode .order-header-img {
    opacity: 1 !important;
}

/* ─── Admin Users View ─── */
.admin-users-view { padding: 4px 0; }
.admin-users-header { margin-bottom: 20px; }
.admin-users-subtitle { color: var(--text-light); font-size: 0.9rem; }
.admin-roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}
.admin-role-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow-sm);
}
.admin-role-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}
.admin-role-title { font-size: 1rem; font-weight: 700; color: var(--text-dark); margin: 0 0 4px; }
.admin-role-desc { font-size: 0.8rem; color: var(--text-light); margin: 0; }
.admin-role-count {
    background: var(--primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}
.admin-email-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
}
.admin-email-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 10px;
    gap: 8px;
}
.admin-email-text { font-size: 0.82rem; color: var(--text-main); word-break: break-all; }
.admin-email-empty { font-size: 0.82rem; color: var(--text-light); font-style: italic; padding: 6px 0; }
.admin-email-remove {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 5px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: background 0.2s;
}
.admin-email-remove:hover { background: var(--danger-bg); }
.admin-add-row {
    display: flex;
    gap: 8px;
}
.admin-email-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    background: white;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s;
}
.admin-email-input:focus { border-color: var(--primary); }
.admin-add-btn { padding: 8px 14px; font-size: 0.85rem; white-space: nowrap; }
.admin-save-status {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
}
.admin-save-status.success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.admin-save-status.error { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }

/* ─── Providers Management ─── */
.providers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.providers-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}
.providers-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 4px 0 0;
}
.providers-search-bar {
    margin-bottom: 16px;
}
.providers-search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: white;
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    box-shadow: var(--shadow-sm);
}
.providers-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(12, 132, 255, 0.12);
}
.providers-search-input::placeholder {
    color: var(--text-light);
}
.providers-table-wrap {
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
}
.providers-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.providers-table thead {
    background: rgba(12,132,255,0.15);
}
.providers-table th {
    padding: 9px 10px;
    text-align: left;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    border-bottom: 2px solid rgba(12,132,255,0.2);
    white-space: nowrap;
    overflow: hidden;
}
/* Column widths — total = 100% */
.providers-table th:nth-child(1) { width: 26%; } /* Nombre */
.providers-table th:nth-child(2) { width: 13%; } /* NIT */
.providers-table th:nth-child(3) { width: 10%; } /* Teléfono */
.providers-table th:nth-child(4) { width: 19%; } /* Correo */
.providers-table th:nth-child(5) { width: 14%; } /* Contacto */
.providers-table th:nth-child(6) { width: 6%;  } /* RUT */
.providers-table th:nth-child(7) { width: 7%;  } /* Cert. Bancaria */
.providers-table th:nth-child(8) { width: 5%;  } /* Acciones */
.providers-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    color: var(--text-primary);
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.providers-table tbody tr {
    transition: background 0.15s;
}
.providers-table tbody tr:hover {
    background: rgba(12,132,255,0.06);
}
.prov-cell-name {
    font-weight: 600;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.prov-cell-email {
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.prov-cell-actions {
    text-align: center;
    white-space: nowrap;
    overflow: visible;
}
.prov-btn-edit,
.prov-btn-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.88rem;
    padding: 3px 4px;
    border-radius: 5px;
    transition: background 0.15s;
}
.prov-btn-edit:hover {
    background: rgba(59,130,246,0.15);
}
.prov-btn-delete:hover {
    background: rgba(239,68,68,0.15);
}

/* Provider doc buttons in table */
.prov-doc-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.15s;
}
.prov-doc-btn.has-doc:hover {
    background: var(--primary-light);
    transform: scale(1.15);
}
.prov-doc-empty {
    color: #cbd5e1;
    font-size: 0.85rem;
}

/* Provider doc upload in form */
.prov-doc-upload-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.prov-upload-btn {
    background: var(--primary-light);
    color: var(--primary-dark);
    border: 1px dashed var(--primary);
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.15s;
}
.prov-upload-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.prov-doc-status {
    font-size: 0.78rem;
    color: var(--text-light);
}
.prov-doc-view-btn {
    background: none;
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--primary);
    font-weight: 600;
    transition: all 0.15s;
}
.prov-doc-view-btn:hover {
    background: var(--primary-light);
}
.prov-doc-remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 0.9rem;
    padding: 2px 6px;
    border-radius: 6px;
    transition: all 0.15s;
}
.prov-doc-remove-btn:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

/* Provider Form */
.prov-form-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 20px;
}
.prov-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.prov-form-grid .full-span {
    grid-column: 1 / -1;
}
.prov-form-grid .field-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.prov-form-grid .field-group input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.prov-form-grid .field-group input:focus {
    border-color: var(--accent);
}
.prov-form-grid .field-group input::placeholder {
    color: var(--text-muted, #64748b);
}

@media (max-width: 700px) {
    .prov-form-grid { grid-template-columns: 1fr; }
    .providers-table { font-size: 0.75rem; }
    .providers-table th, .providers-table td { padding: 6px 7px; }
}

/* ============================
   Workflow Visual Track
   ============================ */
.order-workflow {
    margin: 24px 0;
    padding: 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.order-workflow .detail-section-title { margin-bottom: 16px; }
.workflow-track {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
}
.workflow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 0.35;
    transition: all 0.3s ease;
    width: 90px;
}
.workflow-step.active { opacity: 1; }
.workflow-step.rejected .step-dot { background: var(--danger); }
.step-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #cbd5e1;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}
.workflow-step.active .step-dot {
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(12, 132, 255, 0.2);
}
/* Paso final Comprobante en verde */
.workflow-step:last-child.active .step-dot {
    background: #15803d;
    box-shadow: 0 0 0 4px rgba(21, 128, 61, 0.2);
}
.workflow-step:last-child.active span { color: #15803d; }
.workflow-step span {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-light);
    text-align: center;
    max-width: 80px;
    min-height: 2.4em;
    line-height: 1.2;
}
.workflow-step.active span { color: var(--text-dark); }
.workflow-step .step-date {
    font-size: 0.62rem;
    font-weight: 400;
    color: #94a3b8;
    text-align: center;
    max-width: 80px;
    min-height: 2.4em;
    line-height: 1.2;
    display: block;
}
.workflow-step.active .step-date { color: #64748b; }
.workflow-line {
    width: 40px;
    height: 3px;
    background: #e2e8f0;
    border-radius: 2px;
    margin: 0 4px;
    margin-top: 17px;
    flex-shrink: 0;
    transition: background 0.3s ease;
}
.workflow-line.active { background: var(--primary); }

@media (max-width: 600px) {
    /* Workflow vertical en móvil */
    .workflow-track {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding-left: 8px;
    }
    .workflow-step {
        flex-direction: row;
        align-items: center;
        width: 100%;
        gap: 12px;
        padding: 4px 0;
    }
    .workflow-step span {
        font-size: 0.8rem;
        max-width: none;
        text-align: left;
        min-height: unset;
    }
    .workflow-step .step-date {
        font-size: 0.68rem;
        text-align: left;
        max-width: none;
        min-height: unset;
        margin-left: auto;
        flex-shrink: 0;
    }
    .step-dot {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
        flex-shrink: 0;
    }
    .workflow-line {
        width: 3px;
        height: 18px;
        margin: 0;
        margin-left: 14.5px;
        flex-shrink: 0;
    }
    .order-workflow {
        padding: 16px;
    }
}

/* ============================
   Payment Tracker (pagos parciales)
   ============================ */
.payment-tracker-section {
    margin: 24px 0;
    padding: 20px 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.payment-progress-text {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 8px;
}
.payment-progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 18px;
}
.payment-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 4px;
    transition: width 0.5s ease;
}
.payment-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.payment-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}
.payment-item.payment-paid {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.payment-item.payment-pending {
    background: #fffbeb;
    border-color: #fde68a;
}
.payment-item-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}
.payment-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.payment-item-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-dark);
}
.payment-item-amount {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
}
.payment-item-date {
    font-size: 0.75rem;
    color: var(--text-light);
}
.payment-item-action {
    flex-shrink: 0;
}
.btn-recibido-satisfaccion {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #86efac;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-recibido-satisfaccion:hover {
    background: #bbf7d0;
    color: #15803d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.2);
}
.btn-mark-payment {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-mark-payment:hover {
    background: #fde68a;
    color: #b45309;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
}
.btn-notify-payment {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-notify-payment:hover {
    background: #dbeafe;
    color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* ─── Botones de conformidad ─── */
.btn-conformidad-upload {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f59e0b;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}
.btn-conformidad-upload:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}
.btn-conformidad-approve {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}
.btn-conformidad-approve:hover {
    background: #15803d;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.4);
}

/* Badge de estado conformidad */
.status-badge.conformidad {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* Animación pulso para paso activo en conformidad */
@keyframes pulse-step {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
    50% { transform: scale(1.12); box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
}
.step-dot-conformidad {
    animation: pulse-step 1.4s ease-in-out infinite;
}

/* ─── Botón WhatsApp Solicitante ─── */
.btn-notify-whatsapp-sol {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-notify-whatsapp-sol:hover {
    background: #bbf7d0;
    color: #166534;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(21, 128, 61, 0.2);
}

@media (max-width: 600px) {
    .payment-item {
        flex-wrap: wrap;
        gap: 8px;
    }
    .payment-item-action {
        width: 100%;
    }
    .btn-mark-payment, .btn-notify-payment {
        width: 100%;
        text-align: center;
    }
}

/* ============================
   Payment Pill (indicador en listas)
   ============================ */
.ri-status-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.payment-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 90px;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.payment-pill.none {
    background: var(--warning-bg);
    border: none;
    color: #92400e;
}
.payment-pill.partial {
    background: var(--warning-bg);
    border: none;
    color: #92400e;
}
.payment-pill-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    border-radius: 10px;
    transition: width 0.4s ease;
}
.payment-pill.none .payment-pill-bar {
    background: #fde68a;
}
.payment-pill.partial .payment-pill-bar {
    background: #fbbf24;
}
.payment-pill-text {
    position: relative;
    z-index: 1;
    width: 100%;
    text-align: center;
    padding: 0 8px;
    white-space: nowrap;
}

/* Inside history table */
td .payment-pill {
    margin-top: 4px;
    display: inline-flex;
}

@media (max-width: 600px) {
    .payment-pill { min-width: 76px; font-size: 0.6rem; }
}

/* ============================
   Botones de Estado / Acción
   ============================ */
.btn-danger-outline {
    background: transparent;
    color: var(--danger);
    border: 2px solid var(--danger);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}
.btn-danger-outline:hover {
    background: var(--danger);
    color: white;
}
.btn-warning-outline {
    background: transparent;
    color: var(--warning);
    border: 2px solid var(--warning);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}
.btn-warning-outline:hover {
    background: var(--warning);
    color: white;
}
.btn-status-next {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}
.btn-status-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}
.btn-send-provider {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}
.btn-send-provider:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
}
.btn-evidence {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}
.btn-evidence:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* ============================
   Galería de Evidencias
   ============================ */
.evidence-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.evidence-thumb {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    aspect-ratio: 1;
}
.evidence-thumb:hover {
    border-color: var(--primary);
    transform: scale(1.03);
    box-shadow: var(--shadow-sm);
}
.evidence-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.evidence-thumb .ev-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.65);
    color: white;
    font-size: 0.68rem;
    padding: 4px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.evidence-thumb .ev-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}
.evidence-thumb:hover .ev-delete { opacity: 1; }
.evidence-thumb.new {
    border-color: #7c3aed;
    border-style: dashed;
}

.evidence-preview-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.evidence-existing h3 {
    font-size: 0.95rem;
    color: var(--text-dark);
    margin-bottom: 8px;
}

/* ============================
   Vista Principal de Evidencias
   ============================ */
.evidence-search-section {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-top: 20px;
}
.evidence-search-box label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}
.evidence-search-row {
    display: flex;
    gap: 10px;
    align-items: center;
}
.ev-search-not-found {
    margin-top: 16px;
    padding: 16px;
    background: var(--danger-bg);
    border: 1px solid #fecaca;
    border-radius: 8px;
    text-align: center;
    color: var(--danger);
}
.ev-search-found {
    margin-top: 16px;
    padding: 16px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
}
.ev-found-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.ev-found-info strong {
    font-size: 1.05rem;
    color: var(--text-dark);
}
.ev-found-meta {
    font-size: 0.82rem;
    color: var(--text-light);
    margin-bottom: 12px;
}
.ev-found-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.evidence-pending-section h3,
.evidence-completed-section h3 {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 12px;
}

/* Alerta de evidencia faltante */
.ev-needs-evidence {
    border-left: 4px solid #f59e0b;
    background: #fffbeb !important;
}
.ev-needs-evidence:hover {
    background: #fef3c7 !important;
}
.ev-alert-icon {
    font-size: 1.5rem !important;
    animation: ev-pulse 2s ease-in-out infinite;
}
@keyframes ev-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}
.ev-alert-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #fef3c7;
    color: #b45309;
    padding: 2px 8px;
    border-radius: 50px;
    margin-left: 8px;
    vertical-align: middle;
}
.ri-status.voucher {
    background: #f0fdf4;
    color: #15803d;
}
.ri-amount.voucher {
    color: #15803d;
}

/* Badge de evidencias pendientes en sidebar */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 50px;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    margin-left: auto;
    line-height: 1;
    animation: badge-pop 0.3s ease;
}
@keyframes badge-pop {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
.nav-item.active .nav-badge {
    background: #fff;
    color: var(--primary);
}

.drop-hint {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 4px;
}

@media (max-width: 600px) {
    .evidence-search-row { flex-direction: column; }
    .evidence-gallery { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .ev-found-actions { flex-direction: column; }
    .detail-actions { flex-wrap: wrap; gap: 8px; }
    .detail-actions button { flex: 1 1 auto; min-width: 140px; }
}

/* ═══════════════════════════════════════════════════════════════
   ─── INVENTARIO DE ACTIVOS ───
   ═══════════════════════════════════════════════════════════════ */

.inv-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.inv-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0;
}
.inv-subtitle {
    font-size: 0.88rem;
    color: var(--text-light);
    margin-top: 4px;
}
.inv-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* Stats row */
.inv-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.inv-stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--primary-light);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.inv-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.inv-stat-card.inv-stat-danger {
    background: #fef2f2;
    border-color: #fecaca;
}
.inv-stat-card.inv-stat-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.inv-stat-card.inv-stat-purple {
    background: #f5f3ff;
    border-color: #ddd6fe;
}
.inv-stat-icon {
    font-size: 1.6rem;
}
.inv-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1;
}
.inv-stat-label {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 2px;
}

/* Sede selector */
.inv-sede-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.inv-sede-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 20px 10px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    min-width: 180px;
}
.inv-sede-btn:hover {
    background: var(--bg-surface);
    transform: translateY(-1px);
}
.inv-sede-btn.active {
    background: #f0f7ff;
    border-width: 2px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(12, 132, 255, 0.12);
}
.inv-sede-stats {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 2px;
    letter-spacing: 0.01em;
}
.inv-sede-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}
.inv-sede-name span {
    font-size: 1.2rem;
}
.inv-sede-btn.active .inv-sede-stats {
    color: var(--primary);
    font-weight: 600;
}

/* Tabs */
.inv-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 18px;
    border-bottom: 2px solid var(--border);
}
.inv-tab {
    padding: 10px 22px;
    border: none;
    background: none;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}
.inv-tab:hover {
    color: var(--text-dark);
    background: var(--bg-surface);
}
.inv-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Search bar */
.inv-search-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
    border: 1.5px solid #bfdbfe;
    border-radius: 12px;
    padding: 10px 16px;
}
.inv-search-bar .providers-search-input {
    flex: 1;
}
.inv-results-count {
    font-size: 0.82rem;
    color: var(--text-light);
    white-space: nowrap;
    font-weight: 500;
}

/* Area cards - Grid layout */
.inv-areas-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
    min-width: 0;
    overflow-x: hidden;
}

/* Grid de tarjetas de áreas */
.inv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
    gap: 10px;
}
.inv-grid-card {
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    overflow: hidden;
}
.inv-grid-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.2s;
}
.inv-grid-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(12, 132, 255, 0.12);
    transform: translateY(-2px);
}
.inv-grid-card:hover::before {
    opacity: 1;
}
.inv-grid-card.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    box-shadow: 0 4px 16px rgba(12, 132, 255, 0.2);
}
.inv-grid-card.active::before {
    opacity: 1;
    height: 3px;
    background: var(--primary);
}
.inv-grid-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.inv-grid-code {
    background: #334155;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
}

/* ─── Category card grid ─── */
.inv-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    padding: 20px;
}
.inv-cat-card {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 16px 14px;
    cursor: pointer;
    transition: all 0.18s;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.inv-cat-card:hover {
    border-color: var(--cat-color, #3b82f6);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.inv-cat-card-icon {
    font-size: 1.8rem;
    line-height: 1;
}
.inv-cat-card-name {
    font-size: 0.82rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.2;
    flex: 1;
}
.inv-cat-card-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.inv-cat-card-stat {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 8px;
}
.inv-cat-card-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0.7;
}

/* ─── Breadcrumb para nivel de áreas ─── */
.inv-cat-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px 8px;
    border-bottom: 1px solid #f1f5f9;
}
.inv-cat-back-btn {
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.inv-cat-back-btn:hover { background: #e2e8f0; color: #1e293b; }
.inv-cat-breadcrumb-sep { color: #cbd5e1; font-weight: 300; }
.inv-cat-breadcrumb-current { font-size: 0.85rem; font-weight: 800; }
.inv-cat-breadcrumb-count {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 700;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 10px;
    border-radius: 10px;
}

@media (max-width: 600px) {
    .inv-cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px; }
    .inv-cat-card { padding: 14px 12px 10px; }
    .inv-cat-card-icon { font-size: 1.4rem; }
    .inv-cat-card-name { font-size: 0.75rem; }
}
.inv-grid-items {
    font-size: 0.68rem;
    color: var(--primary);
    font-weight: 700;
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: 10px;
}
.inv-grid-card-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    min-height: 2em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-transform: uppercase;
}
.inv-grid-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 4px;
    border-top: 1px solid #f1f5f9;
}
.inv-grid-qty {
    font-size: 0.68rem;
    color: #16a34a;
    font-weight: 700;
    background: #dcfce7;
    padding: 2px 8px;
    border-radius: 10px;
}
/* Alerta en tarjeta de área */
.inv-grid-alert {
    font-size: 0.63rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    line-height: 1;
}
.inv-grid-alert-red    { background: #fee2e2; color: #dc2626; }
.inv-grid-alert-yellow { background: #fef9c3; color: #ca8a04; }
.inv-grid-card.has-alert   { border-color: #fca5a5; }
.inv-grid-card.has-alert::before   { background: #ef4444; opacity: 1; }
.inv-grid-card.has-warning { border-color: #fde68a; }
.inv-grid-card.has-warning::before { background: #f59e0b; opacity: 1; }
.inv-grid-estado-badge {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
}
.inv-grid-estado-mal { background: #fee2e2; color: #dc2626; }
.inv-grid-estado-reg { background: #fef9c3; color: #ca8a04; }
/* Ícono de alerta en fila de tabla */
.inv-row-alert {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    font-size: 0.68rem;
    font-weight: 900;
    margin-right: 5px;
    vertical-align: middle;
    flex-shrink: 0;
    cursor: default;
}
.inv-row-alert-red    { background: #fef2f2; color: #dc2626; border: 1.5px solid #fca5a5; }
.inv-row-alert-yellow { background: #fefce8; color: #ca8a04; border: 1.5px solid #fde047; }
/* Filtro de estado sobre tabla */
.inv-filter-select {
    padding: 5px 28px 5px 10px;
    border: 1.5px solid #dde3eb;
    border-radius: 8px;
    font-size: 0.78rem;
    font-family: inherit;
    font-weight: 600;
    color: #334155;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%23999' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 8px center;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s;
}
.inv-filter-select:focus { outline: none; border-color: var(--primary); }
.inv-filter-alert-btn {
    padding: 5px 12px;
    border: 1.5px solid #fca5a5;
    border-radius: 8px;
    background: #fee2e2;
    color: #dc2626;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.inv-filter-alert-btn:hover { background: #fecaca; }
.inv-grid-resp {
    font-size: 0.62rem;
    color: #64748b;
    font-weight: 500;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Panel de detalle del área seleccionada */
.inv-detail-panel {
    background: #fff;
    border: 2px solid var(--primary);
    border-radius: 12px;
    overflow: hidden;
    max-width: 100%;
    min-width: 0;
    box-shadow: 0 8px 24px rgba(12, 132, 255, 0.1);
    animation: invSlideDown 0.25s ease-out;
}
@keyframes invSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.inv-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 8px;
}
.inv-detail-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.92rem;
    flex-wrap: wrap;
}
.inv-detail-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.inv-detail-close {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #64748b;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.inv-detail-close:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
}

/* Legacy - keep for compatibility */
.inv-area-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.2s;
}
.inv-area-card:hover {
    box-shadow: var(--shadow-sm);
}
.inv-area-header {
    padding: 14px 18px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}
.inv-area-header:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}
.inv-area-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}
.inv-area-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s;
    color: var(--text-light);
}
.inv-area-card.collapsed .inv-area-arrow {
    transform: rotate(-90deg);
}
.inv-area-card.collapsed .inv-area-body {
    display: none;
}
.inv-area-badge {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}
.inv-area-code {
    background: #334155;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    margin-right: 4px;
}
.inv-area-responsible {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 500;
    margin-left: auto;
    padding-left: 12px;
}
.inv-edit-area-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0.45;
    transition: opacity 0.15s, background 0.15s;
    line-height: 1;
}
.inv-edit-area-btn:hover {
    opacity: 1;
    background: #e0f2fe;
}
/* ── Botón Fusionar área ─────────────────────────────────────────────────── */
.inv-merge-area-btn {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: #fff;
    border: none;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}
.inv-merge-area-btn:hover { opacity: 0.88; }

/* ── Buscador de área (combobox) ─────────────────────────────────────────── */
.inv-area-search-wrap {
    position: relative;
}
.inv-area-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.88rem;
    color: #1e293b;
    background: #fff;
    outline: none;
    transition: border-color 0.15s;
}
.inv-area-search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.inv-area-search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 9999;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px;
}
.inv-area-search-option {
    padding: 9px 12px;
    border-radius: 7px;
    font-size: 0.85rem;
    color: #1e293b;
    cursor: pointer;
    transition: background 0.1s;
}
.inv-area-search-option:hover {
    background: #eff6ff;
    color: #2563eb;
}
.inv-area-search-nueva {
    color: #7c3aed;
    font-weight: 600;
    border-top: 1px solid #f1f5f9;
    margin-top: 2px;
}
.inv-area-search-empty {
    padding: 10px 12px;
    font-size: 0.82rem;
    color: #94a3b8;
    text-align: center;
}

/* ── "Seleccionar todas" en modal traslado ───────────────────────────────── */
.inv-select-all-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #3b82f6;
    cursor: pointer;
    user-select: none;
}
.inv-select-all-label input { cursor: pointer; accent-color: #3b82f6; }

/* ── Modal fusionar área ─────────────────────────────────────────────────── */
.inv-merge-info-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
}
.inv-merge-from, .inv-merge-to {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.inv-merge-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
}
.inv-merge-area-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
}
.inv-merge-count {
    font-size: 0.72rem;
    color: #64748b;
}
.inv-merge-arrow {
    font-size: 1.4rem;
    color: #7c3aed;
    font-weight: 700;
}
.inv-merge-warning {
    margin-top: 12px;
    font-size: 0.78rem;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 7px;
    padding: 8px 12px;
}
.inv-pdf-btn {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
    border: none;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 8px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(185, 28, 28, 0.3);
}
.inv-pdf-btn:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(185, 28, 28, 0.4);
}
.inv-pdf-btn:active {
    transform: scale(0.96);
}
.inv-add-item-btn {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff;
    border: none;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 8px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(22, 163, 74, 0.3);
}
.inv-add-item-btn:hover {
    background: linear-gradient(135deg, #15803d, #16a34a);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(22, 163, 74, 0.4);
}
.inv-add-item-btn:active { transform: scale(0.96); }
/* Botón Informe PDF general en header principal */
.inv-general-pdf-btn {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(185, 28, 28, 0.35);
    font-family: inherit;
}
.inv-general-pdf-btn:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(185, 28, 28, 0.45);
}
.inv-general-pdf-btn:active { transform: scale(0.96); }
.inv-area-body {
    padding: 0;
}

/* Inventory table */
.inv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.77rem;
    table-layout: auto;
}
.inv-table thead th {
    background: #f8fafc;
    padding: 7px 7px;
    text-align: left;
    font-weight: 700;
    font-size: 0.67rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.inv-table tbody td {
    padding: 7px 7px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-main);
    vertical-align: middle;
}
.inv-table tbody tr:last-child td {
    border-bottom: none;
}
.inv-table tbody tr:hover {
    background: #fafbfe;
}

/* ID code */
.inv-id {
    background: #f1f5f9;
    color: var(--primary-dark);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'SF Mono', 'Fira Code', monospace;
    white-space: nowrap;
}

/* Estado badges */
.inv-estado {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: capitalize;
}
.inv-estado-bueno {
    background: #f0fdf4;
    color: #16a34a;
}
.inv-estado-nuevo {
    background: #eff6ff;
    color: #2563eb;
}
.inv-estado-regular {
    background: #fefce8;
    color: #ca8a04;
}
.inv-estado-malo {
    background: #fef2f2;
    color: #dc2626;
}
.inv-estado-dado-de-baja {
    background: #f1f5f9;
    color: #64748b;
}
.inv-estado-pendiente {
    background: #fef3c7;
    color: #d97706;
}

.inv-obs {
    color: var(--text-light);
    font-size: 0.82rem;
    max-width: 250px;
}

/* Empty state */
.inv-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}
.inv-empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

/* Audit footer */
.inv-footer-audit {
    margin-top: 24px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    text-align: center;
}
.inv-footer-audit p {
    font-size: 0.82rem;
    color: var(--text-light);
    margin: 2px 0;
}
.inv-footer-audit p:first-child {
    font-size: 0.88rem;
    color: var(--text-dark);
}

/* ─── Modal Inventario ─── */
.inv-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: background 0.3s ease;
    overflow-y: auto;
}
.inv-modal-overlay.visible {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.inv-modal {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 920px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 32px 80px rgba(0,0,0,0.22), 0 0 0 1px rgba(0,0,0,0.04);
    transform: scale(0.94) translateY(24px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.inv-modal-overlay.visible .inv-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Modal Header */
.inv-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 28px 20px;
    border-bottom: 1px solid #edf0f5;
    background: #fff;
    border-radius: 20px 20px 0 0;
    position: relative;
}
.inv-modal-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0c84ff 0%, #38b2ff 100%);
    border-radius: 20px 20px 0 0;
}
.inv-modal-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.inv-modal-icon {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0c84ff, #0065d1);
    border-radius: 14px;
    font-size: 1.4rem;
    box-shadow: 0 4px 16px rgba(12, 132, 255, 0.3);
}
.inv-modal-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.2px;
}
.inv-modal-subtitle {
    font-size: 0.76rem;
    color: #64748b;
    margin: 3px 0 0;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.inv-modal-close {
    width: 36px; height: 36px;
    border: 1.5px solid #e8ecf1;
    background: #f8fafc;
    font-size: 1.2rem;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}
.inv-modal-close:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Modal Body */
.inv-modal-body {
    padding: 24px 28px;
    background: #f4f6fb;
}

/* Sections */
.inv-modal-section {
    background: #fff;
    border: 1px solid #e8ecf1;
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.inv-modal-section-danger {
    background: #fff;
    border-color: #fca5a5;
    box-shadow: 0 1px 4px rgba(239,68,68,0.08);
}
.inv-modal-section-success {
    background: #fff;
    border-color: #6ee7b7;
    box-shadow: 0 1px 4px rgba(16,185,129,0.08);
}
.inv-modal-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1.5px solid #f1f5f9;
    position: relative;
}
.inv-modal-section-title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: linear-gradient(180deg, #0c84ff, #38b2ff);
    border-radius: 2px;
    flex-shrink: 0;
}

/* Checkboxes de Activo Contable / No Contable */
.inv-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    flex: 1;
    user-select: none;
}
.inv-checkbox-label:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}
.inv-checkbox-label:has(input:checked) {
    border-color: #16a34a;
    background: #f0fdf4;
    box-shadow: 0 0 0 3px rgba(22,163,74,0.1);
}
.inv-checkbox-label input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: #16a34a;
    cursor: pointer;
    flex-shrink: 0;
}
.inv-checkbox-text {
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    line-height: 1.35;
    text-align: center;
}

/* Inputs de serial por unidad */
.inv-serial-header {
    display: grid;
    grid-template-columns: 30px 1fr 120px;
    gap: 8px;
    padding: 0 2px 4px;
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #94a3b8;
    border-bottom: 1px solid #e8ecf1;
    margin-bottom: 6px;
}
.inv-serial-row {
    display: grid;
    grid-template-columns: 30px 1fr 120px;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}
.inv-serial-num {
    font-size: 0.67rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #0c84ff, #0065d1);
    border-radius: 5px;
    padding: 2px 4px;
    text-align: center;
    letter-spacing: 0.3px;
}
.inv-serial-row .inv-modal-input {
    margin: 0;
    font-size: 0.78rem;
    padding: 6px 10px;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    letter-spacing: 0.3px;
}
.inv-serial-row .inv-modal-select {
    margin: 0;
    font-size: 0.75rem;
    padding: 6px 26px 6px 8px;
    background-position: right 8px center;
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.inv-serial-estado.est-bueno   { border-color: #86efac !important; background: #f0fdf4 !important; color: #16a34a !important; }
.inv-serial-estado.est-regular { border-color: #fde047 !important; background: #fefce8 !important; color: #ca8a04 !important; }
.inv-serial-estado.est-malo    { border-color: #fca5a5 !important; background: #fef2f2 !important; color: #dc2626 !important; }
.inv-serial-estado.est-baja    { border-color: #cbd5e1 !important; background: #f1f5f9 !important; color: #64748b !important; }
#inv-seriales-list {
    padding-right: 4px;
}

/* ─── Transfer modal: unit checkboxes ─── */
.inv-transfer-units {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px 2px;
}
.inv-transfer-unit-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    cursor: pointer;
    font-size: 0.83rem;
    transition: background .15s, border-color .15s;
}
.inv-transfer-unit-label:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}
.inv-transfer-unit-label:has(input:checked) {
    background: #eff6ff;
    border-color: var(--primary);
}
.inv-transfer-unit-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}
.inv-transfer-unit-label code {
    font-size: 0.8rem;
    background: #f1f5f9;
    padding: 2px 7px;
    border-radius: 4px;
    color: #475569;
    flex: 1;
}

/* Modal Grid 2x2 Layout (legacy) */
.inv-modal-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Modal 2 columnas: izquierda fija ~340px, derecha flexible */
.inv-modal-2col {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.inv-modal-col-left {
    width: 310px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.inv-modal-col-right {
    flex: 1;
    min-width: 0;
}

/* Auto-ID field */
.inv-modal-input-id {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-weight: 700;
    color: var(--primary);
    background: #f0f6ff;
    letter-spacing: 0.5px;
}
.inv-modal-input-id:read-only {
    cursor: default;
    border-style: dashed;
}
.inv-id-hint {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 3px;
    font-style: italic;
}
.inv-modal-input-serial {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    letter-spacing: 0.5px;
}

/* Serial column in table */
.inv-serial {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.75rem;
    color: #7c3aed;
    background: #f5f3ff;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Fields */
.inv-modal-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.inv-modal-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}
.inv-modal-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
}
.inv-modal-field.full-span {
    grid-column: 1 / -1;
}
.inv-modal-field-area {
    grid-column: 1 / -1;
}
.inv-modal-field label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.inv-modal-input,
.inv-modal-select,
.inv-modal-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #dde3eb;
    border-radius: 9px;
    font-size: 0.875rem;
    font-family: inherit;
    background: #fafbfc;
    color: #1e293b;
    transition: all 0.2s;
    box-sizing: border-box;
}
.inv-modal-input:focus,
.inv-modal-select:focus,
.inv-modal-textarea:focus {
    outline: none;
    border-color: #0c84ff;
    box-shadow: 0 0 0 3px rgba(12, 132, 255, 0.12);
    background: #fff;
}
.inv-modal-input::placeholder,
.inv-modal-textarea::placeholder {
    color: #b0beca;
    font-style: normal;
}
.inv-modal-textarea {
    resize: vertical;
    min-height: 48px;
}
.inv-modal-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%23999' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
}

/* Custom Area Dropdown */
.inv-area-dropdown {
    position: relative;
    width: 100%;
}
.inv-area-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1.5px solid #dde3eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.88rem;
    color: var(--text-dark);
    min-height: 42px;
}
.inv-area-dropdown-trigger:hover {
    border-color: #c0cad6;
}
.inv-area-dropdown.open .inv-area-dropdown-trigger {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(12, 132, 255, 0.1);
}
.inv-area-dropdown-arrow {
    color: #94a3b8;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.inv-area-dropdown.open .inv-area-dropdown-arrow {
    transform: rotate(180deg);
}
.inv-area-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: #fff;
    border: 1.5px solid #dde3eb;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);
    z-index: 100;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.inv-area-dropdown.open .inv-area-dropdown-menu {
    max-height: 320px;
    opacity: 1;
    overflow: visible;
}
.inv-area-dropdown-search {
    padding: 8px;
    border-bottom: 1px solid #e8ecf1;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
    border-radius: 10px 10px 0 0;
}
.inv-area-dropdown-search input {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid #e8ecf1;
    border-radius: 6px;
    font-size: 0.82rem;
    font-family: inherit;
    background: #f8fafc;
    box-sizing: border-box;
}
.inv-area-dropdown-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
}
.inv-area-dropdown-list {
    max-height: 240px;
    overflow-y: auto;
    padding: 4px;
    overscroll-behavior: contain;
}
.inv-area-dropdown-list::-webkit-scrollbar { width: 5px; }
.inv-area-dropdown-list::-webkit-scrollbar-thumb { background: #d0d7de; border-radius: 4px; }
.inv-area-dropdown-item {
    padding: 8px 12px;
    font-size: 0.82rem;
    color: var(--text-dark);
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.12s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.inv-area-dropdown-item:hover {
    background: #f0f4ff;
    color: var(--primary);
}
.inv-area-dropdown-item.selected {
    background: #e8f0fe;
    color: var(--primary);
    font-weight: 700;
}
.inv-area-dropdown-item.selected::before {
    content: '✓ ';
    font-weight: 800;
}

/* Modal Footer */
.inv-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 28px;
    border-top: 1px solid #edf0f5;
    background: #fff;
    border-radius: 0 0 20px 20px;
    position: sticky;
    bottom: 0;
    z-index: 10;
}
.inv-modal-btn-cancel {
    padding: 10px 22px;
    border: 1.5px solid #dde3eb;
    border-radius: 9px;
    background: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.inv-modal-btn-cancel:hover {
    background: #f1f5f9;
    border-color: #b0beca;
    color: #334155;
}
.inv-modal-btn-save {
    padding: 10px 26px;
    border: none;
    border-radius: 9px;
    background: linear-gradient(135deg, #0c84ff, #0065d1);
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 4px 14px rgba(12, 132, 255, 0.35);
    transition: all 0.2s;
    letter-spacing: 0.1px;
}
.inv-modal-btn-save:hover {
    background: linear-gradient(135deg, #0a75e6, #0055b5);
    box-shadow: 0 6px 20px rgba(12, 132, 255, 0.45);
    transform: translateY(-1px);
}

/* ─── Componentes vinculados ─────────────────────────────────── */
.inv-modal-btn-add-comp {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0369a1;
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.15s;
}
.inv-modal-btn-add-comp:hover { background: #e0f2fe; }

.inv-comp-form-row {
    display: grid;
    grid-template-columns: 1fr 130px 110px 32px;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
}
.inv-comp-remove-btn {
    background: #fee2e2;
    border: none;
    color: #dc2626;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.inv-comp-remove-btn:hover { background: #fca5a5; }

.inv-btn-comp {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 2px 5px;
    opacity: 0.6;
    transition: opacity 0.15s;
}
.inv-btn-comp:hover, .inv-btn-comp-active { opacity: 1 !important; }
.inv-btn-vincular, .inv-btn-transfer {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.88rem;
    padding: 3px 4px;
    opacity: 0.55;
    border-radius: 5px;
    transition: opacity 0.15s;
}
.inv-btn-vincular:hover, .inv-btn-transfer:hover { opacity: 1; }
.inv-vincular-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.1s;
}
.inv-vincular-item:last-child { border-bottom: none; }
.inv-vincular-item:hover { background: #eff6ff; }

.inv-comp-expanded-row td {
    border-top: none !important;
}
.inv-comp-inner-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    background: #f8fafc;
}
.inv-comp-inner-table th {
    background: #e2e8f0;
    color: #475569;
    font-weight: 600;
    padding: 5px 10px;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.inv-comp-inner-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
}
.inv-comp-desvincular-btn {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #c2410c;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.15s;
}
.inv-comp-desvincular-btn:hover { background: #ffedd5; }

/* Modal Responsive */
@media (max-width: 768px) {
    .inv-modal { max-width: 100%; border-radius: 16px; }
    .inv-modal-header { padding: 16px 18px; }
    .inv-modal-body { padding: 14px 16px; background: #f4f6fb; }
    .inv-modal-grid-2x2 { grid-template-columns: 1fr; }
    .inv-modal-2col { flex-direction: column; }
    .inv-modal-col-left { width: 100%; }
    .inv-modal-row { grid-template-columns: 1fr; }
    .inv-modal-row-3 { grid-template-columns: 1fr 1fr; }
    .inv-modal-footer { padding: 12px 16px; }
    .inv-modal-icon { width: 40px; height: 40px; font-size: 1.1rem; }
}

/* Responsive */
@media (max-width: 768px) {
    .inv-header { flex-direction: column; }
    .inv-header-actions { width: 100%; }
    .inv-stats-row { grid-template-columns: repeat(2, 1fr); }
    .inv-sede-selector { flex-direction: column; }
    .inv-sede-btn { width: 100%; justify-content: center; }
    .inv-tabs { overflow-x: auto; }
    .inv-search-bar { flex-direction: column; align-items: stretch; }
    .inv-results-count { text-align: right; }
    .inv-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
    .inv-grid-card { padding: 10px; }
    .inv-grid-card-name { font-size: 0.75rem; }
    .inv-detail-header { padding: 10px 12px; }
}
@media (max-width: 480px) {
    .inv-stats-row { grid-template-columns: 1fr; }
    .inv-tab { padding: 8px 14px; font-size: 0.8rem; }
    .inv-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
}

/* ─── Filtro de rango de fechas ─── */
.date-range-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.date-filter-input {
    padding: 8px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    color: #334155;
    background: #fff;
    transition: border-color 0.2s;
    width: 150px;
}
.date-filter-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(12, 132, 255, 0.1);
}
.date-range-sep {
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 600;
}
.btn-clear-dates {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #94a3b8;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-clear-dates:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: #fef2f2;
}

/* ─── Alertas de órdenes estancadas ─── */
.stalled-alerts-box {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1.5px solid #fbbf24;
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 16px;
}
.stalled-alerts-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #92400e;
    margin: 0 0 10px 0;
}
.stalled-alerts-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.stalled-alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    font-size: 0.85rem;
}
.stalled-alert-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.stalled-yellow {
    background: rgba(250, 204, 21, 0.15);
    border-left: 3px solid #eab308;
}
.stalled-orange {
    background: rgba(251, 146, 60, 0.15);
    border-left: 3px solid #f97316;
}
.stalled-red {
    background: rgba(239, 68, 68, 0.12);
    border-left: 3px solid #ef4444;
}
.stalled-id {
    font-weight: 700;
    color: #1e293b;
    min-width: 70px;
}
.stalled-provider {
    flex: 1;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stalled-reason {
    color: #92400e;
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
}
.stalled-days {
    font-weight: 700;
    color: #dc2626;
    font-size: 0.8rem;
    min-width: 50px;
    text-align: right;
}

/* ─── Responsive nuevos componentes ─── */
@media (max-width: 768px) {
    .date-range-filter {
        flex-wrap: wrap;
        width: 100%;
    }
    .date-filter-input {
        flex: 1;
        min-width: 120px;
    }
    .stalled-alert-item {
        flex-wrap: wrap;
        gap: 4px 10px;
    }
    .stalled-provider {
        width: 100%;
        order: 3;
    }
    .detail-actions {
        flex-wrap: wrap;
    }
    .history-toolbar {
        flex-direction: column;
        gap: 8px !important;
    }
}

/* ═══════════════════════════════════════════════════
   GRÁFICOS DEL DASHBOARD (Pure CSS)
   ═══════════════════════════════════════════════════ */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
.chart-card {
    background: #fff;
    border-radius: 18px;
    padding: 20px 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border: 1px solid #f1f5f9;
}
.chart-card-sm {
    grid-column: 1 / -1;
}
.chart-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 16px 0;
}

/* Bar chart */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 200px;
    padding-top: 10px;
}
.bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 100%;
}
.bar-value {
    font-size: 0.65rem;
    font-weight: 700;
    color: #64748b;
    text-align: center;
    min-height: 16px;
    white-space: nowrap;
}
.bar-track {
    flex: 1;
    width: 100%;
    max-width: 60px;
    background: #f1f5f9;
    border-radius: 8px 8px 0 0;
    position: relative;
    display: flex;
    align-items: flex-end;
}
.bar-fill {
    width: 100%;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(180deg, #3b82f6 0%, #0c84ff 100%);
    transition: height 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    min-height: 3px;
}
.bar-label {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}

/* Distribution chart (horizontal bars) */
.dist-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.dist-row {
    display: grid;
    grid-template-columns: 120px 1fr 40px 90px;
    align-items: center;
    gap: 8px;
}
.dist-label {
    font-size: 0.8rem;
    color: #475569;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dist-bar-track {
    height: 10px;
    background: #f1f5f9;
    border-radius: 6px;
    overflow: hidden;
}
.dist-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.dist-pct {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-align: right;
}
.dist-amount {
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
    text-align: right;
}

@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .bar-chart {
        height: 160px;
        gap: 6px;
    }
    .bar-value {
        font-size: 0.55rem;
    }
    .dist-row {
        grid-template-columns: 90px 1fr 35px 70px;
        gap: 4px;
    }
    .dist-label {
        font-size: 0.72rem;
    }
    .dist-amount {
        font-size: 0.68rem;
    }
}

/* ═══════════════════════════════════════════════════
   CATEGORÍA DE GASTO
   ═══════════════════════════════════════════════════ */
.category-select-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.category-select-row label {
    font-weight: 700;
    font-size: 0.9rem;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 6px;
}
.field-required {
    font-size: 0.7rem;
    font-weight: 700;
    color: #dc2626;
    background: #fef2f2;
    padding: 2px 8px;
    border-radius: 50px;
    letter-spacing: 0.3px;
}
.category-select-wrapper {
    position: relative;
    width: 100%;
}
.category-dropdown {
    width: 100%;
    padding: 12px 44px 12px 14px;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    font-size: 0.92rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: #334155;
    background: #fff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: all 0.25s ease;
}
.category-dropdown:hover {
    border-color: #93c5fd;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}
.category-dropdown:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(12, 132, 255, 0.12);
}
.category-dropdown option {
    font-weight: 500;
    padding: 8px;
}
.category-select-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.2s;
}
.category-select-wrapper:hover .category-select-icon {
    color: var(--primary);
}
@keyframes shake-field {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}
.shake-field {
    animation: shake-field 0.4s ease;
}
.category-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    background: #ede9fe;
    color: #7c3aed;
    border: 1px solid #ddd6fe;
}
.cell-category-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    background: #ede9fe;
    color: #7c3aed;
    margin-top: 2px;
}
/* ── Colores por categoría ── */
.cat-administrativo  { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.cat-academico       { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.cat-gestion-humana  { background: #fdf2f8; color: #be185d; border-color: #fbcfe8; }
.cat-mantenimiento   { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.cat-sistemas        { background: #ecfeff; color: #0e7490; border-color: #a5f3fc; }
.cat-comunicaciones  { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
.cat-seguridad-salud { background: #faf5ff; color: #7e22ce; border-color: #e9d5ff; }
.cat-default         { background: #f8fafc; color: #475569; border-color: #e2e8f0; }

/* ═══════════════════════════════════════════════════
   HISTORIAL DE AUDITORÍA
   ═══════════════════════════════════════════════════ */
.audit-log-section {
    margin-top: 16px;
}
.audit-log-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-left: 8px;
    border-left: 2px solid #e2e8f0;
    margin-left: 6px;
}
.audit-entry {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0 8px 12px;
    position: relative;
}
.audit-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #3b82f6;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #3b82f6;
    flex-shrink: 0;
    margin-top: 4px;
    position: absolute;
    left: -19px;
}
.audit-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.audit-action {
    font-weight: 700;
    font-size: 0.85rem;
    color: #1e293b;
}
.audit-detail {
    font-size: 0.78rem;
    color: #64748b;
}
.audit-date {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════
   CONSUMO POR SEDE — 2-Column Master Grid
   ═══════════════════════════════════════════════════ */
.consumo-sede-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.consumo-header {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.consumo-main-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
}
.consumo-subtitle {
    font-size: 0.82rem;
    color: #94a3b8;
    margin: 2px 0 0;
}
.consumo-year-select {
    padding: 7px 14px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    font-size: 0.92rem;
    font-weight: 700;
    color: #1e293b;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.consumo-year-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

/* Summary bar — full width */
.consumo-summary-bar {
    grid-column: 1 / -1;
    background: #fff;
    border-radius: 16px;
    padding: 16px 22px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border: 1px solid #f1f5f9;
}
.consumo-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.consumo-summary-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
}
.consumo-summary-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e293b;
}
.consumo-summary-distribution {
    display: flex;
    height: 10px;
    border-radius: 8px;
    overflow: hidden;
    gap: 2px;
    margin-bottom: 8px;
}
.consumo-dist-segment {
    border-radius: 6px;
    transition: width 0.6s ease;
    min-width: 4px;
}
.consumo-summary-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}
.consumo-summary-stats {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}
.consumo-summary-stat {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
}
.consumo-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
}
.consumo-legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

/* Sede cards — each is a direct grid child */
.consumo-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border: 1px solid #f1f5f9;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.consumo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.09);
}
.consumo-card-header {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    gap: 8px;
}
.consumo-card-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.consumo-card-icon {
    font-size: 1.5rem;
}
.consumo-card-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}
.consumo-card-fullname {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 500;
}
.consumo-card-totals {
    text-align: right;
}
.consumo-card-amount {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1e293b;
}
.consumo-card-pct {
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
}

/* Card body */
.consumo-card-body {
    padding: 12px 16px 16px;
    flex: 1;
}
.consumo-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Mini monthly chart */
.consumo-mini-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 90px;
}
.consumo-mini-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    height: 100%;
}
.consumo-mini-bar.current .consumo-mini-label {
    font-weight: 800;
    color: #1e293b;
}
.consumo-mini-bar.current .consumo-mini-value {
    color: #1e293b;
    font-weight: 800;
}
.consumo-mini-value {
    font-size: 0.48rem;
    font-weight: 600;
    color: #64748b;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    min-height: 10px;
    line-height: 1.1;
}
.consumo-mini-track {
    flex: 1;
    width: 100%;
    background: #f1f5f9;
    border-radius: 3px 3px 0 0;
    position: relative;
    display: flex;
    align-items: flex-end;
}
.consumo-mini-fill {
    width: 100%;
    border-radius: 3px 3px 0 0;
    transition: height 0.5s ease;
    min-height: 2px;
}
.consumo-mini-label {
    font-size: 0.55rem;
    color: #94a3b8;
    font-weight: 600;
}

/* Categories in card */
.consumo-cat-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.consumo-cat-row {
    display: grid;
    grid-template-columns: 90px 1fr 70px;
    align-items: center;
    gap: 5px;
}
.consumo-cat-name {
    font-size: 0.7rem;
    color: #475569;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.consumo-cat-bar-track {
    height: 6px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}
.consumo-cat-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}
.consumo-cat-amount {
    font-size: 0.68rem;
    font-weight: 700;
    color: #334155;
    text-align: right;
}

/* Orders list inside card */
.consumo-orders-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 180px;
    overflow-y: auto;
}
.consumo-order-row {
    display: grid;
    grid-template-columns: 58px 1fr 72px auto;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 0.72rem;
}
.consumo-order-row:hover {
    background: #f1f5f9;
}
.consumo-order-id {
    font-weight: 700;
    color: #3b82f6;
}
.consumo-order-provider {
    color: #334155;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.consumo-order-amount {
    font-weight: 700;
    color: #1e293b;
    text-align: right;
}
.consumo-empty {
    font-size: 0.78rem;
    color: #94a3b8;
    text-align: center;
    padding: 10px 0;
    margin: 0;
}
.consumo-more {
    font-size: 0.7rem;
    color: #94a3b8;
    text-align: center;
    margin: 2px 0 0;
}

/* Comparative table */
.consumo-table-section {
    grid-column: 1 / -1;
    background: #fff;
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border: 1px solid #f1f5f9;
}
.consumo-table-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px;
}
.consumo-comp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}
.consumo-comp-table th {
    padding: 8px 10px;
    text-align: right;
    font-weight: 700;
    font-size: 0.76rem;
    border-bottom: 2px solid #e2e8f0;
    background: #f8fafc;
}
.consumo-comp-table th:first-child {
    text-align: left;
}
.consumo-comp-table td {
    padding: 7px 10px;
    text-align: right;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
}
.consumo-comp-table td:first-child {
    text-align: left;
    color: #1e293b;
}
.consumo-current-row {
    background: #eff6ff !important;
}
.consumo-current-row td {
    font-weight: 700;
    color: #1e293b;
}
.consumo-future td {
    color: #cbd5e1;
}
.consumo-total-row {
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
}
.consumo-total-row td {
    color: #1e293b;
    font-weight: 700;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* Responsive */
@media (max-width: 900px) {
    .consumo-sede-view {
        grid-template-columns: 1fr;
    }
    .consumo-summary-bar,
    .consumo-card,
    .consumo-table-section {
        grid-column: 1;
    }
}
@media (max-width: 768px) {
    .consumo-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .consumo-card-totals {
        text-align: left;
    }
    .consumo-order-row {
        grid-template-columns: 50px 1fr 60px auto;
    }
    .consumo-cat-row {
        grid-template-columns: 75px 1fr 60px;
    }
    .consumo-summary-value {
        font-size: 1.05rem;
    }
    .consumo-comp-table {
        font-size: 0.7rem;
    }
    .consumo-comp-table th,
    .consumo-comp-table td {
        padding: 5px 6px;
    }
}

/* ══════════════════════════════════════════════════════════
   Mobile Order Cards — Panel General (solo móvil)
══════════════════════════════════════════════════════════ */

/* Por defecto: ocultar cards, mostrar tabla */
.mobile-only-cards { display: none; }
.desktop-only-table { display: block; }

@media (max-width: 768px) {
    .desktop-only-table { display: none !important; }
    .mobile-only-cards { display: flex !important; flex-direction: column; gap: 10px; }
}

.mobile-order-card {
    position: relative;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 16px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    overflow: hidden;
}
.mobile-order-card:active {
    transform: scale(0.985);
}
.mobile-order-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Borde izquierdo color por estado */
.mobile-order-card.pending { border-left: 4px solid var(--primary); }
.mobile-order-card.approved { border-left: 4px solid var(--success); }
.mobile-order-card.sent { border-left: 4px solid var(--warning); }
.mobile-order-card.conformidad { border-left: 4px solid #8b5cf6; }
.mobile-order-card.paid { border-left: 4px solid #15803d; }
.mobile-order-card.voucher { border-left: 4px solid #7e22ce; }

/* Header: ID + fecha a la izquierda, estado a la derecha */
.moc-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.moc-id-date {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.moc-id {
    font-weight: 800;
    font-size: 0.88rem;
    color: var(--primary);
    letter-spacing: 0.02em;
}
.moc-date {
    font-size: 0.72rem;
    color: var(--text-light);
    font-weight: 500;
}
.moc-status-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

/* Body: proveedor + descripción */
.moc-body {
    margin-bottom: 8px;
}
.moc-provider {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-dark);
    line-height: 1.3;
    margin-bottom: 3px;
}
.moc-items {
    font-size: 0.76rem;
    color: var(--text-light);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 3px;
}
.moc-obs {
    font-size: 0.72rem;
    color: #94a3b8;
    font-style: italic;
    margin-top: 2px;
}

/* Footer: sede + total */
.moc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}
.moc-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}
.moc-sede {
    font-size: 0.72rem;
    color: var(--text-light);
    font-weight: 500;
}
.moc-total {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-dark);
    font-variant-numeric: tabular-nums;
}

/* Acción de aprobación en la card */
.moc-actions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}
.moc-check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
    padding: 6px 0;
}
.moc-check-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Botón eliminar en la card */
.moc-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: #cbd5e1;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.15s;
    line-height: 1;
    z-index: 2;
}
.moc-delete:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

/* ── Mejoras adicionales para toolbar móvil ─── */
@media (max-width: 768px) {
    .history-toolbar {
        flex-direction: column;
        gap: 8px !important;
    }
    .history-toolbar .history-search-bar {
        width: 100%;
    }
    .date-range-filter {
        flex-wrap: wrap;
        width: 100%;
    }
    .date-filter-input {
        flex: 1;
        min-width: 110px;
        font-size: 0.82rem;
        padding: 8px 10px;
    }
    .history-filters {
        gap: 8px;
        margin-bottom: 14px;
    }
    .filter-chip {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    /* Section header vertical en móvil */
    .section-header {
        gap: 10px;
    }
    .section-header h2 {
        font-size: 1.05rem;
    }

    /* Stalled alerts mejoradas para móvil */
    .stalled-alerts-box {
        padding: 12px 14px;
    }
    .stalled-alerts-title {
        font-size: 0.85rem;
    }
    .stalled-alert-item {
        flex-wrap: wrap;
        gap: 4px 8px;
        padding: 8px 10px;
        font-size: 0.78rem;
    }
    .stalled-id {
        min-width: 60px;
        font-size: 0.78rem;
    }
    .stalled-provider {
        width: 100%;
        order: 3;
        font-size: 0.75rem;
        white-space: normal;
    }
    .stalled-reason {
        font-size: 0.72rem;
    }
    .stalled-days {
        font-size: 0.72rem;
        min-width: 40px;
    }

    /* Bulk approve bar mejorada */
    .bulk-approve-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 14px;
        font-size: 0.82rem;
    }
    .bulk-approve-actions {
        display: flex;
        gap: 8px;
    }
    .bulk-approve-actions .btn-sm {
        flex: 1;
        text-align: center;
        padding: 8px 10px;
    }

    /* Paginación compacta en móvil */
    .dash-pagination-controls {
        gap: 4px;
    }
    .dash-page-btn {
        padding: 6px 8px;
        font-size: 12px;
    }
    .dash-page-info {
        font-size: 11px;
        padding: 0 2px;
    }
}

@media (max-width: 380px) {
    .mobile-order-card {
        padding: 12px 12px;
    }
    .moc-provider {
        font-size: 0.84rem;
    }
    .moc-total {
        font-size: 0.92rem;
    }
    .filter-chip {
        padding: 5px 10px;
        font-size: 0.7rem;
    }
}

/* ══════════════════════════════════════════════════════════
   Paginación del historial
══════════════════════════════════════════════════════════ */
.dash-pagination-wrap {
    display: flex;
    justify-content: center;
    padding: 12px 0 4px;
}
.dash-pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}
.dash-page-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.dash-page-btn:hover:not(:disabled) {
    background: #0c84ff;
    color: #fff;
    border-color: #0c84ff;
}
.dash-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.dash-page-info {
    font-size: 13px;
    color: #64748b;
    padding: 0 6px;
    white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════
   Spinner de sincronización (estado de carga vacío)
══════════════════════════════════════════════════════════ */
@keyframes uib-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.sync-spin {
    display: inline-block;
    animation: uib-spin 1.4s linear infinite;
}

/* ══════════════════════════════════════════════════════════
   Botón PDF en métricas
══════════════════════════════════════════════════════════ */
.btn-metricas-pdf {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
    flex-shrink: 0;
}
.btn-metricas-pdf:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
    transform: translateY(-1px);
}
.btn-metricas-pdf:active { transform: translateY(0); }

/* ══════════════════════════════════════════════════════════
   MÉTRICAS — KPI Cards
══════════════════════════════════════════════════════════ */
.met-kpi-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 0;
}
.met-kpi-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.met-kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.met-kpi-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.met-kpi-label {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.met-kpi-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.met-kpi-sub {
    min-height: 16px;
}

/* ══════════════════════════════════════════════════════════
   MÉTRICAS — Fila 2 columnas (Pipeline + Top Proveedores)
══════════════════════════════════════════════════════════ */
.met-row-2col {
    grid-column: 1 / -1;
    display: flex;
    gap: 16px;
    margin-bottom: 0;
}
.met-row-2col .chart-card {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

/* ══════════════════════════════════════════════════════════
   MÉTRICAS — Responsive
══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .met-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .met-row-2col { flex-direction: column; }
}
@media (max-width: 500px) {
    .met-kpi-grid { grid-template-columns: 1fr; }
    .met-kpi-value { font-size: 1.05rem; }
    .met-kpi-card { padding: 12px 14px; }
}

/* ══════════════════════════════════════════════════════════
   MOBILE UX IMPROVEMENTS v2.1
   Botones sticky, providers cards, evidence cards,
   bottom nav, detail improvements
══════════════════════════════════════════════════════════ */

/* ─── 1) Botones de acción sticky en detalle (móvil) ─── */
@media (max-width: 768px) {
    .detail-actions {
        position: sticky;
        bottom: 0;
        z-index: 50;
        background: #fff;
        border-top: 1px solid var(--border);
        padding: 12px 16px !important;
        margin: 0 -16px -24px -16px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .detail-actions button {
        flex: 1;
        min-width: 0;
        padding: 10px 12px !important;
        font-size: 0.78rem !important;
        border-radius: 10px !important;
        justify-content: center;
        text-align: center;
        white-space: nowrap;
    }
    /* Botón principal (aprobar/pagar) más prominente */
    .detail-actions .btn-success,
    .detail-actions .btn-send-provider,
    .detail-actions .btn-status-next {
        flex: 2;
        font-size: 0.85rem !important;
        min-height: 44px;
    }
    /* Botón volver más sutil */
    .detail-actions .btn-secondary {
        flex: 0 0 auto;
        width: auto;
        padding: 10px 14px !important;
    }
    /* Ajustar padding inferior del card para que no oculte el sticky */
    .detail-actions ~ * { padding-bottom: 0; }
    .full-sheet:has(.detail-actions) {
        padding-bottom: 80px;
    }
}

/* ─── 2) Detail totals-row responsive ─── */
@media (max-width: 768px) {
    .detail-totals-row {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
    .detail-status-bar {
        padding: 12px 16px;
        gap: 8px;
    }
    .detail-order-id strong {
        font-size: 1.1rem;
    }
    .status-badge.large {
        font-size: 0.75rem;
        padding: 6px 14px;
    }
    .detail-section {
        padding: 16px;
    }
    .detail-grid {
        gap: 12px;
        margin-bottom: 20px;
    }
    .detail-signatures {
        flex-direction: column;
        gap: 12px;
    }
    .detail-sig-block {
        padding: 12px;
    }
    /* Items table responsive */
    .detail-items-table th,
    .detail-items-table td {
        padding: 8px 8px;
        font-size: 0.78rem;
    }
    .detail-items-table th:first-child,
    .detail-items-table td:first-child {
        display: none; /* Ocultar columna N° */
    }
    .detail-quote-link {
        flex-wrap: wrap;
    }
    .dql-filename {
        max-width: 100%;
        margin-left: 0;
    }
}

/* ─── 3) Proveedores: cards en móvil ─── */
.prov-mobile-cards { display: none; }
.providers-table-wrap.desktop-prov-table { display: block; }

@media (max-width: 768px) {
    .providers-table-wrap.desktop-prov-table { display: none !important; }
    .prov-mobile-cards { display: flex !important; flex-direction: column; gap: 10px; }

    .providers-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .providers-header > div:last-child {
        width: 100%;
        justify-content: flex-start;
    }
}

.prov-mobile-card {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    position: relative;
    transition: transform 0.15s, box-shadow 0.15s;
}
.prov-mobile-card:active {
    transform: scale(0.985);
}
.pmc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}
.pmc-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-dark);
    text-transform: uppercase;
    line-height: 1.3;
    flex: 1;
    margin-right: 8px;
}
.pmc-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.pmc-actions button {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.pmc-actions .pmc-edit:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}
.pmc-actions .pmc-del:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}
.pmc-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}
.pmc-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-main);
}
.pmc-row-label {
    color: var(--text-light);
    font-weight: 500;
    flex-shrink: 0;
    min-width: 60px;
}
.pmc-row-value {
    font-weight: 600;
    word-break: break-all;
}
.pmc-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}
.pmc-doc-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-light);
}
.pmc-doc-btn.has-doc {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}
.pmc-doc-btn.has-doc:hover {
    background: var(--primary);
    color: #fff;
}

/* ─── 4) Evidencias: mejorar items en móvil ─── */
@media (max-width: 768px) {
    .recent-item {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px 14px;
    }
    .recent-item .ri-icon {
        font-size: 1.1rem;
    }
    .recent-item .ri-info {
        flex: 1;
        min-width: 0;
    }
    .recent-item .ri-title {
        font-size: 0.84rem;
    }
    .recent-item .ri-desc {
        font-size: 0.72rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .recent-item .ri-amount {
        order: 4;
        font-size: 0.95rem;
        margin-left: auto;
    }
    .recent-item .ri-status,
    .recent-item .ri-status-wrap {
        order: 5;
    }
    .recent-item .ri-status-wrap {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
    }
    .recent-item .ri-delete {
        position: absolute;
        top: 8px;
        right: 8px;
    }
    /* Evidence alert tags */
    .ev-needs-evidence {
        border-left: 3px solid #f59e0b;
    }
    .ev-alert-tag {
        font-size: 0.62rem;
        background: #fef3c7;
        color: #d97706;
        padding: 1px 6px;
        border-radius: 4px;
        margin-left: 4px;
        font-weight: 700;
    }
    .evidence-search-row {
        flex-direction: column;
        gap: 8px;
    }
    .evidence-search-row button {
        width: 100%;
    }
}

/* ─── 5) Métricas: mejoras adicionales móvil ─── */
@media (max-width: 768px) {
    .consumo-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .consumo-header-right {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }
    .consumo-header-right button,
    .consumo-header-right select {
        flex: 1;
        min-width: 0;
        font-size: 0.78rem;
        padding: 8px 10px;
    }
    .consumo-main-title {
        font-size: 1.15rem;
    }
    .chart-title {
        font-size: 0.88rem;
    }
    /* Bar chart: más compacto */
    .bar-chart {
        gap: 2px;
    }
    .bar-col .bar-value {
        font-size: 0.5rem;
    }
    .bar-col .bar-label {
        font-size: 0.6rem;
    }
    /* Distribution chart */
    .dist-row {
        flex-wrap: wrap;
        gap: 2px 8px;
    }
    .dist-label {
        font-size: 0.68rem;
        max-width: 80px;
    }
    .dist-amount {
        font-size: 0.68rem;
    }
    .dist-pct {
        font-size: 0.68rem;
    }
    /* Consumo sede cards */
    .consumo-card-body {
        padding: 14px 12px;
    }
    .consumo-mini-chart {
        gap: 1px;
        height: 90px;
    }
    .consumo-mini-label {
        font-size: 0.5rem;
    }
    .consumo-mini-value {
        font-size: 0.42rem;
    }
    .consumo-table-section {
        overflow-x: auto;
    }
}

/* ─── 6) Bottom Navigation Bar (móvil) — gold tab bar ─── */
.mobile-bottom-nav {
    display: none;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    height: 56px;
    background: #e6b400;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }
    .mobile-menu-toggle {
        display: none !important;
    }
    .top-bar {
        padding-left: 16px !important;
    }
    .content {
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 8px);
    }
}

.bnav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 100%;
    padding: 6px 0 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: rgba(80, 50, 10, 0.45);
    text-decoration: none;
    transition: color 0.2s;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}
.bnav-item:active {
    opacity: 0.7;
}
.bnav-icon {
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}
.bnav-icon svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.8;
    fill: none;
    stroke: currentColor;
}
/* Icono "Más" usa círculos rellenos */
#bnav-more-btn .bnav-icon svg {
    fill: currentColor;
    stroke: none;
}
.bnav-label {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
}

/* Active state */
.bnav-item.active {
    color: #fff;
}

/* Botón central "Nueva" */
.bnav-item.bnav-create .bnav-icon {
    width: 38px;
    height: 38px;
    background: #fff;
    color: #c4922e;
    border-radius: 50%;
    margin-top: -6px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s;
}
.bnav-item.bnav-create .bnav-icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
    stroke: #c4922e;
}
.bnav-item.bnav-create:active .bnav-icon {
    transform: scale(0.9);
}
.bnav-item.bnav-create .bnav-label {
    color: #fff;
    font-weight: 800;
    margin-top: 1px;
}

/* Badge */
.bnav-badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 14px);
    background: #ef4444;
    color: #fff;
    font-size: 0.5rem;
    font-weight: 800;
    min-width: 14px;
    height: 14px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 1.5px solid #c4922e;
}

/* Menú "Más" — popup gold */
.bnav-more-menu {
    display: none;
    position: fixed;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    right: 10px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    z-index: 1300;
    min-width: 190px;
    animation: bnav-pop 0.18s ease;
}
.bnav-more-menu.open {
    display: block;
}
@keyframes bnav-pop {
    from { opacity: 0; transform: translateY(6px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.bnav-more-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border: none;
    background: transparent;
    width: 100%;
    font-size: 0.88rem;
    font-weight: 600;
    color: #444;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}
.bnav-more-item svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    flex-shrink: 0;
}
.bnav-more-item + .bnav-more-item {
    border-top: 1px solid #f1f3f5;
}
.bnav-more-item:hover,
.bnav-more-item:active {
    background: #fdf6e8;
    color: #a07828;
}
.bnav-more-item.active {
    color: #a07828;
    background: #fdf6e8;
}
.bnav-more-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1250;
    background: rgba(0, 0, 0, 0.15);
}
.bnav-more-overlay.open {
    display: block;
}
