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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f7fa;
    color: #333;
}

/* Navbar */
.navbar {
    background: #1a237e;
    color: #fff;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    height: 56px;
    gap: 2rem;
}
.navbar-brand {
    font-size: 1.2rem;
    font-weight: 700;
}
.navbar-menu {
    list-style: none;
    display: flex;
    gap: 0.5rem;
}
.navbar-menu a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.2s;
}
.navbar-menu a:hover,
.navbar-menu a.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

h1 {
    margin-bottom: 1.5rem;
    color: #1a237e;
}
h2 {
    margin: 2rem 0 1rem;
    color: #333;
}
.subtitle {
    color: #666;
    margin-bottom: 1.5rem;
}

/* Cards */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.card h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 0.5rem;
}
.card-value {
    font-size: 2rem;
    font-weight: 700;
}
.card-value.success { color: #2e7d32; }
.card-value.warning { color: #f57f17; }
.card-value.danger { color: #c62828; }

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
th, td {
    padding: 0.75rem 1rem;
    text-align: left;
}
th {
    background: #f0f0f0;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #666;
}
tr:not(:last-child) td {
    border-bottom: 1px solid #eee;
}
.text-center { text-align: center; }
.text-danger { color: #c62828; font-weight: 600; }
.text-warning { color: #f57f17; font-weight: 600; }

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-pagado { background: #e8f5e9; color: #2e7d32; }
.badge-pendiente { background: #fff3e0; color: #e65100; }
.badge-abono_parcial { background: #e3f2fd; color: #1565c0; }

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}
.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}
.alert-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* Upload */
.upload-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}
.upload-card {
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.upload-card h3 {
    margin-bottom: 0.5rem;
    color: #1a237e;
}
.upload-card p {
    color: #666;
    margin-bottom: 1rem;
}
.upload-card input[type="file"] {
    display: block;
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-primary {
    background: #1a237e;
    color: #fff;
}
.btn-primary:hover {
    background: #283593;
}

/* Stats grid (conciliación) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.stat-card .stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a237e;
}
.stat-card .stat-label {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
}
.stat-card.stat-success .stat-number { color: #2e7d32; }
.stat-card.stat-info .stat-number { color: #1565c0; }
.stat-card.stat-warning .stat-number { color: #e65100; }

/* Action bar */
.action-bar {
    margin-bottom: 1.5rem;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.3rem;
}
.form-group select,
.form-group input[type="number"],
.form-group input[type="text"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}
.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #1a237e;
    box-shadow: 0 0 0 2px rgba(26, 35, 126, 0.15);
}

code {
    background: #f0f0f0;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

/* Alertas de vencimiento */
.alertas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.alerta-card {
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.alerta-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.alerta-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
    flex-shrink: 0;
}
.alerta-titulo {
    font-weight: 600;
    font-size: 0.9rem;
    flex-grow: 1;
}
.alerta-count {
    font-weight: 700;
    font-size: 1.2rem;
}
.alerta-monto {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.alerta-lista {
    list-style: none;
    font-size: 0.8rem;
    line-height: 1.6;
}
.alerta-mas {
    color: #888;
    font-style: italic;
}

/* Niveles de alerta */
.alerta-critica {
    background: #ffebee;
    border-left: 4px solid #c62828;
}
.alerta-critica .alerta-icon { background: #c62828; }
.alerta-critica .alerta-count,
.alerta-critica .alerta-monto { color: #c62828; }

.alerta-alta {
    background: #fff3e0;
    border-left: 4px solid #e65100;
}
.alerta-alta .alerta-icon { background: #e65100; }
.alerta-alta .alerta-count,
.alerta-alta .alerta-monto { color: #e65100; }

.alerta-media {
    background: #fff8e1;
    border-left: 4px solid #f57f17;
}
.alerta-media .alerta-icon { background: #f57f17; }
.alerta-media .alerta-count,
.alerta-media .alerta-monto { color: #f57f17; }

.alerta-baja {
    background: #e3f2fd;
    border-left: 4px solid #1565c0;
}
.alerta-baja .alerta-icon { background: #1565c0; }
.alerta-baja .alerta-count,
.alerta-baja .alerta-monto { color: #1565c0; }

/* Badges adicionales */
.badge-automatica { background: #e8f5e9; color: #2e7d32; }
.badge-manual { background: #e3f2fd; color: #1565c0; }

/* Links */
.btn-link {
    color: #1a237e;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
}
.btn-link:hover {
    text-decoration: underline;
}

.text-success { color: #2e7d32; font-weight: 600; }

/* Page header with export buttons */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.page-header h1 {
    margin-bottom: 0;
}
.export-buttons {
    display: flex;
    gap: 0.5rem;
}
.btn-secondary {
    background: #fff;
    color: #1a237e;
    border: 1px solid #1a237e;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-secondary:hover {
    background: #e8eaf6;
}

/* Login */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
}
.login-card {
    background: #fff;
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.login-title {
    text-align: center;
    color: #1a237e;
    margin-bottom: 0.25rem;
}
.login-subtitle {
    text-align: center;
    color: #888;
    margin-bottom: 1.5rem;
}
.login-card input[type="text"],
.login-card input[type="password"] {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
}
.login-card input:focus {
    outline: none;
    border-color: #1a237e;
    box-shadow: 0 0 0 2px rgba(26, 35, 126, 0.15);
}

/* User navbar */
.navbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
}
.navbar-right .user-name {
    color: rgba(255, 255, 255, 0.8);
}
.navbar-right a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    font-size: 0.8rem;
    transition: background 0.2s;
}
.navbar-right a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Danger button */
.btn-danger {
    background: #c62828;
    color: #fff;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-danger:hover {
    background: #b71c1c;
}
.btn-success {
    background: #2e7d32;
    color: #fff;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-success:hover {
    background: #1b5e20;
}
