/* ==========================================================================
   ISELÍN GMAN — SISTEMA DE ESTILOS GLOBAL
   ========================================================================== */

:root {
    --orange:   #ff7328;
    --orange-h: #e65f1b;
    --bg:       #f1f5f9;
    --text:     #1e293b;
    --muted:    #64748b;
    --border:   #cbd5e1;
    --white:    #ffffff;
    --danger:   #ef4444;
    --warning:  #f59e0b;
    --success:  #22c55e;
    --info:     #3b82f6;
    --shadow:   0 4px 6px -1px rgba(0,0,0,0.05);
    --radius:   12px;
}

/* ── DARK MODE GLOBAL ── */
[data-bs-theme="dark"] {
    --bg:     #0f172a;
    --text:   #f8fafc;
    --border: #334155;
    --white:  #1e293b;
    --muted:  #94a3b8;
}
[data-bs-theme="dark"] body                          { background: var(--bg); color: var(--text); }
[data-bs-theme="dark"] .sidebar                      { background: var(--white); border-color: var(--border); }
[data-bs-theme="dark"] .sidebar-link.active          { background: #2c2522 !important; color: var(--orange) !important; }
[data-bs-theme="dark"] .sidebar-link:hover           { background: #243044 !important; color: var(--text) !important; }
[data-bs-theme="dark"] .panel-card,
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .task-card,
[data-bs-theme="dark"] .chk-card,
[data-bs-theme="dark"] .rep-card                     { background: var(--white); border-color: var(--border); }
[data-bs-theme="dark"] .modal-box,
[data-bs-theme="dark"] .modal-fotos-box              { background: var(--white); }
[data-bs-theme="dark"] .ot-table th                  { background: #243044; }
[data-bs-theme="dark"] .kpi-card                     { background: #1e293b; border-color: var(--border); }
[data-bs-theme="dark"] .form-control                 { background: #243044; border-color: var(--border); color: var(--text); }
[data-bs-theme="dark"] .form-control:focus           { background: var(--white); border-color: var(--orange); }
[data-bs-theme="dark"] .task-meta                    { background: #243044; }
[data-bs-theme="dark"] .ot-resumen                   { background: #243044; }
[data-bs-theme="dark"] .subtab-btn                   { background: #243044; color: var(--muted); }
[data-bs-theme="dark"] .check-item                   { border-color: #243044; }
[data-bs-theme="dark"] .btn-action                   { background: #243044; border-color: var(--border); color: var(--text); }
[data-bs-theme="dark"] .bottom-nav                   { background: var(--white); border-color: var(--border); }
[data-bs-theme="dark"] .table-container              { background: var(--white); }
[data-bs-theme="dark"] .progress-bar-bg              { background: #334155; }
[data-bs-theme="dark"] .chart-card                   { border-color: var(--border); }
[data-bs-theme="dark"] .no-tasks                     { background: var(--white); border-color: var(--border); }

/* Reset base */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Public Sans', sans-serif; }
body { background: var(--bg); color: var(--text); display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.navbar { position: sticky; top: 0; z-index: 1000; flex-shrink: 0; }

/* ── BOOTSTRAP CUSTOM ── */
.bg-iselin { background-color: var(--orange) !important; }

/* ==========================================================================
   LAYOUT
   ========================================================================== */
.app-wrapper       { display: flex; min-height: 0; height: calc(100vh - 56px); background: var(--bg); overflow: hidden; }
.main-layout       { display: flex; flex: 1; min-height: 0; height: calc(100vh - 56px); overflow: hidden; }
.main-content      { flex-grow: 1; min-width: 0; min-height: 0; padding: 20px; overflow-y: auto; }
.content-workspace { flex: 1; min-width: 0; min-height: 0; padding: 24px; overflow: auto; }

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.sidebar {
    width: 260px;
   height: 100%;
    background: var(--white);
    border-right: 2px solid var(--border);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
   overflow-y: auto;
}

.sidebar-link {
    background: none !important;
    border: none !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    padding: 14px 24px !important;
    color: var(--muted) !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    cursor: pointer;
    border-left: 4px solid transparent !important;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left !important;
    text-decoration: none !important;
}
.sidebar-link:hover  { background: #f8fafc !important; color: var(--text) !important; }
.sidebar-link.active { color: var(--orange) !important; background: #fff5f0 !important; border-left-color: var(--orange) !important; }
.sidebar-icon { font-size: 1.2rem; display: inline-block; width: 24px; text-align: center; }
.menu-badge   { margin-left: auto; background: var(--danger); color: var(--white); font-size: 0.72rem; padding: 2px 8px; border-radius: 20px; }

/* ==========================================================================
   PANEL CARDS
   ========================================================================== */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; height: 100%; }

.panel-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 14px;
    border-bottom: 2px solid var(--bg);
    padding-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==========================================================================
   SUBTABS
   ========================================================================== */
.subtab-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-bottom: 14px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.subtab-btn { padding: 9px 8px; background: var(--bg); border: none; font-size: 0.8rem; font-weight: 600; color: var(--muted); cursor: pointer; transition: all 0.2s; text-align: center; }
.subtab-btn:first-child { border-right: 1px solid var(--border); }
.subtab-btn.active { background: var(--orange); color: var(--white); }
.scrollable-list { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 10px; }

/* ==========================================================================
   CHECKLIST Y REPORTE CARDS (supervisor)
   ========================================================================== */
.chk-card { border: 1px solid var(--border); border-radius: 8px; padding: 13px; border-left: 4px solid var(--warning); transition: all 0.2s; }
.chk-card:hover { border-color: var(--orange); background: #fffbfa; }
.chk-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.chk-falla-item { font-size: 0.8rem; font-weight: 500; padding: 2px 0; }
.chk-falla-item.oblig { color: var(--danger); }
.chk-falla-item.gen   { color: var(--warning); }
.chk-actions { display: flex; gap: 8px; margin-top: 10px; }
.btn-sm-outline { background: var(--bg); border: 1px solid var(--border); color: var(--muted); padding: 6px 12px; border-radius: 6px; font-size: 0.78rem; font-weight: 600; cursor: pointer; border: 1px solid var(--border); }
.btn-sm-outline:hover { background: #e2e8f0; }
.btn-sm-orange { background: var(--orange); color: var(--white); border: none; padding: 6px 12px; border-radius: 6px; font-size: 0.78rem; font-weight: 600; cursor: pointer; }
.btn-sm-orange:hover { background: var(--orange-h); }

.rep-card { border: 1px solid var(--border); border-radius: 8px; padding: 13px; cursor: pointer; transition: all 0.2s; border-left: 4px solid var(--danger); }
.rep-card:hover, .rep-card.selected { border-color: var(--orange); background: #fffbfa; }
.rep-tipo-badge { display: inline-block; background: #fee2e2; color: var(--danger); font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; margin-bottom: 6px; }
.rep-detalle { font-size: 0.82rem; color: var(--text); line-height: 1.45; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.btn-ver-fotos { background: #eff6ff; color: var(--info); border: 1px solid #bfdbfe; padding: 5px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; cursor: pointer; }
.btn-ver-fotos:hover { background: #dbeafe; }

/* ==========================================================================
   FORMULARIOS
   ========================================================================== */
.form-group { margin-bottom: 13px; }
.form-group label { display: block; font-weight: 600; font-size: 0.82rem; margin-bottom: 4px; }
.form-control { width: 100%; padding: 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 0.9rem; transition: border-color 0.2s, background 0.2s; }
.form-control:focus { outline: none; border-color: var(--orange); background: var(--white); box-shadow: 0 0 0 3px rgba(255,115,40,0.12); }
textarea.form-control { resize: vertical; min-height: 90px; }

/* ==========================================================================
   BOTONES
   ========================================================================== */
.btn { padding: 10px 14px; border-radius: 6px; font-weight: 600; border: none; cursor: pointer; }
.btn-orange { background: var(--orange); color: var(--white); width: 100%; font-size: 0.95rem; }
.btn-orange:hover { background: var(--orange-h); }

/* btn-submit: botón principal mobile del chofer */
.btn-submit {
    display: block;
    width: 100%;
    background: var(--orange);
    color: var(--white);
    border: none;
    padding: 14px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    letter-spacing: 0.3px;
    margin-top: 4px;
    transition: background 0.2s;
}
.btn-submit:active, .btn-submit:hover { background: var(--orange-h); }

.btn-action { background: var(--bg); border: 1px solid var(--border); padding: 5px 10px; border-radius: 6px; font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.btn-action:hover { background: #e2e8f0; }
.btn-action-primary { background: var(--orange); color: var(--white); border: none; padding: 6px 14px; border-radius: 6px; font-size: 0.78rem; font-weight: 600; cursor: pointer; }
.btn-action-primary:hover { background: var(--orange-h); }
.btn-outline-success { background: #f0fdf4; color: var(--success); border: 1px dashed var(--success); width: 100%; font-size: 0.85rem; padding: 10px; border-radius: 6px; cursor: pointer; font-weight: 600; }

/* ==========================================================================
   ALERTAS
   ========================================================================== */
.alert { padding: 13px 16px; border-radius: 8px; font-weight: 600; font-size: 0.9rem; margin-bottom: 16px; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error,
.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ==========================================================================
   TABLAS Y KPIs
   ========================================================================== */
.table-container { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); padding: 20px; box-shadow: var(--shadow); }
.kpi-container { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi-card  { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.kpi-title { font-size: 0.78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.kpi-value { font-size: 1.8rem; font-weight: 700; }
.kpi-sub   { font-size: 0.72rem; font-weight: 500; }
.charts-container { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.chart-card  { border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.chart-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 14px; }
.chart-row   { margin-bottom: 12px; }
.chart-label { display: flex; justify-content: space-between; font-size: 0.82rem; margin-bottom: 4px; font-weight: 500; }
.progress-bar-bg   { background: #e2e8f0; height: 10px; border-radius: 5px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 5px; }
.ot-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.ot-table th, .ot-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); text-align: left; }
.ot-table th { background: var(--bg); font-weight: 700; }
.ot-table tr:last-child td { border-bottom: none; }
.ot-table tr:hover td { background: rgba(0,0,0,0.02); }

/* ==========================================================================
   BADGES Y TAGS
   ========================================================================== */
.badge-count   { background: var(--orange);  color: var(--white); font-size: 0.75rem; padding: 3px 9px; border-radius: 20px; }
.badge-danger  { background: var(--danger);  color: var(--white); font-size: 0.75rem; padding: 3px 9px; border-radius: 20px; }
.badge-warning { background: var(--warning); color: var(--white); font-size: 0.75rem; padding: 3px 9px; border-radius: 20px; }
.badge-success { background: var(--success); color: var(--white); font-size: 0.75rem; padding: 3px 9px; border-radius: 20px; }
.badge-oblig   { background: #fee2e2; color: var(--danger); font-size: 0.7rem; padding: 2px 8px; border-radius: 20px; }
.badge-gen     { background: #e0f2fe; color: #0369a1;       font-size: 0.7rem; padding: 2px 8px; border-radius: 20px; }
.interno-tag   { background: var(--text); color: var(--white); font-weight: 700; padding: 2px 7px; border-radius: 4px; font-size: 0.82rem; }
.fecha-tag     { font-size: 0.72rem; color: var(--muted); }
.chofer-tag    { font-size: 0.78rem; color: var(--muted); font-weight: 500; margin-bottom: 6px; }
.status-pill   { display: inline-block; padding: 3px 8px; border-radius: 20px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; }
.status-pill.pendiente        { background: #fef3c7; color: var(--warning); }
.status-pill.en_proceso       { background: #dbeafe; color: var(--info); }
.status-pill.pausado_repuesto { background: #fee2e2; color: var(--danger); }
.status-pill.terminada        { background: #dcfce7; color: var(--success); }

/* ==========================================================================
   MODALES
   ========================================================================== */
.modal-overlay   { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-box       { background: var(--white); border-radius: var(--radius); width: 100%; max-width: 460px; padding: 24px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); }
.modal-fotos-box { background: var(--white); border-radius: var(--radius); width: 100%; max-width: 680px; padding: 24px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.15); }
.modal-actions   { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.modal-title     { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.modal-subtitle  { font-size: 0.82rem; color: var(--muted); margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.fotos-grid      { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.foto-slot img   { width: 100%; border-radius: 8px; object-fit: cover; max-height: 300px; border: 1px solid var(--border); }
.foto-slot-label { font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.foto-vacia      { background: var(--bg); border: 2px dashed var(--border); border-radius: 8px; height: 180px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.85rem; }

/* ==========================================================================
   MÓDULO CHOFER
   ========================================================================== */
.section-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 3px; }
.section-sub   { font-size: 0.85rem; color: var(--muted); margin-bottom: 16px; }
.card       { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card-title { font-size: 0.9rem; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

.check-item { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid #f1f5f9; }
.check-item:last-child { border-bottom: none; }
.check-label { font-size: 0.9rem; font-weight: 500; }
.check-label.oblig { font-weight: 700; }

.switch { position: relative; display: inline-block; width: 48px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: #cbd5e1; transition: .25s; border-radius: 34px; }
.slider::before { position: absolute; content: ""; height: 18px; width: 18px; left: 4px; bottom: 4px; background: var(--white); transition: .25s; border-radius: 50%; }
input:checked + .slider { background: var(--orange); }
input:checked + .slider::before { transform: translateX(22px); }
.switch.oblig input:not(:checked) + .slider { background: var(--danger); }

.warning-banner { background: #fffbeb; border: 1px solid #fef3c7; border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; font-size: 0.85rem; color: #92400e; font-weight: 500; }
.warning-banner b { display: block; margin-bottom: 4px; }

.tipo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tipo-opt { position: relative; }
.tipo-opt input { position: absolute; opacity: 0; }
.tipo-opt label { display: block; padding: 12px 8px; border: 2px solid var(--border); border-radius: 8px; text-align: center; font-size: 0.82rem; font-weight: 600; cursor: pointer; background: #f8fafc; color: var(--muted); transition: all 0.2s; }
.tipo-opt input:checked + label { border-color: var(--orange); background: #fff5f0; color: var(--orange); }
.tipo-emoji { display: block; font-size: 1.5rem; margin-bottom: 4px; }

.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.photo-box  { border: 2px dashed var(--border); border-radius: 8px; padding: 20px 10px; text-align: center; position: relative; cursor: pointer; transition: border-color 0.2s; overflow: hidden; }
.photo-box:hover { border-color: var(--orange); }
.photo-box input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.photo-preview { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; display: none; }
.photo-icon { font-size: 1.8rem; display: block; margin-bottom: 5px; }
.photo-text { font-size: 0.75rem; color: var(--muted); font-weight: 500; }

.ot-notice       { margin-top: 12px; background: #fffbeb; border: 1px solid #fef3c7; border-radius: 8px; padding: 12px; }
.ot-notice-title { font-size: 0.82rem; font-weight: 700; color: #92400e; margin-bottom: 6px; }
.ot-notice-item  { font-size: 0.8rem; color: #78350f; font-weight: 500; margin-bottom: 3px; }
.ot-notice-note  { font-size: 0.75rem; color: #9a3412; font-style: italic; margin-top: 6px; }

/* ==========================================================================
   MÓDULO OPERARIO
   ========================================================================== */
.task-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow); border-left: 5px solid var(--warning); }
.task-card.pendiente        { border-left-color: var(--warning); }
.task-card.en_proceso       { border-left-color: var(--info); }
.task-card.pausado_repuesto { border-left-color: var(--danger); }
.task-card.terminada        { border-left-color: var(--success); opacity: 0.7; }
.task-header      { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ot-number        { font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.task-instruction { font-size: 1.05rem; font-weight: 600; margin-bottom: 12px; }
.task-meta        { font-size: 0.8rem; color: var(--muted); background: var(--bg); padding: 6px 10px; border-radius: 6px; margin-bottom: 14px; }
.btn-status { width: 100%; padding: 12px; border-radius: 8px; font-size: 0.9rem; font-weight: 600; border: none; cursor: pointer; background: #eff6ff; color: var(--info); text-align: center; transition: background 0.2s; }
.btn-status.btn-terminar   { background: #dcfce7; color: var(--success); }
.btn-status.btn-finalizado { background: var(--bg); color: var(--muted); cursor: not-allowed; }
.no-tasks { text-align: center; color: var(--muted); padding: 30px; font-style: italic; background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); }

/* ==========================================================================
   MÓDULO PAÑOL
   ========================================================================== */
.historial-item { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--bg); }
.historial-item:last-child { border-bottom: none; }
.historial-ot   { font-weight: 700; font-size: 0.9rem; }
.historial-mat  { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.historial-hora { font-size: 0.75rem; color: var(--muted); text-align: right; }
.historial-cant { font-size: 0.8rem; font-weight: 700; color: var(--success); }
.row-urgente td:first-child { border-left: 4px solid var(--danger); }
.row-normal  td:first-child { border-left: 4px solid var(--border); }
.nota-urgente { background: #fff1f2; border: 1px solid #fecdd3; border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; font-size: 0.82rem; color: #9f1239; font-weight: 500; }
.mat-row { display: grid; grid-template-columns: 2fr 80px 36px; gap: 8px; margin-bottom: 8px; align-items: center; }
.btn-del  { background: #fee2e2; border: none; color: var(--danger); border-radius: 6px; padding: 8px; cursor: pointer; font-size: 0.85rem; }
.ot-resumen { background: var(--bg); border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; }
.ot-resumen-row { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; }
.ot-resumen-row:last-child { margin-bottom: 0; }
.ot-resumen-label { font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; width: 80px; flex-shrink: 0; }
.ot-resumen-val   { font-size: 0.85rem; font-weight: 600; color: var(--text); }

/* ==========================================================================
   BOTTOM NAV (mobile operario/chofer)
   ========================================================================== */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: 64px; background: var(--white); border-top: 2px solid var(--border); display: grid; z-index: 200; }
.nav-item { background: none; border: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 0.75rem; font-weight: 600; cursor: pointer; }
.nav-item.active { color: var(--orange); }
.nav-icon { font-size: 1.3rem; line-height: 1; }

/* ==========================================================================
   UTILIDADES
   ========================================================================== */
.hidden { display: none !important; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
    .sidebar { width: 70px; }
    .sidebar-link { padding: 14px 0 !important; justify-content: center !important; }
    .sidebar-link span:not(.sidebar-icon) { display: none !important; }
    .kpi-container { grid-template-columns: 1fr 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; height: auto; }
    .charts-container { grid-template-columns: 1fr; }
}
.th-filter { margin-top: 6px; }
.th-filter-input,
.th-filter-select {
    width: 100%;
    font-size: 0.75rem;
    font-weight: 400;
    padding: 5px 8px;
    border-radius: 5px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text);
}
.btn-sort {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    margin-left: 4px;
    font-size: 0.75rem;
}
.btn-sort:hover { color: var(--orange); }
/* ==========================================================================
   UI — TOASTS (sistema unificado de avisos)   [js/ui.js + helpers/flash.php]
   ========================================================================== */
.ui-toast-wrap {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    max-width: min(380px, calc(100vw - 2rem));
    pointer-events: none;
}
.ui-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    padding: .85rem 1rem;
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--border);
    border-left: 4px solid var(--info);
    border-radius: var(--radius);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,.18);
    opacity: 0;
    transform: translateX(20px);
    transition: opacity .25s ease, transform .25s ease;
}
.ui-toast.is-visible { opacity: 1; transform: translateX(0); }
.ui-toast__icon { font-size: 1.15rem; line-height: 1.4; margin-top: .05rem; }
.ui-toast__msg  { flex: 1; font-size: .92rem; line-height: 1.4; white-space: pre-line; word-break: break-word; }
.ui-toast__close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--muted);
    padding: 0 .1rem;
    margin-left: .2rem;
}
.ui-toast__close:hover { color: var(--text); }

.ui-toast--success { border-left-color: var(--success); }
.ui-toast--success .ui-toast__icon { color: var(--success); }
.ui-toast--error   { border-left-color: var(--danger);  }
.ui-toast--error   .ui-toast__icon { color: var(--danger);  }
.ui-toast--warning { border-left-color: var(--warning); }
.ui-toast--warning .ui-toast__icon { color: var(--warning); }
.ui-toast--info    { border-left-color: var(--info);    }
.ui-toast--info    .ui-toast__icon { color: var(--info);    }

@media (max-width: 480px) {
    .ui-toast-wrap { left: 1rem; right: 1rem; max-width: none; }
}

/* ==========================================================================
   UI — MODAL DE CONFIRMACIÓN   [ui.confirm() en js/ui.js]
   ========================================================================== */
.ui-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 3100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, .55);
    opacity: 0;
    transition: opacity .2s ease;
}
.ui-modal-overlay.is-visible { opacity: 1; }
.ui-modal {
    width: min(420px, 100%);
    padding: 1.4rem 1.5rem;
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 20px 45px -12px rgba(0, 0, 0, .4);
    transform: translateY(12px) scale(.98);
    transition: transform .2s ease;
}
.ui-modal-overlay.is-visible .ui-modal { transform: translateY(0) scale(1); }
.ui-modal__titulo { font-size: 1.1rem; font-weight: 700; margin-bottom: .5rem; }
.ui-modal__msg {
    font-size: .94rem;
    line-height: 1.5;
    color: var(--muted);
    white-space: pre-line;
    margin-bottom: 1.3rem;
}
.ui-modal__acciones { display: flex; justify-content: flex-end; gap: .6rem; }
.ui-modal__btn {
    border: none;
    cursor: pointer;
    padding: .55rem 1.1rem;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    font-family: inherit;
    transition: filter .15s ease, background .15s ease;
}
.ui-modal__btn--cancel {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.ui-modal__btn--cancel:hover { background: var(--bg); }
.ui-modal__btn--primary { background: var(--orange); color: #fff; }
.ui-modal__btn--primary:hover { background: var(--orange-h); }
.ui-modal__btn--danger { background: var(--danger); color: #fff; }
.ui-modal__btn--danger:hover { filter: brightness(.92); }
