/*
 * 3r_projects — hoja de estilos principal.
 * Base visual de hwdpos (barra lateral blanca, contenido gris claro, tarjetas con borde fino) con el
 * azul de la marca 3R (#0d6efd) y criterios de las Human Interface Guidelines de Macintosh (1992):
 *  · Estabilidad percibida: la barra lateral y la superior nunca se mueven; cada pantalla igual.
 *  · Botón por defecto visible (anillo) que responde a Enter; Esc cancela.
 *  · Retroalimentación inmediata: estado "trabajando", avisos breves, guardado automático visible.
 *  · Perdón: lo destructivo pide confirmación y casi todo se anula en vez de borrarse.
 */
:root {
  --tr-brand: #0d6efd;
  --tr-brand-rgb: 13, 110, 253;
  --tr-brand-dark: #0a58ca;
  --tr-brand-soft: #e7efff;
  --tr-ink: #0c0c0c;
  --tr-text: #1d1d1f;
  --tr-muted: #6e7681;
  --tr-sidebar-w: 236px;
  --tr-bg: #f4f5f7;
  --tr-border: #e4e7eb;
  --tr-row-alt: #eef3fa;

  --bs-primary: #0d6efd;
  --bs-primary-rgb: 13, 110, 253;
  --bs-link-color: #0d6efd;
  --bs-link-color-rgb: 13, 110, 253;
  --bs-link-hover-color: #0a58ca;
  --bs-link-hover-color-rgb: 0, 51, 111;
  --bs-focus-ring-color: rgba(13, 110, 253, .25);
}

body { background: var(--tr-bg); }

/* Botón por defecto (HIG): el que responde a Enter lleva un anillo para que se vea cuál es. */
.btn-default-action { box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(13, 110, 253, .45); }

/* ---------- Estructura ---------- */
.tr-layout { display: flex; min-height: 100vh; }
.tr-sidebar {
  width: var(--tr-sidebar-w); background: #fff; border-right: 1px solid var(--tr-border);
  position: fixed; top: 0; bottom: 0; left: 0; display: flex; flex-direction: column; z-index: 30;
}
.tr-sidebar .brand {
  flex: 0 0 auto; padding: .95rem 1.1rem; border-bottom: 1px solid var(--tr-border); text-align: center;
  font-weight: 700; font-size: 1.05rem; color: var(--tr-brand); text-decoration: none; display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tr-sidebar .brand:hover { text-decoration: none; }
.tr-sidebar .brand img { max-height: 34px; max-width: 100%; width: auto; display: block; margin: 0 auto; }
/* Con símbolo: el símbolo de la empresa a la izquierda del nombre. */
.tr-sidebar .brand.brand-mark { display: flex; align-items: center; justify-content: center; gap: .55rem; }
.tr-sidebar .brand.brand-mark img { height: 30px; max-height: 30px; max-width: 48px; margin: 0; flex: 0 0 auto; }
.tr-sidebar .brand.brand-mark span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tr-sidebar > nav { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; min-height: 0; flex-wrap: nowrap; padding: .3rem 0; }
.tr-sidebar-footer { flex: 0 0 auto; padding: .5rem 1rem; text-align: center; font-size: .72rem; border-top: 1px solid var(--tr-border); }
/* Crédito del fabricante: «3R PROJECTS BY 3RSOFT» en gris claro (igual que hwdpos). */
.brand-credit { color: #98a2b0; }
/* Logo de 3R PROJECTS en las pantallas de ingreso e instalación (public/assets/brand). */
.auth-product-logo { display: block; margin: 0 auto; height: auto; }
.brand-3r { color: #b9c2ce; text-decoration: none; font-weight: 600; letter-spacing: .3px; }
.brand-3r:hover { color: #8b95a3; text-decoration: none; }
.tr-sidebar .nav-link { color: #344; padding: .42rem 1.1rem; display: flex; gap: .55rem; align-items: center; font-size: .92rem; border-radius: 0; }
.tr-sidebar .nav-link:hover { background: #f0f4ff; }
.tr-sidebar .nav-link.active { background: var(--tr-brand-soft); color: var(--tr-brand); font-weight: 600; border-right: 3px solid var(--tr-brand); }
.tr-sidebar .nav-ico { width: 1.25rem; text-align: center; }
.tr-sidebar .nav-link.active .nav-ico { color: var(--tr-brand); }
.tr-sidebar .nav-group-toggle {
  width: 100%; background: none; border: 0; cursor: pointer; color: #344; padding: .5rem 1.1rem;
  display: flex; gap: .55rem; align-items: center; font-size: .9rem; font-weight: 600;
}
.tr-sidebar .nav-group-toggle:hover { background: #f0f4ff; }
.tr-sidebar .nav-group-label { margin-right: auto; text-align: left; }
.tr-sidebar .nav-group.has-active > .nav-group-toggle { color: var(--tr-brand); }
.tr-sidebar .nav-caret { font-size: .68rem; color: #b6bcc4; transition: transform .15s; }
.tr-sidebar .nav-group.collapsed .nav-caret { transform: rotate(-90deg); }
.tr-sidebar .nav-group.collapsed .nav-group-items { display: none; }
.tr-sidebar .nav-group-items .nav-link { padding-left: 2.35rem; font-size: .88rem; }

/* Barra superior FIJA (position: fixed, no sticky): no se mueve al desplazarse y el rebote nativo
   del trackpad mueve solo el contenido. Su alto real lo pone app.js en --tr-topbar-h (en el móvil
   ocupa dos filas). */
:root { --tr-topbar-h: 55px; scroll-padding-top: calc(var(--tr-topbar-h) + .5rem); }
.tr-main { flex: 1; margin-left: var(--tr-sidebar-w); display: flex; flex-direction: column; min-width: 0; padding-top: var(--tr-topbar-h); }
.tr-topbar {
  background: #fff; border-bottom: 1px solid var(--tr-border); padding: .5rem .9rem; position: fixed; top: 0; right: 0; left: var(--tr-sidebar-w); z-index: 20;
  display: flex; align-items: center; gap: .7rem;
}
.tr-content { padding: 1.1rem 1.3rem 2rem; min-width: 0; }
.tr-sidebar-toggle { display: none; }
.tr-sidebar-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 25; display: none; }
.tr-sidebar-backdrop.show { display: block; }
@media (max-width: 860px) {
  .tr-sidebar { left: -260px; transition: left .2s; box-shadow: 2px 0 16px rgba(0, 0, 0, .18); }
  .tr-sidebar.open { left: 0; }
  .tr-main { margin-left: 0; }
  .tr-topbar { left: 0; }
  .tr-sidebar-toggle { display: inline-flex; align-items: center; }
}
@media (max-width: 576px) {
  :root { --tr-topbar-h: 96px; }
  .tr-topbar { flex-wrap: wrap; row-gap: .45rem; }
  .tr-global-search { order: 3; flex: 1 1 100% !important; max-width: none !important; }
  .tr-topbar .tr-btn-label { display: none; }
  .tr-content { padding: .9rem .8rem 2rem; }
}

/* ---------- Búsqueda global y resultados desplegables ---------- */
.tr-global-search { position: relative; flex: 1; max-width: 620px; }
.tr-global-search .form-control { padding-left: 2rem; }
.tr-global-search .tr-search-ico { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: #9aa1ab; font-size: .85rem; pointer-events: none; }
.tr-search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--tr-border);
  border-radius: .55rem; box-shadow: 0 14px 34px rgba(0, 0, 0, .13); max-height: 70vh; overflow-y: auto; z-index: 1085; display: none;
}
.tr-search-results.show { display: block; }
.tr-search-group-title { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: #9aa1ab; padding: .45rem .8rem .15rem; }
.tr-search-item { display: flex; gap: .55rem; align-items: center; padding: .42rem .8rem; border-top: 1px solid #f2f4f6; color: #233; text-decoration: none; cursor: pointer; }
.tr-search-item:hover, .tr-search-item.active { background: #eef3fb; color: #233; }
.tr-search-item .ico { width: 1.1rem; text-align: center; color: #7b8590; }
.tr-search-item small { color: #8a929c; }
.tr-search-empty { padding: .7rem .8rem; color: #8a929c; font-size: .86rem; }

/* ---------- Combobox: campo de texto + lista desplegable (como hwdpos) ---------- */
.tr-combo { position: relative; }
.tr-combo > select { display: none !important; }
.tr-combo-input { padding-right: 1.9rem; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23656d77' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right .6rem center; background-size: 12px 10px; }
.tr-combo-menu {
  position: absolute; z-index: 1080; top: 100%; left: 0; right: 0; margin-top: 2px; background: #fff; border: 1px solid #d5dae0;
  border-radius: .45rem; box-shadow: 0 8px 22px rgba(0, 0, 0, .14); max-height: 280px; overflow-y: auto; display: none;
}
.tr-combo.open .tr-combo-menu { display: block; }
.tr-combo-item { padding: .38rem .65rem; font-size: .9rem; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-combo-item small { color: #8a929c; margin-left: .35rem; }
.tr-combo-item:hover, .tr-combo-item.active { background: #eaf1fb; }
.tr-combo-item.is-selected { font-weight: 600; }
.tr-combo-item.disabled { color: #9aa1ab; cursor: default; background: none; }
.tr-combo-empty { padding: .45rem .65rem; font-size: .85rem; color: #8a929c; }
.input-group > .tr-combo { flex: 1 1 auto; width: 1%; min-width: 0; }
.input-group > .tr-combo:not(:last-child) .tr-combo-input { border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* Selector con búsqueda remota (cliente, servicio): mismo aspecto que el combobox. */
.tr-picker { position: relative; }
.tr-picker .tr-search-results { top: calc(100% + 2px); }
.tr-picker-chosen { font-size: .8rem; color: var(--tr-muted); margin-top: .2rem; }

/* ---------- Piezas comunes ---------- */
.card { border-color: var(--tr-border); }
.card-header { background: #fff; border-bottom-color: var(--tr-border); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-title { font-size: 1.3rem; font-weight: 600; margin: 0; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.page-title .sub { font-size: .9rem; font-weight: 400; color: var(--tr-muted); }
.page-actions { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }
.table { --bs-table-hover-bg: #f3f7fc; }
.table-sm td, .table-sm th { padding: .4rem .55rem; }
.table thead th { background: #f8f9fa; color: #212529; font-weight: 600; white-space: nowrap; }
.table td.num, .table th.num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
tr.row-link { cursor: pointer; }
.muted { color: var(--tr-muted); }
.small-label { font-size: .875rem; color: #495057; font-weight: 600; }
.badge { display: inline-flex; align-items: center; justify-content: center; gap: .3em; line-height: 1; padding: .36em .62em; font-weight: 600; }
.page-title .badge { vertical-align: middle; font-size: .72rem; }
.stat-tile { border: 1px solid var(--tr-border); border-radius: .6rem; background: #fff; padding: .85rem 1rem; height: 100%; }
.stat-tile .v { font-size: clamp(1.05rem, .75rem + .85vw, 1.45rem); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat-tile .l { color: #8a929c; font-size: .8rem; }
.stat-tile .h { font-size: .75rem; color: #9aa1ab; margin-top: .15rem; }
a.stat-tile { display: block; color: inherit; text-decoration: none; transition: box-shadow .12s; }
a.stat-tile:hover { box-shadow: 0 2px 10px rgba(0, 0, 0, .07); }
.empty-state { text-align: center; color: #8a929c; padding: 2.2rem 1rem; }
.empty-state > i, .empty-state > .fa-solid, .empty-state > .fa-regular { font-size: 1.8rem; color: #c6ccd4; display: block; width: auto; margin: 0 auto .6rem; text-align: center; }
.empty-state > i.text-success { color: var(--bs-success) !important; }
.dl-grid { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; font-size: .9rem; margin: 0; }
.dl-grid dt { color: #6c757d; font-weight: 500; }
.dl-grid dd { margin: 0; }
.tr-kbd, kbd.tr-kbd { background: #f1f3f6; color: #59616b; border: 1px solid #dde1e6; border-bottom-width: 2px; border-radius: .3rem; padding: .02rem .32rem; font-size: .7rem; font-family: inherit; font-weight: 600; box-shadow: none; }
.btn .tr-kbd { margin-left: .35rem; background: rgba(255, 255, 255, .18); color: inherit; border-color: rgba(255, 255, 255, .35); }
.btn-outline-secondary .tr-kbd, .btn-light .tr-kbd, .btn-outline-primary .tr-kbd { background: #f1f3f6; color: #59616b; border-color: #dde1e6; }
.tr-swatch { display: inline-block; width: 11px; height: 11px; border-radius: 3px; vertical-align: middle; }
.nav-tabs .nav-link { color: #59616b; }
.nav-tabs .nav-link.active { color: var(--tr-brand); font-weight: 600; }
.nav-tabs .nav-link .badge { font-size: .65rem; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--tr-brand-soft); color: var(--tr-brand); display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; flex-shrink: 0; }
.is-overdue { color: #dc3545; font-weight: 600; }
.text-pre { white-space: pre-wrap; }
.cursor-pointer { cursor: pointer; }
.sticky-actions { position: sticky; bottom: 0; background: rgba(244, 245, 247, .95); padding: .6rem 0; border-top: 1px solid var(--tr-border); z-index: 5; }

/* Barra de progreso con valor */
.tr-progress { display: flex; align-items: center; gap: .5rem; min-width: 120px; }
.tr-progress .progress { flex: 1; height: 7px; background: #e9edf2; border-radius: 99px; }
.tr-progress .progress-bar { border-radius: 99px; }
.tr-progress-lg .progress { height: 11px; }
.tr-progress-v { font-size: .78rem; font-weight: 600; color: #4b535d; min-width: 2.4rem; text-align: right; font-variant-numeric: tabular-nums; }

/* Gráficos */
/* Gráficos (charts.js, igual que hwdpos): tooltip flotante y resaltado al pasar el puntero. */
.tr-chart-tip { position: fixed; z-index: 1080; pointer-events: none; background: #111827; color: #fff;
  font-size: 12px; line-height: 1.35; padding: 6px 9px; border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.22); max-width: 240px; }
.tr-chart-tip .t { font-weight: 600; margin-bottom: 1px; }
.tr-chart-tip .v { color: #e5e7eb; white-space: nowrap; }
.tr-chart-tip .muted { color: #9ca3af; }
svg.tr-line { cursor: crosshair; }
svg.tr-line .tr-line-pt { transition: r .1s; }
svg.tr-donut .tr-donut-slice { transition: opacity .12s; cursor: pointer; }
.tr-donut-leg { transition: opacity .12s; cursor: default; }

/* ---------- Avisos del sistema (alert / confirm) al estilo de las alertas Mac ---------- */
.tr-modal { position: fixed; inset: 0; z-index: 2000; display: none; align-items: center; justify-content: center; padding: 16px; }
.tr-modal.show { display: flex; }
.tr-modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); }
.tr-modal__dialog { position: relative; background: #fff; border-radius: 12px; max-width: 420px; width: 100%; box-shadow: 0 12px 40px rgba(0, 0, 0, .28); padding: 20px; animation: tr-pop .14s ease-out; }
.tr-modal__icon { display: none; }
.tr-modal__title { font-weight: 700; font-size: 1.05rem; margin-bottom: 8px; }
.tr-modal__body { color: #333; white-space: pre-wrap; line-height: 1.45; margin-bottom: 18px; }
.tr-modal__input { margin: -8px 0 18px; }
.tr-modal__actions { display: flex; gap: 8px; justify-content: flex-end; }
@keyframes tr-pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Cargando y aviso breve */
.tr-loading { position: fixed; inset: 0; z-index: 20000; display: none; align-items: center; justify-content: center; background: rgba(17, 24, 39, .35); }
.tr-loading.show { display: flex; }
.tr-loading-box { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 32px; border-radius: 16px; background: rgba(255, 255, 255, .95); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.tr-spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid rgba(0, 0, 0, .1); border-top-color: var(--tr-brand); animation: tr-spin .8s linear infinite; }
@keyframes tr-spin { to { transform: rotate(360deg); } }
.tr-busy { position: relative; pointer-events: none; opacity: .75; cursor: wait !important; padding-right: 2.1em !important; }
.tr-busy::after { content: ''; position: absolute; top: 50%; right: .6em; width: .85em; height: .85em; margin-top: -.42em; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: tr-spin .7s linear infinite; }
.tr-alerts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 2100; width: min(560px, calc(100vw - 32px));
  display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.tr-alerts .tr-pop { pointer-events: auto; margin: 0; display: flex; align-items: flex-start; gap: .6rem; padding-top: .7rem; padding-bottom: .7rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .16); animation: tr-pop-in .22s ease-out; }
.tr-pop .tr-pop-icon { flex: none; font-size: 1.05rem; line-height: 1.35; }
.tr-pop .tr-pop-text { flex: 1; min-width: 0; line-height: 1.4; white-space: pre-line; }
.tr-pop .btn-close { padding: .95rem 1rem; }
.tr-pop.tr-pop-out { opacity: 0; transform: translateY(-8px); transition: opacity .2s, transform .2s; }
@keyframes tr-pop-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

/* Estado del autoguardado (junto al título del formulario) */
.tr-autosave { font-size: .78rem; color: #8a929c; display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.tr-autosave .dot { width: 7px; height: 7px; border-radius: 50%; background: #c6ccd4; }
.tr-autosave.saving .dot { background: #ffc107; }
.tr-autosave.saved .dot { background: #2f9e6b; }
.tr-autosave.error .dot { background: #dc3545; }
.tr-restore-banner { border-left: 3px solid #ffc107; }

/* ---------- Editor de renglones (cotización / factura) ---------- */
.doc-lines { width: 100%; }
.doc-lines th { white-space: nowrap; }
.doc-lines td { vertical-align: top; }
.doc-lines .form-control, .doc-lines .form-select { padding: .3rem .45rem; font-size: .88rem; }
.doc-lines .line-detail { margin-top: .3rem; font-size: .8rem; color: #59616b; resize: vertical; min-height: 30px; }
.doc-lines .line-total { padding-top: .45rem; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc-lines .line-handle { cursor: grab; color: #b6bcc4; padding-top: .45rem; text-align: center; }
.doc-lines tr.dragging { opacity: .5; }
.doc-lines .line-num { color: #9aa1ab; font-size: .8rem; padding-top: .5rem; text-align: center; }
.doc-summary .row-line { display: flex; justify-content: space-between; padding: .22rem 0; font-variant-numeric: tabular-nums; }
.doc-summary .grand { font-size: 1.15rem; font-weight: 700; border-top: 1px solid var(--tr-border); margin-top: .35rem; padding-top: .45rem; }

/* ---------- Línea de tiempo del proyecto ---------- */
.timeline { position: relative; padding-left: 0; list-style: none; margin: 0; }
.timeline-day { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #8a929c; font-weight: 700; margin: 1rem 0 .4rem 3rem; }
.timeline-item { position: relative; padding: 0 0 .9rem 3rem; }
.timeline-item::before { content: ''; position: absolute; left: 15px; top: 30px; bottom: -4px; width: 2px; background: #e3e7ec; }
.timeline-item:last-child::before { display: none; }
.timeline-ico { position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .85rem; color: #fff; background: #8a929c; box-shadow: 0 0 0 3px var(--tr-bg); }
.timeline-card { background: #fff; border: 1px solid var(--tr-border); border-radius: .55rem; padding: .6rem .8rem; }
.timeline-card .meta { font-size: .76rem; color: #8a929c; }
.timeline-card .body { font-size: .9rem; margin-top: .3rem; }
.timeline-card .body ul { padding-left: 1.2rem; margin: .2rem 0; }

/* ---------- Notas ---------- */
.notes-shell { display: grid; grid-template-columns: 300px 1fr; gap: 1rem; min-height: 60vh; }
@media (max-width: 992px) { .notes-shell { grid-template-columns: 1fr; } }
.notes-list { background: #fff; border: 1px solid var(--tr-border); border-radius: .6rem; overflow: hidden; display: flex; flex-direction: column; }
.notes-list .list-head { padding: .55rem .7rem; border-bottom: 1px solid var(--tr-border); display: flex; gap: .4rem; }
.notes-list .items { overflow-y: auto; max-height: 70vh; }
.note-row { display: block; padding: .55rem .75rem; border-bottom: 1px solid #f0f2f5; color: inherit; text-decoration: none; }
.note-row:hover { background: #f5f8fc; color: inherit; }
.note-row.active { background: var(--tr-brand-soft); border-left: 3px solid var(--tr-brand); padding-left: calc(.75rem - 3px); }
.note-row .t { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-row .s { font-size: .78rem; color: #8a929c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-editor { background: #fff; border: 1px solid var(--tr-border); border-radius: .6rem; display: flex; flex-direction: column; }
.note-editor .ed-head { padding: .6rem .9rem; border-bottom: 1px solid var(--tr-border); display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.note-editor .ed-title { border: 0; font-size: 1.25rem; font-weight: 650; padding: .7rem .9rem .2rem; outline: none; width: 100%; }
.note-editor .ed-body { border: 0; outline: none; padding: .4rem .9rem 1rem; width: 100%; min-height: 48vh; resize: vertical; font-size: .95rem; line-height: 1.55; font-family: inherit; }
.note-editor .ed-foot { padding: .45rem .9rem; border-top: 1px solid var(--tr-border); font-size: .78rem; color: #8a929c; display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; }
.note-cat { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 600; padding: .15rem .45rem; border-radius: 99px; background: #f1f3f6; }
.note-card { background: #fff; border: 1px solid var(--tr-border); border-radius: .6rem; padding: .8rem .95rem; height: 100%; display: flex; flex-direction: column; }
.note-card .body { font-size: .88rem; color: #3b4148; max-height: 9.5em; overflow: hidden; position: relative; }
.note-card .body::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2em; background: linear-gradient(transparent, #fff); }

/* ---------- Archivos ---------- */
.dropzone { border: 2px dashed #c9d2de; border-radius: .6rem; padding: 1rem; text-align: center; color: #7b8590; background: #fafbfd; transition: background .12s, border-color .12s; cursor: pointer; }
.dropzone.over { background: var(--tr-brand-soft); border-color: var(--tr-brand); color: var(--tr-brand); }
.file-ico { font-size: 1.25rem; width: 1.6rem; text-align: center; color: #7b8590; }
.file-ico.fa-file-pdf { color: #dc3545; } .file-ico.fa-file-word { color: #2b579a; } .file-ico.fa-file-excel { color: #217346; }
.file-ico.fa-file-image { color: #6f42c1; } .file-ico.fa-file-powerpoint { color: #d24726; } .file-ico.fa-file-zipper { color: #a0522d; }

/* ---------- Plugins / permisos ---------- */
.perm-group { border: 1px solid var(--tr-border); border-radius: .5rem; padding: .6rem .8rem; background: #fff; height: 100%; }
.perm-group h6 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: #59616b; margin-bottom: .45rem; }

/* ---------- Impresión ---------- */
@media print {
  .no-print, .tr-sidebar, .tr-topbar { display: none !important; }
  body { background: #fff; }
  .tr-main { padding-top: 0 !important; margin-left: 0 !important; }
}

.tr-sidebar { min-height: 100vh; }

/* Búsqueda en vivo de las listas: mientras llegan los resultados */
.tr-live-busy main.tr-content { cursor: progress; }
.tr-live-busy main.tr-content .table, .tr-live-busy main.tr-content .empty-state { opacity: .55; transition: opacity .15s; }
