/* ==========================================================================
   Panel Taller CIE — sistema de diseño (v2)
   Colores tomados del logo: azul marino + dorado.
   ========================================================================== */

:root {
  --brand: #1f2a80;
  --brand-700: #161f63;
  --brand-900: #0f1548;
  --brand-50: #eef0fb;
  --gold: #f5b800;

  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --border: #e4e7f0;
  --text: #1b2033;
  --muted: #6b7390;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 27, 77, .05), 0 8px 24px rgba(20, 27, 77, .06);
  --shadow-lg: 0 10px 40px rgba(20, 27, 77, .18);

  --sidebar-w: 268px;

  --bs-primary: #2a37a3;
  --bs-primary-rgb: 42, 55, 163;
  --bs-link-color: #2a37a3;
  --bs-link-color-rgb: 42, 55, 163;
  --bs-link-hover-color: #161f63;
  --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-body-font-size: .94rem;
  --bs-border-radius: 10px;
  --bs-border-radius-lg: 14px;
}

[data-bs-theme="dark"] {
  --brand-50: #1d2350;
  --bg: #0e1120;
  --surface: #171b30;
  --surface-2: #1c2138;
  --border: #2a3050;
  --text: #e8eaf6;
  --muted: #98a0c0;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --bs-primary: #7c8cff;
  --bs-primary-rgb: 124, 140, 255;
  --bs-link-color: #9aa6ff;
  --bs-link-color-rgb: 154, 166, 255;
  --bs-link-hover-color: #c3caff;
  --bs-body-bg: #0e1120;
  --bs-body-color: #e8eaf6;
  --bs-border-color: #2a3050;
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--bs-body-font-family);
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; }
.text-muted { color: var(--muted) !important; }
.form-text { color: var(--muted); }
::selection { background: rgba(42, 55, 163, .18); }

/* ---------- Botones ---------- */
.btn { font-weight: 600; border-radius: var(--radius-sm); padding: .5rem 1rem; transition: transform .06s ease, box-shadow .15s ease, background .15s ease; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: .32rem .7rem; font-size: .84rem; border-radius: 9px; }
.btn-lg { padding: .75rem 1.3rem; font-size: 1rem; }
.btn-primary {
  --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-700); --bs-btn-hover-border-color: var(--brand-700);
  --bs-btn-active-bg: var(--brand-900); --bs-btn-active-border-color: var(--brand-900);
  --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
  box-shadow: 0 4px 12px rgba(31, 42, 128, .22);
}
[data-bs-theme="dark"] .btn-primary { --bs-btn-bg: #4b5bd6; --bs-btn-border-color: #4b5bd6; --bs-btn-hover-bg: #5c6be8; --bs-btn-hover-border-color: #5c6be8; }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: rgba(31, 42, 128, .35); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand-700); }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #9aa6ff; --bs-btn-border-color: rgba(154, 166, 255, .4); --bs-btn-hover-bg: #4b5bd6; --bs-btn-hover-border-color: #4b5bd6; }
.btn-success { --bs-btn-bg: #16a34a; --bs-btn-border-color: #16a34a; --bs-btn-hover-bg: #128a3e; --bs-btn-hover-border-color: #128a3e; }
.btn-wa { background: #25d366; border-color: #25d366; color: #063d1c; }
.btn-wa:hover { background: #1fbd5a; border-color: #1fbd5a; color: #063d1c; }
.btn-soft { background: var(--brand-50); color: var(--bs-primary); border-color: transparent; }
.btn-soft:hover { background: rgba(var(--bs-primary-rgb), .18); color: var(--bs-primary); }
.btn-icon { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; }

/* ---------- Formularios ---------- */
.form-control, .form-select {
  border-radius: var(--radius-sm); border-color: var(--border); background-color: var(--surface);
  padding: .55rem .8rem; color: var(--text);
}
.form-control:focus, .form-select:focus { border-color: var(--bs-primary); box-shadow: 0 0 0 .22rem rgba(var(--bs-primary-rgb), .15); }
.form-label { font-weight: 600; font-size: .84rem; color: var(--text); margin-bottom: .3rem; }
.form-control::placeholder { color: #9aa2bd; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon > .form-control { padding-left: 2.4rem; }
.req::after { content: ' *'; color: #dc3545; }

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-content { padding: 1.5rem clamp(1rem, 3vw, 2.25rem) 3rem; width: 100%; max-width: 1500px; margin: 0 auto; flex: 1; }

.sidebar { --bs-offcanvas-width: 288px; --bs-offcanvas-bg: transparent; --bs-offcanvas-border-width: 0; }
.sidebar-inner {
  height: 100%; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--brand-900) 0%, var(--brand) 100%);
  color: #dfe3ff; padding: 1.1rem .9rem;
}
@media (min-width: 992px) {
  .sidebar { flex: 0 0 var(--sidebar-w); width: var(--sidebar-w); position: sticky; top: 0; height: 100vh; }
}
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: .35rem .6rem 1.1rem; color: #fff; }
.sidebar-brand .logo-chip { width: 46px; height: 46px; border-radius: 12px; background: #fff; display: grid; place-items: center; padding: 4px; flex: 0 0 auto; }
.sidebar-brand .logo-chip img { width: 100%; height: 100%; object-fit: contain; }
.sidebar-brand b { display: block; font-size: 1.02rem; letter-spacing: .01em; }
.sidebar-brand small { color: #aab2ee; font-size: .74rem; }
.sidebar-label { text-transform: uppercase; font-size: .68rem; letter-spacing: .09em; color: #8e98e6; padding: .9rem .8rem .35rem; font-weight: 700; }
.side-link {
  display: flex; align-items: center; gap: .8rem; padding: .62rem .8rem; margin: 2px 0;
  border-radius: 11px; color: #d6dbff; font-weight: 500; position: relative; transition: background .15s, color .15s;
}
.side-link i { width: 20px; text-align: center; font-size: 1rem; opacity: .9; }
.side-link:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.side-link.active { background: rgba(255, 255, 255, .15); color: #fff; font-weight: 600; }
.side-link.active::before { content: ''; position: absolute; left: -.9rem; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: var(--gold); }
.side-link .badge-count { margin-left: auto; background: #25d366; color: #063d1c; font-weight: 800; font-size: .72rem; border-radius: 999px; padding: .15rem .5rem; min-width: 22px; text-align: center; }
.sidebar-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, .12); }
.user-chip { display: flex; align-items: center; gap: .7rem; padding: .4rem .5rem; }
.user-chip .avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--gold); color: #3a2c00; display: grid; place-items: center; font-weight: 800; }
.user-chip small { color: #aab2ee; display: block; line-height: 1.1; }

.topbar {
  position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .75rem;
  padding: .7rem clamp(1rem, 3vw, 2.25rem); background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 1.15rem; margin: 0; font-weight: 700; letter-spacing: -.01em; }
.topbar .spacer { flex: 1; }
.top-btn {
  position: relative; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); display: inline-grid; place-items: center; transition: background .15s;
}
.top-btn:hover { background: var(--brand-50); color: var(--bs-primary); }
.top-btn .dot {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: #ef4444; color: #fff; font-size: .7rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg);
}
.top-btn.ring i { animation: ring 1.1s ease 2; transform-origin: 50% 0; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); } 45% { transform: rotate(10deg); } 60% { transform: rotate(-8deg); } }

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--border); padding: .9rem 1.15rem; font-weight: 700; display: flex; align-items: center; gap: .6rem; }
.card-header i { color: var(--bs-primary); }
.card-body { padding: 1.15rem; }
.section-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: .75rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.page-head h2 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.page-head p { margin: .15rem 0 0; color: var(--muted); }

/* ---------- KPIs ---------- */
.kpi { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.2rem; color: inherit; transition: transform .15s, box-shadow .15s; }
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: inherit; }
.kpi .ic { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; font-size: 1.25rem; flex: 0 0 auto; }
.kpi .num { font-size: 1.75rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.kpi .lbl { color: var(--muted); font-size: .82rem; margin-top: .25rem; }
.ic-blue { background: rgba(42, 55, 163, .12); color: #2a37a3; }
.ic-green { background: rgba(22, 163, 74, .13); color: #16a34a; }
.ic-amber { background: rgba(245, 158, 11, .16); color: #d97706; }
.ic-red { background: rgba(220, 38, 38, .14); color: #dc2626; }
.ic-wa { background: rgba(37, 211, 102, .16); color: #128c4a; }
[data-bs-theme="dark"] .ic-blue { color: #9aa6ff; }

/* ---------- Tablas ---------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; color: var(--text); }
.table > :not(caption) > * > * { padding: .8rem 1rem; border-bottom-color: var(--border); }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--brand-50); }
.table td { vertical-align: middle; }
.row-link { cursor: pointer; }
.avatar-sm { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; color: #fff; flex: 0 0 auto; font-size: .9rem; }
.mono { font-variant-numeric: tabular-nums; }
.truncate-1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---------- Estados (badges suaves) ---------- */
.badge-estado {
  --c: #64748b; display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .65rem; border-radius: 999px;
  font-size: .76rem; font-weight: 700; white-space: nowrap;
  background: color-mix(in srgb, var(--c) 14%, transparent); color: color-mix(in srgb, var(--c) 82%, var(--text));
}
.est-CREADA { --c: #64748b; } .est-DIAGNOSTICO_EN_PROCESO { --c: #d97706; } .est-DIAGNOSTICO_ENVIADO { --c: #2563eb; }
.est-APROBADA { --c: #0d9488; } .est-RESTITUCION { --c: #ea580c; } .est-REPARANDO { --c: #7c3aed; }
.est-LISTO_ENTREGA { --c: #16a34a; } .est-ENTREGADO { --c: #475569; } .est-CANCELADO { --c: #dc2626; }
.lang-pill { font-size: .7rem; font-weight: 800; padding: .15rem .45rem; border-radius: 6px; background: var(--brand-50); color: var(--bs-primary); letter-spacing: .04em; }

/* ---------- Chips / filtros ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  display: inline-flex; align-items: center; gap: .45rem; padding: .42rem .85rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: .84rem; transition: all .15s;
}
.chip:hover { border-color: var(--bs-primary); color: var(--bs-primary); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
[data-bs-theme="dark"] .chip.active { background: #4b5bd6; border-color: #4b5bd6; }
.chip .n { font-size: .74rem; padding: .05rem .42rem; border-radius: 999px; background: rgba(127, 127, 127, .16); }
.chip.active .n { background: rgba(255, 255, 255, .25); }

/* ---------- Stepper de estado ---------- */
.stepper { display: flex; gap: 0; overflow-x: auto; padding: .25rem 0 .5rem; scrollbar-width: thin; }
.step { flex: 1 1 0; min-width: 96px; text-align: center; position: relative; font-size: .74rem; color: var(--muted); font-weight: 600; }
.step .dot { width: 32px; height: 32px; border-radius: 50%; margin: 0 auto .4rem; display: grid; place-items: center; background: var(--surface-2); border: 2px solid var(--border); position: relative; z-index: 1; font-size: .8rem; }
.step::before { content: ''; position: absolute; top: 15px; left: -50%; width: 100%; height: 3px; background: var(--border); }
.step:first-child::before { display: none; }
.step.done .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.step.done::before, .step.current::before { background: var(--brand); }
.step.current .dot { background: var(--gold); border-color: var(--gold); color: #3a2c00; box-shadow: 0 0 0 5px rgba(245, 184, 0, .22); }
.step.current { color: var(--text); font-weight: 800; }
[data-bs-theme="dark"] .step.done .dot, [data-bs-theme="dark"] .step.done::before, [data-bs-theme="dark"] .step.current::before { background: #4b5bd6; border-color: #4b5bd6; }

/* ---------- Selector de tipo de aviso ---------- */
.evt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.evt-opt input { position: absolute; opacity: 0; pointer-events: none; }
.evt-opt label {
  display: flex; align-items: center; gap: .55rem; padding: .6rem .7rem; border: 1.5px solid var(--border); border-radius: 11px;
  cursor: pointer; font-weight: 600; font-size: .83rem; background: var(--surface); transition: all .15s; height: 100%;
}
.evt-opt label i { width: 18px; text-align: center; color: var(--muted); }
.evt-opt label:hover { border-color: var(--bs-primary); }
.evt-opt input:checked + label { border-color: var(--bs-primary); background: var(--brand-50); color: var(--bs-primary); box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), .12); }
.evt-opt input:checked + label i { color: var(--bs-primary); }
.evt-opt input:focus-visible + label { outline: 2px solid var(--bs-primary); outline-offset: 2px; }

/* ---------- Línea de tiempo ---------- */
.timeline { position: relative; padding-left: 1.6rem; margin: 0; list-style: none; }
.timeline::before { content: ''; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 1.15rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -1.6rem; top: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .68rem; color: #fff; background: var(--c, #64748b); border: 3px solid var(--surface); box-sizing: content-box; margin-left: -3px; margin-top: -3px; }
.tl-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.tl-head b { font-size: .9rem; }
.tl-time { color: var(--muted); font-size: .78rem; }
.tl-note { margin: .25rem 0 0; white-space: pre-wrap; word-break: break-word; }
.tl-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem; }
.tag { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.tag.wa { background: rgba(37, 211, 102, .14); color: #128c4a; border-color: transparent; }
.tag.money { background: rgba(245, 158, 11, .14); color: #b45309; border-color: transparent; }

/* ---------- Inbox de conversaciones ---------- */
.inbox-item { display: flex; align-items: center; gap: .9rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--border); color: inherit; transition: background .12s; }
.inbox-item:last-child { border-bottom: 0; }
.inbox-item:hover { background: var(--brand-50); color: inherit; }
.inbox-item .body { flex: 1; min-width: 0; }
.inbox-item .top { display: flex; justify-content: space-between; gap: .75rem; align-items: baseline; }
.inbox-item .name { font-weight: 700; }
.inbox-item .when { font-size: .76rem; color: var(--muted); white-space: nowrap; }
.inbox-item .snip { color: var(--muted); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-item.unread .name, .inbox-item.unread .snip { color: var(--text); font-weight: 700; }
.inbox-item.unread .when { color: #128c4a; font-weight: 700; }
.unread-pill { background: #25d366; color: #063d1c; font-weight: 800; font-size: .74rem; border-radius: 999px; min-width: 24px; height: 24px; display: inline-grid; place-items: center; padding: 0 7px; }
.dir-ic { font-size: .72rem; margin-right: .3rem; }

/* ---------- Chat ---------- */
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
@media (min-width: 1200px) { .chat-layout { grid-template-columns: minmax(0, 1fr) 340px; } }
.chat-card { display: flex; flex-direction: column; height: calc(100vh - 150px); min-height: 520px; overflow: hidden; padding: 0; }
.chat-head { display: flex; align-items: center; gap: .85rem; padding: .8rem 1.1rem; border-bottom: 1px solid var(--border); background: var(--surface); }
.chat-head .who { flex: 1; min-width: 0; }
.chat-head .who b { display: block; }
.chat-head .who small { color: var(--muted); }
.win-tag { font-size: .74rem; font-weight: 700; padding: .25rem .65rem; border-radius: 999px; white-space: nowrap; }
.win-open { background: rgba(37, 211, 102, .16); color: #128c4a; }
.win-closed { background: rgba(245, 158, 11, .18); color: #b45309; }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 1rem 1.1rem; background: #ece5dd;
  background-image: radial-gradient(rgba(0, 0, 0, .035) 1px, transparent 1px); background-size: 18px 18px;
}
[data-bs-theme="dark"] .chat-messages { background-color: #0d1418; background-image: radial-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px); }
.day-sep { text-align: center; margin: .8rem 0; }
.day-sep span { background: rgba(255, 255, 255, .9); color: #54656f; font-size: .72rem; font-weight: 700; padding: .25rem .7rem; border-radius: 8px; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
[data-bs-theme="dark"] .day-sep span { background: #1f2c34; color: #8696a0; }
.msg-row { display: flex; margin-bottom: 4px; }
.msg-row.out { justify-content: flex-end; }
.bubble {
  max-width: min(78%, 560px); padding: .45rem .7rem .3rem; border-radius: 10px; background: #fff; color: #111b21;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .1); font-size: .92rem; word-break: break-word;
}
.msg-row.out .bubble { background: #d9fdd3; border-top-right-radius: 3px; }
.msg-row.in .bubble { border-top-left-radius: 3px; }
[data-bs-theme="dark"] .bubble { background: #202c33; color: #e9edef; }
[data-bs-theme="dark"] .msg-row.out .bubble { background: #005c4b; }
.bubble .txt { white-space: pre-wrap; }
.bubble a { text-decoration: underline; }
.bubble .meta { text-align: right; font-size: .68rem; color: #667781; margin-top: 1px; line-height: 1.2; }
[data-bs-theme="dark"] .bubble .meta { color: #8696a0; }
.bubble .meta .tick { color: #53bdeb; margin-left: 3px; }
.bubble img.media { max-width: 100%; max-height: 240px; border-radius: 8px; display: block; margin-bottom: 4px; object-fit: contain; }
.file-chip { display: flex; align-items: center; gap: .55rem; padding: .5rem .65rem; border-radius: 8px; background: rgba(0, 0, 0, .05); margin-bottom: 4px; color: inherit; font-size: .84rem; }
.file-chip i { font-size: 1.3rem; color: #dc2626; }
.file-chip.warn i { color: #d97706; }
.bot-tag { font-size: .62rem; font-weight: 800; letter-spacing: .06em; opacity: .6; text-transform: uppercase; display: block; }
.chat-foot { border-top: 1px solid var(--border); background: var(--surface); padding: .7rem .9rem; }
.win-banner { display: none; background: rgba(245, 158, 11, .14); border: 1px solid rgba(245, 158, 11, .35); border-radius: 12px; padding: .7rem .9rem; margin-bottom: .6rem; font-size: .86rem; }
.win-banner.show { display: block; }
.composer { display: flex; align-items: flex-end; gap: .4rem; }
.composer textarea { resize: none; max-height: 140px; min-height: 42px; border-radius: 22px; padding: .6rem 1rem; }
.composer .btn-icon { border-radius: 50%; width: 42px; height: 42px; flex: 0 0 auto; }
.attach-chip { display: none; align-items: center; gap: .6rem; padding: .45rem .7rem; margin-bottom: .55rem; background: var(--brand-50); border-radius: 12px; font-size: .84rem; }
.attach-chip.show { display: flex; }
.drop-hint { position: absolute; inset: 0; z-index: 5; display: none; place-items: center; background: rgba(31, 42, 128, .82); color: #fff; font-weight: 800; font-size: 1.2rem; border-radius: var(--radius); }
.drop-hint.show { display: grid; }
.quick-list { max-height: 280px; overflow-y: auto; min-width: 290px; }
.quick-list .dropdown-item { white-space: normal; font-size: .85rem; padding: .5rem .9rem; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem; background:
  radial-gradient(900px 500px at 10% -10%, rgba(245, 184, 0, .22), transparent 60%),
  radial-gradient(800px 500px at 100% 110%, rgba(75, 91, 214, .45), transparent 60%),
  linear-gradient(140deg, var(--brand-900), var(--brand)); }
.login-card { width: 100%; max-width: 410px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 2rem 1.75rem 1.75rem; }
.login-card .logo { width: 128px; display: block; margin: 0 auto .5rem; }
.login-card h1 { font-size: 1.3rem; font-weight: 800; text-align: center; margin-bottom: .2rem; }
.login-card .sub { text-align: center; color: var(--muted); margin-bottom: 1.4rem; font-size: .9rem; }

/* ---------- Misc ---------- */
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty i { font-size: 2.4rem; opacity: .35; display: block; margin-bottom: .8rem; }
.flash-stack .alert { border-radius: var(--radius-sm); border: 0; box-shadow: var(--shadow); display: flex; align-items: center; gap: .7rem; }
.money-big { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.divider { height: 1px; background: var(--border); margin: 1rem 0; }
.secret-field { position: relative; }
.secret-field .toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { border-radius: 14px; border: 0; box-shadow: var(--shadow-lg); overflow: hidden; }
.toast-wa { cursor: pointer; }
.toast-wa .toast-body { display: flex; gap: .75rem; align-items: flex-start; }
.toast-wa .ic { width: 38px; height: 38px; border-radius: 50%; background: #25d366; color: #063d1c; display: grid; place-items: center; flex: 0 0 auto; }
.ts-wrapper.form-select, .ts-wrapper.form-control { padding: 0; }
.ts-control { border-radius: var(--radius-sm) !important; padding: .5rem .75rem !important; border-color: var(--border) !important; background: var(--surface) !important; color: var(--text) !important; }
.ts-dropdown { border-radius: 12px !important; box-shadow: var(--shadow-lg) !important; background: var(--surface) !important; color: var(--text) !important; }
.ts-dropdown .active { background: var(--brand-50) !important; color: var(--bs-primary) !important; }
.pagination { --bs-pagination-border-radius: 10px; --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-bg: var(--surface); --bs-pagination-border-color: var(--border); --bs-pagination-color: var(--text); --bs-pagination-hover-bg: var(--brand-50); }
.dropdown-menu { border-radius: 12px; border-color: var(--border); box-shadow: var(--shadow-lg); background: var(--surface); }
.modal-content { border-radius: var(--radius); }

@media (max-width: 991.98px) {
  .chat-card { height: calc(100vh - 130px); }
  .app-content { padding-top: 1rem; }
}
@media (max-width: 575.98px) {
  .page-head h2 { font-size: 1.25rem; }
  .bubble { max-width: 88%; }
  .kpi .num { font-size: 1.45rem; }
}
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  body { background: #fff; }
}


/* ===== Fotos del equipo ===== */
.foto-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:8px}
.foto-item{position:relative;border-radius:10px;overflow:hidden;aspect-ratio:1;background:var(--surface-2,#f1f5f9)}
.foto-item img{width:100%;height:100%;object-fit:cover;display:block}
.foto-btn{position:absolute;bottom:4px;width:28px;height:28px;border:0;border-radius:8px;background:rgba(15,23,42,.65);color:#fff;font-size:.75rem;display:flex;align-items:center;justify-content:center;cursor:pointer}
.foto-btn:hover{background:rgba(15,23,42,.9)}
.foto-eye{left:4px}.foto-eye.on{background:#16a34a}
.foto-del{right:4px}

.bubble .tr-line { margin-top: 5px; padding-top: 4px; border-top: 1px dashed rgba(0,0,0,.18); font-size: .82rem; color: #475569; white-space: pre-wrap; }
[data-bs-theme="dark"] .bubble .tr-line { color: #aebac1; border-top-color: rgba(255,255,255,.2); }
