/* ERP-CRM Origen Aqua — sistema de diseño según el mockup Aqua.html (sidebar azul agua, tarjetas blancas, chips de estado).
   Mantiene los nombres --cf-* / .cf-* que usan los componentes reutilizados (filtro-toolbar, listados.js). */
@font-face { font-family: 'Figtree'; font-weight: 400 800; font-display: swap; src: url('/fonts/Figtree-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+1E00-1EFF; }
@font-face { font-family: 'Figtree'; font-weight: 400 800; font-display: swap; src: url('/fonts/Figtree-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+2000-206F, U+20AC; }
@font-face { font-family: 'Material Symbols Rounded'; font-style: normal; font-weight: 100 700; src: url('/fonts/MaterialSymbolsRounded.woff2') format('woff2'); }
.ms { font-family: 'Material Symbols Rounded'; font-weight: normal; font-style: normal; font-size: 22px; line-height: 1; display: inline-block; white-space: nowrap; letter-spacing: normal; text-transform: none; -webkit-font-feature-settings: 'liga'; font-feature-settings: 'liga'; -webkit-font-smoothing: antialiased; vertical-align: middle; flex: none; }
.ms.fill { font-variation-settings: 'FILL' 1; }

:root {
  --cf-primary: #0c6b8f; --cf-primary-hover: #095a78; --cf-primary-soft: #e6f2f8; --cf-link: #0b6e99;
  --cf-bg: #f4f7fa; --cf-surface: #fff; --cf-surface-alt: #f7f9fb; --cf-row-hover: #f1f6fa;
  --cf-text: #12263f; --cf-text-2: #334a63; --cf-text-3: #4a5b6e; --cf-muted: #6b7b8e;
  --cf-border: #e4eaf0; --cf-border-2: #dbe3eb; --cf-border-3: #c5d1dc; --cf-border-soft: #edf1f5;
  --cf-success: #17713d; --cf-success-bg: #e3f4ea; --cf-warning: #b26a00; --cf-warning-bg: #fff5e6;
  --cf-danger: #c0272d; --cf-danger-bg: #fde9e9; --cf-info: #0b6e99; --cf-info-bg: #e6f2f8;
  --cf-font: 'Figtree', system-ui, sans-serif;
  --cf-r-sm: 8px; --cf-r: 10px; --cf-r-md: 12px; --cf-r-lg: 14px;
  --bs-primary: #0c6b8f; --bs-primary-rgb: 12,107,143; --bs-link-color: #0b6e99; --bs-body-font-family: 'Figtree', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--cf-bg); font-family: var(--cf-font); color: var(--cf-text); -webkit-font-smoothing: antialiased; }
a { color: var(--cf-link); text-decoration: none; } a:hover { color: #08506f; }
button { font-family: inherit; }
.form-control, .form-select { border-color: var(--cf-border-2); border-radius: 9px; font-size: 13.5px; min-height: 40px; }
.form-control:focus, .form-select:focus { border-color: var(--cf-primary); box-shadow: 0 0 0 3px rgba(12,107,143,.14); }
.form-label { font-size: 11.5px; font-weight: 600; color: var(--cf-text-3); margin-bottom: 4px; }

/* ---- Shell ---- */
.oa-shell { display: flex; height: 100vh; overflow: hidden; }
.oa-sidebar { width: 236px; flex: none; background: linear-gradient(180deg, #1590b1 0%, #0b7799 100%); color: #fff; display: flex; flex-direction: column; transition: width .18s; z-index: 40; }
.oa-shell.colapsado .oa-sidebar { width: 76px; }
.oa-shell.colapsado .oa-txt { display: none; }
.oa-brand { display: flex; align-items: center; gap: 10px; padding: 22px 20px 18px; height: 84px; }
.oa-brand .ms { font-size: 38px; } .oa-brand b { display: block; font-size: 22px; font-weight: 800; letter-spacing: .5px; line-height: 1.05; } .oa-brand small { font-size: 12.5px; font-weight: 500; }
.oa-nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.oa-nav h6 { margin: 0; font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: rgba(255,255,255,.72); padding: 14px 10px 5px; }
.oa-nav a { display: flex; align-items: center; gap: 13px; padding: 9px 12px; border-radius: 10px; color: #fff; font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.oa-nav a:hover { background: rgba(255,255,255,.14); color: #fff; } .oa-nav a.act { background: rgba(255,255,255,.26); font-weight: 700; }
.oa-side-foot { border-top: 1px solid rgba(255,255,255,.22); padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.oa-side-foot button { appearance: none; border: 0; background: none; color: #fff; display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 4px 6px; }
.oa-user { display: flex; align-items: center; gap: 10px; } .oa-user .av { width: 38px; height: 38px; border-radius: 50%; background: #fff; color: #0b6e99; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.oa-user div { line-height: 1.3; font-size: 12px; min-width: 0; } .oa-user b { display: block; } .oa-user a { color: #fff; opacity: .9; text-decoration: underline; }
.oa-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.oa-head { display: flex; align-items: center; gap: 14px; padding: 20px 28px 14px; flex-wrap: wrap; }
.oa-head .tt { flex: 1; min-width: 240px; } .oa-head h1 { margin: 0; font-size: 25px; font-weight: 700; line-height: 1.2; } .oa-head .crumb { font-size: 13px; color: var(--cf-muted); margin-top: 4px; }
.oa-scope { display: flex; border: 1px solid var(--cf-border-2); border-radius: 10px; overflow: hidden; background: #fff; }
.oa-scope a { display: flex; align-items: center; gap: 8px; padding: 0 18px; height: 44px; font-size: 13px; font-weight: 600; color: var(--cf-link); } .oa-scope a.act { background: #dcedf6; }
.oa-bell { position: relative; width: 46px; height: 44px; border-radius: 10px; border: 1px solid var(--cf-border-2); background: #fff; cursor: pointer; color: var(--cf-text); display: grid; place-items: center; }
.oa-bell .n { position: absolute; top: -9px; right: -7px; background: var(--cf-primary); color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 7px; border: 2px solid var(--cf-bg); }
.oa-cta { display: flex; align-items: center; gap: 8px; padding: 0 20px; height: 44px; border-radius: 10px; background: var(--cf-primary); color: #fff; font-size: 13.5px; font-weight: 600; border: 0; cursor: pointer; }
.oa-cta:hover { background: var(--cf-primary-hover); color: #fff; }
.oa-content { flex: 1; overflow: auto; padding: 4px 28px 32px; }
.oa-bellpanel { position: absolute; top: 82px; right: 28px; width: 400px; max-height: calc(100vh - 110px); overflow: auto; background: #fff; border: 1px solid var(--cf-border-2); border-radius: 14px; box-shadow: 0 18px 40px rgba(18,38,63,.18); z-index: 60; display: none; }
.oa-bellpanel.open { display: block; }
.oa-aviso { display: flex; gap: 12px; align-items: flex-start; padding: 13px 18px; border-bottom: 1px solid var(--cf-border-soft); font-size: 12.5px; line-height: 1.4; }
.oa-aviso .t { font-weight: 600; } .oa-aviso .s { color: var(--cf-muted); font-size: 11.5px; margin-top: 2px; }
.oa-iconbtn { width: 30px; height: 30px; border: 1px solid var(--cf-border-3); border-radius: 7px; display: grid; place-items: center; color: var(--cf-link); background: #fff; cursor: pointer; }

/* ---- Tarjetas, paneles, KPI ---- */
.cf-card, .oa-card { background: #fff; border: 1px solid var(--cf-border); border-radius: 14px; }
.oa-card.pad { padding: 18px 22px; }
.oa-grid { display: grid; gap: 14px; } .oa-g2 { grid-template-columns: minmax(0,1.9fr) minmax(300px,1fr); align-items: start; gap: 18px; } .oa-g2b { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.oa-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 14px; margin-bottom: 18px; }
.oa-kpi { background: #fff; border: 1px solid var(--cf-border); border-radius: 14px; padding: 16px 18px; display: block; color: inherit; }
.oa-kpi:hover { border-color: var(--cf-primary); box-shadow: 0 4px 14px rgba(11,110,153,.12); }
.oa-kpi .ic { width: 38px; height: 38px; border-radius: 10px; background: var(--cf-primary-soft); color: var(--cf-link); display: grid; place-items: center; margin-bottom: 8px; }
.oa-kpi .v { font-size: 28px; font-weight: 800; line-height: 1.1; } .oa-kpi .l { font-size: 12.5px; color: var(--cf-muted); margin-top: 2px; } .oa-kpi .lk { font-size: 12px; font-weight: 600; margin-top: 8px; }
.oa-kpi.orange .ic { background: #fff2dc; color: #e08a00; } .oa-kpi.red .ic { background: var(--cf-danger-bg); color: var(--cf-danger); } .oa-kpi.green .ic { background: var(--cf-success-bg); color: var(--cf-success); }
.oa-ph { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; } .oa-ph b { font-size: 15px; font-weight: 700; flex: 1; } .oa-ph .ms { color: var(--cf-link); }
.oa-field { display: flex; gap: 10px; font-size: 13px; padding: 4px 0; } .oa-field .k { width: 130px; flex: none; color: var(--cf-muted); font-size: 12px; } .oa-field .v { font-weight: 500; min-width: 0; word-break: break-word; }
.oa-note { background: var(--cf-surface-alt); border-radius: 10px; padding: 10px 12px; font-size: 12px; line-height: 1.5; color: var(--cf-text-2); }
.oa-note.warn { background: var(--cf-warning-bg); color: #7a4300; } .oa-note.bad { background: var(--cf-danger-bg); color: #8a1f24; }
.oa-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--cf-border-soft); padding: 0 12px; overflow-x: auto; }
.oa-tabs a { padding: 14px 16px; font-size: 13px; font-weight: 600; color: var(--cf-muted); border-bottom: 3px solid transparent; white-space: nowrap; cursor: pointer; }
.oa-tabs a.act { color: var(--cf-link); border-bottom-color: var(--cf-primary); }
.oa-pane { display: none; padding: 18px 22px; } .oa-pane.act { display: block; }
.oa-bar { height: 9px; background: #edf1f5; border-radius: 5px; overflow: hidden; } .oa-bar > i { display: block; height: 100%; background: var(--cf-primary); }
.oa-sem { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; }
.oa-empty { padding: 28px; text-align: center; color: var(--cf-muted); font-size: 13px; }

/* ---- Barra de filtros / tabla / chips (nombres de la referencia) ---- */
.cf-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.cf-search { position: relative; flex: 1; min-width: 220px; max-width: 380px; }
.cf-search .ms { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--cf-muted); }
.cf-search input { width: 100%; height: 42px; border: 1px solid var(--cf-border-2); border-radius: 10px; padding: 0 12px 0 38px; font-size: 13.5px; background: #fff; }
.cf-search input:focus { outline: none; border-color: var(--cf-primary); box-shadow: 0 0 0 3px rgba(12,107,143,.14); }
.cf-filter { height: 42px; border: 1px solid var(--cf-border-2); border-radius: 10px; padding: 0 12px; font-size: 13px; background: #fff; min-width: 170px; }
.cf-spacer { flex: 1; }
.cf-btn { display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 16px; border-radius: 10px; font-size: 13px; font-weight: 600; border: 1px solid transparent; cursor: pointer; background: #fff; white-space: nowrap; }
.cf-btn-primary, .cf-btn-soft { background: var(--cf-primary); color: #fff; } .cf-btn-primary:hover, .cf-btn-soft:hover { background: var(--cf-primary-hover); color: #fff; }
.cf-btn-outline { border-color: var(--cf-link); color: var(--cf-link); } .cf-btn-outline:hover { background: var(--cf-primary-soft); }
.cf-btn-danger { border-color: var(--cf-danger); color: var(--cf-danger); } .cf-btn-sm { height: 34px; padding: 0 12px; font-size: 12.5px; }
.cf-btn[disabled] { opacity: .5; cursor: not-allowed; }
.cf-table-wrap { background: #fff; border: 1px solid var(--cf-border); border-radius: 14px; overflow: hidden; padding: 4px 0 0; }
.cf-table-wrap .dt-container { padding: 0 14px 10px; }
table.cf-table { width: 100% !important; margin: 0; font-size: 13px; }
table.cf-table thead th { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--cf-muted); border-bottom: 1px solid var(--cf-border) !important; padding: 12px 10px; background: #fff; }
table.cf-table tbody td { padding: 11px 10px; vertical-align: middle; border-bottom: 1px solid var(--cf-border-soft); }
table.cf-table tbody tr:hover > td { background: var(--cf-row-hover); }
.cf-td-strong { font-weight: 700; } .cf-td-code { color: var(--cf-muted); } .cf-td-chevron { color: var(--cf-border-3); }
.cf-field-k { color: var(--cf-muted); }
.cf-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.cf-badge-success { background: var(--cf-success-bg); color: var(--cf-success); } .cf-badge-muted { background: #eef1f4; color: var(--cf-muted); }
.cf-badge-cyan, .cf-badge-info { background: var(--cf-info-bg); color: var(--cf-info); } .cf-badge-warn { background: var(--cf-warning-bg); color: var(--cf-warning); } .cf-badge-danger { background: var(--cf-danger-bg); color: var(--cf-danger); }
.cf-iconbtn-sm { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--cf-border-2); background: #fff; color: var(--cf-muted); display: inline-grid; place-items: center; cursor: pointer; }
.cf-iconbtn-sm:hover { color: var(--cf-link); border-color: var(--cf-link); } .cf-iconbtn-sm.cf-is-danger:hover { color: var(--cf-danger); border-color: var(--cf-danger); }
.cf-avatar-md { width: 32px; height: 32px; border-radius: 50%; background: #dcedf6; color: var(--cf-link); display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.cf-sociedad-1 { background: #e6f2f8; color: #0b6e99; } .cf-sociedad-2 { background: #dff5f6; color: #0f8fa3; }

/* ---- Login ---- */
.oa-login { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #0f89ab, #0b6e99); padding: 20px; }
.oa-login .box { width: 100%; max-width: 400px; background: #fff; border-radius: 18px; padding: 32px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.oa-login img { height: 90px; display: block; margin: 0 auto 14px; }

/* ---- Formularios / utilidades ---- */
.oa-form { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 14px; } .oa-form > [class*="col-"] { min-width: 0; }
.oa-sub { font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--cf-muted); margin: 14px 0 8px; }
.oa-acts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.oa-mono { font-family: ui-monospace, monospace; font-size: 12px; color: var(--cf-muted); }
.oa-chk { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--cf-border-2); border-radius: 9px; padding: 8px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; user-select: none; }
.oa-chk:has(input:checked) { border: 1.5px solid var(--cf-primary); background: var(--cf-primary-soft); color: var(--cf-link); }
.oa-chk input { accent-color: var(--cf-primary); }
.text-end { text-align: right; } .oa-scroll { overflow-x: auto; }
.oa-tbl { width: 100%; font-size: 13px; border-collapse: collapse; } .oa-tbl th { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--cf-muted); text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--cf-border); } .oa-tbl td { padding: 8px 10px; border-bottom: 1px solid var(--cf-border-soft); vertical-align: middle; }
#oaMapa { width: 100%; height: 520px; border-radius: 12px; background: #e8eef3; }
@media (max-width: 1100px) { .oa-g2, .oa-g2b { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .oa-shell { height: auto; min-height: 100vh; flex-direction: column; overflow: visible; } .oa-sidebar, .oa-shell.colapsado .oa-sidebar { width: 100%; } .oa-nav { max-height: 240px; } .oa-content, .oa-head { padding-left: 14px; padding-right: 14px; } .oa-main { overflow: visible; } .oa-content { overflow: visible; } .oa-bellpanel { width: calc(100vw - 28px); right: 14px; } }
