/* Gestión TI - estilos propios sobre AdminLTE 4 */
:root { --gti-radius: .6rem; }
body { font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

/* Colores extra para badges */
.text-bg-orange { color:#fff !important; background-color:#fd7e14 !important; }
.text-bg-purple { color:#fff !important; background-color:#6f42c1 !important; }
.text-bg-teal   { color:#fff !important; background-color:#20c997 !important; }
.text-bg-indigo { color:#fff !important; background-color:#6610f2 !important; }
.text-bg-pink   { color:#fff !important; background-color:#d63384 !important; }
.text-orange{color:#fd7e14!important}.text-purple{color:#6f42c1!important}.text-teal{color:#20c997!important}.text-indigo{color:#6610f2!important}.text-pink{color:#d63384!important}
.border-orange{border-color:#fd7e14!important}.border-purple{border-color:#6f42c1!important}.border-teal{border-color:#20c997!important}.border-indigo{border-color:#6610f2!important}.border-pink{border-color:#d63384!important}

.card { border-radius: var(--gti-radius); }
.card > .card-header:first-child { border-top-left-radius: var(--gti-radius); border-top-right-radius: var(--gti-radius); }
.card-title { font-weight: 600; }
.small-box { border-radius: var(--gti-radius); }
.small-box .small-box-icon { font-size: 60px; height: 60px; }
.table > :not(caption) > * > * { vertical-align: middle; }
.table-sm td, .table-sm th { font-size: .92rem; }
.page-actions .btn { margin-left: .25rem; margin-bottom: .25rem; }

/* Avatar con inicial */
.user-avatar { display:inline-flex; align-items:center; justify-content:center; width:2rem; height:2rem; border-radius:50%;
  background: linear-gradient(135deg,#3b82f6,#6366f1); color:#fff; font-weight:700; margin-right:.35rem; font-size:.95rem; }
.user-avatar-lg { width:4.5rem; height:4.5rem; font-size:2rem; border:3px solid rgba(255,255,255,.4); margin:0 auto .5rem; display:flex; }
.user-avatar-sm { width:1.6rem; height:1.6rem; font-size:.75rem; }
.navbar .user-avatar { vertical-align: middle; }

.app-sidebar .brand-image { border-radius: .5rem; }
.nav-badge { position:absolute; right: 1.8rem; top: .55rem; }
.sidebar-mini.sidebar-collapse .app-sidebar:not(:hover) .nav-badge { display:none; }
.global-search .form-control { width: 22rem; }

/* Timeline */
.timeline > div > .timeline-item { border-radius: .5rem; }
.timeline .timeline-item.internal { border-left: 4px solid #ffc107; background: rgba(255,193,7,.06); }
.timeline .timeline-item.system .timeline-header { font-size: .9rem; border-bottom: 0; }
.timeline .timeline-body { white-space: pre-wrap; word-break: break-word; }

/* Árbol de ubicaciones */
.tree-panel { max-height: 70vh; overflow:auto; }
.jstree-default .jstree-anchor { height: auto; line-height: 1.6; }

/* Tarjetas de atributos */
.attr-list dt { font-weight: 600; color: var(--bs-secondary-color); font-size: .85rem; }
.attr-list dd { margin-bottom: .6rem; }

/* Prioridades: barra a la izquierda en tablas */
tr.prio-danger > td:first-child { box-shadow: inset 4px 0 0 #dc3545; }
tr.prio-warning > td:first-child { box-shadow: inset 4px 0 0 #ffc107; }
tr.prio-primary > td:first-child { box-shadow: inset 4px 0 0 #0d6efd; }
tr.prio-secondary > td:first-child { box-shadow: inset 4px 0 0 #6c757d; }

.kpi-link { text-decoration:none; color: inherit; }
.chart-box { position: relative; height: 280px; }
.chart-box-sm { position: relative; height: 220px; }

/* Selector de equipo afectado (portal operador) */
.asset-pick { cursor:pointer; border:2px solid var(--bs-border-color); border-radius:.75rem; transition: all .15s; }
.asset-pick:hover { border-color: var(--bs-primary); }
.btn-check:checked + .asset-pick { border-color: var(--bs-primary); background: rgba(13,110,253,.08); box-shadow: 0 0 0 .2rem rgba(13,110,253,.15); }
.asset-pick i.bi { font-size: 2rem; }

/* Etiquetas */
.label-sheet { display:flex; flex-wrap:wrap; gap: 4mm; }
.asset-label { border:1px dashed #999; padding: 2mm; display:flex; gap: 2mm; align-items:center; overflow:hidden; background:#fff; color:#000; break-inside: avoid; }
.asset-label .lbl-text { line-height: 1.1; font-family: Arial, sans-serif; overflow:hidden; }
.asset-label .lbl-tag { font-weight: 800; font-size: 13pt; }
.asset-label .lbl-org { font-size: 7pt; text-transform: uppercase; }
.asset-label .lbl-sub { font-size: 7pt; }
.asset-label svg.barcode { max-width: 100%; }
@media print {
  .app-header, .app-sidebar, .app-footer, .app-content-header, .no-print { display:none !important; }
  .app-main, .app-wrapper { margin:0 !important; padding:0 !important; }
  .asset-label { border: 1px solid #ddd; }
  body { background:#fff !important; }
  .card { border:0 !important; box-shadow:none !important; }
}

/* Login */
.login-page { background: radial-gradient(1200px 600px at 10% 10%, rgba(99,102,241,.25), transparent), radial-gradient(900px 500px at 90% 90%, rgba(59,130,246,.25), transparent); }
.login-logo img { width: 64px; height: 64px; }

/* Portal operador */
.portal-hero { background: linear-gradient(135deg,#1e3a8a,#4f46e5); color:#fff; border-radius: 1rem; }
.portal-hero .bi { opacity:.85; }

/* Tom-select dentro de input-group / tema oscuro */
[data-bs-theme=dark] .ts-dropdown, [data-bs-theme=dark] .ts-control { background-color: var(--bs-body-bg); color: var(--bs-body-color); }
[data-bs-theme=dark] .ts-dropdown .active { background-color: var(--bs-secondary-bg); color: var(--bs-body-color); }
.ts-wrapper.form-select, .ts-wrapper.form-control { padding: 0; }

div.dt-container div.dt-buttons { margin-bottom: .5rem; }
.dt-container .dt-search input { min-width: 14rem; }
.json-diff { font-size: .8rem; max-width: 28rem; white-space: pre-wrap; word-break: break-word; }
.text-truncate-2 { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.cursor-pointer { cursor: pointer; }
.stat-mini { font-size: 1.6rem; font-weight: 700; }
