/* =====================================================================
   REVANET · estilos (colores tomados del logo: azul #069BFF, ajustado a #0A7BD4 para contraste)
   ===================================================================== */
:root {
  --brand: #0a7bd4;
  --brand-700: #0866b0;
  --brand-800: #075191;
  --brand-50: #ebf5fd;
  --brand-100: #d4e9fa;
  --ink: #18222e;
  --ink-2: #4a5868;
  --ink-3: #7a8796;
  --line: #dfe6ee;
  --bg: #f3f6fa;
  --card: #ffffff;
  --ok: #1f8a5b;
  --ok-bg: #e5f5ed;
  --warn: #b26a00;
  --warn-bg: #fff3dc;
  --err: #c43c3c;
  --err-bg: #fdeaea;
  --violet: #6a4fc4;
  --violet-bg: #efebfb;
  --wa: #1fa855;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 40, 70, .06), 0 4px 14px rgba(20, 40, 70, .06);
  --font: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Montserrat", var(--font);
  --side: 248px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.45;
  color: var(--ink); background: var(--bg);
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; }
a { color: var(--brand-700); }
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
.ic { width: 20px; height: 20px; flex: none; }
.hidden { display: none !important; }
.center { text-align: center; }
.muted { color: var(--ink-3); }
.mono { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid rgba(10, 123, 212, .45); outline-offset: 2px; }

/* ---------- estructura ---------- */
#app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--card);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 20;
}
.brand { padding: 18px 18px 10px; }
.brand img { width: 100%; height: auto; display: block; }
.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; flex: 1; overflow-y: auto; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--ink-2); text-decoration: none; font-weight: 600;
}
.side-nav a:hover { background: var(--brand-50); color: var(--brand-700); }
.side-nav a.active { background: var(--brand); color: #fff; }
.side-foot { padding: 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.me-card { display: flex; gap: 10px; align-items: center; text-decoration: none; color: inherit; padding: 6px; border-radius: var(--radius-sm); }
.me-card:hover, .me-card.active { background: var(--brand-50); }
.me-text { display: grid; min-width: 0; }
.me-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .92rem; }
.me-text small { color: var(--ink-3); }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--brand-100); color: var(--brand-800);
  display: inline-grid; place-items: center; font-weight: 800; font-size: .85rem; flex: none; text-decoration: none;
}
.avatar-sm { width: 34px; height: 34px; }
.demo-flag { margin: 0; text-align: center; font-size: .75rem; font-weight: 700; color: var(--warn); background: var(--warn-bg); border-radius: 99px; padding: 3px; }

.topbar { display: none; }
.bottom-nav { display: none; }
.main { margin-left: var(--side); padding: 28px 32px 40px; max-width: calc(1180px + var(--side)); outline: none; }
.app-foot { margin-left: var(--side); padding: 0 32px 24px; color: var(--ink-3); font-size: .78rem; }

/* ---------- encabezados de página ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; color: var(--ink-3); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); text-decoration: none; font-weight: 600; font-size: .88rem; margin-bottom: 8px; }
.back-link:hover { color: var(--brand); }
.back-link .ic { width: 16px; height: 16px; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px;
  border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-weight: 700; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
}
.btn .ic { width: 18px; height: 18px; }
.btn:disabled, .btn.disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-700); }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-700); }
.btn-soft { background: var(--brand-50); color: var(--brand-700); }
.btn-soft:hover { background: var(--brand-100); }
.btn-danger { background: var(--err); color: #fff; }
.btn-danger:hover { background: #a83131; }
.btn-danger-ghost { background: transparent; color: var(--err); border-color: #f0caca; }
.btn-danger-ghost:hover { background: var(--err-bg); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { background: #18734b; }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: #188b46; }
.btn-lg { min-height: 50px; font-size: 1.02rem; }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: .85rem; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--brand-50); color: var(--brand); }

/* ---------- tarjetas ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-head .ic { color: var(--brand); }
.card-body { padding: 16px 20px 20px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.layout-detail { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; }

/* ---------- indicadores ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: inherit; display: block; }
.kpi:hover { border-color: var(--brand); }
.kpi small { color: var(--ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; }
.kpi strong { display: block; font-family: var(--font-head); font-size: 1.9rem; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi.k-open strong { color: var(--brand); }
.kpi.k-active strong { color: var(--violet); }
.kpi.k-wait strong { color: var(--warn); }
.kpi.k-closed strong { color: var(--ok); }

/* ---------- etiquetas de estado ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-open { background: var(--brand-50); color: var(--brand-700); }
.st-active { background: var(--violet-bg); color: var(--violet); }
.st-wait { background: var(--warn-bg); color: var(--warn); }
.st-closed { background: var(--ok-bg); color: var(--ok); }
.badge-plain::before { display: none; }
.b-gray { background: #eef1f4; color: var(--ink-2); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-brand { background: var(--brand-50); color: var(--brand-700); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: var(--brand-50); color: var(--brand-800); font-size: .82rem; font-weight: 600; }
.chip .ic { width: 15px; height: 15px; }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-muted { background: #eef1f4; color: var(--ink-3); }

/* ---------- barra de filtros ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.search { position: relative; flex: 1 1 260px; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 18px; height: 18px; }
.search input { padding-left: 38px; }
.seg { display: inline-flex; background: #e8edf3; border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; font: inherit; font-weight: 700; font-size: .85rem; color: var(--ink-2); padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--card); color: var(--brand-700); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg .n { color: var(--ink-3); font-weight: 600; margin-left: 4px; }

/* ---------- formularios ---------- */
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #cfd8e3;
  border-radius: var(--radius-sm); padding: 9px 12px; min-height: 42px;
}
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: 3px solid rgba(10, 123, 212, .16); }
input[readonly] { background: #f6f8fa; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label, .lbl { font-weight: 700; font-size: .86rem; color: var(--ink-2); }
.field label .req { color: var(--err); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; align-items: start; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { font-family: var(--font-head); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-700); margin: 6px 0 10px; grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); }
.hint { font-size: .82rem; color: var(--ink-3); margin: 4px 0 0; }
.form-error { color: var(--err); font-weight: 700; min-height: 1.2em; margin: 0 0 8px; font-size: .9rem; }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 46px; }
.pass-wrap .icon-btn { position: absolute; right: 3px; top: 3px; }
.radio-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.radio-cards label { border: 1px solid #cfd8e3; border-radius: var(--radius-sm); padding: 10px 12px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 700; }
.radio-cards input { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); }
.radio-cards label:has(input:checked) { border-color: var(--brand); background: var(--brand-50); color: var(--brand-800); }

/* ---------- listas y tablas ---------- */
.list { display: grid; }
.row-link {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit;
}
.row-link:last-child { border-bottom: 0; }
.row-link:hover { background: #f8fbfe; }
.row-main { min-width: 0; }
.row-main strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main span { display: block; color: var(--ink-3); font-size: .87rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-side { text-align: right; display: grid; gap: 4px; justify-items: end; font-size: .82rem; color: var(--ink-3); }
.row-icon { width: 42px; height: 42px; border-radius: 10px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; }
.folio { font-family: var(--font-head); font-weight: 700; color: var(--brand-700); font-size: .82rem; letter-spacing: .02em; }
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); background: #f9fbfd; white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover { background: #f8fbfe; }

/* ---------- detalle ---------- */
.dl { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: 8px 14px; margin: 0; }
.dl dt { color: var(--ink-3); font-size: .85rem; font-weight: 700; }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.big-actions { display: grid; gap: 8px; }
.contact-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.note { background: var(--brand-50); border-radius: var(--radius-sm); padding: 10px 12px; color: var(--brand-800); font-size: .9rem; }
.note-warn { background: var(--warn-bg); color: #7a4b00; }
.note-ok { background: var(--ok-bg); color: #155c3d; }
.text-block { white-space: pre-wrap; overflow-wrap: anywhere; }
.ok-line { display: flex; gap: 6px; align-items: center; color: var(--ok); font-weight: 700; }

/* ---------- línea de tiempo ---------- */
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.timeline li { display: grid; grid-template-columns: 12px 1fr; gap: 12px; }
.timeline .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); margin-top: 6px; box-shadow: 0 0 0 3px var(--brand-100); }
.timeline .t-text { font-size: .9rem; }
.timeline small { color: var(--ink-3); display: block; }

/* ---------- pasos del servicio (técnico) ---------- */
.steps { counter-reset: s; display: grid; gap: 14px; }
.step { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.step > header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: #f9fbfd; border-bottom: 1px solid var(--line); }
.step > header::before { counter-increment: s; content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .85rem; flex: none; }
.step > header h3 { flex: 1; }
.step > .step-body { padding: 14px 16px; }
.step.done > header::before { content: "✓"; background: var(--ok); }

/* ---------- fotos ---------- */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.photo { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: #e8edf3; border: 1px solid var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.photo .icon-btn { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; background: rgba(255,255,255,.92); color: var(--err); }
.photo-add { aspect-ratio: 1; border: 2px dashed #b9cbe0; border-radius: var(--radius-sm); display: grid; place-items: center; text-align: center; color: var(--brand); font-weight: 700; font-size: .85rem; cursor: pointer; background: var(--brand-50); padding: 6px; }
.photo-add .ic { width: 28px; height: 28px; margin: 0 auto 4px; display: block; }
.photo-add input { display: none; }
.lightbox img { max-width: 100%; max-height: 75vh; display: block; margin: 0 auto; border-radius: 8px; }

/* ---------- partidas (piezas / cotización) ---------- */
.items-table input { min-height: 38px; padding: 6px 8px; }
.items-table td { padding: 6px; border-bottom: 1px solid var(--line); }
.items-table th { font-size: .74rem; text-transform: uppercase; color: var(--ink-3); text-align: left; padding: 6px; }
.totals { display: grid; grid-template-columns: auto auto; gap: 6px 24px; justify-content: end; margin-top: 12px; font-variant-numeric: tabular-nums; }
.totals dt { color: var(--ink-3); text-align: right; }
.totals dd { margin: 0; text-align: right; font-weight: 700; }
.totals .grand { font-size: 1.2rem; color: var(--brand-800); }

/* ---------- base de conocimiento ---------- */
.kb-card { display: block; padding: 16px 18px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.kb-card:hover { background: #f8fbfe; }
.kb-card h3 { margin-bottom: 4px; }
.kb-card p { margin: 0; color: var(--ink-2); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kb-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- vacíos y carga ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 60px; color: var(--ink-3); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--brand-100); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- modales ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 30, 50, .45); display: grid; place-items: center; padding: 16px; z-index: 100; animation: fade .15s; }
.modal { background: var(--card); border-radius: 14px; width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-wide { width: min(820px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.confirm-text { margin: 0; }
.msg-preview { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.msg-small { white-space: pre-wrap; background: #f6f8fa; border-radius: 8px; padding: 10px; font-size: .82rem; }
.send-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; margin-top: 14px; }
@keyframes fade { from { opacity: 0; } }

/* ---------- avisos ---------- */
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 200; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 600; max-width: 360px; transition: opacity .3s, transform .3s; border-left: 4px solid var(--ok); }
.toast-err { border-left-color: #ff7b7b; }
.toast-warn { border-left-color: #ffbe55; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- inicio de sesión ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-art { background: linear-gradient(160deg, var(--brand) 0%, var(--brand-800) 100%); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 60px; }
.login-art img { width: 140px; filter: brightness(0) invert(1); opacity: .95; margin-bottom: 28px; }
.login-art h2 { font-size: 2rem; max-width: 420px; }
.login-art p { max-width: 420px; opacity: .85; font-size: 1.05rem; }
.login-card { align-self: center; justify-self: center; width: min(400px, calc(100% - 32px)); padding: 32px 0; }
.login-logo { width: 100%; max-width: 340px; display: block; margin: 0 auto 28px; }
.login-card h1 { margin-bottom: 18px; }
.login-card .check { margin: 4px 0 14px; }
.login-foot { text-align: center; color: var(--ink-3); font-size: .78rem; margin-top: 28px; }

/* ---------- impresión de etiquetas (vista previa) ---------- */
.label-preview { border: 1px dashed #b9cbe0; border-radius: 8px; padding: 12px; background: #fff; }

/* =====================================================================
   Responsivo
   ===================================================================== */
.seg a { text-decoration: none; font-weight: 700; font-size: .85rem; color: var(--ink-2); padding: 6px 12px; border-radius: 8px; }
.seg a.on { background: var(--card); color: var(--brand-700); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
div.kpi:hover { border-color: var(--line); }
.b-err { background: var(--err-bg); color: var(--err); }
.brand-product { letter-spacing: .28em; text-transform: uppercase; font-size: .78rem !important; color: var(--brand-700) !important; }
.brand-name { display: block; margin-top: 8px; font-family: var(--font-head); font-weight: 800; color: var(--brand-800); font-size: .95rem; line-height: 1.2; }
.brand img { max-height: 72px; width: auto; max-width: 100%; }
.top-icon { object-fit: contain; }
.co-banner { margin-left: var(--side); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 32px; background: var(--brand-50); color: var(--brand-800); border-bottom: 1px solid var(--brand-100); font-size: .9rem; }
.co-banner .ic { width: 18px; height: 18px; flex: none; }
.co-banner span { flex: 1; min-width: 200px; }
.co-banner-warn { background: var(--warn-bg); color: #7a4b00; border-color: #f3dfb5; }
.logo-prev { display: grid; place-items: center; min-height: 110px; margin: 12px 0 4px; padding: 14px; border: 1px dashed #b9cbe0; border-radius: var(--radius-sm); background: #fff; }
.logo-prev img { max-height: 90px; max-width: 100%; }
.kv { width: 100%; border-collapse: collapse; font-size: .92rem; }
.kv td { padding: 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.kv td:first-child { color: var(--ink-3); width: 45%; padding-right: 10px; }

/* ---------- Empresas (como REVANET Attendance) ---------- */
.side-switch { padding: 0 14px 12px; }
.co-switch { display: flex; align-items: center; gap: 8px; background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: var(--radius-sm); padding: 4px 8px; color: var(--brand-800); min-width: 0; }
.co-switch .ic { width: 18px; height: 18px; flex: none; }
.co-switch select { border: 0; background: transparent; font: inherit; font-weight: 800; color: inherit; padding: 6px 0; width: 100%; min-width: 0; outline: none; box-shadow: none; }
.kpi-of { font-size: 1rem; color: var(--ink-3); font-weight: 700; }
.co-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.co-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: grid; gap: 12px; align-content: start; }
.co-card.off { opacity: .72; background: #f8f9fb; }
.co-card-head { display: flex; align-items: center; gap: 12px; }
.co-card-title { flex: 1; min-width: 0; display: grid; }
.co-card-title strong { font-family: var(--font-head); font-size: 1.02rem; }
.co-card-title small { color: var(--ink-3); overflow-wrap: anywhere; }
.co-logo { width: 46px; height: 46px; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; overflow: hidden; flex: none; }
.co-logo img { width: 100%; height: 100%; object-fit: contain; }
.co-logo-txt { background: var(--brand-50); color: var(--brand-700); font-weight: 800; font-family: var(--font-head); }
.co-logo-xl { width: 76px; height: 76px; border-radius: 14px; font-size: 1.3rem; }
.co-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 0; }
.co-meta dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 700; }
.co-meta dd { margin: 2px 0 0; font-weight: 700; font-size: .9rem; }
.co-actions { display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.txt-err { color: var(--err) !important; }
.txt-ok { color: var(--ok) !important; }
.photo-pick { display: flex; align-items: center; gap: 14px; }
[hidden] { display: none !important; }

/* ---------- Inicio de sesión: REVANET Help Desk ---------- */
.login-tk { background: var(--bg); }
.tk-art { position: relative; overflow: hidden; align-items: center; justify-content: center; gap: 34px; padding: 56px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.13) 0 255px, transparent 256px),
    linear-gradient(155deg, #0a8ae6 0%, var(--brand) 40%, var(--brand-800) 100%); }
.tk-art::before { content: ""; position: absolute; inset: 0; opacity: .10; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.8) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.8) 1px, transparent 1px);
  background-size: 34px 34px; mask-image: radial-gradient(circle at 50% 45%, #000 0, transparent 70%); -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 0, transparent 70%); }
.tk-art > * { position: relative; }
.tk-art .tk-emblem { width: min(380px, 78%); height: auto; margin: 0; opacity: 1; transform: rotate(-6deg); filter: drop-shadow(0 18px 40px rgba(3, 30, 70, .35)); }
.tk-word { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tk-art .tk-logo { width: 220px; margin: 0; filter: brightness(0) invert(1); opacity: 1; }
.tk-word span { font-family: var(--font-head); font-weight: 800; letter-spacing: .42em; text-transform: uppercase; font-size: .95rem; padding-left: .42em; opacity: .92; }
.tk-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 10px; border-radius: 99px; font-family: var(--font-head); font-weight: 800; font-size: .9rem; letter-spacing: .02em; }
.tk-pill .ic { width: 17px; height: 17px; }
.tk-pill-soft { background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100); }
.tk-head { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 22px; }
.login-tk .login-logo { margin: 0 auto; max-width: 300px; }
.tk-mobile-tag { display: none; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-detail { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  body { font-size: 15.5px; }
  .sidebar { display: none; }
  .topbar {
    display: flex; position: sticky; top: 0; z-index: 30; align-items: center; gap: 10px; padding: 10px 16px;
    background: var(--card); border-bottom: 1px solid var(--line);
  }
  .top-icon { width: 34px; height: 34px; }
  .top-title { flex: 1; display: grid; line-height: 1.15; }
  .top-title strong { font-family: var(--font-head); color: var(--brand-800); }
  .top-title small { color: var(--ink-3); font-size: .78rem; }
  .main { margin: 0; padding: 18px 16px 96px; }
  .co-banner { margin: 0; padding: 10px 16px; }
  .top-title .co-switch { padding: 2px 8px; }
  .co-grid { grid-template-columns: 1fr; }
  .app-foot { margin: 0; padding: 0 16px 92px; text-align: center; }
  .bottom-nav {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--card); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .bottom-nav a { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; text-decoration: none; color: var(--ink-3); font-size: .68rem; font-weight: 700; border-radius: 10px; }
  .bottom-nav a .ic { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--brand); background: var(--brand-50); }
  #toasts { left: 16px; right: 16px; bottom: 84px; }
  .toast { max-width: none; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .tk-mobile-tag { display: block; text-align: center; color: var(--ink-3); margin: -10px 0 18px; font-weight: 600; }
  .login-tk .login-logo { max-width: 240px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .row-link { padding: 12px 14px; gap: 10px; }
  .row-icon { display: none; }
  .row-link { grid-template-columns: minmax(0, 1fr) auto; }
  .card-head, .card-body { padding-left: 16px; padding-right: 16px; }
  .modal-backdrop { padding: 0; place-items: end stretch; }
  .modal, .modal-wide { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dd { margin-bottom: 8px; }
  .tbl-cards thead { display: none; }
  .tbl-cards tr { display: grid; grid-template-columns: 1fr auto; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .tbl-cards td { border: 0; padding: 2px 0; }
  .tbl-cards td[data-k]::before { content: attr(data-k) ": "; color: var(--ink-3); font-size: .78rem; font-weight: 700; }
  .tbl-cards td.num { text-align: left; }
}
@media (max-width: 420px) {
  .kpi strong { font-size: 1.5rem; }
  .radio-cards { grid-template-columns: 1fr; }
}
.ic-xs { width: 14px; height: 14px; vertical-align: -2px; }
.dev-link { color: var(--brand-700); font-weight: 700; text-decoration: none; }
.dev-link:hover { text-decoration: underline; }
