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

body {
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f4f5f7;
    color: #1f2430;
}

.app { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    background: #1f2430;
    color: #e8eaf0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-brand {
    padding: 20px 16px;
    font-size: 18px;
    font-weight: 700;
    border-bottom: 1px solid #2e3444;
}

.sidebar nav { display: flex; flex-direction: column; padding: 8px 0; }

.sidebar nav a {
    color: #c4c9d6;
    text-decoration: none;
    padding: 10px 20px;
    font-size: 14px;
}

.sidebar nav a:hover, .sidebar nav a.activo {
    background: #2e3444;
    color: #fff;
}

.nav-grupo {
    color: #6b7280;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 700;
    padding: 14px 20px 4px;
    letter-spacing: .05em;
}

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    background: #fff;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
}

.usuario-info { display: flex; align-items: center; gap: 16px; font-size: 14px; }

.btn-salir {
    color: #b91c1c;
    text-decoration: none;
    font-weight: 600;
}

.contenido { padding: 24px; }

.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 18px;
}

.kpi .valor { font-size: 26px; font-weight: 700; }
.kpi .etiqueta { font-size: 13px; color: #6b7280; margin-top: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th, td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
}

th { background: #f9fafb; font-weight: 600; color: #374151; }

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-pendiente, .badge-abierto { background: #fef3c7; color: #92400e; }
.badge-pagado, .badge-resuelto, .badge-operativo { background: #d1fae5; color: #065f46; }
.badge-vencido, .badge-baja { background: #fee2e2; color: #991b1b; }
.badge-en_proceso { background: #dbeafe; color: #1e40af; }

.btn {
    display: inline-block;
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 9px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
}

.btn:hover { background: #1d4ed8; }

.form-grupo { margin-bottom: 14px; }

.form-grupo label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.form-grupo input, .form-grupo select, .form-grupo textarea {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

.alerta {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alerta-error { background: #fee2e2; color: #991b1b; }
.alerta-ok { background: #d1fae5; color: #065f46; }

.pagina-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1f2430;
}

.caja-login {
    background: #fff;
    padding: 32px;
    border-radius: 10px;
    width: 340px;
}

.caja-login h1 { font-size: 20px; margin-bottom: 20px; text-align: center; }

.vacio { color: #6b7280; font-size: 14px; padding: 16px 0; }

.alerta-aviso { background: #fef3c7; color: #92400e; }
.alerta a { color: inherit; font-weight: 600; }

.usuario-info a { color: #374151; text-decoration: none; }
.usuario-info a:hover { text-decoration: underline; }
.usuario-info .btn-salir { color: #b91c1c; }

.selector-condominio { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.selector-condominio select { padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; }

.badge-prueba { background: #dbeafe; color: #1e40af; }
.badge-activa { background: #d1fae5; color: #065f46; }
.badge-suspendida, .badge-cancelada, .badge-vencida, .badge-rechazado, .badge-inactivo { background: #fee2e2; color: #991b1b; }
.badge-confirmado { background: #d1fae5; color: #065f46; }

.btn-enlace { background: none; border: none; padding: 0; font-size: 14px; cursor: pointer; color: #2563eb; }
.btn-enlace.peligro { color: #b91c1c; }
.btn-enlace.ok { color: #065f46; }
.btn-secundario { background: #fff; color: #374151; border: 1px solid #d1d5db; }
.btn-secundario:hover { background: #f9fafb; }

.tabla-scroll { overflow-x: auto; }
.filtros { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filtros a { padding: 5px 12px; border-radius: 999px; border: 1px solid #d1d5db; color: #374151; text-decoration: none; font-size: 13px; }
.filtros a.activo { background: #2563eb; border-color: #2563eb; color: #fff; }

.form-fila { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-seccion { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; margin: 8px 0 12px; }

.login-sub { text-align: center; color: #6b7280; font-size: 14px; margin: -10px 0 18px; }
.login-pie { text-align: center; font-size: 13px; color: #6b7280; margin-top: 18px; line-height: 1.9; }
.login-pie a { color: #2563eb; }

.pagina-registro { align-items: flex-start; padding: 32px 16px; }
.caja-registro { width: 100%; max-width: 640px; }

.planes-elegir { display: grid; gap: 10px; margin-bottom: 16px; }
.plan-opcion { display: block; cursor: pointer; }
.plan-opcion input { position: absolute; opacity: 0; pointer-events: none; }
.plan-opcion-cuerpo {
    display: grid;
    gap: 2px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
}
.plan-opcion-cuerpo small { color: #6b7280; }
.plan-opcion input:checked + .plan-opcion-cuerpo { border-color: #2563eb; background: #eff6ff; box-shadow: 0 0 0 1px #2563eb; }
.plan-opcion input:focus-visible + .plan-opcion-cuerpo { outline: 2px solid #2563eb; outline-offset: 2px; }

@media (max-width: 720px) {
    .app { flex-direction: column; }
    .sidebar { width: 100%; }
    .form-fila { grid-template-columns: 1fr; }
    .topbar { flex-direction: column; align-items: flex-start; gap: 8px; }
}

.insignia { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; text-align: center; line-height: 18px; }
.solo-imprimir { display: none; }
.text-derecha { text-align: right; }
.resumen-fila { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #f3f4f6; font-size: 14px; }
.resumen-fila.total { font-weight: 700; border-top: 2px solid #1f2430; border-bottom: none; margin-top: 4px; }
.barra { height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; min-width: 80px; }
.barra > span { display: block; height: 100%; background: #2563eb; }
.barra > span.exceso { background: #dc2626; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #f3f4f6; font-size: 12px; color: #374151; }
.badge-abierta, .badge-borrador { background: #fef3c7; color: #92400e; }
.badge-cerrada, .badge-aprobado, .badge-aprobada, .badge-enviado, .badge-pagada { background: #d1fae5; color: #065f46; }
.badge-anulada, .badge-error, .badge-parcial { background: #fee2e2; color: #991b1b; }
.badge-no_requerida { background: #f3f4f6; color: #4b5563; }
.mensaje-burbuja { padding: 10px 14px; border-radius: 10px; margin-bottom: 10px; max-width: 80%; background: #f3f4f6; }
.mensaje-burbuja.propio { background: #dbeafe; margin-left: auto; }
.mensaje-burbuja small { display: block; color: #6b7280; margin-bottom: 4px; }
.calendario { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendario .dia { min-height: 78px; border: 1px solid #e5e7eb; border-radius: 6px; padding: 4px 6px; font-size: 12px; background: #fff; }
.calendario .dia.otro-mes { background: #f9fafb; color: #9ca3af; }
.calendario .dia.hoy { border-color: #2563eb; box-shadow: 0 0 0 1px #2563eb; }
.calendario .cab { font-weight: 700; text-align: center; font-size: 12px; color: #6b7280; }
.calendario .evento { display: block; margin-top: 3px; padding: 1px 5px; border-radius: 4px; background: #dbeafe; color: #1e40af; font-size: 11px; }
.calendario .evento.vencido { background: #fee2e2; color: #991b1b; }
.qr-caja { display: inline-block; background: #fff; padding: 10px; border: 1px solid #e5e7eb; border-radius: 8px; }
@media print {
    .sidebar, .topbar, .no-imprimir, .filtros { display: none !important; }
    .solo-imprimir { display: block; }
    .app { display: block; }
    .contenido { padding: 0; }
    body { background: #fff; }
    .card { border: none; padding: 0; }
}
.badge-rechazada { background: #fee2e2; color: #991b1b; }
