/* SG Ingresos · Panel Cliente y Admin Spartan */
:root {
  --sg: #0F6B3E; --sg-dark: #0A4F2D; --sg-tint: #E1F1E7; --ink: #14201A; --muted: #46564D;
  --line: #DCE3DE; --line2: #C4CFC7; --bg: #F3F5F2; --warn-bg: #FFEFCC; --warn: #7A4A00; --bad-bg: #FBE1E2; --bad: #93141C; --red: #B3202A;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'DM Sans', system-ui, sans-serif; }
button, input, select, textarea { font-family: inherit; }
.h { font-family: 'Bebas Neue', 'Arial Narrow', sans-serif; letter-spacing: .5px; font-weight: 400; }
[hidden] { display: none !important; }
.splash, .login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: var(--sg); color: #fff; padding: 24px; text-align: center; }
.logo { font-size: 56px; line-height: 1; }
.login .card { background: #fff; color: var(--ink); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 14px; align-items: center; min-width: 300px; }
.layout { display: flex; min-height: 100vh; flex-wrap: wrap; }
.side { width: 230px; flex: 0 0 230px; background: var(--sg); color: #fff; padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.side .brand { font-size: 30px; line-height: 1; padding: 0 8px; }
.side .sub { font-size: 12px; color: #D5EBDD; padding: 2px 8px 16px; }
.nav { display: block; width: 100%; text-align: left; padding: 11px 14px; border-radius: 10px; color: #D5EBDD; font-size: 15px; font-weight: 600; background: transparent; border: 0; cursor: pointer; }
.nav.on, .nav:hover { background: rgba(255,255,255,.14); color: #fff; }
.navsep { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: #A9D3B9; padding: 16px 14px 4px; }
.side .who { margin-top: auto; font-size: 12px; color: #D5EBDD; padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,.18); }
.side .who button { margin-top: 8px; background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 8px; padding: 8px 12px; cursor: pointer; font-weight: 600; }
.main { flex: 999 1 560px; min-width: 0; padding: 24px 28px; display: flex; flex-direction: column; gap: 16px; }
.title { margin: 0; font-size: 42px; line-height: 1; }
.muted { color: var(--muted); font-size: 13px; margin: 0; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.sect { font-family: 'Bebas Neue', sans-serif; font-weight: 400; font-size: 24px; letter-spacing: .6px; color: var(--sg); margin: 0; }
.grid-f { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.field { display: flex; flex-direction: column; }
.lbl { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 0 0 6px; }
.req { color: var(--red); }
.in { width: 100%; height: 42px; border: 1.5px solid var(--line2); border-radius: 10px; padding: 0 12px; font-size: 14px; font-weight: 500; color: var(--ink); background: #fff; }
textarea.in { height: auto; padding: 10px 12px; }
.in:focus { outline: none; border-color: var(--sg); box-shadow: 0 0 0 3px rgba(15,107,62,.18); }
.btn { height: 44px; padding: 0 20px; border-radius: 12px; border: 0; background: var(--sg); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; }
.btn2 { height: 44px; padding: 0 18px; border-radius: 12px; border: 1.5px solid var(--sg); background: #fff; color: var(--sg); font-size: 15px; font-weight: 700; cursor: pointer; }
.btnred { height: 44px; padding: 0 18px; border-radius: 12px; border: 0; background: var(--red); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; }
.btnsm { height: 34px; padding: 0 12px; border-radius: 8px; border: 1.5px solid var(--sg); background: #fff; color: var(--sg); font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btnsm.red { border-color: var(--red); color: var(--red); }
.link { background: none; border: 0; color: var(--sg); font-weight: 700; cursor: pointer; padding: 0; font-size: 13px; text-decoration: underline; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 38px; padding: 0 14px; border-radius: 19px; border: 1.5px solid var(--line2); background: #fff; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; }
.chip.on { background: var(--sg); border-color: var(--sg); color: #fff; }
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.metric { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.metric .v { font-family: 'Bebas Neue', sans-serif; font-size: 40px; line-height: 1; color: var(--sg); }
.metric .k { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 4px; }
.tablebox { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: #FAFBFA; white-space: nowrap; position: sticky; top: 0; }
td { padding: 9px 12px; border-bottom: 1px solid #EEF2EF; vertical-align: top; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #F7FAF8; }
.st { display: inline-flex; align-items: center; min-height: 22px; padding: 1px 8px; border-radius: 11px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.st.ok { background: var(--sg-tint); color: #0B5A33; }
.st.warn { background: var(--warn-bg); color: var(--warn); }
.st.bad { background: var(--bad-bg); color: var(--bad); }
.st.dark { background: var(--ink); color: #fff; }
.banner { border-radius: 10px; padding: 10px 14px; font-size: 14px; font-weight: 600; }
.banner.ok { background: var(--sg-tint); color: #0B5A33; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.code { font-family: ui-monospace, monospace; font-size: 34px; letter-spacing: 3px; font-weight: 700; color: var(--sg); text-align: center; padding: 12px; background: var(--sg-tint); border-radius: 12px; }
.modalbg { position: fixed; inset: 0; background: rgba(20,32,26,.55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 30; }
.modal { background: #fff; border-radius: 16px; padding: 22px; width: min(640px, 100%); max-height: 90vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal img { max-width: 100%; border-radius: 10px; }
.tree-o { padding-left: 16px; border-left: 2px solid var(--line); margin-left: 4px; display: flex; flex-direction: column; gap: 10px; }
.tree-p { padding-left: 16px; border-left: 2px dashed var(--line); margin-left: 4px; display: flex; flex-direction: column; gap: 6px; }
.sw { width: 46px; height: 28px; border-radius: 14px; background: var(--line2); border: 0; position: relative; cursor: pointer; padding: 0; flex-shrink: 0; }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 11px; background: #fff; transition: left .12s; }
.sw.on { background: var(--sg); }
.sw.on::after { left: 21px; }
.sw:disabled { opacity: .35; cursor: not-allowed; }
.cfggrid { display: grid; grid-template-columns: minmax(0, 1.6fr) 100px 80px 100px 116px; gap: 10px; align-items: center; }
.acciones { display: flex; gap: 4px; }
.mini { width: 34px; height: 34px; border-radius: 8px; border: 1.5px solid var(--line2); background: #fff; color: var(--ink); font-size: 16px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.mini:disabled { opacity: .3; cursor: not-allowed; }
.mini.red { border-color: var(--red); color: var(--red); }
.mini.ghost { border: 0; background: none; cursor: default; }
.cfggrid.docs { grid-template-columns: minmax(0, 1.6fr) 120px 90px 120px; }
.split { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.split > .grow { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.phone { flex: 1 1 280px; max-width: 320px; background: var(--ink); border-radius: 32px; padding: 10px; position: sticky; top: 16px; }
.phone .scr { background: var(--bg); border-radius: 24px; overflow: hidden; }
.phone .ph { background: var(--sg); color: #fff; padding: 12px 14px; font-family: 'Bebas Neue', sans-serif; font-size: 20px; }
.phone .pb { padding: 12px; display: flex; flex-direction: column; gap: 8px; max-height: 560px; overflow-y: auto; }
.phone .pl { font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.phone .px { height: 30px; border: 1.5px solid var(--line2); border-radius: 8px; background: #fff; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; z-index: 40; transition: opacity .4s; }
.toast.bad { background: var(--red); }
.toast.out { opacity: 0; }
@media (max-width: 760px) {
  .side { width: 100%; flex-basis: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; }
  .side .brand { font-size: 24px; }
  .side .sub, .navsep { display: none; }
  .nav { width: auto; padding: 8px 10px; font-size: 13px; }
  .side .who { margin-top: 0; border-top: 0; width: 100%; }
  .main { padding: 16px; }
  .cfggrid { grid-template-columns: minmax(0, 1fr) 60px 60px 112px; }
  .cfggrid > :nth-child(2) { display: none; }
  .cfggrid.docs { grid-template-columns: minmax(0, 1fr) 80px 70px 80px; }
  .cfggrid.docs > :nth-child(2) { display: block; }
}

.asig { border: 1.5px solid var(--line2); border-radius: 10px; padding: 12px; max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.asig-c { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.asig-t { font-family: 'Bebas Neue', sans-serif; font-size: 19px; color: var(--sg); letter-spacing: .5px; }
.asig-o { display: flex; flex-direction: column; gap: 4px; padding-left: 8px; }
.asig-p { display: flex; flex-direction: column; gap: 2px; padding-left: 26px; }
.chk { display: flex; align-items: center; gap: 10px; min-height: 34px; font-size: 14px; cursor: pointer; }
.chk input { width: 20px; height: 20px; accent-color: var(--sg); }
.chk.strong { font-weight: 700; }
.chk:has(input:disabled) { opacity: .45; cursor: default; }

.qr { flex: 0 0 220px; width: 220px; height: 220px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.qr svg { width: 100%; height: 100%; display: block; }
.modal .grow p { margin: 0; }
