/* Prosistem - panel del sistema */
:root {
  --azul: #12a3df; --azul-osc: #0b6f9c; --amarillo: #ffe600; --tinta: #10212b;
  --texto: #33434d; --muted: #7b8b94; --bg: #f2f6f9; --card: #fff; --borde: #e1e9ee;
  --rojo: #d64545; --verde: #1f9d63; --ambar: #c98a00;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; color: var(--texto); background: var(--bg); font-size: 15px; }
a { color: var(--azul-osc); }
.ico { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); } .center { text-align: center; } .error { color: var(--rojo); }

/* Estructura */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; background: var(--tinta); color: #b9c8d1; display: flex; flex-direction: column; z-index: 40; transition: transform .2s; }
.brand { display: block; background: #fff; padding: 14px 16px; }
.brand img { width: 100%; height: auto; }
.panel-name { padding: 16px 20px 8px; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--amarillo); font-weight: 700; }
.sidebar nav { display: flex; flex-direction: column; padding: 4px 10px; gap: 2px; flex: 1; overflow-y: auto; }
.sidebar a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: #c7d4db; text-decoration: none; font-weight: 500; }
.sidebar a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar a.active { background: var(--azul); color: #fff; }
.side-foot { padding: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.main { margin-left: 250px; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; background: #fff; padding: 12px 28px; border-bottom: 1px solid var(--borde); }
.topbar h1 { font-size: 1.25rem; margin: 0; flex: 1; color: var(--tinta); }
.user { display: flex; align-items: center; gap: 10px; }
.user strong { display: block; font-size: .9rem; color: var(--tinta); }
.user small { color: var(--muted); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--amarillo); color: var(--tinta); display: grid; place-items: center; font-weight: 800; }
.content { padding: 26px 28px 110px; max-width: 1400px; }
.only-mobile { display: none; }

/* Tarjetas */
.card { background: var(--card); border: 1px solid var(--borde); border-radius: 14px; padding: 20px; margin-bottom: 20px; }
.card h2 { margin: 0 0 14px; font-size: 1.1rem; color: var(--tinta); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--borde); border-radius: 14px; padding: 18px 20px; border-left: 5px solid var(--azul); }
.stat.y { border-left-color: var(--amarillo); } .stat.g { border-left-color: var(--verde); } .stat.a { border-left-color: var(--ambar); }
.stat span { color: var(--muted); font-size: .85rem; font-weight: 600; }
.stat strong { display: block; font-size: 2rem; color: var(--tinta); line-height: 1.2; margin-top: 4px; }
.quick { display: flex; gap: 12px; flex-wrap: wrap; }

/* Formularios */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .input { max-width: 320px; }
.toolbar .grow { flex: 1; }
.input { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #cfdbe2; border-radius: 10px; background: #fff; color: var(--tinta); }
.input:focus { outline: 2px solid var(--azul); border-color: transparent; }
textarea.input { resize: vertical; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: .88rem; color: var(--tinta); }
.req { color: var(--rojo); }
.help { color: var(--muted); font-size: .8rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; }

.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 10px; border: 1px solid #cfdbe2; background: #fff; color: var(--tinta); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #f2f7fa; }
.btn .ico { width: 18px; height: 18px; }
.btn.primary { background: var(--azul); border-color: var(--azul); color: #fff; }
.btn.primary:hover { background: var(--azul-osc); }
.btn.yellow { background: var(--amarillo); border-color: #e6cf00; }
.btn.danger { color: var(--rojo); border-color: #f0c9c9; }
.btn.danger:hover { background: #fdf0f0; }
.btn.sm { padding: 5px 10px; font-size: .82rem; border-radius: 8px; }
.btn.block { width: 100%; justify-content: center; padding: 12px; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-icon { background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; }

/* Tablas */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 2px solid var(--borde); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--borde); vertical-align: middle; }
.table tr:hover td { background: #f8fbfd; }
.table .acciones { text-align: right; white-space: nowrap; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge.green { background: #e2f6ec; color: var(--verde); } .badge.gray { background: #eef1f3; color: #6b7a83; }
.badge.amber { background: #fff4d6; color: #9a6a00; } .badge.blue { background: #e1f3fc; color: var(--azul-osc); }
.chip { display: inline-block; font-size: .75rem; background: #eef4f7; color: #5a6b74; padding: 2px 8px; border-radius: 6px; margin-right: 4px; }

/* Modal */
.modal { border: 0; border-radius: 16px; padding: 0; width: min(720px, 100% - 24px); box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.modal::backdrop { background: rgba(16,33,43,.5); }
.modal header, .modal footer { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; }
.modal header { border-bottom: 1px solid var(--borde); }
.modal header h2 { margin: 0; font-size: 1.1rem; }
.modal footer { border-top: 1px solid var(--borde); justify-content: flex-end; gap: 10px; }
.modal .form-grid { padding: 18px 22px 4px; max-height: 65vh; overflow-y: auto; }

/* Trabajos */
.dropzone { border: 2px dashed #b8cfdc; border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; background: #f8fbfd; transition: .15s; }
.dropzone.over, .dropzone:hover { border-color: var(--azul); background: #eef8fd; color: var(--azul-osc); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.gallery figure { margin: 0; position: relative; border-radius: 10px; overflow: hidden; background: #eef3f6; aspect-ratio: 4/3; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.gallery .del { position: absolute; top: 6px; right: 6px; background: rgba(214,69,69,.92); color: #fff; border: 0; border-radius: 8px; width: 28px; height: 28px; cursor: pointer; font-size: 1.1rem; }
.gallery .nuevo { outline: 3px solid var(--amarillo); }
.docs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.doc-box { border: 1px solid var(--borde); border-radius: 12px; padding: 14px; }
.doc-box h3 { margin: 0 0 8px; font-size: .95rem; color: var(--tinta); }
.detalle { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 24px; }
.detalle div span { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.detalle div strong { color: var(--tinta); font-weight: 600; }
.desc { white-space: pre-wrap; line-height: 1.6; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); display: grid; place-items: center; z-index: 100; cursor: zoom-out; }
.lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 8px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-bottom: 18px; }

/* Avisos */
#toast { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 200; }
.toast { background: var(--tinta); color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); border-left: 5px solid var(--verde); transition: .4s; max-width: 380px; }
.toast.err { border-left-color: var(--rojo); }
.toast.out { opacity: 0; transform: translateY(10px); }
.alert { background: #fdeeee; color: #9c2b2b; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: .9rem; }

/* Login */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: linear-gradient(135deg, var(--azul-osc), var(--azul) 55%, #3cc3f2); }
.login-card { background: #fff; width: min(420px, 100%); border-radius: 20px; padding: 34px; box-shadow: 0 30px 80px rgba(4,40,60,.35); }
.login-logo { width: 100%; margin-bottom: 18px; }
.login-card h1 { margin: 0; font-size: 1.4rem; color: var(--tinta); }
.login-card p { margin: 4px 0 22px; }
.login-card .back { display: block; text-align: center; margin-top: 18px; font-size: .9rem; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.4); }
  .main { margin-left: 0; }
  .only-mobile { display: inline-block; }
  .content { padding: 18px 16px 40px; }
  .topbar { padding: 10px 16px; }
  .user div { display: none; }
  .form-grid, .docs { grid-template-columns: 1fr; }
  .toolbar .input { max-width: none; }
  .table thead { display: none; }
  .table tr { display: block; border-bottom: 1px solid var(--borde); padding: 8px 0; }
  .table td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 5px 4px; }
  .table td[data-label]::before { content: attr(data-label); font-weight: 700; color: var(--muted); font-size: .8rem; }
  .table .acciones { justify-content: flex-end; }
}

/* Mensajes de contacto */
.nav-badge { margin-left: auto; background: var(--amarillo); color: var(--tinta); font-size: .75rem; min-width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; padding: 0 6px; }
.msg-list { display: grid; gap: 12px; }
.msg { border: 1px solid var(--borde); border-radius: 12px; padding: 14px 16px; background: #fff; border-left: 5px solid #cfdbe2; }
.msg.nuevo { border-left-color: var(--amarillo); background: #fffdf0; }
.msg-head { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; justify-content: space-between; }
.msg-head strong { color: var(--tinta); font-size: 1rem; }
.msg-meta { color: var(--muted); font-size: .85rem; display: flex; gap: 14px; flex-wrap: wrap; margin: 4px 0 8px; }
.msg-body { white-space: pre-wrap; line-height: 1.55; color: var(--texto); }
.msg-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.field[hidden] { display: none; }

[hidden] { display: none !important; }

/* ---------- Chat flotante (burbuja) ---------- */
.online-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); text-decoration: none; padding: 5px 10px; border-radius: 999px; }
.online-pill:hover { background: var(--bg); }
.online-pill:has(#navOnline:empty) { display: none; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #b8c4cb; flex: none; }
.dot.on { background: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,.2); }

.cw { position: fixed; right: 22px; bottom: 22px; z-index: 150; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.cw-fab { position: relative; width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer; background: var(--azul); color: #fff;
  box-shadow: 0 10px 26px rgba(11,111,156,.45); display: grid; place-items: center; transition: transform .15s, background .15s; }
.cw-fab:hover { transform: scale(1.06); background: var(--azul-osc); }
.cw-fab svg { width: 30px; height: 30px; }
.cw-ic-x { display: none; font-size: 2rem; line-height: 1; }
.cw.abierto .cw-ic-chat { display: none; }
.cw.abierto .cw-ic-x { display: block; }
.cw-badge { position: absolute; top: -4px; right: -4px; background: #e11d48; color: #fff; min-width: 24px; height: 24px; border-radius: 12px; font-size: .78rem;
  display: grid; place-items: center; padding: 0 6px; border: 2px solid #fff; }
.cw-fab.rebote { animation: cwRebote .9s ease; }
@keyframes cwRebote { 0%,100% { transform: none; } 20% { transform: translateY(-14px) scale(1.08); } 40% { transform: none; } 60% { transform: translateY(-7px); } 80% { transform: none; } }

.cw-peek { position: relative; width: 300px; background: #fff; border-radius: 16px 16px 4px 16px; box-shadow: 0 14px 40px rgba(16,33,43,.25); padding: 12px 34px 12px 12px;
  cursor: pointer; animation: cwEntra .25s ease; border-left: 4px solid var(--amarillo); }
.cw-peek-body { display: flex; gap: 10px; align-items: flex-start; }
.cw-peek-body strong { display: block; color: var(--tinta); font-size: .9rem; }
.cw-peek-txt { display: block; color: var(--texto); font-size: .88rem; line-height: 1.35; word-break: break-word; }
.cw-peek-x { position: absolute; top: 4px; right: 6px; background: none; border: 0; font-size: 1.3rem; color: var(--muted); cursor: pointer; }
@keyframes cwEntra { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }

.cw-panel { width: 370px; height: min(560px, calc(100vh - 120px)); background: #fff; border-radius: 18px; box-shadow: 0 20px 60px rgba(16,33,43,.3);
  overflow: hidden; display: flex; flex-direction: column; animation: cwEntra .2s ease; }
.cw-view { display: flex; flex-direction: column; flex: 1; min-height: 0; position: relative; }
.cw-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; background: var(--tinta); color: #fff; }
.cw-head-t { flex: 1; min-width: 0; }
.cw-head-t strong { display: block; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-head-t small { display: flex; align-items: center; gap: 6px; font-size: .76rem; color: #b9c8d1; }
.cw-hbtn { background: none; border: 0; color: #fff; font-size: 1.15rem; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; flex: none; }
.cw-hbtn:hover { background: rgba(255,255,255,.12); }
.cw-search { padding: 10px 12px; border-bottom: 1px solid var(--borde); }
.cw-search .input { padding: 8px 12px; }
.cw-contacts { overflow-y: auto; flex: 1; }
.cw-pad { padding: 16px; }
.cw-contact { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 14px; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.cw-contact:hover { background: #f3f8fb; }
.cw-contact.nuevo strong { color: var(--azul-osc); }
.cw-info { flex: 1; min-width: 0; display: grid; }
.cw-info strong { color: var(--tinta); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-info small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .78rem; }
.cw-contact.nuevo small { color: var(--tinta); font-weight: 600; }
.cw-cbadge { background: #e11d48; color: #fff; border-radius: 11px; min-width: 22px; height: 22px; font-size: .74rem; display: grid; place-items: center; padding: 0 6px; }
.cw-avatar { position: relative; width: 40px; height: 40px; border-radius: 50%; background: var(--azul); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.cw-avatar.sm { width: 34px; height: 34px; font-size: .78rem; }
.cw-avatar.grupo { background: var(--amarillo) !important; font-size: 1.15rem; }
.cw-avatar .dot { position: absolute; right: -1px; bottom: 0; width: 12px; height: 12px; border: 2px solid #fff; box-shadow: none; }

.cw-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 5px; background: #eef3f6; }
.b { max-width: 82%; align-self: flex-start; background: #fff; border-radius: 4px 14px 14px 14px; padding: 6px 10px 4px; box-shadow: 0 1px 1px rgba(0,0,0,.06); word-wrap: break-word; font-size: .92rem; }
.b.mio { align-self: flex-end; background: #d4f0fc; border-radius: 14px 4px 14px 14px; }
.b-de { display: block; font-size: .74rem; font-weight: 700; margin-bottom: 1px; }
.b-txt { white-space: pre-wrap; line-height: 1.4; color: var(--tinta); }
.b.emoji { background: none; box-shadow: none; }
.b.emoji .b-txt { font-size: 2rem; line-height: 1.2; }
.b-hora { display: block; text-align: right; font-size: .68rem; color: #8a99a2; margin-top: 1px; }
.tick { font-style: normal; margin-left: 4px; color: #a9b6bd; letter-spacing: -3px; }
.b.leido .tick { color: var(--azul); }
.b-img { display: block; max-width: 100%; max-height: 220px; border-radius: 8px; cursor: zoom-in; margin: 2px 0 3px; }
.b-doc { display: flex; align-items: center; gap: 9px; text-decoration: none; background: rgba(255,255,255,.75); border: 1px solid var(--borde); border-radius: 10px; padding: 7px 9px; margin: 2px 0 3px; }
.b-doc strong { display: block; color: var(--tinta); font-size: .84rem; word-break: break-all; }
.b-doc small { color: var(--muted); font-size: .74rem; }
.b-ext { background: var(--tinta); color: var(--amarillo); font-size: .66rem; font-weight: 800; border-radius: 6px; padding: 7px 5px; min-width: 40px; text-align: center; flex: none; }

.cw-compose { position: relative; border-top: 1px solid var(--borde); padding: 8px 10px; background: #fff; }
.cw-bar { display: flex; align-items: flex-end; gap: 4px; }
.cw-bar textarea { flex: 1; min-width: 0; resize: none; font: inherit; font-size: .92rem; border: 1px solid #cfdbe2; border-radius: 18px; padding: 8px 13px; max-height: 110px; line-height: 1.35; }
.cw-bar textarea:focus { outline: 2px solid var(--azul); border-color: transparent; }
.cw-btn { background: none; border: 0; font-size: 1.25rem; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; flex: none; }
.cw-btn:hover { background: var(--bg); }
.cw-send { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--azul); color: #fff; font-size: 1rem; cursor: pointer; flex: none; }
.cw-send:hover { background: var(--azul-osc); }
.cw-send:disabled { opacity: .5; }
.cw-adjunto { display: flex; align-items: center; gap: 9px; background: var(--bg); border-radius: 10px; padding: 6px 8px; margin-bottom: 7px; }
.cw-adjunto img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.cw-adj-info { flex: 1; min-width: 0; }
.cw-adj-info strong { display: block; font-size: .84rem; color: var(--tinta); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-adj-info small { color: var(--muted); }
.cw-emojis { position: absolute; bottom: calc(100% + 4px); left: 8px; right: 8px; max-height: 250px; overflow-y: auto; background: #fff; border: 1px solid var(--borde);
  border-radius: 14px; box-shadow: 0 12px 34px rgba(0,0,0,.18); padding: 6px 8px; z-index: 5; }
.emoji-cat { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 4px 3px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); }
.emoji-grid button { background: none; border: 0; font-size: 1.35rem; padding: 3px 0; border-radius: 8px; cursor: pointer; }
.emoji-grid button:hover { background: var(--bg); }
.cw-drop { position: absolute; inset: 8px; border: 3px dashed var(--azul); border-radius: 14px; background: rgba(230,245,252,.94); display: grid; place-items: center;
  font-weight: 700; color: var(--azul-osc); z-index: 10; pointer-events: none; text-align: center; padding: 10px; }
#toast { bottom: 100px; }

@media (max-width: 600px) {
  .cw { right: 14px; bottom: 14px; }
  .cw.abierto { inset: 0; right: 0; bottom: 0; gap: 0; }
  .cw.abierto .cw-fab { display: none; }
  .cw-panel { width: 100vw; height: 100dvh; border-radius: 0; }
  .cw-peek { width: calc(100vw - 28px); }
  .online-pill { display: none; }
}

/* ---------- Inventario ---------- */
.table .num, .table th.num { text-align: right; white-space: nowrap; }
.table th.center { text-align: center; }
.table .thumb { width: 56px; }
.table .thumb img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; cursor: zoom-in; display: block; }
.nofoto { display: grid; place-items: center; width: 44px; height: 44px; background: var(--bg); border-radius: 8px; font-size: 1.3rem; }
.table tr.inactivo td { opacity: .55; }
.kardex th.in, .kardex td.in { background: #f0faf5; }
.kardex th.out, .kardex td.out { background: #fff6f3; }
.kardex td { font-size: .9rem; }
.prod-top { display: grid; grid-template-columns: 340px 1fr; gap: 20px; }
.prod-fotos { display: flex; flex-direction: column; gap: 10px; }
.prod-principal { width: 100%; aspect-ratio: 1; object-fit: contain; background: #f6f9fb; border-radius: 10px; cursor: zoom-in; }
.prod-miniaturas { display: flex; gap: 8px; flex-wrap: wrap; }
.prod-miniaturas img { width: 58px; height: 58px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid var(--borde); }
.prod-sinfoto { aspect-ratio: 1; display: grid; place-content: center; text-align: center; font-size: 4rem; background: #f6f9fb; border-radius: 10px; }
.totales { margin: 16px 0 0 auto; max-width: 360px; display: grid; gap: 6px; }
.totales > div { display: flex; justify-content: space-between; gap: 20px; }
.totales span { color: var(--muted); }
.totales .grand { border-top: 2px solid var(--tinta); padding-top: 8px; font-size: 1.15rem; }
.totales .grand span, .totales .grand strong { color: var(--tinta); }
.lineas td { vertical-align: top; }
.lineas .input { padding: 8px 10px; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tab { padding: 9px 16px; border-radius: 10px; background: #fff; border: 1px solid var(--borde); text-decoration: none; color: var(--texto); font-weight: 600; }
.tab.on { background: var(--tinta); color: #fff; border-color: var(--tinta); }
.modal-lg { width: min(980px, 100% - 24px); }
.modal-body { padding: 18px 22px; max-height: 70vh; overflow-y: auto; }
.stat span a { color: inherit; }
@media (max-width: 900px) { .prod-top { grid-template-columns: 1fr; } }

/* ---------- Exportar ---------- */
.export { display: inline-flex; gap: 6px; align-items: center; }
.btn.exp-word { color: #1f5bb5; border-color: #c7d8f2; }
.btn.exp-word:hover { background: #eef4fd; }
.btn.exp-pdf { color: #c0392b; border-color: #f0c9c4; }
.btn.exp-pdf:hover { background: #fdf1ef; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { margin: 0; }

/* ---------- Trabajos avanzados ---------- */
.grupo-trab { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.lista-trab { max-height: 420px; overflow-y: auto; border: 1px solid var(--borde); border-radius: 12px; }
.lt-item { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-bottom: 1px solid #eef3f6; cursor: pointer; }
.lt-item:hover { background: #f6fafc; }
.lt-item input { width: 18px; height: 18px; flex: none; }
.lt-f { font-size: .82rem; color: var(--muted); white-space: nowrap; width: 78px; flex: none; }
.lt-t { flex: 1; min-width: 0; display: grid; }
.lt-t strong { color: var(--tinta); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-t small { color: var(--muted); font-size: .78rem; }
.lt-a { display: flex; gap: 4px; flex: none; }
.sel-trab { margin: 0; padding: 0; list-style: none; counter-reset: n; display: grid; gap: 6px; max-height: 420px; overflow-y: auto; }
.sel-trab li { counter-increment: n; display: flex; align-items: center; gap: 10px; background: #f3f9fc; border: 1px solid #d6ebf5; border-radius: 10px; padding: 7px 10px; }
.sel-trab li::before { content: counter(n); background: var(--azul); color: #fff; border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; font-size: .78rem; font-weight: 700; flex: none; }
.kicker-panel { font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--azul); }
.texto-inf p { margin: 0 0 8px; line-height: 1.6; }
.texto-inf.lista { margin: 0; padding-left: 20px; line-height: 1.6; }
@media (max-width: 900px) { .grupo-trab { grid-template-columns: 1fr; } }

/* ---------- Envíos ---------- */
.btn.wa { background: #25d366; border-color: #25d366; color: #fff; }
.btn.wa:hover { background: #1ebe5a; }
.btn.env-mail { color: var(--azul-osc); border-color: #b9dcee; }
.env-h { font-size: .95rem; color: var(--tinta); margin: 22px 0 8px; border-top: 1px solid var(--borde); padding-top: 16px; }
#dlgEnvio .tab { cursor: pointer; font: inherit; }

/* ---------- Cotizaciones ---------- */
.badge.red { background: #fde8e8; color: #b42318; }
.stat small { display: block; margin-top: 2px; }
.cot-top { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
.estado-box { margin-top: 16px; padding: 12px 14px; border-radius: 10px; line-height: 1.5; }
.estado-box.green { background: #e2f6ec; color: #125c3c; }
.estado-box.red { background: #fdeeee; color: #8f2424; }
.estado-acciones { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--borde); }
.btn.green-btn { background: var(--verde); border-color: var(--verde); color: #fff; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--borde); display: grid; gap: 14px; max-height: 380px; overflow-y: auto; }
.timeline li { position: relative; font-size: .9rem; line-height: 1.45; }
.timeline li::before { content: ""; position: absolute; left: -23px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #b8c4cb; border: 2px solid #fff; }
.timeline li.amber::before { background: var(--ambar); } .timeline li.green::before { background: var(--verde); } .timeline li.red::before { background: var(--rojo); }
.visor { width: 100%; height: 75vh; border: 1px solid var(--borde); border-radius: 10px; background: #f6f9fb; }
@media (max-width: 900px) { .cot-top { grid-template-columns: 1fr; } .visor { height: 60vh; } }

/* Cotizaciones: tipo (elaborada / archivo) y editor de líneas */
.tipo-cot { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.tipo-op { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border: 2px solid var(--borde, #dfe6ea); border-radius: 14px; background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.tipo-op:hover { border-color: #9fd6ee; }
.tipo-op.on { border-color: #12a3df; box-shadow: 0 0 0 4px rgba(18,163,223,.12); background: #f4fbfe; }
.tipo-op strong { display: block; color: var(--tinta); margin-bottom: 3px; }
.tipo-op small { color: var(--muted); line-height: 1.4; }
.tipo-ic { font-size: 1.8rem; line-height: 1; }
.table.items td { vertical-align: top; }
.table.items textarea { min-width: 260px; resize: vertical; }
.table.items .input.num { width: 96px; text-align: right; }
.table.items .tot { font-weight: 700; white-space: nowrap; padding-top: 14px; }
@media (max-width: 700px) { .tipo-cot { grid-template-columns: 1fr; } .table.items textarea { min-width: 180px; } }

/* Reparaciones */
.sub-h { font-size: .92rem; margin: 18px 0 8px; color: var(--tinta); }
.dropzone.dz-sm { padding: 14px; }
.alerta-prest { background: #fff6dc; border: 1px solid #f3d27a; color: #6b4d00; border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; line-height: 1.45; }
.alerta-prest .btn { margin-left: auto; }
.bloque { margin-top: 14px; }
.bloque > span { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.dos-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.fotos-etapa { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--borde); }
.fe-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 700; font-size: .9rem; color: var(--tinta); }
.prest-box { border: 1px solid #f3d27a; background: #fffcf1; border-radius: 12px; padding: 14px 16px; margin-top: 12px; }
.prest-box.dev { border-color: var(--borde); background: #fafcfd; }
.prest-box h3 { margin: 0 0 10px; font-size: 1rem; color: var(--tinta); }
.modal .modal-body .gallery { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
@media (max-width: 700px) { .dos-col { grid-template-columns: 1fr; } .alerta-prest .btn { margin-left: 0; } }
.modal .modal-body .form-grid { padding: 0; max-height: none; overflow: visible; }
.stats.stats-sm { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 6px; }
.stats.stats-sm .stat { padding: 12px 14px; }
.stats.stats-sm .stat strong { font-size: 1.5rem; }
#dashRep .sub-h { margin-top: 20px; }

/* Chat: menú de sonido */
.cw-panel { position: relative; }
.cw-hbtn.cw-snd { font-size: 1rem; }
.cw-hbtn.cw-snd.mudo { opacity: .7; }
.cw-sndmenu { position: absolute; top: 56px; right: 10px; z-index: 5; width: 270px; background: #fff; border: 1px solid var(--borde); border-radius: 12px; box-shadow: 0 14px 34px rgba(16,33,43,.22); padding: 10px; color: var(--tinta); }
.cw-sndtit { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 2px 6px 8px; }
.cw-sndop { display: flex; justify-content: space-between; width: 100%; background: none; border: 0; text-align: left; padding: 8px 10px; border-radius: 8px; cursor: pointer; font: inherit; font-size: .92rem; color: var(--tinta); }
.cw-sndop:hover { background: #eef6fb; }
.cw-sndop.on { background: #e3f4fc; font-weight: 700; }
.cw-sndop b { color: var(--azul); }
.cw-vol { display: flex; align-items: center; gap: 8px; padding: 10px 8px 4px; font-size: .9rem; }
.cw-vol input { flex: 1; accent-color: var(--azul); }
.cw-notif { display: flex; gap: 8px; align-items: flex-start; padding: 10px 8px 4px; margin-top: 6px; border-top: 1px solid var(--borde); font-size: .82rem; color: var(--muted); line-height: 1.35; cursor: pointer; }
.cw-notif[hidden] { display: none; }

/* Chat: historial y borrado */
.cw-dia { display: flex; justify-content: center; margin: 8px 0 4px; }
.cw-dia span { background: #dce7ee; color: #4b5d67; font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; text-transform: capitalize; }
.cw-mas { align-self: center; background: #fff; border: 1px solid var(--borde); color: var(--azul-osc, #0b6f9c); font: inherit; font-size: .8rem; font-weight: 700;
  padding: 6px 14px; border-radius: 999px; cursor: pointer; margin: 2px 0 6px; }
.cw-mas:hover { background: #eef8fd; }
.cw-mas:disabled { opacity: .6; cursor: default; }
.cw-confirm { position: absolute; inset: 0; background: rgba(16,33,43,.55); display: grid; place-items: center; z-index: 4; padding: 18px; border-radius: 0 0 18px 18px; }
.cw-confirm[hidden] { display: none; }
.cw-confirm-box { background: #fff; border-radius: 14px; padding: 18px; text-align: center; display: grid; gap: 8px; width: 100%; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.cw-confirm-box strong { color: var(--tinta); }
.cw-confirm-box p { margin: 0 0 6px; color: var(--muted); font-size: .85rem; line-height: 1.4; }
.cw-confirm-ic { font-size: 1.8rem; }
.cw-confirm-box .btn { width: 100%; justify-content: center; }
.cw-confirm-box .btn.ghost { background: none; border-color: transparent; }

/* Chat: varios adjuntos */
.cw-adjunto { flex-direction: column; align-items: stretch; gap: 4px; max-height: 170px; overflow-y: auto; }
.cw-adjunto[hidden] { display: none; }
.cw-adj-item { display: flex; align-items: center; gap: 9px; }
.cw-adj-item .b-ext { width: 44px; height: 44px; flex: none; display: grid; place-items: center; }
.cw-adj-estado { font-size: .78rem; font-weight: 700; color: var(--azul-osc, #0b6f9c); padding: 2px 2px 4px; }

/* Ajustes: cuentas de correo */
.cuenta-correo { border: 1px solid var(--borde); border-radius: 12px; padding: 16px; margin-top: 14px; }
.cuenta-correo h3 { margin: 0 0 4px; font-size: 1rem; color: var(--tinta); }
.help.falta { color: #a15c00; font-weight: 600; }
.env-desde { margin: 0 0 10px; font-size: .88rem; color: var(--muted); }

/* Herramientas */
.her-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 8px; }
.her-card { display: flex; flex-direction: column; border: 1px solid var(--borde); border-radius: 14px; overflow: hidden; background: #fff; color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s; }
.her-card:hover { box-shadow: 0 10px 26px rgba(16,33,43,.12); transform: translateY(-2px); }
.her-foto { position: relative; aspect-ratio: 4 / 3; background: #eef3f6; }
.her-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.her-nfotos { position: absolute; right: 8px; bottom: 8px; background: rgba(16,33,43,.75); color: #fff; font-size: .72rem; padding: 2px 8px; border-radius: 999px; }
.her-sinfoto { display: grid; place-items: center; width: 100%; height: 100%; font-size: 2.4rem; color: #9fb2bd; background: #eef3f6; }
.her-sinfoto.grande { aspect-ratio: 4 / 3; border-radius: 12px; font-size: 4rem; align-content: center; gap: 6px; }
.her-sinfoto.grande small { font-size: .85rem; }
.her-info { padding: 12px 14px 14px; display: grid; gap: 3px; }
.her-info strong { color: var(--tinta); font-size: 1rem; }
.her-info > span { font-size: .85rem; }
.her-pie { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.her-pie small { color: var(--muted); font-size: .8rem; }
.her-mini { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; display: block; font-size: 1.4rem; }
span.her-mini { display: grid; place-items: center; }
.her-top { display: grid; grid-template-columns: minmax(280px, 1fr) 1.4fr; gap: 20px; }
.her-principal { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #eef3f6; border-radius: 12px; cursor: zoom-in; display: block; }
.her-miniaturas { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.her-miniaturas img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.her-miniaturas img.on { border-color: var(--azul); }
.vista-btns .btn.on { background: var(--tinta); color: #fff; border-color: var(--tinta); }
.gallery figure.principal { outline: 3px solid var(--azul); }
.gallery .estrella { position: absolute; top: 6px; left: 6px; background: rgba(255,255,255,.92); border: 0; border-radius: 8px; width: 28px; height: 28px; cursor: pointer; color: #c98a00; font-size: 1rem; }
@media (max-width: 900px) { .her-top { grid-template-columns: 1fr; } }

/* Respaldos */
.resp-top { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.nota-resp { margin-top: 16px; padding: 12px 14px; background: #f3f8fb; border: 1px solid #d8e6ee; border-radius: 12px; font-size: .9rem; line-height: 1.5; }
.nota-resp code { display: block; margin-top: 8px; padding: 8px 10px; background: #10212b; color: #e6f4fb; border-radius: 8px; font-size: .82rem; overflow-x: auto; white-space: nowrap; }
@media (max-width: 900px) { .resp-top { grid-template-columns: 1fr; } }
.dropzone { display: block; }

/* Reportes Dollarcity */
.dc-logo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dc-logo img { max-height: 64px; max-width: 220px; border-radius: 8px; background: #7fae3a; padding: 6px; }
.dc-eq { border: 1px solid var(--borde); border-radius: 14px; margin-bottom: 12px; background: #fff; overflow: hidden; }
.dc-eq-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #f4f9ee; border-bottom: 1px solid transparent; flex-wrap: wrap; }
.dc-eq.abierto .dc-eq-head { border-bottom-color: var(--borde); }
.dc-eq-tit { flex: 1; min-width: 200px; cursor: pointer; line-height: 1.35; }
.dc-toggle { border: 0; background: none; font-size: 1.1rem; cursor: pointer; color: var(--tinta); transition: transform .15s; width: 28px; }
.dc-eq.abierto .dc-toggle { transform: rotate(90deg); }
.dc-eq-body { display: none; padding: 14px; }
.dc-eq.abierto .dc-eq-body { display: block; }
.dc-eq-btns { display: inline-flex; gap: 4px; }
.dc-sec { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--borde); }
.dc-sec h4 { margin: 0 0 8px; font-size: .95rem; color: var(--tinta); }
.dc-slots { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.dc-slots.uno { grid-template-columns: 1fr; }
.dc-slot { border: 1px solid var(--borde); border-radius: 12px; padding: 10px; background: #fbfdfe; }
.dc-slot.antes { border-top: 3px solid #c98a00; } .dc-slot.despues { border-top: 3px solid var(--verde); }
.dc-slot-h { font-weight: 800; font-size: .82rem; letter-spacing: .03em; color: #5a6b74; }
.dc-slot .gallery { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 8px 0; }
.dc-slot .gallery:empty { display: none; }
.dc-slot .dc-add { padding: 10px; margin-top: 8px; font-size: .88rem; }
.dc-fig { aspect-ratio: auto !important; }
.dc-fig img { aspect-ratio: 4 / 3; height: auto !important; }
.dc-ley { width: 100%; border: 0; border-top: 1px solid var(--borde); padding: 6px 8px; font: inherit; font-size: .8rem; background: #fff; }
.dc-resumen { font-size: .85rem; }
.dc-rec { border: 1px solid var(--borde); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.dc-rec.urgente { border-color: #f1b4b4; background: #fff7f7; }
.dc-rec.urgente textarea { color: #b42318; font-style: italic; }
.dc-rec-top { display: flex; gap: 8px; align-items: flex-start; }
.dc-rec-top textarea { flex: 1; }
.dc-check { color: var(--verde); font-weight: 800; padding-top: 8px; }
.dc-rec-pie { margin-top: 8px; display: grid; gap: 8px; }
.dc-rec-nueva { margin-top: 12px; padding: 12px; border: 1px dashed #b8cfdc; border-radius: 12px; }
.dc-portada { border: 1px solid var(--borde); border-radius: 14px; overflow: hidden; text-align: center; max-width: 520px; }
.dc-portada .band { background: #7fae3a; color: #fff; font-weight: 800; font-size: 1.6rem; padding: 14px; }
.dc-portada .band img { max-height: 70px; max-width: 80%; }
.dc-portada .tit { background: #dcebc0; padding: 12px 16px; font-weight: 700; color: var(--tinta); }
.dc-ver-eq { border: 1px solid var(--borde); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.dc-ver-eq h3 { margin: 0 0 4px; font-size: 1rem; }
.dc-ver-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 8px; }
.dc-ver-fotos figure { margin: 0; }
.dc-ver-fotos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; cursor: zoom-in; display: block; }
.dc-ver-fotos figcaption { font-size: .75rem; color: var(--muted); text-align: center; margin-top: 2px; }
@media (max-width: 800px) { .dc-slots { grid-template-columns: 1fr; } }

/* Selector de panel de trabajo (usuarios con varios paneles) */
.panel-sel { display: block; margin: 14px 16px 8px; }
.panel-sel span { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: #9fb3bf; margin-bottom: 4px; }
.panel-sel select { width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.panel-sel select option { color: #10212b; }

/* Accesos por usuario */
.acc-user { display: flex; gap: 14px; align-items: center; }
.acc-user .avatar { width: 48px; height: 48px; font-size: 1.3rem; }
.acc-resumen { margin: 14px 0 0; padding: 10px 14px; background: #f3f8fb; border-radius: 10px; }
.acc-paneles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.acc-panel { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--borde); border-radius: 12px; padding: 12px; cursor: pointer; }
.acc-panel:has(input:checked) { border-color: var(--azul); background: #f0f9fe; }
.acc-panel.principal { cursor: default; }
.acc-panel input { margin-top: 4px; width: 18px; height: 18px; }
.acc-panel small { display: block; color: var(--muted); margin-top: 4px; line-height: 1.35; }
.acc-tabla td:first-child { width: 230px; }
.acc-celdas { display: flex; flex-wrap: wrap; gap: 8px; }
.acc-p { display: flex; align-items: center; gap: 6px; border: 1px solid var(--borde); border-radius: 10px; padding: 4px 6px 4px 8px; background: #fbfcfd; }
.acc-p .input { padding: 4px 6px; font-size: .82rem; width: auto; min-width: 0; }
.acc-ef { font-weight: 800; color: #b42318; width: 14px; text-align: center; }
.acc-p.on .acc-ef { color: var(--verde); }
.acc-p.cambio { border-color: #f3d27a; background: #fffaeb; }
.acc-txt { font-size: .86rem; font-weight: 600; }
@media (max-width: 700px) { .acc-tabla td:first-child { width: auto; } }

/* Rango de fechas de los listados */
.rango { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; background: #f3f8fb; border: 1px solid var(--borde); border-radius: 12px; padding: 4px 6px; }
.rango .input { width: auto; max-width: 160px; padding: 6px 8px; }
.rango select.input { font-weight: 700; color: var(--azul-osc); }
.rango-a { color: var(--muted); font-size: .85rem; }
.rango.todo input[type=date], .rango.todo .rango-a { display: none; }
@media (max-width: 700px) { .rango { width: 100%; } .rango .input { flex: 1; max-width: none; } }
.stat.r { border-left-color: var(--rojo); } .stat.r strong { color: var(--rojo); }

/* Campos de fecha dd/mm/aaaa (ver CampoFecha en app.js) */
.fecha-campo { position: relative; display: inline-flex; align-items: center; min-width: 150px; }
.field .fecha-campo, .form-grid .fecha-campo { display: flex; width: 100%; }
.fecha-campo > .input { width: 100%; padding-right: 38px; font-variant-numeric: tabular-nums; }
.fecha-campo .fecha-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--azul-osc); cursor: pointer; padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.fecha-campo .fecha-btn:hover { background: #e8f4fb; }
.fecha-campo .fecha-btn:disabled { color: var(--muted); cursor: default; }
.fecha-campo .fecha-nativa { position: absolute; right: 0; bottom: 0; width: 38px; height: 100%; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.fecha-campo .fecha-mal { border-color: var(--rojo) !important; background: #fff6f6; }
.rango .fecha-campo { min-width: 140px; max-width: 160px; }
@media (max-width: 700px) { .rango .fecha-campo { flex: 1; max-width: none; } }

/* Finanzas */
.nav-sec { margin: 14px 16px 4px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.08); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--amarillo); font-weight: 700; }
tr.anulado td { color: #9aa6ad; text-decoration: line-through; }
tr.anulado td .badge, tr.anulado td a.btn { text-decoration: none; }
tr.fin-total td { background: #eef4f7; border-top: 2px solid var(--borde); }
.fin-letras { margin: 10px 0 0; padding: 10px 14px; background: #f3f8fb; border-radius: 10px; font-weight: 700; color: var(--azul-osc); }
.fin-letras:empty { display: none; }
.fin-saldo { display: grid; gap: 8px; }
.fin-saldo div { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; border-bottom: 1px dashed var(--borde); }
.fin-saldo span { color: var(--muted); font-weight: 600; }
.fin-saldo strong { font-size: 1.2rem; }
.fin-saldo .total strong { font-size: 1.6rem; color: var(--tinta); }
.fin-barra { height: 8px; background: #e7eef2; border-radius: 99px; overflow: hidden; margin: 10px 0 4px; }
.fin-barra span { display: block; height: 100%; background: linear-gradient(90deg, var(--verde), #34c38f); border-radius: 99px; }
.fin-bar-row { display: grid; grid-template-columns: minmax(140px, 1.3fr) 2fr auto; gap: 12px; align-items: center; padding: 6px 0; }
.fin-bar-row > div:first-child { display: flex; flex-direction: column; line-height: 1.25; }
.fin-bar-row .fin-barra { margin: 0; }
.fin-bar-row .fin-barra span { background: linear-gradient(90deg, var(--azul), #5cc6f0); }
.fin-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.fin-dos > .card { margin-bottom: 0; }
.fin-dos + .fin-dos, .fin-dos + .card { margin-top: 20px; }
.fin-comp { width: 100%; max-height: 420px; object-fit: contain; background: #f3f6f8; border-radius: 10px; cursor: zoom-in; }
.caja-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.caja-card { display: block; border: 1px solid var(--borde); border-radius: 14px; padding: 16px; color: inherit; text-decoration: none; transition: .15s; }
.caja-card:hover { border-color: var(--azul); box-shadow: 0 6px 18px rgba(16,33,43,.08); }
.caja-card.inactiva { opacity: .6; }
.caja-h { font-size: 1.05rem; margin-bottom: 2px; }
.caja-saldo { font-size: 2rem; font-weight: 800; color: var(--verde); margin: 8px 0 0; }
.caja-saldo.bajo { color: var(--rojo); }
/* recibo en pantalla */
.recibo { background: #fff; border: 1px solid var(--borde); border-radius: 16px; padding: 24px; max-width: 860px; position: relative; }
.recibo.anulado::after { content: 'ANULADO'; position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%) rotate(-14deg); font-size: 4.5rem; font-weight: 900; color: rgba(214,69,69,.22); pointer-events: none; }
.recibo-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; border-bottom: 4px solid var(--amarillo); padding-bottom: 14px; flex-wrap: wrap; }
.recibo-top img { height: 58px; }
.recibo-num { border: 2px solid var(--azul); border-radius: 12px; padding: 8px 18px; text-align: center; display: flex; flex-direction: column; }
.recibo-num span { color: var(--azul); font-weight: 800; font-size: .8rem; letter-spacing: .05em; }
.recibo-num strong { font-size: 1.05rem; }
.recibo-num em { font-style: normal; font-size: 1.6rem; font-weight: 800; }
.recibo-fecha { text-align: right; margin: 14px 0; }
.recibo-linea { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid #e3eaee; }
.recibo-linea span { color: var(--muted); font-weight: 700; font-size: .85rem; }
.recibo-pie { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 50px; text-align: center; font-size: .9rem; color: var(--muted); }
.recibo-pie span { display: block; border-top: 1px solid #8a969d; margin: 0 20px 6px; }
.recibo-pie strong { color: var(--tinta); }
@media (max-width: 800px) { .fin-dos { grid-template-columns: 1fr; } .recibo-linea { grid-template-columns: 1fr; gap: 2px; } .recibo { padding: 16px; } .fin-bar-row { grid-template-columns: 1fr auto; } .fin-bar-row .fin-barra { grid-column: 1 / -1; grid-row: 2; } }
/* menú más compacto (hay más módulos) */
.sidebar nav a { padding: 8px 12px; }
.sidebar nav { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }

/* ---------- Recordatorios: calendario ---------- */
.rcd-cab { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.rcd-cab h2 { margin: 0 6px; min-width: 180px; text-align: center; text-transform: capitalize; font-size: 1.15rem; color: var(--tinta); }
.rcd-cab .grow { flex: 1; }
.rcd-ley { margin: 0 0 12px; font-size: .85rem; }
.rcd-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--borde); border: 1px solid var(--borde); border-radius: 12px; overflow: hidden; }
.rcd-dn { background: #f4f8fb; text-align: center; font-size: .75rem; font-weight: 700; padding: 7px 2px; color: var(--muted); text-transform: uppercase; }
.rcd-dia { background: #fff; min-height: 104px; padding: 5px 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rcd-dia.puede { cursor: pointer; }
.rcd-dia.puede:hover { background: #fafdff; }
.rcd-dia:focus-visible { outline: 2px solid var(--azul); outline-offset: -2px; }
.rcd-dia.fuera { background: #f8fafb; }
.rcd-dia.fuera .rcd-num { color: #a9b6bf; }
.rcd-num { font-size: .8rem; font-weight: 700; color: var(--muted); align-self: flex-end; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.rcd-dia.hoy .rcd-num { background: var(--azul); color: #fff; }
.rcd-ev { border: 0; text-align: left; font: inherit; font-size: .75rem; line-height: 1.3; padding: 3px 6px; border-radius: 5px; background: #e1f3fc; color: var(--azul-osc);
  border-left: 3px solid var(--azul); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; max-width: 100%; }
.rcd-ev.enviado { background: #e2f6ec; color: #13764a; border-left-color: var(--verde); }
.rcd-ev.error { background: #fde8e8; color: #b42318; border-left-color: var(--rojo); }
.rcd-ev.pausado { background: #eef1f3; color: #6b7a83; border-left-color: #a9b6bf; }
.rcd-ley .rcd-ev { cursor: default; margin-right: 4px; }
.rcd-mas { font-size: .72rem; color: var(--muted); padding-left: 4px; cursor: pointer; }
.rcd-acciones { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px 14px; border: 1px solid var(--borde); border-radius: 10px; padding: 8px 12px; }
.rcd-acciones label { display: flex; align-items: center; gap: 8px; font-weight: 500 !important; cursor: pointer; padding: 3px 0; }
.rcd-acciones input { width: 16px; height: 16px; accent-color: var(--azul); }
.rcd-acciones a { margin-left: auto; font-size: .75rem; }
.rcd-rep { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rcd-hist { max-height: 220px; overflow-y: auto; margin-top: 8px; }
.rcd-sub { display: block; color: var(--muted); font-size: .8rem; }
@media (max-width: 700px) {
  .rcd-dia { min-height: 62px; padding: 3px; }
  .rcd-cal .rcd-ev { font-size: 0; padding: 0; height: 7px; border-left-width: 0; border-radius: 4px; }
}
.rcd-chips { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.rcd-chips .chip { margin: 0; white-space: normal; }
@media (max-width: 700px) {
  #tb td { flex-wrap: wrap; justify-content: flex-start; }
  #tb td > strong, #tb td > .rcd-sub, #tb td > .rcd-chips { flex-basis: 100%; }
  #tb td.acciones { justify-content: flex-end; }
}

/* Avisos informativos y Sistema → Sincronización (DBF) */
.alert.info { background: #e1f3fc; color: #0f4a66; } .alert.ok { background: #e2f6ec; color: #1d6b45; }
.sinc-arch { font-size: .85rem; line-height: 1.6; white-space: nowrap; }
.sinc-arch .si { color: var(--verde); font-weight: 700; } .sinc-arch .no { color: var(--rojo); font-weight: 700; } .sinc-arch .op { color: #9aa6ad; }
.sinc-modo { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.sinc-modo label { flex: 1 1 240px; border: 1px solid var(--borde); border-radius: 12px; padding: 10px 12px; cursor: pointer; display: flex; gap: 8px; align-items: flex-start; }
.sinc-modo label:has(input:checked) { border-color: var(--azul); background: #f3f8fb; }
.sinc-modo small { display: block; color: var(--muted); }
.sinc-res { word-break: break-word; min-width: 220px; }

/* ============================================================
   Dashboard colorido (includes/dashboard.php)
   ============================================================ */
.stat .st-ico { float: right; font-style: normal; font-size: 1.35rem; line-height: 1; margin-left: 8px; }
.dash-banner { position: relative; overflow: hidden; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; padding: 18px 22px;
  border-radius: 16px; color: #fff; background: linear-gradient(120deg, #0b6f9c 0%, #12a3df 55%, #3cc4f0 100%); box-shadow: 0 8px 24px rgba(18, 163, 223, .3); }
.dash-banner::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--amarillo); }
.dash-banner::after { content: ""; position: absolute; right: 90px; top: -70px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255, 230, 0, .16); pointer-events: none; }
.dash-banner-logo { height: 58px; background: #fff; border-radius: 12px; padding: 6px 10px; box-shadow: 0 4px 12px rgba(0,0,0,.15); position: relative; z-index: 1; }
.dash-banner-txt { flex: 1; min-width: 220px; position: relative; z-index: 1; }
.dash-banner-txt h2 { margin: 0; font-size: 1.35rem; color: #fff; }
.dash-banner-txt p { margin: 4px 0 0; opacity: .92; font-size: .92rem; }
.dash-banner-fecha { position: relative; z-index: 1; text-align: center; background: var(--amarillo); color: var(--tinta); border-radius: 12px; padding: 6px 14px; min-width: 86px; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.dash-banner-fecha strong { display: block; font-size: 1.7rem; line-height: 1.1; }
.dash-banner-fecha span { font-size: .78rem; font-weight: 700; text-transform: capitalize; }

.dash .stat[data-color] { --g1: #12a3df; --g2: #3cc4f0; position: relative; overflow: hidden; border: 0; color: #fff;
  background: linear-gradient(135deg, var(--g1), var(--g2)); box-shadow: 0 6px 16px rgba(16, 33, 43, .14); transition: transform .15s, box-shadow .15s; }
.dash .stat[data-color]:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(16, 33, 43, .2); }
.dash .stat[data-color]::after { content: ""; position: absolute; right: -28px; bottom: -38px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255,255,255,.14); pointer-events: none; }
.dash .stat[data-color] span, .dash .stat[data-color] span a { color: #fff; opacity: .95; }
.dash .stat[data-color] strong { color: #fff; }
.dash .stat[data-color] .st-ico { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: rgba(255,255,255,.24); font-size: 1.2rem; }
.dash .stats-sm .stat[data-color] .st-ico { width: 32px; height: 32px; font-size: 1rem; }
.dash .stat[data-color=azul] { --g1: #0b6f9c; --g2: #12a3df; }
.dash .stat[data-color=celeste] { --g1: #12a3df; --g2: #5fd3f5; }
.dash .stat[data-color=ambar] { --g1: #e08a00; --g2: #f7c548; }
.dash .stat[data-color=verde] { --g1: #13955a; --g2: #34c98a; }
.dash .stat[data-color=violeta] { --g1: #6a4ee0; --g2: #a06cf0; }
.dash .stat[data-color=rosa] { --g1: #d63384; --g2: #f478b4; }
.dash .stat[data-color=indigo] { --g1: #2f3fa8; --g2: #5a74e6; }
.dash .stat[data-color=turquesa] { --g1: #0b9db8; --g2: #3dd6c8; }
.dash .stat[data-color=naranja] { --g1: #e8590c; --g2: #ff9a48; }
.dash .stat[data-color=rojo] { --g1: #d63a3a; --g2: #ff7b6b; }
.dash .stat[data-color=grafito] { --g1: #33434d; --g2: #62778a; }
/* texto oscuro sobre el amarillo/ámbar para que se lea bien */
.dash .stat[data-color=ambar], .dash .stat[data-color=ambar] span, .dash .stat[data-color=ambar] strong, .dash .stat[data-color=ambar] span a { color: #3a2a00; }

.dash-card { border-top: 4px solid var(--c, var(--azul)); box-shadow: 0 4px 14px rgba(16, 33, 43, .05); }
.c-azul { --c: #12a3df; --c-suave: #e1f3fc; } .c-ambar { --c: #e8a800; --c-suave: #fff6d6; } .c-verde { --c: #1f9d63; --c-suave: #e2f6ec; }
.c-violeta { --c: #7c5ce6; --c-suave: #eee9fd; } .c-rosa { --c: #d63384; --c-suave: #fde8f2; }
.dash-card > h2, .dash-card .card-head h2, .dash-card .head-actions h2 { color: var(--tinta); }

.dash-accesos .btn { --b: #12a3df; --bs: #e1f3fc; background: var(--bs); border-color: transparent; color: var(--tinta); transition: transform .12s, box-shadow .12s; }
.dash-accesos .btn .ico { color: var(--b); }
.dash-accesos .btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16,33,43,.12); background: var(--b); color: #fff; }
.dash-accesos .btn:hover .ico { color: #fff; }
.dash-accesos .btn:nth-child(8n+1) { --b: #12a3df; --bs: #e1f3fc; } .dash-accesos .btn:nth-child(8n+2) { --b: #1f9d63; --bs: #e2f6ec; }
.dash-accesos .btn:nth-child(8n+3) { --b: #7c5ce6; --bs: #eee9fd; } .dash-accesos .btn:nth-child(8n+4) { --b: #e8590c; --bs: #ffeadb; }
.dash-accesos .btn:nth-child(8n+5) { --b: #d63384; --bs: #fde8f2; } .dash-accesos .btn:nth-child(8n+6) { --b: #0b9db8; --bs: #ddf7f4; }
.dash-accesos .btn:nth-child(8n+7) { --b: #c98a00; --bs: #fff4d6; } .dash-accesos .btn:nth-child(8n+8) { --b: #2f3fa8; --bs: #e6e9fb; }
.dash-accesos .btn.primary { background: linear-gradient(135deg, #0b6f9c, #12a3df); color: #fff; }
.dash-accesos .btn.primary .ico { color: var(--amarillo); }

@media (max-width: 600px) {
  .dash-banner { padding: 14px; gap: 12px; }
  .dash-banner-logo { display: none; }
  .dash .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dash .stats .stat[data-color] { padding: 12px; }
  .dash .stats .stat[data-color] strong { font-size: 1.5rem; }
  .dash .stats .stat[data-color] span { font-size: .78rem; }
  .dash .stats .stat[data-color] .st-ico { width: 28px; height: 28px; font-size: .9rem; }
  .dash-banner-txt h2 { font-size: 1.1rem; }
  .dash-banner-fecha { min-width: 0; padding: 4px 10px; }
  .dash-banner-fecha strong { font-size: 1.3rem; }
}
