/* SulbaTEK CRM · Tema visual: iconos de trazo, barra flotante, pantalla Hoy, recibos, movimiento,
   modo oscuro automático y vista de computadora. Se carga después de styles.css y modulos.css. */
:root { --bt: var(--brand); --ok: #1FA855; --amber: #E8A317; }

/* ---------- iconos de trazo ---------- */
.i { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.aplay .i { fill: currentColor; stroke: none; }
.clip .i { transform: none; }
.ei { display: inline-block; flex: none; width: 1.25em; height: 1.25em; vertical-align: -.26em; margin-right: .35em; }
.hasi > .ei { margin-right: 0; }
.mitem.hasi { display: flex; align-items: center; gap: 13px; }
.mitem .ei { width: 22px; height: 22px; color: var(--bt); }
.mitem.danger .ei { color: inherit; }
.menu:has(.hasi) .mitem:not(.hasi) { padding-left: 51px; }
.go.hasi, .ghost.hasi { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.go .ei, .ghost .ei { width: 19px; height: 19px; }
.sheet h2.hasi, .top h1.hasi, .card h3.hasi { display: flex; align-items: center; gap: 8px; }
.sheet h2 .ei { width: 22px; height: 22px; color: var(--bt); }
.owner.hasi .ei { width: 12px; height: 12px; vertical-align: -1.5px; margin-right: 3px; stroke-width: 2.2; }
.opti .ei { width: 27px; height: 27px; }
.payico .ei { width: 21px; height: 21px; color: var(--bt); }
.tick .ei { width: 12px; height: 12px; }
.top .ic .ei { width: 23px; height: 23px; }
.stchip.hasi { display: inline-flex; align-items: center; gap: 4px; }
.stchip .ei { width: 14px; height: 14px; stroke-width: 2.2; }
.banner.hasi, .warnline.hasi { display: flex; gap: 8px; align-items: flex-start; }
.banner .ei, .warnline .ei { width: 18px; height: 18px; margin-top: 1px; }
a.file .ei { margin-right: 6px; }
.preview .ei { width: 15px; height: 15px; vertical-align: -3px; margin-right: 3px; }

/* ---------- barra superior ---------- */
.top { background: linear-gradient(135deg, #050F3F, #0B1C68); }

/* ---------- avatares ---------- */
.avatar { position: relative; background-image: linear-gradient(140deg, rgba(255, 255, 255, .30), rgba(255, 255, 255, 0) 62%); }
.chb { position: absolute; right: -3px; bottom: -3px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: #5E6378; box-shadow: 0 0 0 2px var(--card); }
.chb .i { width: 11px; height: 11px; stroke-width: 2.4; }
.chb-whatsapp { background: #1FA855; } .chb-instagram { background: #D6377E; } .chb-facebook { background: #2F5BD8; }
.chb-correo { background: #7F66FF; } .chb-web { background: #0E8FA8; } .chb-google { background: #E8A317; }
.row.hasch .ch { display: none; }

/* ---------- barra flotante de abajo ---------- */
.tbar { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom)); width: min(440px, calc(100% - 24px)); height: 64px; z-index: 4;
  display: flex; align-items: center; padding: 0 6px; border-radius: 24px;
  background: rgba(255, 255, 255, .88); -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
  border: 1px solid rgba(5, 15, 63, .08); box-shadow: 0 10px 30px rgba(5, 15, 63, .18), 0 1px 2px rgba(5, 15, 63, .08); }
.tbi { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; font-size: 11px; font-weight: 500; color: var(--muted); border-radius: 16px; }
.tbi .i { width: 24px; height: 24px; }
.tbi.on { color: var(--bt); font-weight: 600; }
.tbi.on .i { stroke-width: 2.2; }
.tbi.on::before { content: ''; position: absolute; top: 4px; width: 46px; height: 30px; border-radius: 15px; background: rgba(66, 96, 230, .13); }
.tbi > * { position: relative; }
.tbplus { flex: none; width: 56px; height: 56px; margin: -26px 4px 0; border-radius: 20px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, #5B78F2, var(--brand) 55%, #2F49B8); box-shadow: 0 8px 20px rgba(66, 96, 230, .45); }
.tbplus .i { width: 26px; height: 26px; stroke-width: 2.3; }
.tbb { position: absolute; top: 2px; left: calc(50% + 7px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #E5484D; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; line-height: 1; box-shadow: 0 0 0 2px var(--card); }
#app:has(.tbar) .fabnew { display: none; }
#app:has(.tbar) > .info { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
#app:has(.tbar) > .list { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }

/* ---------- tarjetas ---------- */
.info > .card { margin: 0 12px 10px; border-radius: 18px; box-shadow: var(--shadow); }
.info > .hero { margin-bottom: 10px; }
.info > .card:first-child, .info > .remhelp + .card { margin-top: 12px; }

/* ---------- Hoy ---------- */
.hero2 { position: relative; overflow: hidden; margin: 12px 12px 10px; padding: 18px 18px 16px; border-radius: 26px; color: #F4F3EE;
  background: linear-gradient(140deg, #050F3F 0%, #14257F 52%, var(--brand) 115%); box-shadow: 0 16px 34px rgba(5, 15, 63, .30); display: flex; flex-direction: column; gap: 14px; }
.hero2::before { content: ''; position: absolute; right: -70px; top: -90px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0)); pointer-events: none; }
.hero2 > * { position: relative; }
.h2day { margin: 0; font-size: 12.5px; color: #B9C4F5; text-transform: capitalize; }
.h2hi { margin: 1px 0 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.h2main { display: flex; align-items: center; gap: 14px; }
.h2txt { flex: 1; min-width: 0; }
.h2big { margin: 0; font-size: 23px; line-height: 1.2; font-weight: 700; letter-spacing: -.015em; }
.h2sub { margin: 6px 0 0; font-size: 13.5px; color: #C9D2F8; }
.ringbox { flex: none; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.ring { --p: 0; position: relative; width: 82px; height: 82px; display: grid; place-items: center; text-align: center; }
.ring::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255, 255, 255, .20) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px)); mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px)); }
.ring b { display: block; font-size: 22px; font-weight: 700; line-height: 1; }
.ring small { display: block; font-size: 11px; color: #C9D2F8; margin-top: 2px; }
.ringcap { font-size: 11px; color: #C9D2F8; }
.h2btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 15px; background: #F4F3EE; color: #050F3F; font-weight: 600; box-shadow: 0 6px 16px rgba(0, 0, 0, .22); }
.h2btn .i { width: 19px; height: 19px; stroke-width: 2.2; }
.h2ok { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: #C9F5D9; }
.h2ok .i { width: 19px; height: 19px; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 12px 10px; }
.kpi { text-align: left; background: var(--card); border-radius: 18px; padding: 12px 13px; display: flex; flex-direction: column; gap: 1px; box-shadow: var(--shadow); min-width: 0; }
.kpic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 7px; background: rgba(66, 96, 230, .12); color: var(--bt); }
.kpic .i { width: 19px; height: 19px; stroke-width: 2; }
.kpi.k-ok .kpic { background: rgba(31, 168, 85, .14); color: #178A45; }
.kpi.k-amber .kpic { background: rgba(232, 163, 23, .16); color: #A06A00; }
.kpi b { font-size: 22px; font-weight: 700; line-height: 1.2; color: var(--noche); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi span { font-size: 12.5px; color: var(--muted); }
.kpi.warn b { color: var(--danger); }
.today .pick { border-radius: 12px; }
.today .card h3 { font-size: 14px; }

/* ---------- pagos como recibos ---------- */
.paycard { position: relative; overflow: hidden; border-radius: 16px; padding: 13px 14px 12px 18px; gap: 5px; box-shadow: var(--shadow); }
.paycard::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--amber); }
.paycard:has(.st-ok)::before { background: var(--ok); }
.paycard:has(.st-no)::before { background: var(--danger); }
.payhead { padding-bottom: 9px; margin-bottom: 3px; border-bottom: 1.5px dashed var(--line); }
.payhead b { font-size: 20px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stchip.st-ok { background: transparent; border: 1.6px solid currentColor; border-radius: 7px; padding: 2px 7px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; transform: rotate(-3deg); }
.proofthumb { border: 1px solid var(--line); }

/* ---------- esqueletos de carga y estados vacíos ---------- */
.empty.skels { padding: 6px 0; text-align: left; }
.sk { display: flex; gap: 13px; align-items: center; padding: 12px 16px; }
.sk i { flex: none; width: 46px; height: 46px; border-radius: 50%; }
.sk b { flex: 1; display: flex; flex-direction: column; gap: 9px; }
.sk b::before, .sk b::after { content: ''; height: 11px; border-radius: 6px; }
.sk b::before { width: 46%; } .sk b::after { width: 82%; }
.sk i, .sk b::before, .sk b::after { background: linear-gradient(90deg, var(--panel) 25%, var(--line) 37%, var(--panel) 63%); background-size: 400% 100%; animation: shim 1.3s ease infinite; }
@keyframes shim { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.empty:not(.skels)::before { content: ''; display: block; width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 28px;
  background: rgba(66, 96, 230, .10) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='%234260E6' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 9h24a4 4 0 0 1 4 4v15a4 4 0 0 1-4 4H20l-9 7v-7a4 4 0 0 1-3-4V13a4 4 0 0 1 4-4z'/%3E%3Cpath d='M17 21l4.500 4.500L31 16'/%3E%3C/svg%3E") center / 46px no-repeat; }

/* ---------- tirar para actualizar ---------- */
.ptr { position: fixed; z-index: 6; left: 50%; top: calc(46px + env(safe-area-inset-top)); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--card); color: var(--muted); box-shadow: 0 4px 14px rgba(5, 15, 63, .22); transform: translate(-50%, 0); opacity: 0; pointer-events: none; transition: opacity .15s; }
.ptr .i { width: 20px; height: 20px; stroke-width: 2.2; }
.ptr.on { opacity: 1; }
.ptr.ready { color: var(--bt); }
.ptr.spin { opacity: 1; transition: transform .2s, opacity .15s; }
.ptr.spin .i { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.row.swiping { transition: none; background: var(--panel); }
.row.swipeok { background: rgba(66, 96, 230, .14); }

/* ---------- celebración ---------- */
.confetti { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -16px; width: 8px; height: 13px; border-radius: 2px; --dx: 0px; --r: 360deg; animation: conf 1.7s cubic-bezier(.25, .6, .45, 1) forwards; }
@keyframes conf { to { transform: translate3d(var(--dx), 108vh, 0) rotate(var(--r)); opacity: .85; } }

/* ---------- movimiento ---------- */
@media (prefers-reduced-motion: no-preference) {
  #app > .info, #app > .list, #app > .chatwrap, #app > .login { animation: vin .26s cubic-bezier(.2, .8, .2, 1); }
  .sheet { animation: fin .18s ease-out; }
  .sheet > div { animation: sup .3s cubic-bezier(.2, .8, .2, 1); }
  .guide { animation: fin .25s ease-out; }
  .row { transition: transform .18s ease-out; }
  .go, .ghost, .kpi, .tbplus, .h2btn, .hact, .fab, .tbi { transition: transform .12s ease-out, filter .12s; }
  .go:active, .ghost:active, .kpi:active, .tbplus:active, .h2btn:active, .hact:active { transform: scale(.96); }
  .tbi:active { transform: scale(.92); }
}
@keyframes vin { from { opacity: 0; transform: translateY(10px); } }
@keyframes fin { from { opacity: 0; } }
@keyframes sup { from { transform: translateY(46px); opacity: .5; } }

/* ---------- guía ---------- */
.gart .i { width: 72px; height: 72px; color: #fff; stroke-width: 1.5; }

/* ---------- computadora: dos columnas ---------- */
.side { display: none; }
@media (min-width: 1000px) {
  body.desk { display: flex; }
  body.desk .side { display: flex; flex-direction: column; flex: none; width: 384px; height: 100vh; height: 100dvh; background: var(--card); border-right: 1px solid var(--line); }
  body.desk #app { flex: 1; min-width: 0; max-width: none; margin: 0; }
  .side .list { padding-bottom: 16px; }
  .side .row.sel { background: rgba(66, 96, 230, .12); }
  .side .row:hover, body.desk .pick:hover, body.desk .mitem:hover { background: var(--panel); }
  body.desk .tbi[data-k="chats"] { display: none; }
  body.desk #app > .info { padding-left: max(0px, calc((100% - 800px) / 2)); padding-right: max(0px, calc((100% - 800px) / 2)); }
  body.desk .bubble { max-width: 62%; }
  body.desk .kpis { grid-template-columns: repeat(4, 1fr); }
  .sheet { place-items: center; }
  .sheet > div { border-radius: 22px; max-height: 86%; }
}

/* ---------- modo oscuro automático ---------- */
@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; --noche: #E9ECF8; --bg: #0B1022; --panel: #1C2443; --card: #131A33; --muted: #9BA5C4; --line: #252E4D; --in: #1C2443; --danger: #FF7B7B; --bt: #9DB0FF;
    --shadow: 0 1px 2px rgba(0, 0, 0, .30), 0 6px 18px rgba(0, 0, 0, .28); }
  .top { background: #0A0F26; border-bottom: 1px solid var(--line); }
  .sbox, .fchip { background: #1C2443; }
  .fchip.on { background: rgba(66, 96, 230, .30); color: #C7D1FF; }
  .row:active, .mitem:active { background: #1C2443; }
  .row.unread .when, .owner, .unreadsep, .sitem b, .sheet a, .hact, .card h3, .login .tagline { color: var(--bt); }
  .owner.none { color: var(--muted); }
  .avatar { background-color: #2F49B8; box-shadow: 0 0 0 1px rgba(255, 255, 255, .10); }
  .ch-whatsapp, .st-ok { background: #123D24; color: #7FE0A2; }
  .ch-instagram { background: #4A1535; color: #FF9CCB; }
  .ch-facebook { background: #1B2B63; color: #A9BDFF; }
  .msgs { background-color: #0B1022;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23FFFFFF' stroke-opacity='.045' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M18 22h20a4 4 0 0 1 4 4v10a4 4 0 0 1-4 4H26l-6 5v-5h-2a4 4 0 0 1-4-4V26a4 4 0 0 1 4-4z'/%3E%3Ccircle cx='88' cy='30' r='8'/%3E%3Cpath d='M70 82l8-8 8 8M78 74v20'/%3E%3Cpath d='M20 88c6-10 14-10 20 0s14 10 20 0'/%3E%3Cpath d='M96 96l6 6M102 96l-6 6'/%3E%3Ccircle cx='60' cy='58' r='2'/%3E%3C/g%3E%3C/svg%3E"); }
  .day { background: #1C2443; }
  .unreadsep { background: rgba(28, 36, 67, .85); }
  .bubble.in { background: #1C2443; }
  .bubble.in::before { background: linear-gradient(225deg, #1C2443 50%, transparent 50%); }
  .bubble.out { background: #2B3F9F; color: #fff; }
  .bubble.out::before { background: linear-gradient(135deg, #2B3F9F 50%, transparent 50%); }
  .bubble.out .meta, .bubble.out .atime { color: #C7D1FF; }
  .bubble.out .aplay { color: #fff; }
  .tick { color: #A9B4D6; }
  .tick.read { color: #8FC0FF; }
  .bubble a { color: #A9BDFF; }
  .bubble a.file { background: rgba(255, 255, 255, .09); }
  .wave span, .aspeed { background: #56618A; }
  .wave span.on { background: #9DB0FF; }
  .tobottom, .clip, .composer textarea, .composer.recording .recinfo, .composer.recording .lockhint { background: #1C2443; }
  .composer, .recbar { background: #0B1022; }
  .suggest { background: var(--card); }
  .banner, .st-pend, .warnline { background: #3A2E0A; color: #F3D98A !important; border-color: #57450F; }
  .st-no { background: #45191C; color: #FFA3A3; }
  .stchip.st-ok { background: transparent; }
  .note { background: #3A3310; }
  .login .wordmark span { color: #C9CFE6; }
  .sheet { background: rgba(0, 0, 0, .62); }
  #toast { background: #E9ECF8; color: #0B1022; }
  .seg button.on { background: #2C3766; color: #fff; }
  .chip { background: rgba(66, 96, 230, .22); border-color: rgba(157, 176, 255, .30); }
  .tbar { background: rgba(28, 36, 67, .88); border-color: rgba(255, 255, 255, .08); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
  .tbi.on::before { background: rgba(157, 176, 255, .16); }
  .kpic { background: rgba(157, 176, 255, .14); }
  .kpi.k-ok .kpic { background: rgba(31, 168, 85, .20); color: #7FE0A2; }
  .kpi.k-amber .kpic { background: rgba(232, 163, 23, .20); color: #F3D98A; }
  .hero2 { box-shadow: 0 16px 34px rgba(0, 0, 0, .45); background: linear-gradient(140deg, #101B5C 0%, #1B2F96 55%, var(--brand) 120%); }
  .empty:not(.skels)::before { background-color: rgba(157, 176, 255, .12); }
  .row.swipeok, .side .row.sel { background: rgba(157, 176, 255, .16); }
  .gart { box-shadow: 0 14px 34px rgba(0, 0, 0, .5); }
  input::placeholder, textarea::placeholder { color: #7480A6; }
}
