:root {
    --primary: #0f172a; --primary-light: #1e293b; --secondary: #2563eb; --secondary-hover: #1d4ed8;
    --bg-body: #f1f5f9; --surface: #ffffff; --text-main: #0f172a; --text-muted: #64748b;
    --border: #e2e8f0; --success: #059669; --warning: #d97706; --danger: #dc2626;
    --radius: 10px; --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { background-color: var(--bg-body); color: var(--text-main); line-height: 1.5; -webkit-tap-highlight-color: transparent; }

.navbar { background-color: var(--primary); color: white; padding: 15px 20px; display: flex; align-items: center; box-shadow: 0 2px 10px rgba(0,0,0,0.2); position: sticky; top: 0; z-index: 40; justify-content: space-between;}
.menu-icon { cursor: pointer; margin-right: 15px; display: flex; align-items: center; }
.logo { font-size: 20px; font-weight: 700; letter-spacing: 0.5px; flex-grow: 1; }
.nube-indicador { font-size: 12px; font-weight: bold; color: #a7f3d0; background: rgba(255,255,255,0.1); padding: 4px 8px; border-radius: 4px; }

.portada-corporativa { padding: 0; overflow: hidden; position: relative; border: none; }
.img-portada { width: 100%; height: 220px; object-fit: cover; display: block; filter: brightness(0.6); }
.portada-texto { position: absolute; bottom: 0; left: 0; width: 100%; padding: 20px; color: white; background: linear-gradient(transparent, rgba(15,23,42,0.9)); }
.portada-texto h2 { font-size: 28px; margin-bottom: 5px; text-shadow: 1px 1px 3px rgba(0,0,0,0.5); }
.portada-texto p { font-size: 14px; color: #e2e8f0; font-weight: 500; }
.btn-sincronizar { background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.5); border-radius: 50%; width: 40px; height: 40px; font-size: 18px; color: white; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s; padding: 0; backdrop-filter: blur(5px); }
.btn-sincronizar:hover { background: rgba(255,255,255,0.4); transform: scale(1.1); }
.btn-sincronizar.girando { animation: girar 1s linear infinite; }
@keyframes girar { 100% { transform: rotate(360deg); } }

.menu-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15,23,42,0.6); z-index: 45; opacity: 0; transition: opacity 0.3s; }
.menu-overlay.active { display: block; opacity: 1; }
.side-menu { height: 100%; width: 0; position: fixed; z-index: 50; top: 0; left: 0; background-color: var(--surface); overflow-x: hidden; transition: 0.3s; box-shadow: 2px 0 10px rgba(0,0,0,0.1); }
.menu-header { background: var(--primary); color: white; padding: 20px; font-size: 1.2rem; font-weight: bold; margin-bottom: 10px; }
.side-menu a { padding: 15px 20px; text-decoration: none; font-size: 16px; color: var(--text-main); display: block; transition: 0.2s; font-weight: 500; border-left: 4px solid transparent; }
.side-menu a:hover { background-color: var(--bg-body); border-left-color: var(--secondary); color: var(--secondary); }

main { padding: 15px; max-width: 800px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.card { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; border: 1px solid var(--border); }
.header-card h2 { color: var(--primary); font-size: 1.5rem; margin-bottom: 5px; }
.card-light { background: #f8fafc; padding: 15px; border-radius: 8px; border: 1px solid var(--border); }
.caja-estadistica { text-align: center; cursor: pointer; transition: transform 0.2s; padding: 20px 10px; }
.caja-estadistica:active { transform: scale(0.95); }
.caja-estadistica h3 { font-size: 14px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 5px; }
.caja-estadistica h1 { font-size: 2.5rem; color: var(--primary); margin: 0; }

.input-group { margin-bottom: 15px; text-align: left; }
.input-group label { display: block; font-size: 14px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
input, select, textarea, .select-styled { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 16px; background-color: var(--surface); color: var(--text-main); transition: 0.2s; }
.input-mini { padding: 8px; width: 140px; font-size: 13px; margin-right: 5px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.checkbox-group { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.checkbox-group label { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--secondary); cursor: pointer; }

button { padding: 12px 20px; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; transition: 0.2s; text-align: center; }
button:active { transform: scale(0.98); }
.btn-primary { background-color: var(--secondary); color: white; }
.btn-secondary { background-color: var(--primary-light); color: white; }
.btn-large { width: 100%; padding: 15px; font-size: 16px; margin-top: 10px; }
.btn-small { padding: 8px 12px; font-size: 13px; margin: 0; }
.btn-icon { background: transparent; border: none; padding: 4px 8px; font-size: 16px; cursor: pointer; transition: 0.2s; display: inline-flex; align-items: center; justify-content: center;}
.btn-icon:hover { transform: scale(1.2); }

.caja-grande { text-align: center; background: linear-gradient(to bottom right, #ffffff, #f1f5f9); cursor: pointer; }
.caja-grande h3 { color: var(--text-muted); font-size: 1.1rem; text-transform: uppercase; }
.caja-grande h1 { font-size: 2.8rem; color: var(--success); margin: 10px 0; font-weight: 800; }

.estado-tag { padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: bold; border: 1px solid var(--border); background: var(--surface); color: var(--text-main); }
.tag-btn { cursor: pointer; transition: all 0.2s; opacity: 0.6; }
.tag-btn.active { opacity: 1; transform: scale(1.05); box-shadow: 0 2px 4px rgba(0,0,0,0.1); border-width: 2px; }
.tag-orange { color: var(--warning); border-color: #fcd34d; background: #fffbeb; }
.tag-green { color: var(--success); border-color: #a7f3d0; background: #ecfdf5; }
.tag-blue { color: var(--secondary); border-color: #bfdbfe; background: #eff6ff; }
.tag-gray { color: var(--text-muted); border-color: var(--border); background: #f8fafc; }

details { background: var(--surface); border-radius: var(--radius); margin-bottom: 12px; border: 1px solid var(--border); overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
summary { padding: 16px; font-weight: 600; font-size: 16px; cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; background: #f8fafc; transition: background 0.2s; }
summary::-webkit-details-marker { display: none; }
.acordeon-contenido { padding: 16px; }

.datos-proyecto-grid { display: grid; grid-template-columns: 1fr; gap: 8px; font-size: 13px; margin-bottom: 15px; color: var(--text-main); line-height: 1.4; }
.datos-proyecto-grid p { margin: 0; border-bottom: 1px dashed var(--border); padding-bottom: 4px; }

.balance-box { background: #f0fdf4; border: 1px solid #bbf7d0; padding: 15px; border-radius: 8px; margin-bottom: 15px; }
.balance-box p { margin: 4px 0; font-size: 14px; display: flex; justify-content: space-between; }
.balance-box h4 { display: flex; justify-content: space-between; color: var(--success); margin-top: 10px; padding-top: 10px; border-top: 1px dashed #bbf7d0; font-size: 18px; }

.lista-registros { display: flex; flex-direction: column; gap: 10px; margin-top: 15px; }
.registro-item { background: var(--surface); padding: 12px; border-left: 4px solid var(--border); border-radius: 6px; font-size: 14px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); border: 1px solid var(--border); display: flex; flex-direction: column; }
.registro-positivo { border-left-color: var(--success); }
.registro-negativo { border-left-color: var(--danger); }
.registro-info { display: flex; justify-content: space-between; align-items: flex-start; width: 100%;}
.registro-monto { font-weight: 700; font-size: 15px; margin-left: 10px; white-space: nowrap; }

.modal { display: none; position: fixed; z-index: 100; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(15, 23, 42, 0.7); backdrop-filter: blur(2px); }
.modal-content { background-color: var(--surface); margin: 10% auto; border-radius: 12px; width: 92%; max-width: 450px; max-height: 85vh; display: flex; flex-direction: column; animation: modalIn 0.3s ease; }
@keyframes modalIn { from { transform: translateY(20px) scale(0.95); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
.modal-header { padding: 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: #f8fafc; border-radius: 12px 12px 0 0; }
.modal-header h3 { color: var(--primary); font-size: 1.2rem; margin: 0; }
.modal-body { padding: 20px; overflow-y: auto; }
.close { color: var(--text-muted); font-size: 28px; font-weight: bold; cursor: pointer; line-height: 1; }

.socio-card summary { font-size: 1.1rem; color: var(--primary); border-bottom: none; background: var(--surface); justify-content: flex-start; gap: 10px;}
.socio-card[open] summary { border-bottom: 2px solid var(--bg-body); border-radius: var(--radius) var(--radius) 0 0; }
.socio-card .acordeon-contenido { background: #f8fafc; font-size: 14px; }
.socio-card ul { padding-left: 15px; color: var(--text-muted); margin-top: 5px; }