:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-bg: #115e59;
    --primary-light: #ccfbf1;
    --bg: #f8fafc;
    --bg-card: white;
    --text: #334155;
    --text-light: #64748b;
    --text-white: white;
    --border: #e2e8f0;
    --shadow: 0 2px 8px rgba(0,0,0,0.05);
    --radius: 8px;
    --radius-lg: 12px;
}

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

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

body { 
    font-family: 'Inter', 'Segoe UI', sans-serif; 
    font-weight: 450;
    background: var(--bg); 
    min-height: 100vh; 
    color: var(--text);
}

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

/* === LAYOUT COMÚN === */
.header { 
    background: var(--bg-card); 
    padding: 1rem 2rem; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.header + .container { padding-top: 0; }
.header + .container .card:first-child { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.header h1 { color: var(--text); font-size: 1.25rem; }
.header h1 a { color: #667eea; text-decoration: none; }
.header-right { display: flex; align-items: center; gap: 1rem; }

.container { padding: 1rem 2rem 2rem; max-width: 1000px; margin: 0 auto; }

.card { 
    background: var(--bg-card); 
    padding: 1.5rem; 
    border-radius: var(--radius-lg); 
    margin-bottom: 1.5rem; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); 
}
.card h2 { color: var(--text); font-size: 1.1rem; margin-bottom: 1rem; }

/* === FORMULARIOS === */
.form-row { display: grid; grid-template-columns: 2fr 1fr auto; gap: 0.5rem; align-items: flex-end; margin-bottom: 0.4rem; }
.form-group { }
.form-group label { display: block; margin-bottom: 0.1rem; color: var(--text-light); font-size: 0.8rem; font-weight: 600; }
.form-group input, .form-group select, .form-group textarea { 
    width: 100%; 
    padding: 0.25rem 0.5rem; 
    border: 1px solid var(--border); 
    border-radius: 6px; 
    font-size: 0.85rem; 
    font-weight: 600;
    font-family: inherit;
}
.form-group textarea { 
    min-height: 120px;
    min-width: 400px;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #667eea; }

/* === BOTONES === */
.btn { 
    padding: 0.625rem 1.25rem; 
    border: none; 
    border-radius: 6px; 
    font-weight: 600; 
    cursor: pointer; 
    font-size: 0.9rem; 
    transition: all 0.2s;
    font-family: inherit;
}
.btn-primary { background: var(--primary); color: var(--text-white); }
.btn-primary:hover { background: var(--primary-dark); }

.btn-save-percent { 
    padding: 0.75rem 2rem; 
    background: var(--primary); 
    color: var(--text-white); 
    border: none; 
    border-radius: 6px; 
    font-weight: 600; 
    cursor: pointer; 
    font-family: inherit; 
    font-size: 0.9rem; 
    transition: all 0.2s; 
}
.btn-save-percent:hover { 
    background: var(--primary-dark); 
}

.btn-new { 
    background: var(--primary); 
    color: var(--text-white); 
    text-decoration: none; 
    padding: 0.625rem 1.25rem; 
    border-radius: 6px; 
    font-weight: 600; 
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-new:hover { background: var(--primary-dark); }

.btn-secondary { 
    background: #94a3b8; 
    color: var(--text-white); 
    text-decoration: none; 
    padding: 0.5rem 1rem; 
    border-radius: 6px; 
}

/* === TABLAS === */
.table { width: 100%; border-collapse: collapse; font-size: 0.85rem; font-weight: 450; }
.table th, .table td { padding: 4px 8px; border: 1px solid var(--border); }
.table th { background: #334155; color: var(--text-white); font-weight: 600; }
.table tbody tr:hover { background: #f8fafc; }

/* === BADGES === */
.badge {
    background: #e0e7ff;
    color: #4338ca;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-pen { background: #fee2e2; color: #dc2626; padding: 0.25rem 0.6rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.badge-pag { background: #d1fae5; color: #059669; padding: 0.25rem 0.6rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }

/* === ACCIONES === */
.actions { display: flex; gap: 0.5rem; }
.actions a { text-decoration: none; padding: 0.25rem 0.5rem; border-radius: 4px; color: var(--text-light); }
.actions a:hover { background: #e2e8f0; }

/* === ALERTS === */
.alert { padding: 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.85rem; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #bbf7d0; }
.alert-danger { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }

/* === LOGIN === */
.login-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.login-header { text-align: center; margin-bottom: 2rem; }
.login-header h1 { color: var(--primary-bg); font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; }
.login-header p { color: var(--text-light); font-size: 0.875rem; }
.form-input { 
    width: 100%; 
    padding: 0.75rem 1rem; 
    border: 1px solid var(--border); 
    border-radius: var(--radius); 
    font-size: 0.9rem; 
    transition: all 0.2s;
    font-family: inherit;
}
.form-input:focus { outline: none; border-color: var(--primary-bg); box-shadow: 0 0 0 3px rgba(17,94,89,0.1); }
.btn-ingresar { 
    width: 100%; 
    padding: 0.875rem; 
    background: var(--primary-bg); 
    color: var(--text-white); 
    border: none; 
    border-radius: var(--radius); 
    font-size: 0.9rem; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.2s;
    margin-top: 0.5rem;
    font-family: inherit;
}
.btn-ingresar:hover { background: var(--primary); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16,185,129,0.3); }
.login-link { 
    display: block; 
    text-align: center; 
    margin-top: 1.5rem; 
    color: var(--text-light); 
    font-size: 0.8rem; 
    text-decoration: none;
    transition: color 0.2s;
}
.login-link:hover { color: var(--primary-bg); }
.btn-volver { 
    background: none; 
    border: none; 
    color: var(--text-light); 
    font-size: 0.8rem; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    gap: 0.25rem;
    margin-bottom: 1rem;
    font-family: inherit;
}
.btn-volver:hover { color: var(--primary-bg); }

/* === TOOLBAR === */
.toolbar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.toolbar label {
    color: #64748b;
    font-weight: 500;
}

.toolbar select {
    padding: 0.625rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
}

/* === SIDEBAR (index.php) === */
.sidebar {
    position: fixed;
    left: -230px;
    width: 230px;
    height: 100vh;
    background: var(--primary-bg);
    color: white;
    transition: left 0.3s;
    z-index: 1000;
    overflow-y: auto;
}
.sidebar.open { left: 0; }
.sidebar-header { 
    padding: 1.25rem 1.5rem; 
    background: #0f4a44; 
    color: var(--text-white); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}
.sidebar-header h3 { font-size: 0.95rem; font-weight: 600; }
.sidebar-close { 
    background: none; 
    border: none; 
    color: #99f6e4; 
    font-size: 1.5rem; 
    cursor: pointer; 
    width: 28px; 
    height: 28px; 
    border-radius: 6px; 
    transition: all 0.2s; 
}
.sidebar-close:hover { background: #14b8a6; color: var(--text-white); }
.sidebar-section { padding: 0.5rem 0; border-bottom: 1px solid #14b8a6; }
.sidebar-section h4 { 
    color: #5eead4; 
    font-size: 0.6rem; 
    text-transform: uppercase; 
    letter-spacing: 1.5px; 
    padding: 0.75rem 1.5rem 0.25rem; 
    font-weight: 700; 
}
.sidebar a { 
    display: flex; 
    align-items: center; 
    gap: 0.6rem; 
    padding: 0.5rem 1.5rem; 
    color: var(--primary-light); 
    text-decoration: none; 
    font-size: 0.8rem; 
    transition: all 0.2s; 
    border-left: 3px solid transparent; 
}
.sidebar a:hover { background: var(--primary); color: var(--text-white); border-left-color: #34d399; }
.sidebar a .icon { font-size: 1rem; color: #5eead4; }
.sidebar a:hover .icon { color: var(--text-white); }

.overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.3); 
    opacity: 0; 
    visibility: hidden; 
    transition: all 0.3s; 
    z-index: 999; 
}
.overlay.show { opacity: 1; visibility: visible; }

.menu-toggle { 
    background: var(--primary-bg); 
    border: none; 
    color: var(--text-white); 
    width: 36px; 
    height: 36px; 
    border-radius: 8px; 
    font-size: 1rem; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: all 0.2s; 
}
.menu-toggle:hover { background: var(--primary); }

.top-bar { 
    background: var(--bg-card); 
    padding: 1rem 2.5rem; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.06); 
    position: sticky; 
    top: 0; 
    z-index: 100; 
    border-bottom: 1px solid var(--border); 
    margin: -1rem -1rem 0 -1rem; 
}
.top-bar-center { display: flex; align-items: center; gap: 1rem; }
.top-bar h1 { font-size: 1.1rem; color: var(--text); font-weight: 600; line-height: 1; }
.top-bar-right { display: flex; align-items: center; gap: 1rem; line-height: 1; }
.saludo { font-size: 0.85rem; color: var(--text-light); line-height: 1; }
.saludo strong { color: var(--primary-bg); font-weight: 700; }
.btn-salir { 
    background: #f1f5f9; 
    border: 1px solid var(--border); 
    color: var(--text-light); 
    cursor: pointer; 
    font-size: 0.8rem; 
    padding: 0.5rem 1rem; 
    border-radius: 6px; 
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: inherit;
}
.btn-salir:hover { background: #fee2e2; border-color: #fecaca; color: #ef4444; }

.menu-section { margin-bottom: 2rem; }
.menu-section-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    background: var(--primary-bg);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    color: var(--text-white);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.menu-section-bar .icon { font-size: 1rem; }
.menu-section-bar .line { flex: 1; height: 1px; background: rgba(255,255,255,0.3); }

.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }

.menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    font-size: 0.85rem;
    box-shadow: var(--shadow);
    transition: all 0.2s;
    border: 2px solid transparent;
}
.menu-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--text);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}
.menu-btn .icon { font-size: 1.25rem; opacity: 0.8; min-width: 20px; text-align: center; }
.menu-btn:hover .icon { opacity: 1; }

.menu-btn.verdeo { border-left: 3px solid var(--primary); }
.menu-btn.verdeo:hover { border-color: var(--primary); background: #f0fdf4; }

.menu-btn.azul { border-left: 3px solid #3b82f6; }
.menu-btn.azul:hover { border-color: #3b82f6; background: #eff6ff; }

.menu-btn.amarillo { border-left: 3px solid #f59e0b; }
.menu-btn.amarillo:hover { border-color: #f59e0b; background: #fffbeb; }

.menu-btn.rojo { border-left: 3px solid #ef4444; }
.menu-btn.rojo:hover { border-color: #ef4444; background: #fef2f2; }

.menu-btn.morado { border-left: 3px solid #8b5cf6; }
.menu-btn.morado:hover { border-color: #8b5cf6; background: #f5f3ff; }

.menu-btn.gris { border-left: 3px solid var(--text-light); }
.menu-btn.gris:hover { border-color: var(--text-light); background: #f8fafc; }

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    color: #64748b;
    padding: 3rem;
}

/* === FORM LABEL === */
.form-label {
    font-weight: 600;
    color: #475569;
    display: block;
    margin-bottom: 0.25rem;
}

/* === FORM SELECT === */
.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}

.form-select:focus {
    outline: none;
    border-color: #667eea;
}

/* === FORM ACTIONS === */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2.5rem;
}

/* === TH CENTER === */
.th-center {
    text-align: center;
}

/* === TABLE CONTAINER === */
.table-container {
    padding: 0;
    overflow-x: auto;
}

/* === CARD SIZES === */
.card-sm {
    max-width: 500px;
    margin: 2rem auto;
}

.card-md {
    max-width: 600px;
    margin: 2rem auto;
}

.card-lg {
    max-width: 700px;
    margin: 2rem auto;
}

.card-flush {
    padding: 0;
    overflow-x: auto;
}

/* === RECORD COUNT === */
.record-count {
    color: #64748b;
}

/* === ALERT VARIANTS === */
.alert-danger-inline {
    background: #fef2f2;
    color: #dc2626;
}

.alert-success-inline {
    background: #d1fae5;
    color: #065f46;
}

.alert-error-inline {
    background: #fee2e2;
    color: #991b1b;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #fecaca;
}

/* === FLEX UTILITIES === */
.flex-gap-1rem {
    display: flex;
    gap: 1rem;
}

.flex-gap-05rem {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* === REPORTES === */
.reporte-scroll-container {
    max-height: 500px;
    overflow: auto;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: 4px;
    margin-top: 1rem;
}

/* === EXCEL EXPORT HEADERS === */
.excel-header {
    background: #10b981;
    color: white;
    font-weight: bold;
}

/* === ARCHIVO ACTUAL === */
.archivo-actual {
    margin-top: 1rem;
}

/* === TEXT ALIGN === */
.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

/* === TOTALS CARD (cobranza) === */
.totals-card {
    background: #e0e0e0;
    display: flex;
    justify-content: space-between;
}

.total-item {
    text-align: center;
}

.total-label {
    display: block;
    font-size: 0.75rem;
    color: #666;
}

.total-value {
    display: block;
    font-size: 1rem;
    margin-top: 0.25rem;
    font-weight: 600;
}

/* === EXPORT BUTTONS CONTAINER === */
.export-buttons {
    margin-top: 1rem;
}

.btn-export {
    background: #f59e0b;
    color: white;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-export:hover {
    background: #d97706;
}

/* === POSITIVE/NEGATIVE VALUES === */
.value-positive {
    color: #10b981;
}

.value-negative {
    color: #dc2626;
}

.value-bold {
    font-weight: 600;
}

/* === GESTOR ARCHIVOS === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
}

.modal-header {
    background: #dc2626;
    color: white;
    padding: 1rem;
    margin: -1.5rem -1.5rem 1rem;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.folder-item {
    display: block;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
}

.folder-item:hover {
    background: #f0fdf4;
    border-color: var(--primary);
}

.folder-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.folder-detail {
    font-size: 0.85rem;
    color: #64748b;
}

.breadcrumb {
    background: #f1f5f9;
    padding: 0.75rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: #10b981;
    text-decoration: none;
}

.breadcrumb-separator {
    color: #94a3b8;
}

.breadcrumb-current {
    font-weight: 600;
    color: var(--text);
}

.file-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.upload-section {
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    margin-top: 1rem;
}

.upload-form {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-input {
    flex: 1;
    padding: 0.5rem;
}

.file-hint {
    color: #94a3b8;
    font-size: 0.8rem;
}

.nav-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-delete-sm {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
}

.btn-delete-sm:hover {
    background: #fecaca;
}

.empty-folder {
    text-align: center;
    color: #94a3b8;
    padding: 2rem;
}

.width-80 { width: 80px; }
.width-100 { width: 100px; }
.width-120 { width: 120px; }
.width-200 { width: 200px; }
.width-250 { width: 250px; }
.width-300 { width: 300px; }
.width-400 { width: 400px; }
.width-200 { width: 200px; }
.width-300 { width: 300px; }
.width-400 { width: 400px; }

/* Utility classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #64748b; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 2rem; }

/* Alert variants */
.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Form actions */
.form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2.5rem;
}

/* Cancel button */
.btn-cancel {
    background: #94a3b8;
    color: white;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-cancel:hover {
    background: #64748b;
}

/* Card flush */
.card-flush {
    padding: 4rem;
    text-align: center;
    color: #64748b;
}

/* Empty state */
.empty-state {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

/* Grid columns */
.grid-2 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.grid-4col {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr 1.5fr;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.width-auto {
    width: auto;
}

/* Payment section */
.payment-section {
    background: #f1f5f9;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
    text-align: right;
}

.payment-total {
    margin: 0;
    color: #1e293b;
}

/* Toolbar */
.toolbar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
}

.toolbar label {
    color: #64748b;
    font-weight: 500;
}

/* Info box */
.info-box {
    background: #dbeafe;
    color: #1e40af;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

/* Select styled */
.select-styled {
    padding: 0.625rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* File manager styles */
.card-900 {
    max-width: 900px;
    margin: 0 auto;
}

.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.folder-item {
    padding: 1rem;
    border-radius: 8px;
    text-decoration: none;
    color: #334155;
    transition: all 0.2s;
    display: block;
}

.folder-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.folder-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.folder-detail {
    font-size: 0.85rem;
    color: #64748b;
}

/* Navigation path */
.nav-path {
    background: #f1f5f9;
    padding: 0.75rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.nav-path a {
    color: #10b981;
    text-decoration: none;
}

.nav-path .current {
    font-weight: 600;
    color: #10b981;
}

.nav-separator {
    color: #94a3b8;
}

/* File input area */
.upload-area {
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    margin-top: 1rem;
}

.upload-area form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-content {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
}

.modal-header {
    background: #dc2626;
    color: white;
    padding: 1rem;
    margin: -1.5rem -1.5rem 1rem;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-cancel-modal {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    background: #f1f5f9;
    color: #64748b;
}

.btn-danger-modal {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    background: #dc2626;
    color: white;
}

/* File row actions */
.file-link {
    color: #2563eb;
    font-weight: 500;
}

.file-link:hover {
    text-decoration: underline;
}

.btn-delete-file {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    margin-left: 0.5rem;
}

/* Input styled */
.input-styled {
    padding: 0.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
}

.input-styled:focus {
    outline: none;
    border-color: #10b981;
}

.width-150 {
    width: 150px;
}

/* Empty folder */
.empty-folder {
    text-align: center;
    color: #94a3b8;
    padding: 2rem;
}

/* Form row override */
.form-row-2 {
    grid-template-columns: 2fr 1fr;
}

.form-row-1 {
    grid-template-columns: 1fr;
}

/* User table styles */
.row-current {
    background: #f0fdf4;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.text-dark {
    color: #1e293b;
}

.justify-center {
    justify-content: center;
}

/* Disabled input */
.input-disabled {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: #f8fafc;
    color: #64748b;
}

/* Form help text */
.form-help {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 5px;
}

/* Flex utilities */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.items-center { align-items: center; }

/* Card variants */
.card-sm { max-width: 400px; }
.card-md { max-width: 600px; }
.card-lg { max-width: 800px; }

/* Text utilities */
.text-danger { color: #dc2626; }
.text-success { color: #16a34a; }
.text-warning { color: #f59e0b; }

/* Elimination confirmation */
.confirm-danger {
    color: #dc2626;
    margin-bottom: 1rem;
}

.confirm-text {
    margin-bottom: 1.5rem;
    color: #1e293b;
    font-size: 1.1rem;
}

/* Table cell center */
.table-cell-center {
    text-align: center;
}

/* Card no padding */
.card-no-pad {
    padding: 0;
    overflow-x: auto;
}

/* Section heading */
.section-heading {
    margin: 0.75rem 0 0.5rem;
    color: #10b981;
    font-size: 1rem;
}

/* Pendiente row */
.pendiente-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.9rem;
}

.pendiente-row label {
    flex: 1;
}

.pendiente-row input[type="checkbox"] {
    width: auto;
}

/* Total display */
.total-display {
    display: flex;
    gap: 1.5rem;
    justify-content: flex-end;
    padding: 0.75rem;
    background: #e8f5e9;
    border-radius: 4px;
    margin-top: 0.5rem;
    font-weight: bold;
}

.total-display span {
    color: #2e7d32;
}

/* Section description */
.section-desc {
    margin-bottom: 0.5rem;
    color: #666;
    font-size: 0.85rem;
}

/* Input right aligned */
.input-right {
    text-align: right;
}

/* Code/digit styling */
.font-code {
    font-weight: 600;
    color: #115e59;
}

/* === INICIO.PHP — Tabs y top bar === */
.top-bar-unificada { background-color: var(--primary-bg) !important; z-index: 40; }
.tab-btn { padding: 12px 24px; cursor: pointer; border-bottom: 3px solid transparent; font-weight: bold; font-size: 13px; transition: all 0.2s ease; color: var(--text-light); }
.tab-btn.active { border-bottom-color: var(--primary-bg); color: var(--primary-bg); background-color: rgba(17, 94, 89, 0.05); }
.view-section { display: none; }
.view-section.active { display: block; }
.brand-bg { background-color: var(--primary-bg) !important; }
.brand-bg:hover { background-color: var(--primary-dark) !important; }
.brand-light-bg { background-color: var(--primary-light) !important; }

/* === MONITOR CHAT — Burbujas y acordeones === */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details[open] .chevron { transform: rotate(180deg); }
.burbuja-cliente { background: #f1f5f9; border-radius: 12px 12px 12px 2px; }
.burbuja-ia      { background: #d1fae5; border-radius: 12px 12px 2px 12px; }
.burbuja-admin   { background: #dbeafe; border-radius: 12px 12px 2px 12px; }

/* === MENSAJERÍA — Layout y colores brand === */
.bg-primary      { background-color: var(--primary); }
.bg-primary-dark { background-color: var(--primary-dark); }
.bg-primary-bg   { background-color: var(--primary-bg); }
.text-primary    { color: var(--primary); }
.focus-ring-primary:focus { --tw-ring-color: var(--primary); }
@media (max-width: 767px) {
    .item-contacto { margin: 8px 12px; border-radius: 14px; background: white; box-shadow: 0 2px 8px rgba(0,0,0,0.06); border: 1px solid #e2e8f0 !important; }
    #panelContactos { width: 100% !important; }
    #panelChat { position: fixed; inset: 0; z-index: 50; border-radius: 0; }
    #panelChat.hidden { display: none !important; }
    #panelChat:not(.hidden) { display: flex !important; }
}
@media (min-width: 768px) {
    .app-container { max-width: 1100px; margin: 0 auto; height: 100vh; }
}

/* === FILTROS (contactos / reclamos) === */
.filtros-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.filtro-group { display: flex; flex-direction: column; gap: .2rem; }
.filtro-group label { font-size: .72rem; font-weight: 600; text-transform: uppercase; color: #64748b; }
.filtro-group select,
.filtro-group input { padding: .38rem .6rem; border: 1px solid #cbd5e1; border-radius: 6px; font-size: .84rem; }

/* === MODAL BOX (contactos / reclamos) === */
.modal-box { background: #fff; border-radius: 16px; padding: 1.5rem; width: 100%; max-width: 480px; margin: 1rem; max-height: 90vh; overflow-y: auto; }
.modal-box h3 { margin: 0 0 1rem; font-size: 1.05rem; }
.btn-row { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; }

/* === TABLA RESPONSIVE (contactos / reclamos) === */
.cards-mobile { display: none; flex-direction: column; gap: .6rem; }
@media (max-width: 640px) {
    .tabla-desktop { display: none !important; }
    .cards-mobile  { display: flex !important; }
    .filtros-form select,
    .filtros-form input { width: 100%; box-sizing: border-box; }
}
@media (min-width: 641px) {
    .cards-mobile { display: none !important; }
}

/* === CARDS CONTACTOS === */
.card-contacto { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: .9rem 1rem; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.card-contacto .cc-nombre  { font-weight: 700; font-size: .9rem; color: #1e293b; }
.card-contacto .cc-meta    { font-size: .74rem; color: #64748b; margin-top: .2rem; }
.card-contacto .cc-desc    { font-size: .8rem; color: #475569; margin-top: .3rem; font-style: italic; }
.card-contacto .cc-actions { display: flex; gap: .4rem; margin-top: .6rem; }

/* === CARDS RECLAMOS === */
.card-reclamo { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: .9rem 1rem; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.card-reclamo .cr-header  { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; margin-bottom: .35rem; }
.card-reclamo .cr-asunto  { font-weight: 700; font-size: .9rem; color: #1e293b; }
.card-reclamo .cr-meta    { font-size: .74rem; color: #64748b; display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .25rem; }
.card-reclamo .cr-actions { display: flex; gap: .4rem; margin-top: .6rem; }

/* === RECLAMOS.PHP — Badges estado/prioridad y tarjetas mobile === */
.badge-prioridad { min-width: 55px; text-align: center; }
.badge-estado    { min-width: 70px; text-align: center; }
.filtro-group .btn { padding: .4rem 1rem; font-size: .85rem; }
.tarjetas-mobile { display: none; flex-direction: column; gap: .75rem; }
.tarjeta-reclamo { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: .9rem 1rem; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.tarjeta-reclamo .tr-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: .4rem; gap: .5rem; }
.tarjeta-reclamo .tr-asunto { font-weight: 700; font-size: .9rem; color: #1e293b; }
.tarjeta-reclamo .tr-meta   { font-size: .75rem; color: #64748b; margin-top: .3rem; display: flex; flex-wrap: wrap; gap: .4rem; }
@media (max-width: 640px) {
    .tarjetas-mobile { display: flex !important; }
}
@media (min-width: 641px) {
    .tarjetas-mobile { display: none !important; }
}

/* === UTILIDADES INLINE — Reemplazos de style= comunes === */
.page-title      { margin: 0; font-size: 1.25rem; }
.page-header     { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.page-header-end { display: flex; justify-content: flex-end; align-items: center; margin-bottom: .75rem; }
.flex-center     { display: flex; align-items: center; gap: .75rem; }
.link-bare       { text-decoration: none; }
.input-highlight { background: #f0fdf4; font-weight: bold; color: #166534; }
.btn-light       { background: #f1f5f9; color: #64748b; text-decoration: none; }
.btn-light:hover { background: #e2e8f0; }
.btn-danger      { background: #dc2626; color: white; }
.btn-danger:hover{ background: #b91c1c; }
.h2-mb  { margin-bottom: 1rem; }
.p-3    { padding: 1rem; }
.mr-1   { margin-right: .5rem; }
.ml-auto{ margin-left: auto; }
.w-full { width: 100%; }
.folder-item-active { background: #d1fae5; }
.folder-item-empty  { background: #f1f5f9; }
