:root {
    --pw-primary: #2563eb;
    --pw-primary-dark: #1d4ed8;
    --pw-accent: #10b981;
    --pw-ink: #0f172a;
    --pw-muted: #64748b;
    --pw-surface: #ffffff;
    --pw-canvas: #f4f7fb;
    --pw-border: #e2e8f0;
    --pw-sidebar: #101827;
    --pw-radius: 16px;
    --pw-shadow: 0 16px 40px rgba(15, 23, 42, .08);
}

html, body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif !important; }
body { color: var(--pw-ink); background: var(--pw-canvas); }
a { text-decoration: none; }

/* Estructura general */
.desktop-nav.header.navbar {
    min-height: 76px;
    background: rgba(255,255,255,.96) !important;
    border-bottom: 1px solid var(--pw-border);
    box-shadow: 0 4px 24px rgba(15,23,42,.05) !important;
    backdrop-filter: blur(16px);
}
.desktop-nav .nav-logo { display:flex; align-items:center; }
.desktop-nav .nav-link, .desktop-nav .sidebarCollapse { color: var(--pw-ink) !important; }
.desktop-nav .user-profile img {
    width: 42px !important; height: 42px !important; object-fit: cover;
    border: 3px solid #fff; box-shadow: 0 0 0 2px #bfdbfe, 0 6px 16px rgba(37,99,235,.2);
}
.modernSidebar-nav.header.navbar {
    background: linear-gradient(180deg, #111827 0%, #0b1220 100%) !important;
    border-right: 0 !important;
    box-shadow: 8px 0 28px rgba(15,23,42,.12);
}
#modernSidebar .menu a { border-radius: 12px; margin: 4px 10px; transition: .2s ease; }
#modernSidebar .menu a:hover, #modernSidebar .menu a[aria-expanded="true"] {
    background: rgba(255,255,255,.09) !important; transform: translateX(2px);
}
#modernSidebar .menu a i, #modernSidebar .menu a span { color: #dbeafe !important; }
#modernSidebar .submenu a { color: #94a3b8 !important; font-weight: 500; }
#modernSidebar .submenu a:hover { color: #fff !important; background: rgba(37,99,235,.2) !important; }
.main-content { background: var(--pw-canvas) !important; min-height: 100vh; }
.main-content .container, .main-content .container-fluid { max-width: 1600px; }
.page-header h3, .page-header h4 { font-weight: 750; letter-spacing: -.03em; color: var(--pw-ink); }

/* Componentes */
.card, .widget, .widget-content, .statbox {
    border: 1px solid var(--pw-border) !important;
    border-radius: var(--pw-radius) !important;
    background: var(--pw-surface);
    box-shadow: var(--pw-shadow) !important;
}
.card-header, .modal-header { background: transparent; border-color: var(--pw-border); font-weight: 700; }
.btn { border-radius: 10px; font-weight: 650; padding: .62rem 1rem; transition: .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary, .btn-info {
    background: linear-gradient(135deg, var(--pw-primary), var(--pw-primary-dark)) !important;
    border-color: transparent !important; box-shadow: 0 8px 18px rgba(37,99,235,.2);
}
.btn-success { background: #059669 !important; border-color: #059669 !important; }
.btn-danger { background: #e11d48 !important; border-color: #e11d48 !important; }
.form-control, .form-select, select.form-control {
    min-height: 44px; border: 1px solid #cbd5e1; border-radius: 10px;
    color: var(--pw-ink); background-color: #fff;
}
.form-control:focus, .form-select:focus {
    border-color: #60a5fa; box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}
.form-label, label { color: #334155; font-weight: 600; }
.table { --bs-table-bg: transparent; color: #334155; }
.table thead th {
    background: #f8fafc !important; color: #475569 !important; border-bottom: 1px solid var(--pw-border) !important;
    font-size: .76rem; letter-spacing: .045em; text-transform: uppercase; font-weight: 750;
}
.table > :not(caption) > * > * { padding: .9rem .85rem; border-color: #edf2f7; }
.table tbody tr:hover { background: #f8fbff; }
.badge { border-radius: 999px; padding: .42em .7em; font-weight: 650; }
.alert { border: 0; border-radius: 12px; }
.modal-content { border: 0; border-radius: 20px; box-shadow: 0 28px 80px rgba(15,23,42,.24); }
.dropdown-menu { border: 1px solid var(--pw-border); border-radius: 12px; box-shadow: var(--pw-shadow); }
.dataTables_wrapper .dataTables_filter input, .dataTables_wrapper .dataTables_length select {
    border: 1px solid #cbd5e1 !important; border-radius: 9px !important; padding: .45rem .7rem !important;
}
.pagination .page-link { border: 0; margin: 0 2px; border-radius: 8px !important; color: #475569; }
.pagination .active .page-link { background: var(--pw-primary); }

/* Login */
body.login { margin: 0; min-height: 100vh; background: #eef4fb !important; overflow-x: hidden; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr); }
.login-showcase {
    position: relative; display: flex; align-items: flex-end; padding: clamp(3rem, 7vw, 7rem);
    overflow: hidden; color: #fff;
    background:
        radial-gradient(circle at 22% 18%, rgba(52,211,153,.3), transparent 28%),
        radial-gradient(circle at 82% 75%, rgba(96,165,250,.35), transparent 30%),
        linear-gradient(145deg, #0b1220 5%, #102a43 52%, #164e63 100%);
}
.login-showcase::before, .login-showcase::after {
    content:""; position:absolute; border:1px solid rgba(255,255,255,.12); border-radius:50%;
}
.login-showcase::before { width:520px; height:520px; right:-180px; top:-170px; }
.login-showcase::after { width:320px; height:320px; right:8%; top:12%; }
.login-showcase-content { position:relative; z-index:1; max-width:680px; }
.login-eyebrow { display:inline-flex; gap:.55rem; align-items:center; padding:.55rem .8rem; border-radius:999px; background:rgba(255,255,255,.1); font-weight:650; font-size:.82rem; }
.login-showcase h2 { color:#fff; margin:1.4rem 0 1rem; max-width:650px; font-size:clamp(2.4rem,5vw,4.9rem); line-height:1.02; letter-spacing:-.055em; font-weight:800; }
.login-showcase p { color:#cbd5e1; font-size:1.05rem; line-height:1.75; max-width:590px; }
.login-feature-grid { display:flex; flex-wrap:wrap; gap:.75rem; margin-top:2rem; }
.login-feature-grid span { padding:.72rem .9rem; border:1px solid rgba(255,255,255,.14); border-radius:12px; background:rgba(255,255,255,.06); font-weight:600; }
.login-feature-grid i { margin-right:.4rem; color:#6ee7b7; }
.form-login {
    width: min(480px, calc(100% - 3rem)) !important; margin:auto !important; padding:2rem !important;
    position:relative !important; left:auto !important; right:auto !important; top:auto !important;
    border:0 !important; border-radius:24px; background:#fff !important; box-shadow:0 28px 70px rgba(15,23,42,.12);
}
.login-brand { display:flex; align-items:center; gap:.8rem; margin-bottom:2.3rem; }
.login-brand img { width:54px !important; height:54px; object-fit:contain; }
.login-brand div { display:flex; flex-direction:column; }
.login-brand strong { color:var(--pw-ink); font-size:1rem; }
.login-brand span { color:var(--pw-muted); font-size:.78rem; margin-top:.15rem; }
.login-heading { margin-bottom:1.8rem; }
.login-kicker { color:var(--pw-primary); font-size:.78rem; font-weight:750; text-transform:uppercase; letter-spacing:.1em; }
.login-heading h1 { color:var(--pw-ink); margin:.35rem 0 .55rem; font-size:2rem; font-weight:800; letter-spacing:-.04em; }
.login-heading p { margin:0; color:var(--pw-muted); line-height:1.6; }
.form-login .form-label { display:block !important; margin-bottom:.45rem; font-size:.84rem; }
.modern-input { border:1px solid #cbd5e1; border-radius:12px; overflow:hidden; transition:.2s; }
.modern-input:focus-within { border-color:#60a5fa; box-shadow:0 0 0 4px rgba(37,99,235,.1); }
.form-login .modern-input .input-group-text { border:0 !important; background:#f8fafc !important; color:#64748b !important; padding:0 .9rem; }
.form-login .modern-input .form-control { min-height:52px; border:0 !important; box-shadow:none !important; padding-left:.25rem; background:#fff !important; color:var(--pw-ink) !important; }
.form-login .modern-input .form-control::placeholder { color:#94a3b8 !important; }
.login-submit { min-height:52px; display:flex; align-items:center; justify-content:center; gap:.8rem; }
.login-feedback { min-height:24px; margin-top:.8rem; }
.login-feedback .alert { margin:0; text-align:center; font-size:.86rem; }
.login-security { margin:1.2rem 0 0; text-align:center; color:#94a3b8; font-size:.78rem; }
.login-security i { margin-right:.3rem; }

@media (max-width: 991.98px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-showcase { min-height:300px; padding:2.5rem 2rem; align-items:center; }
    .login-showcase h2 { font-size:2.4rem; }
    .form-login { margin:2rem auto !important; }
}
@media (max-width: 575.98px) {
    .login-showcase { display:none; }
    .login-shell { display:flex; align-items:center; }
    .form-login { width:calc(100% - 1.5rem) !important; padding:1.5rem !important; }
    .main-content .container { padding-left:1rem; padding-right:1rem; }
}

/* Shell v2: navegación amplia y dashboard operativo */
.desktop-nav.header.navbar { height:76px !important; padding:0 22px 0 14px !important; }
.desktop-nav .nav-logo { width:238px; gap:10px; margin:0 !important; }
.desktop-nav .sidebarCollapse { width:42px; height:42px; display:grid !important; place-items:center; margin:0 !important; border-radius:11px; background:#f1f5f9; }
.panel-brand { display:flex; align-items:center; gap:10px; color:var(--pw-ink); }
.panel-brand img { width:38px; height:38px; object-fit:cover; border-radius:10px; }
.panel-brand span, .profile-copy, .header-status div { display:flex; flex-direction:column; line-height:1.12; }
.panel-brand strong { font-size:1rem; letter-spacing:-.03em; }
.panel-brand small, .profile-copy small, .header-status small { color:#94a3b8; font-size:.7rem; margin-top:4px; }
.header-status { align-items:center; gap:9px; padding:0 20px; border-right:1px solid var(--pw-border); }
.header-status .status-dot { width:9px; height:9px; border-radius:50%; background:#10b981; box-shadow:0 0 0 5px rgba(16,185,129,.12); }
.header-status strong { font-size:.76rem; color:#334155; }
.profile-trigger { display:flex !important; align-items:center; gap:10px; padding:5px 8px !important; border-radius:12px; }
.profile-trigger:hover { background:#f8fafc; }
.profile-copy { text-align:left; min-width:90px; }
.profile-copy strong { color:#1e293b; font-size:.8rem; max-width:130px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.modernSidebar-nav.header.navbar { top:76px !important; width:250px !important; height:calc(100vh - 76px) !important; padding:18px 12px !important; overflow-y:auto; }
.modernSidebar-nav.header.navbar > div,
.modernSidebar-nav.header nav#modernSidebar,
.modernSidebar-nav.header nav#modernSidebar ul.menu-categories { width:100% !important; height:auto !important; }
.modernSidebar-nav.header nav#modernSidebar ul.menu-categories li.menu { width:100%; margin:0 0 4px; }
.modernSidebar-nav.header nav#modernSidebar ul.menu-categories li.menu > a {
    width:100% !important; height:52px !important; min-height:52px; margin:0 !important;
    padding:0 14px !important; display:flex !important; align-items:center; justify-content:flex-start !important;
    border:0 !important; border-radius:12px !important; box-shadow:none !important;
}
.modernSidebar-nav.header nav#modernSidebar ul.menu-categories li.menu > a > div { width:100%; display:flex; align-items:center; gap:12px; overflow:hidden; }
.modernSidebar-nav.header nav#modernSidebar ul.menu-categories li.menu > a i { width:22px; flex:0 0 22px; margin:0 !important; text-align:center; font-size:1.05rem; }
.modernSidebar-nav.header nav#modernSidebar ul.menu-categories li.menu > a span {
    display:block !important; width:auto !important; max-width:none !important; margin:0 !important;
    color:#dbeafe !important; font-size:.86rem; line-height:1.2; font-weight:650;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.modernSidebar-nav.header nav#modernSidebar ul.menu-categories li.menu > a[aria-expanded="true"] div i::after { display:none !important; content:none !important; }
.modernSidebar-nav.header nav#modernSidebar ul.menu-categories li.menu .submenu {
    position:static !important; width:auto !important; height:auto !important; margin:4px 0 10px 34px !important;
    padding:0 !important; background:transparent !important; border-left:1px solid rgba(148,163,184,.22);
    box-shadow:none !important; text-align:left;
}
.modernSidebar-nav.header nav#modernSidebar ul.menu-categories li.menu .submenu .submenu-scroll { height:auto !important; padding:0 !important; }
.modernSidebar-nav.header nav#modernSidebar ul.menu-categories li.menu .submenu .list-unstyled > li:first-child > a { margin-top:0 !important; padding-top:9px !important; }
.modernSidebar-nav.header nav#modernSidebar ul.menu-categories li.menu .submenu .list-unstyled > li > a {
    display:block; margin:2px 0 2px 7px; padding:9px 12px !important; border-radius:9px;
    color:#94a3b8 !important; font-size:.8rem; font-weight:550 !important;
}
.main-content { width:calc(100% - 250px) !important; margin-top:76px !important; margin-left:250px !important; padding-top:0 !important; flex:none !important; }
.main-container.sidebar-closed .modernSidebar-nav, .sidebar-closed .modernSidebar-nav { left:-260px !important; }
.main-container.sidebar-closed #content, .sidebar-closed #content { width:100% !important; margin-left:0 !important; }

.dashboard-page { background:#f6f8fc !important; }
.dashboard-container { max-width:1580px !important; margin:0 auto; padding:28px clamp(20px,2.4vw,38px) 50px; }
.dashboard-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:26px; }
.dashboard-overline { color:#2563eb; font-size:.72rem; font-weight:750; letter-spacing:.12em; text-transform:uppercase; }
.dashboard-heading h1 { margin:5px 0 6px; font-size:clamp(1.8rem,3vw,2.5rem); font-weight:800; letter-spacing:-.055em; color:#0f172a; }
.dashboard-heading p { margin:0; color:#64748b; }
.dashboard-live { display:flex; align-items:center; gap:9px; padding:9px 13px; border:1px solid #dbe4ef; background:#fff; border-radius:999px; color:#475569; font-size:.75rem; font-weight:650; }
.dashboard-live span { width:8px; height:8px; border-radius:50%; background:#10b981; box-shadow:0 0 0 4px rgba(16,185,129,.12); }
.metric-grid { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:14px; margin-bottom:18px; }
.metric-card { min-width:0; padding:18px; background:#fff; border:1px solid #e6ebf2; border-radius:16px; box-shadow:0 8px 24px rgba(15,23,42,.045); }
.metric-card > span { display:block; margin:15px 0 5px; color:#64748b; font-size:.72rem; font-weight:650; }
.metric-card strong { display:block; color:#0f172a; font-size:1.65rem; letter-spacing:-.05em; line-height:1; }
.metric-card small { display:block; margin-top:9px; color:#94a3b8; font-size:.67rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.metric-card.metric-primary { color:#fff; border:0; background:linear-gradient(145deg,#1d4ed8,#2563eb 58%,#3b82f6); box-shadow:0 14px 34px rgba(37,99,235,.22); }
.metric-primary > span,.metric-primary small { color:#dbeafe; }.metric-primary strong{color:#fff;}
.metric-icon { width:36px; height:36px; display:grid; place-items:center; border-radius:10px; color:#1d4ed8; background:#dbeafe; }
.metric-primary .metric-icon{color:#fff;background:rgba(255,255,255,.18)}.metric-green{color:#047857;background:#d1fae5}.metric-violet{color:#6d28d9;background:#ede9fe}.metric-cyan{color:#0e7490;background:#cffafe}.metric-amber{color:#b45309;background:#fef3c7}
.dashboard-grid { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(310px,.55fr); gap:18px; }
.dashboard-panel { min-width:0; background:#fff; border:1px solid #e6ebf2; border-radius:18px; padding:22px; box-shadow:0 10px 30px rgba(15,23,42,.045); }
.panel-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:20px; }
.panel-heading span { color:#94a3b8; font-size:.68rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; }
.panel-heading h2 { margin:4px 0 0; color:#172033; font-size:1rem; font-weight:750; letter-spacing:-.025em; }
.panel-heading a { color:#2563eb; font-size:.75rem; font-weight:700; }.panel-heading a i{margin-left:5px;}
.panel-chip { padding:7px 10px; color:#2563eb !important; background:#eff6ff; border-radius:999px; letter-spacing:0 !important; text-transform:none !important; }
.chart-wrap { position:relative; }.chart-wide{height:285px}.chart-donut{width:170px;height:170px;flex:0 0 170px}
.chart-empty { height:100%; display:grid; place-items:center; border:1px dashed #dbe4ef; border-radius:14px; background:#f8fafc; text-align:center; color:#64748b; }
.chart-empty[hidden] { display:none; }
.chart-empty i { display:block; margin-bottom:10px; color:#94a3b8; font-size:1.4rem; }
.chart-empty strong { display:block; color:#334155; font-size:.86rem; }
.chart-empty span { display:block; margin-top:4px; font-size:.72rem; }
.delivery-score { padding:16px; margin-bottom:18px; border-radius:14px; background:#f8fafc; text-align:center; }
.delivery-score strong{display:block;font-size:2.3rem;letter-spacing:-.06em;color:#0f172a}.delivery-score span{color:#64748b;font-size:.72rem}
.progress-list { display:grid; gap:15px; }.progress-list label{display:flex;justify-content:space-between;margin-bottom:6px;color:#64748b;font-size:.72rem}.progress-list b{color:#334155}
.progress-list > div > span{display:block;height:7px;overflow:hidden;border-radius:999px;background:#edf2f7}.progress-list i{display:block;height:100%;width:0;border-radius:inherit;background:linear-gradient(90deg,#2563eb,#60a5fa);transition:width .5s}.progress-list .danger i{background:#f43f5e}
.chat-summary { display:flex; align-items:center; justify-content:space-around; gap:24px; min-height:210px; }.chat-summary ul{list-style:none;padding:0;margin:0;min-width:190px}.chat-summary li{display:grid;grid-template-columns:12px 1fr auto;align-items:center;gap:10px;padding:12px 0;border-bottom:1px solid #f1f5f9}.chat-summary li span{color:#64748b;font-size:.76rem}.chat-summary li strong{color:#172033}.dot{width:9px;height:9px;border-radius:50%}.dot.waiting{background:#f59e0b}.dot.active{background:#2563eb}.dot.closed{background:#cbd5e1}
.recent-lots { display:grid; }.lot-row{display:grid;grid-template-columns:minmax(140px,1fr) auto auto;align-items:center;gap:18px;padding:14px 0;border-bottom:1px solid #f1f5f9}.lot-row:last-child{border:0}.lot-row>div:first-child{display:flex;flex-direction:column;min-width:0}.lot-row strong{font-size:.78rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.lot-row span,.lot-stats{color:#94a3b8;font-size:.68rem}.lot-row .lot-template{display:block;margin:3px 0 1px;color:#475569;font-size:.69rem;font-weight:700;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.lot-row .lot-date{line-height:1.3}.lot-row>b{padding:6px 9px;border-radius:999px;font-size:.66rem}.status-complete{color:#047857;background:#d1fae5}.status-pending{color:#b45309;background:#fef3c7}.dashboard-empty{padding:30px;text-align:center;color:#94a3b8;font-size:.78rem}
@media(max-width:1400px){.metric-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:991.98px){.modernSidebar-nav.header.navbar{width:230px!important}.main-content{width:100%!important;margin-left:0!important}.dashboard-grid{grid-template-columns:1fr}.metric-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:575.98px){.dashboard-container{padding:24px 14px}.dashboard-heading{align-items:flex-start;flex-direction:column}.metric-grid{grid-template-columns:1fr 1fr;gap:10px}.metric-card{padding:14px}.metric-card strong{font-size:1.35rem}.chat-summary{align-items:stretch;flex-direction:column}.chart-donut{margin:auto}.lot-row{grid-template-columns:1fr auto}.lot-stats{display:none}.panel-brand span,.header-status{display:none!important}}
