/* ═══════════════════════════════════════════════════════════
   SIRIUS-PRO · styles.css (Executive Update + Security)
   ═══════════════════════════════════════════════════════════ */
   *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

   :root {
     --bg: #F2F4F8;
     --card: #FFFFFF;
     --dark: #0F172A;
     --dark2: #1E293B;
     --blue: #3B82F6;
     --blue-light: #EFF6FF;
     --green: #10B981;
     --green-light: #ECFDF5;
     --red: #EF4444;
     --red-light: #FEF2F2;
     --yellow: #F59E0B;
     --yellow-light: #FFFBEB;
     --purple: #8B5CF6;
     --purple-light: #F5F3FF;
     --orange: #F97316;
     --text: #1E293B;
     --text-light: #64748B;
     --border: #E2E8F0;
     --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
     --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
     --radius: 12px;
     --radius-sm: 8px;
     --transition: all .2s ease;
   }
   
   body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; min-height: 100vh; }
   
   /* ── HEADER & TABS ── */
   .app-header { background: linear-gradient(135deg, #0F172A 0%, #1E3A5F 100%); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 20px rgba(0,0,0,.3); }
   .header-inner { max-width: 1400px; margin: 0 auto; padding: 16px 24px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
   .brand { display: flex; align-items: center; gap: 12px; }
   .brand-logo { width: 44px; height: 44px; background: linear-gradient(135deg, #3B82F6, #8B5CF6); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; color: #fff; box-shadow: 0 0 20px rgba(59,130,246,.4); }
   .brand-name { color: #fff; font-size: 22px; font-weight: 800; letter-spacing: 2px; display: block; }
   .brand-sub { color: #94A3B8; font-size: 11px; letter-spacing: 1px; display: block; }
   .project-field { display: flex; align-items: center; gap: 10px; flex: 1; }
   .project-field label { color: #94A3B8; font-size: 12px; font-weight: 600; }
   .project-field input { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); color: #fff; border-radius: var(--radius-sm); padding: 8px 14px; font-size: 15px; font-weight: 600; flex: 1; min-width: 200px; transition: var(--transition); }
   .project-field input:focus { outline: none; border-color: var(--blue); background: rgba(255,255,255,.15); }
   .header-date { color: #94A3B8; font-size: 12px; white-space: nowrap; }
   
   /* ── TABS ── */
   .app-tabs { display: flex; max-width: 1400px; margin: 0 auto; padding: 0 24px; gap: 4px; overflow-x: auto; scrollbar-width: none; }
   .app-tabs::-webkit-scrollbar { display: none; }
   .tab-btn { background: rgba(255,255,255,0.05); border: none; border-radius: 8px 8px 0 0; color: #94A3B8; padding: 12px 16px; font-size: 13px; font-weight: 600; cursor: pointer; transition: var(--transition); flex: 0 0 auto; white-space: nowrap; }
   .tab-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
   .tab-btn.active { background: var(--bg); color: var(--dark); box-shadow: 0 -4px 12px rgba(0,0,0,0.1); }
   
   /* ── VIEWS & LAYOUT ── */
   .view { display: none; animation: fadeIn 0.3s ease; }
   .view.active { display: block; }
   @keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
   
   .app-main { max-width: 1400px; margin: 0 auto; padding: 32px 24px; display: flex; flex-direction: column; gap: 24px; }
   .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
   @media(max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }
   
   /* ── CARDS ── */
   .card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; }
   .mt-24 { margin-top: 24px; }
   .mt-3 { margin-top: 12px; }
   .card-header { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
   .card-header h2 { font-size: 15px; font-weight: 700; margin: 0; }
   .card-icon { font-size: 18px; }
   
   .accent-green { background: var(--green-light); color: var(--green); }
   .accent-red   { background: var(--red-light); color: var(--red); }
   .accent-blue  { background: var(--blue-light); color: var(--blue); }
   .accent-yellow{ background: var(--yellow-light); color: var(--yellow); }
   .accent-purple{ background: var(--purple-light); color: var(--purple); }
   .accent-dark  { background: var(--dark2); color: #fff; }
   
   .card-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
   .help-text { font-size: 12px; color: var(--text-light); background: #F8FAFC; padding: 10px; border-radius: var(--radius-sm); border: 1px dashed var(--border); margin-bottom: 10px; }
   
   /* ── INPUTS & SELECTS ── */
   .field-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
   .field-row label { font-size: 13px; font-weight: 500; color: var(--text-light); flex: 0 0 160px; }
   .input-prefix { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; flex: 1; background: #fff; }
   .input-prefix > span { padding: 8px 10px; background: #F8FAFC; color: var(--text-light); font-weight: 600; border-right: 1.5px solid var(--border); }
   .input-prefix.pct > span { border-right: none; border-left: 1.5px solid var(--border); }
   .input-prefix input { border: none !important; border-radius: 0; flex: 1; box-shadow: none !important; width: 100%; }
   
   input[type="text"], input[type="date"], input[type="number"], input[type="password"], input[type="month"], select { 
     font-family: inherit; font-size: 14px; padding: 8px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); color: var(--text); background: #fff; transition: var(--transition); width: 100%; 
   }
   input:focus, select:focus, .input-prefix:focus-within { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
   
   input[readonly], select[disabled], .input-prefix input[readonly] {
      background-color: #F1F5F9;
      color: #94A3B8;
      cursor: not-allowed;
      border-color: #E2E8F0;
   }
   
   .currency-input { text-align: right; font-variant-numeric: tabular-nums; }
   .mt-auto { margin-top: auto; }
   .divider { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
   
   /* ── TABLAS & BOTONES ── */
   .data-table { width: 100%; border-collapse: collapse; }
   .data-table th { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--text-light); padding: 8px; border-bottom: 2px solid var(--border); text-align: left; }
   .data-table td { padding: 4px; vertical-align: middle; }
   .concept-input { border: 1.5px solid transparent; background: transparent; font-weight: 500; }
   .concept-input:focus { background: #fff; border-color: var(--blue); }
   
   .btn-del-row, .btn-dup-row, .btn-edit-row { background: none; border: none; cursor: pointer; font-size: 14px; padding: 6px; opacity: 0.6; }
   .btn-del-row:hover { opacity: 1; color: var(--red); transform: scale(1.1); }
   .btn-dup-row:hover { opacity: 1; color: var(--blue); transform: scale(1.1); }
   .btn-edit-row:hover { opacity: 1; color: var(--yellow); transform: scale(1.1); }
   .row-actions { display: flex; gap: 4px; }
   
   .btn-add-row { align-self: flex-start; background: none; border: 1.5px dashed var(--border); color: var(--text-light); border-radius: var(--radius-sm); padding: 6px 14px; font-size: 12px; font-weight: 500; cursor: pointer; transition: var(--transition); margin-top: 4px; }
   .btn-add-row:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
   
   .btn-primary { background: var(--blue); color: #fff; border: none; padding: 10px 20px; font-size: 14px; font-weight: 600; border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); width: 100%; display: block; text-align: center; }
   .btn-primary:hover { background: #2563EB; box-shadow: var(--shadow); }
   
   .btn-unlock { background: var(--yellow-light); color: var(--yellow); border: 1px solid var(--yellow); padding: 4px 8px; font-size: 12px; font-weight: 600; border-radius: 4px; cursor: pointer; display: flex; align-items: center; gap: 4px; transition: var(--transition); }
   .btn-unlock:hover { background: var(--yellow); color: #fff; }
   .btn-unlock.unlocked { background: var(--green-light); color: var(--green); border-color: var(--green); }
   
   /* ── CAJAS DE RESULTADO ── */
   .result-box { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; margin-top: 8px; }
   .result-box.green { background: var(--green-light); color: var(--green); }
   .result-box.red   { background: var(--red-light); color: var(--red); }
   .result-box.blue  { background: var(--blue-light); color: var(--blue); }
   .result-box strong { font-size: 18px; font-weight: 800; }
   
   /* ── PROGRESS BAR (ADMIN SOCIOS) ── */
   .progress-container { margin-bottom: 10px; }
   .progress-labels { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
   .progress-bar-bg { width: 100%; height: 12px; background: #E2E8F0; border-radius: 6px; overflow: hidden; }
   .progress-bar-fill { height: 100%; background: var(--blue); transition: width 0.4s ease, background-color 0.4s ease; width: 0%; }
   .progress-bar-fill.full { background: var(--green); }
   .progress-bar-fill.error { background: var(--red); }
   .warning-text { font-size: 12px; color: var(--red); font-weight: 600; margin-top: 6px; text-align: center; min-height: 18px; }
   
   /* ── SOCIO PANELS DINÁMICOS ── */
   .socio-panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
   .sp-header { display: flex; justify-content: space-between; margin-bottom: 16px; align-items: center; border-bottom: 1px dashed var(--border); padding-bottom: 8px; }
   .sp-name { font-size: 16px; font-weight: 700; color: var(--dark); }
   .sp-pct { font-size: 14px; font-weight: 700; color: var(--blue); background: var(--blue-light); padding: 4px 8px; border-radius: 4px; }
   .sp-body { display: flex; flex-direction: column; gap: 8px; }
   .sp-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-light); align-items: center; }
   .sp-row.total { font-size: 14px; font-weight: 700; color: var(--text); }
   .sp-row strong { font-size: 15px; font-weight: 700; }
   .sp-row.total strong { font-size: 18px; }
   
   /* ── FICHAS (RRHH / PROVEEDORES) ── */
   .fichas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 20px; }
   .ficha-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; background: #FAFAFA; position: relative; }
   .ficha-header { display: flex; gap: 10px; margin-bottom: 12px; align-items: center; }
   .ficha-header input { font-weight: 600; font-size: 15px; }
   .ficha-delete { position: absolute; top: 12px; right: 12px; background: none; border: none; color: var(--red); opacity: 0.5; cursor: pointer; }
   .ficha-delete:hover { opacity: 1; }
   .ficha-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
   .ficha-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 10px; }
   .ficha-label { font-size: 10px; color: var(--text-light); text-transform: uppercase; font-weight: 600; display: block; margin-bottom: 4px; }
   
   .empleados-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 20px; }
   
   /* ── BALANCE GLOBAL ── */
   .balance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
   .balance-section { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 20px; display: flex; flex-direction: column; gap: 12px; background:#fff; }
   .balance-section.highlight { background: #F8FAFC; border-color: var(--blue); }
   .balance-title { font-size: 15px; font-weight: 700; border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 4px; }
   .balance-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--text); }
   .balance-row.total { font-size: 16px; font-weight: 700; margin-top: 8px; }
   .final-balance-box { margin-top: 30px; background: linear-gradient(135deg, #0F172A, #1E3A5F); border-radius: var(--radius); padding: 30px; text-align: center; color: #fff; box-shadow: var(--shadow-lg); }
   .fb-label { display: block; font-size: 14px; color: #94A3B8; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
   .fb-value { display: block; font-size: 42px; font-weight: 800; color: #10B981; }
   .fb-value.negative { color: #EF4444; }
   
   /* ── EXPORT BTNS ── */
   .export-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
   .btn-export { padding: 12px 20px; border: none; border-radius: var(--radius-sm); font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); flex: 1; max-width: 300px; }
   .btn-export.excel { background: linear-gradient(135deg, #166534, #15803D); color: #fff; box-shadow: 0 4px 15px rgba(22,101,52,.3); }
   .btn-export.word { background: linear-gradient(135deg, #1E3A8A, #1D4ED8); color: #fff; box-shadow: 0 4px 15px rgba(29,78,216,.3); }
   .btn-export:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
   
   .green { color: var(--green) !important; }
   .red { color: var(--red) !important; }
   .blue { color: var(--blue) !important; }
   .orange { color: var(--orange) !important; }

   /* ── SALDOS SOCIOS EXTRAS ── */
   #s-cuentasClarasText { line-height: 1.4; }
   #s-cuentasClarasText span.red { font-weight: 800; text-decoration: underline; }
   #view-saldos .final-balance-box { transition: var(--transition); }
   #view-saldos .final-balance-box:hover { transform: scale(1.02); }
