/* SelectOR · «Mi empresa»: misma apariencia que la sección Empresas del programa (Theme.cs). */
.emp-page { background: var(--bg); }
.emp-page [hidden] { display: none !important; }   /* las reglas de display no deben anular «hidden» */
.emp-wrap { width: min(1400px, 100% - 32px); margin: 28px auto 40px; }

/* ---------- acceso ---------- */
.emp-login { max-width: 560px; margin: 40px auto; }
.emp-login h1 { font-size: 1.6rem; margin-bottom: .3em; }
.emp-login p { color: var(--subtle); margin: 0 0 18px; }
.emp-field { display: block; margin: 0 0 14px; color: var(--subtle); font-size: .95rem; }
.emp-field input { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; }
.emp-field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.emp-login .btn { border: 0; cursor: pointer; font: inherit; font-weight: 700; padding: 10px 28px; }
.emp-login .btn:disabled { opacity: .6; cursor: default; }
.emp-note { font-size: .88rem; color: var(--subtle); margin-top: 18px; }
.emp-msg { min-height: 1.4em; margin: 12px 0 0; color: var(--subtle); font-size: .95rem; }
.emp-msg.bad { color: #e57373; }

/* ---------- aplicación ---------- */
.emp-app { display: grid; grid-template-columns: 230px 1fr; gap: 0; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; min-height: 640px; }
.emp-side { background: var(--bg-2); padding: 14px 12px; display: flex; flex-direction: column; gap: 12px; border-right: 1px solid var(--border); }
.emp-card { background: var(--surface); border-radius: 10px; padding: 12px; }
.emp-co { display: flex; gap: 10px; align-items: flex-start; }
.emp-co img { width: 38px; height: 38px; border-radius: 50%; flex: none; }
.emp-co-name { font-weight: 700; line-height: 1.25; }
.emp-co-role { color: var(--subtle); font-size: .8rem; margin-top: 3px; }
.emp-card select { width: 100%; margin-top: 10px; padding: 6px 8px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 4px; font: inherit; font-size: .9rem; }
.emp-nav-h { color: var(--subtle); font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin: 6px 6px 0; }
.emp-nav { display: flex; flex-direction: column; gap: 2px; }
.emp-nav-i { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: 8px; color: var(--text);
  background: none; font: inherit; font-size: .92rem; text-align: left; cursor: pointer; }
.emp-nav-i:hover { background: var(--surface); }
.emp-nav-i.on { color: var(--accent-hi); background: rgba(76, 175, 80, .22); }
.emp-nav-i svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.emp-nav-h { margin-top: 10px; }
.emp-user { margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; }
.emp-user b { display: block; margin-bottom: 4px; }
.emp-su { color: var(--warn); font-size: .8rem; font-weight: 700; }
.emp-side-btn { display: block; width: 100%; margin-top: 10px; padding: 8px; border: 0; border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; }
.emp-side-btn:hover { background: var(--surface-2); }

.emp-main { padding: 18px 22px 20px; min-width: 0; }
.emp-main h1 { font-size: 1.5rem; margin: 0 0 12px; }
.emp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.emp-kpi { background: var(--surface); border-radius: 8px; padding: 10px 14px; }
.emp-kpi span { display: block; font-size: .72rem; font-weight: 700; color: var(--subtle); text-transform: uppercase; letter-spacing: .03em; }
.emp-kpi b { display: block; font-size: 1.35rem; margin-top: 2px; }
.emp-kpi b.money { color: var(--accent); }
.emp-kpi b.money.neg { color: #e57373; }

.emp-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--surface-2); margin-bottom: 10px; flex-wrap: wrap; }
.emp-tabs { display: flex; gap: 4px; }
.emp-tabs button { background: none; border: 0; border-bottom: 3px solid transparent; color: var(--subtle); padding: 8px 14px; font: inherit; font-size: .92rem; cursor: pointer; }
.emp-tabs button[aria-selected="true"] { color: var(--accent-hi); font-weight: 700; border-bottom-color: var(--accent); }
.emp-search { margin-bottom: 6px; padding: 7px 12px; width: 240px; max-width: 100%; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; }

.emp-table-box { background: var(--surface); border-radius: 6px; overflow: hidden; }
.emp-scroll { max-height: 470px; overflow: auto; }
.emp-table { width: 100%; border-collapse: collapse; font-size: .9rem; white-space: nowrap; }
.emp-table thead th { position: sticky; top: 0; background: var(--border); color: var(--accent); font-size: .78rem; font-weight: 700; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--accent-dk); z-index: 1; }
.emp-table td { padding: 8px 10px; border-bottom: 1px solid var(--surface-2); }
.emp-table tbody tr:nth-child(even) td { background: var(--border); }
.emp-table tbody tr[data-id] { cursor: pointer; }
.emp-table tbody tr[data-id]:hover td { background: #35393d; }
.emp-table tbody tr.sel td { background: rgba(76, 175, 80, .20); }
.emp-table tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.emp-table tbody tr:focus { outline: none; }
.emp-table tbody tr:focus-visible td { background: var(--surface-2); }
.emp-table tr.empty td { color: var(--subtle); text-align: center; padding: 26px; background: none; }
.emp-table .r, .emp-table th.r { text-align: right; }
.c-sub { color: var(--subtle); }
.c-pos { color: var(--accent); }
.c-neg { color: #e57373; }
.st-ok { color: var(--accent); }
.st-open { color: #7890e2; }
.st-bad { color: #e57373; }

.emp-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.emp-btn { border: 0; border-radius: 8px; padding: 9px 22px; font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; background: var(--surface); color: var(--text); }
.emp-btn:hover { background: var(--surface-2); }
.emp-btn.primary { background: linear-gradient(180deg, var(--accent-hi), var(--accent)); color: #fff; }
.emp-btn.primary:hover { filter: brightness(1.06); }
.emp-btn.danger { color: #e57373; }
.emp-empty { color: var(--subtle); padding: 30px 0; }

/* ---------- detalle del servicio (como «Servicio registrado») ---------- */
.emp-dlg { width: min(560px, 100% - 24px); padding: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); }
.emp-dlg::backdrop { background: rgba(0, 0, 0, .6); }
.emp-dlg header { background: var(--bg-2); padding: 14px 18px; border-bottom: 1px solid var(--border); }
.emp-dlg header h2 { margin: 0; color: var(--accent-hi); font-size: 1.2rem; }
.emp-dlg .dlg-body { padding: 14px 18px 18px; }
.emp-dlg .sub { color: var(--subtle); margin: 0 0 10px; font-size: .92rem; }
.dlg-box { background: var(--surface); border-radius: 10px; padding: 10px 16px; margin-bottom: 10px; }
.dlg-box dl { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; margin: 0; font-size: .92rem; }
.dlg-box dt { color: var(--subtle); }
.dlg-box dd { margin: 0; font-weight: 700; word-break: break-word; }
.dlg-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.dlg-stats div { background: var(--surface); border-radius: 8px; padding: 8px 12px; }
.dlg-stats span { display: block; font-size: .7rem; font-weight: 700; color: var(--subtle); text-transform: uppercase; }
.dlg-stats b { display: block; font-size: 1.2rem; margin-top: 4px; }
.dlg-stats div:nth-child(1) b { color: var(--accent); }
.dlg-stats div:nth-child(2) b { color: #7890e2; }
.dlg-stats div:nth-child(3) b { color: #f0a050; }
/* Cálculo de cada importe, debajo de su fila */
.dlg-money tr.calc td { padding: 0 0 4px 12px; color: var(--subtle); font-size: .8rem; line-height: 1.35; }
.dlg-money tr.calc.sub td { padding-left: 26px; }
.dlg-calc { color: var(--subtle); font-size: .8rem; margin: 4px 0 0; }
.dlg-calc.old { font-style: italic; margin-top: 8px; }
.dlg-money thead td { font-size: .7rem; font-weight: 700; color: var(--subtle); padding-bottom: 6px; }

/* Servicios en tarjetas */
.emp-tabs .cnt { background: var(--surface-2); color: var(--text); border-radius: 9px; padding: 0 6px; margin-left: 2px; font-size: .72rem; font-weight: 400; }
.emp-tabs .cnt:empty { display: none; }
.svc-cards { max-height: 560px; overflow: auto; padding-right: 4px; }
.svc-empty { color: var(--subtle); text-align: center; padding: 30px 0; margin: 0; }
.svc-day { display: flex; align-items: baseline; gap: 10px; margin: 12px 2px 6px; flex-wrap: wrap; }
.svc-day:first-child { margin-top: 2px; }
.svc-day b { font-size: .92rem; }
.svc-day span { color: var(--subtle); font-size: .82rem; }
.svc-day .svc-day-tot { margin-left: auto; }
.svc-day em { font-style: normal; font-weight: 700; }
/* content-visibility: el navegador no maqueta ni pinta las tarjetas que no se ven */
.svc-card { content-visibility: auto; contain-intrinsic-size: auto 122px; background: var(--surface); border-radius: 10px; padding: 10px 14px 10px 16px; margin-bottom: 8px; display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 5px 16px; position: relative; border: 1px solid transparent; cursor: pointer; }
.svc-card::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.svc-card.neg::before { background: #e57373; }
.svc-card.live::before { background: #7890e2; }
.svc-card:hover { background: #323639; border-color: var(--border); }
.svc-card.sel { background: #323639; border-color: var(--accent); }
.svc-card:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 1px; }
.svc-who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.svc-av { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .66rem; font-weight: 700; background: var(--surface-2); color: var(--accent-hi); flex: none; }
.svc-who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.svc-meta { color: var(--subtle); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.svc-strip { grid-column: 1; height: 44px; background: #1c1f24; border-radius: 6px; display: flex; align-items: center; padding: 0 8px; overflow: hidden; }
.svc-strip img { display: block; height: 40px; max-width: 100%; object-fit: contain; object-position: left center; }
.svc-noimg { color: var(--subtle); font-size: .78rem; }
.svc-facts { grid-column: 1; display: flex; flex-wrap: wrap; gap: 3px 16px; color: var(--subtle); font-size: .82rem; }
.svc-facts b { color: var(--text); }
.svc-money { grid-column: 2; grid-row: 1 / span 3; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; text-align: right; border-left: 1px solid var(--surface-2); padding-left: 14px; }
.svc-net { font-size: 1.25rem; font-weight: 700; }
.svc-net.live { color: #7890e2; font-size: 1rem; }
.svc-money small { color: var(--subtle); font-size: .75rem; }
.svc-st { margin-top: 4px; font-size: .75rem; color: var(--accent-hi); }
.svc-st.live { color: #7890e2; }
@media (max-width: 700px) {
  .svc-cards { max-height: none; overflow: visible; padding-right: 0; }
  .svc-card { grid-template-columns: minmax(0, 1fr); }
  .svc-money { grid-column: 1; grid-row: auto; flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 10px; border-left: 0; padding-left: 0; border-top: 1px solid var(--surface-2); padding-top: 6px; }
  .svc-st { margin-top: 0; margin-left: auto; }
  .svc-day .svc-day-tot { margin-left: 0; width: 100%; }
}
.dlg-pax { color: var(--accent-hi); font-weight: 700; margin: 0 0 10px; }
.dlg-money { width: 100%; border-collapse: collapse; font-size: .95rem; }
.dlg-money td { padding: 3px 0; }
.dlg-money .r { text-align: right; }
.dlg-money tfoot td { border-top: 1px solid var(--border); padding-top: 8px; font-weight: 700; font-size: 1.05rem; }
.emp-dlg footer { padding: 0 18px 16px; text-align: right; }

@media (max-width: 900px) {
  .emp-app { grid-template-columns: 1fr; }
  .emp-side { border-right: 0; border-bottom: 1px solid var(--border); }
  .emp-user { margin-top: 0; }
  .emp-kpis { grid-template-columns: repeat(2, 1fr); }
  .emp-main { padding: 14px; }
}
@media (max-width: 520px) {
  .dlg-stats { grid-template-columns: 1fr; }
  .emp-search { width: 100%; }
}

/* ---------- secciones (1.2.35) ---------- */
.emp-h { color: var(--accent); font-size: .8rem; font-weight: 700; letter-spacing: .02em; margin: 14px 2px 8px; }
.emp-bar .emp-h { margin: 0 0 8px; }
.emp-note { font-size: .88rem; color: var(--subtle); margin-top: 12px; }
.st-warn { color: #f0a050; }
.logo-sm { display: inline-block; width: 22px; height: 22px; border-radius: 50%; vertical-align: middle; margin-right: 8px; }
.emp-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.emp-chart { background: var(--surface); border-radius: 8px; padding: 6px 14px 14px; min-width: 0; }
.emp-rank { background: var(--surface); border-radius: 10px; padding: 12px 16px; margin-bottom: 12px; }
.rk-top { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.rk-lbl { font-size: .75rem; font-weight: 700; color: var(--subtle); }
.rk-top b { font-size: 1.35rem; color: var(--accent); }
.rk-step { font-weight: 700; color: var(--subtle); font-size: .9rem; }
.rk-track { height: 8px; background: var(--surface-2); border-radius: 4px; margin: 10px 0 6px; overflow: hidden; }
.rk-track span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; }
.rk-next { margin: 0; color: var(--subtle); font-size: .85rem; }
.emp-pkpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.emp-pkpis .emp-kpi { border-left: 4px solid var(--accent); }
.emp-pkpis .k2 { border-left-color: #64a0f0; } .emp-pkpis .k3 { border-left-color: #b48cf0; }
.emp-pkpis .k4 { border-left-color: #f0a050; } .emp-pkpis .k5 { border-left-color: #50c8b4; }
.emp-pkpis .k1 b { color: var(--accent); } .emp-pkpis .k2 b { color: #64a0f0; } .emp-pkpis .k3 b { color: #b48cf0; }
.emp-pkpis .k4 b { color: #f0a050; } .emp-pkpis .k5 b { color: #50c8b4; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
/* Mi perfil: aire entre las insignias y los módulos de trenes y rutas */
.badges + .emp-charts { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--surface-2); }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border-radius: 10px; background: var(--surface); color: var(--subtle); font-size: .86rem; border: 1px solid transparent; }
.badge .bi { width: 26px; height: 26px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); filter: grayscale(1); opacity: .6; }
.badge.on { color: var(--text); font-weight: 700; border-color: var(--accent-dk); background: rgba(76, 175, 80, .14); }
.badge.on .bi { filter: none; opacity: 1; background: rgba(76, 175, 80, .35); }
.hbar { display: grid; grid-template-columns: minmax(0, 290px) minmax(60px, 1fr) auto; gap: 10px; align-items: center; margin: 8px 0; font-size: .88rem; }
.hb-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-t { height: 12px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.hb-f { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.hb-v { white-space: nowrap; }
@media (max-width: 900px) {
  .emp-charts { grid-template-columns: 1fr; }
  .emp-pkpis { grid-template-columns: repeat(2, 1fr); }
  .emp-pkpis .k5 { grid-column: 1 / -1; }
}

/* ---------- liga del mes ---------- */
.emp-league-info { font-weight: 700; margin: 4px 2px 2px; }
.emp-league-prizes { margin-top: 2px; }
.emp-league-tabs { margin: 6px 0 2px; }
.t-liga td.k { color: var(--accent-hi); font-weight: 700; }

/* ---------- móvil: menú lateral como pestañas y tablas como tarjetas ---------- */
@media (max-width: 900px) {
  .emp-wrap { margin-top: 16px; }
  .emp-app { min-height: 0; }
  .emp-side { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px; }
  .emp-card { grid-column: 1 / -1; }
  .emp-nav { grid-column: 1 / -1; flex-direction: row; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .emp-nav::-webkit-scrollbar { display: none; }
  .emp-nav-h { display: none; }
  .emp-nav-i { width: auto; flex: 1 0 auto; justify-content: center; gap: 7px; padding: 8px 12px; border-radius: 999px; background: var(--surface); white-space: nowrap; }
  .emp-user { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 0; padding-top: 0; }
  .emp-user b { margin: 0; }
  .emp-side-btn { width: auto; margin: 0 0 0 auto; padding: 7px 16px; }
}
@media (max-width: 700px) {
  .emp-main { padding: 12px; }
  .emp-main h1 { font-size: 1.3rem; }
  .emp-kpi { padding: 8px 12px; }
  .emp-kpi b { font-size: 1.15rem; }
  .emp-bar { align-items: stretch; }
  .emp-tabs { overflow-x: auto; scrollbar-width: none; }
  .emp-tabs button { padding: 8px 10px; white-space: nowrap; }
  .emp-search { width: 100%; }
  .emp-actions .emp-btn { flex: 1 1 auto; }
  .emp-actions #svc-detail { display: none; }            /* un toque en la tarjeta abre el detalle */

  .emp-table-box { background: none; border-radius: 0; overflow: visible; }
  .emp-scroll { max-height: none; overflow: visible; }
  .emp-table, .emp-table tbody { display: block; white-space: normal; }
  .emp-table thead { display: none; }
  .emp-table tbody tr { display: grid; gap: 4px 10px; background: var(--surface); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; border: 1px solid transparent; }
  .emp-table tbody tr:nth-child(even) td, .emp-table tbody tr td { background: none !important; }
  .emp-table tbody tr.sel { border-color: var(--accent); background: rgba(76, 175, 80, .14); }
  .emp-table tbody tr.sel td:first-child { box-shadow: none; }
  .emp-table td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
  .emp-table td[data-label]::before { content: attr(data-label); display: block; font-size: .68rem; font-weight: 700; color: var(--subtle); text-transform: uppercase; letter-spacing: .03em; }
  .emp-table .r { text-align: left; }
  .emp-table tr.empty { display: block; background: none; }
  .emp-table tr.empty td { padding: 20px 8px; text-align: center; }

  /* Historial del carné */
  .t-lic tbody tr { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "date st" "inf inf" "det det" "co pts"; }
  .t-lic td:nth-child(1) { grid-area: date; color: var(--subtle); font-size: .85rem; }
  .t-lic td:nth-child(2) { grid-area: inf; font-weight: 700; }
  .t-lic td:nth-child(3) { grid-area: det; font-size: .88rem; }
  .t-lic td:nth-child(4) { grid-area: co; } .t-lic td:nth-child(5) { grid-area: pts; font-weight: 700; }
  .t-lic td:nth-child(6) { grid-area: st; text-align: right; font-size: .85rem; font-weight: 700; }
  .t-lic td:nth-child(1)::before, .t-lic td:nth-child(2)::before, .t-lic td:nth-child(3)::before, .t-lic td:nth-child(6)::before { display: none; }

  /* Rankings */
  .t-rank tbody tr { grid-template-columns: 2.2em repeat(3, minmax(0, 1fr)); grid-template-areas: "pos name name name" ". a b c"; }
  .t-rank td:nth-child(1) { grid-area: pos; color: var(--subtle); font-weight: 700; }
  .t-rank td:nth-child(2) { grid-area: name; font-weight: 700; }
  .t-rank td:nth-child(3) { grid-area: a; }
  .t-rank td:nth-child(4) { grid-area: b; }
  .t-rank td:nth-child(5) { grid-area: c; }
  .t-rank td:nth-child(1)::before, .t-rank td:nth-child(2)::before { display: none; }

  /* Liga del mes */
  .t-liga tbody tr { grid-template-columns: 2.2em repeat(3, minmax(0, 1fr)); grid-template-areas: "pos name name name" ". a b c" ". d e f"; }
  .t-liga td:nth-child(1) { grid-area: pos; color: var(--subtle); font-weight: 700; }
  .t-liga td:nth-child(2) { grid-area: name; font-weight: 700; }
  .t-liga td:nth-child(3) { grid-area: a; } .t-liga td:nth-child(4) { grid-area: b; } .t-liga td:nth-child(5) { grid-area: c; }
  .t-liga td:nth-child(6) { grid-area: d; } .t-liga td:nth-child(7) { grid-area: e; font-weight: 700; }
  .t-liga td:nth-child(1)::before, .t-liga td:nth-child(2)::before { display: none; }
  /* Campeones */
  .t-camp tbody tr { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "mes mes pue" "emp emp emp" "cat res pre"; }
  .t-camp td:nth-child(1) { grid-area: mes; color: var(--subtle); font-size: .85rem; }
  .t-camp td:nth-child(2) { grid-area: cat; } .t-camp td:nth-child(3) { grid-area: pue; text-align: right; font-weight: 700; }
  .t-camp td:nth-child(4) { grid-area: emp; font-weight: 700; } .t-camp td:nth-child(5) { grid-area: res; } .t-camp td:nth-child(6) { grid-area: pre; font-weight: 700; }
  .t-camp td:nth-child(1)::before, .t-camp td:nth-child(3)::before, .t-camp td:nth-child(4)::before { display: none; }

  /* Mi perfil */
  .hbar { grid-template-columns: 1fr auto; gap: 4px 10px; }
  .hb-l { grid-column: 1 / -1; }
  .emp-chart { padding: 6px 12px 12px; }
  .badge { font-size: .8rem; }
  .emp-dlg { max-height: calc(100% - 24px); }
  .dlg-box dl { grid-template-columns: 92px 1fr; }
}
@media (max-width: 480px) {
  .emp-nav-i svg { display: none; }
}
@media (max-width: 380px) {
  .emp-kpis, .emp-pkpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .emp-kpi span { font-size: .64rem; }
}

/* ---------- carné por puntos (Mi perfil) ---------- */
.emp-lic { background: var(--surface); border-radius: 10px; padding: 12px 16px; margin-bottom: 12px; }
.emp-lic .rk-top b { font-size: 1.35rem; }
.lic-ok { color: #81c784; } .lic-warn { color: #f5c542; } .lic-bad { color: #e57373; }
.lic-state { font-weight: 700; font-size: .9rem; }
.lic-bar { display: grid; grid-template-columns: repeat(15, 1fr); gap: 3px; margin: 10px 0 6px; }
.lic-bar span { height: 8px; border-radius: 3px; background: var(--surface-2); position: relative; }
.lic-bar.lic-ok span.on { background: #81c784; } .lic-bar.lic-warn span.on { background: #f5c542; } .lic-bar.lic-bad span.on { background: #e57373; }
.lic-bar span.mark::before { content: ""; position: absolute; left: -2.5px; top: -4px; bottom: -4px; border-left: 1px dotted rgba(200, 205, 210, .6); }
.t-lic ~ .emp-note, .emp-sec[data-sec="perfil"] .t-lic { margin-top: 0; }
.emp-sec[data-sec="perfil"] .emp-charts + .emp-h { margin-top: 22px; }

/* ---------- chat de la empresa ---------- */
.chat-list { background: #1c2024; border-radius: 12px; padding: 12px 16px; height: 480px; overflow-y: auto; display: flex; flex-direction: column; }
.chat-empty { color: var(--subtle); margin: auto; text-align: center; }
.chat-day { display: flex; align-items: center; gap: 10px; color: var(--subtle); font-size: .78rem; margin: 10px 0 4px; }
.chat-day::before, .chat-day::after { content: ""; flex: 1; border-top: 1px solid rgba(255, 255, 255, .12); }
.chat-row { display: flex; flex-direction: column; align-items: flex-start; margin-top: 3px; }
.chat-row.head { margin-top: 10px; }
.chat-row.mine { align-items: flex-end; }
.chat-head { display: flex; align-items: baseline; gap: 7px; margin: 0 2px 3px; font-size: .82rem; }
.chat-row.mine .chat-name { color: var(--accent-hi); }
.chat-role { font-size: .7rem; padding: 1px 5px; border-radius: 4px; }
.chat-role.r-owner { color: #f5c542; background: rgba(245, 197, 66, .16); }
.chat-role.r-manager { color: #a78bfa; background: rgba(167, 139, 250, .16); }
.chat-role.r-superadmin { color: #60a5fa; background: rgba(96, 165, 250, .16); }
.chat-time { color: var(--subtle); font-size: .74rem; }
.chat-bubble { background: var(--surface); border-radius: 10px; padding: 6px 12px; max-width: 70%; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-row.mine .chat-bubble { background: #264a32; }
.chat-bubble.del { font-style: italic; color: var(--subtle); background: transparent; border: 1px dashed rgba(255, 255, 255, .18); }
.chat-edited { display: block; font-size: .72rem; color: var(--subtle); margin-top: 2px; }
.chat-row.mine .chat-edited { text-align: right; }
.chat-line { display: flex; align-items: center; gap: 6px; width: 100%; }
.chat-row.mine .chat-line { justify-content: flex-end; }
.chat-line .chat-bubble { max-width: 70%; }
.chat-acts { display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.chat-row.mine:hover .chat-acts, .chat-row.mine:focus-within .chat-acts { opacity: 1; }
.chat-act { border: 0; border-radius: 6px; background: var(--surface); color: var(--subtle); width: 26px; height: 24px; cursor: pointer; font: inherit; font-size: .8rem; }
.chat-act:hover { background: var(--surface-2); color: var(--text); }
@media (hover: none) { .chat-acts { opacity: 1; } }
.chat-form { display: flex; gap: 10px; margin-top: 10px; position: relative; }
/* Emojis: botón 😊 y selector encima de la caja */
.chat-emoji { flex: none; width: 42px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font-size: 1.25rem; line-height: 1; cursor: pointer; }
.chat-emoji:hover, .chat-emoji[aria-expanded="true"] { background: var(--surface-2); }
.chat-emoji:disabled { opacity: .55; cursor: default; }
.emoji-pop { position: absolute; right: 0; bottom: calc(100% + 8px); width: 312px; max-width: 100%; background: #24282c; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); z-index: 20; }
.emoji-pop[hidden] { display: none; }
.emoji-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 4px; gap: 2px; }
.emoji-tabs button { flex: 1; background: none; border: 0; border-radius: 6px; font-size: 1.1rem; padding: 5px 0; cursor: pointer; }
.emoji-tabs button[aria-selected="true"] { background: var(--surface-2); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); padding: 6px; height: 222px; overflow-y: auto; align-content: start; }
.emoji-grid button { background: none; border: 0; border-radius: 6px; font-size: 1.45rem; line-height: 1; padding: 5px 0; cursor: pointer; }
.emoji-grid button:hover, .emoji-grid button:focus-visible { background: var(--surface-2); outline: none; }
.chat-bubble.big { font-size: 2rem; line-height: 1.15; padding: 4px 10px; }
.chat-input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.chat-input:disabled, .chat-form .emp-btn:disabled { opacity: .55; cursor: default; }
@media (max-width: 700px) {
  .chat-list { height: calc(100vh - 330px); min-height: 320px; padding: 10px; }
  .chat-bubble, .chat-line .chat-bubble { max-width: 88%; }
  .emp-lic .rk-top b { font-size: 1.15rem; }
}

/* ---------- mapa de la ruta con los trenes en directo ---------- */
.map-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.map-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.map-title b { font-size: 1.05rem; }
.map-count { color: var(--subtle); font-size: .9rem; }
.map-tools { display: flex; gap: 6px; }
.map-btn { min-width: 38px; padding-left: 0; padding-right: 0; font-size: 1.1rem; line-height: 1; }
.map-box { display: grid; grid-template-columns: 1fr 250px; gap: 12px; }
#map-canvas { display: block; width: 100%; height: calc(100vh - 300px); min-height: 460px; max-height: 820px; border-radius: 12px;
  background: #1c2024; touch-action: none; cursor: grab; }
#map-canvas:active { cursor: grabbing; }
.map-legend { background: var(--surface); border-radius: 12px; padding: 12px; overflow-y: auto; max-height: calc(100vh - 300px); min-height: 460px; }
.map-legend .emp-h { margin-top: 0; }
.map-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.map-empty { color: var(--subtle); font-size: .88rem; }
.map-it { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; background: none; border: 1px solid transparent; border-radius: 8px;
  padding: 7px 8px; color: var(--text); font: inherit; cursor: pointer; }
.map-it:hover { background: var(--surface-2); }
.map-it.on { border-color: rgba(255, 255, 255, .35); background: var(--surface-2); }
.map-dot { flex: none; width: 11px; height: 11px; border-radius: 50%; margin-top: 5px; }
.map-tx { display: flex; flex-direction: column; min-width: 0; }
.map-tx b { overflow-wrap: anywhere; }
.map-it.me .map-tx b { color: var(--accent-hi); }
.map-tx small { color: var(--subtle); font-size: .8rem; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .map-box { grid-template-columns: 1fr; }
  #map-canvas { height: 62vh; min-height: 340px; }
  .map-legend { max-height: none; min-height: 0; }
}

/* ---------- 1.2.50: al día con SelectOR y administración del superadmin ---------- */
.emp-app { position: relative; }
.emp-chip { display: inline-block; margin-top: 4px; padding: 1px 7px; border: 0; border-radius: 6px; background: var(--surface-2); color: var(--subtle);
  font: inherit; font-size: .72rem; cursor: pointer; }
.emp-chip:hover { color: var(--text); }
.emp-co .emp-chip { display: block; }
.emp-user .emp-chip { margin: 0 0 6px; }
.emp-name-row { display: flex; align-items: center; gap: 8px; }
.emp-name-row b { margin: 0 !important; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.emp-bell { position: relative; flex: none; width: 34px; height: 30px; border: 0; border-radius: 8px; background: var(--surface); cursor: pointer; font-size: 1rem; line-height: 1; }
.emp-bell:hover, .emp-bell[aria-expanded="true"] { background: var(--surface-2); }
.bell-n { position: absolute; top: -5px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #e05252; color: #fff;
  font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center; }
.bell-pop { position: absolute; z-index: 30; width: 350px; max-width: calc(100% - 16px); max-height: 470px; display: flex; flex-direction: column;
  background: #24282c; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.bell-h { padding: 10px 14px; font-weight: 700; border-bottom: 1px solid var(--border); }
.bell-list { overflow-y: auto; padding: 6px; }
.bell-empty { color: var(--subtle); text-align: center; padding: 20px 8px; margin: 0; }
.bell-it { display: flex; gap: 10px; width: 100%; text-align: left; padding: 8px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; cursor: pointer; }
.bell-it:hover { background: var(--surface); }
.bell-it.new { background: rgba(76, 175, 80, .10); }
.bell-ic { flex: none; font-size: 1.15rem; line-height: 1.4; }
.bell-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: .86rem; }
.bell-tx span { color: var(--subtle); overflow-wrap: anywhere; }
.bell-tx small { color: var(--subtle); font-size: .74rem; }
.bell-res { font-style: normal; color: var(--accent); }
.kpi-sub { display: block; color: var(--subtle); font-size: .74rem; margin-top: 2px; min-height: 1em; }

/* Servicios anulados y detalle */
.svc-card.annulled::before { background: #8a8f94; }
.svc-card.annulled .svc-facts, .svc-card.annulled .svc-strip img { opacity: .6; }
.svc-card.annulled .svc-net { text-decoration: line-through; }
.svc-st.annul { color: #e57373; font-weight: 700; letter-spacing: .04em; cursor: help; }
.svc-st.bad { color: #e57373; }
.dlg-annul { display: flex; flex-direction: column; gap: 3px; background: rgba(229, 115, 115, .12); border: 1px solid rgba(229, 115, 115, .45); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 10px; }
.dlg-annul b { color: #e57373; }
.dlg-annul small { color: var(--subtle); }
.dlg-stops .emp-h { margin: 2px 0 6px; }
.dlg-stop { display: grid; grid-template-columns: 52px 1fr auto; gap: 8px; font-size: .9rem; padding: 2px 0; }
.dlg-notes { background: var(--surface); border-radius: 10px; padding: 8px 14px; margin: 0 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Diálogo con campos */
.emp-form .emp-field input { margin-top: 6px; }
.dlg-ctx { font-size: .84rem; }
.dlg-live { color: var(--accent-hi); font-size: .88rem; min-height: 1.2em; margin: 0; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; }
.emp-btn.danger-solid { background: #b84646; color: #fff; }
.emp-btn.danger-solid:hover { background: #c95252; }
.emp-btn.sm { padding: 5px 12px; font-size: .82rem; }
.emp-btn:disabled { opacity: .55; cursor: default; }

/* Chat: permisos */
.chat-perm { background: var(--surface); border-radius: 10px; padding: 8px 14px; margin-bottom: 10px; }
.chat-perm summary { cursor: pointer; font-weight: 700; color: var(--accent-hi); }
.chat-perm-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.chat-perm-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center; font-size: .9rem; }
.chat-perm .emp-note { margin-top: 8px; }

/* Mi perfil: carné de maquinista */
.drv-card { display: flex; gap: 16px; align-items: center; background: linear-gradient(135deg, #263a2b, var(--surface)); border: 1px solid var(--accent-dk);
  border-radius: 12px; padding: 12px 16px; margin-bottom: 12px; }
.drv-ph { width: 66px; height: 88px; flex: none; border-radius: 8px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.drv-ph img { width: 100%; height: 100%; object-fit: cover; }
.drv-ph span { font-size: 1.5rem; font-weight: 700; color: var(--accent-hi); }
.drv-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.drv-name { font-size: 1.3rem; }
.drv-sub, .drv-id { color: var(--subtle); font-size: .86rem; }

/* Acceso: clave de recuperación */
.emp-link { display: inline-block; margin: 10px 0 0; padding: 0; border: 0; background: none; color: var(--accent-hi); font: inherit; font-size: .92rem; cursor: pointer; text-decoration: underline; }
.emp-forgot { margin-top: 6px; }
.emp-forgot h2 { font-size: 1.15rem; margin: 0 0 .4em; }
.emp-forgot .btn { border: 0; cursor: pointer; font: inherit; font-weight: 700; padding: 10px 28px; margin-right: 14px; }
.emp-forgot .btn:disabled { opacity: .6; cursor: default; }

/* Administración */
.emp-nav-i .adm-n { margin-left: auto; background: #e05252; color: #fff; border-radius: 9px; padding: 0 6px; font-size: .7rem; font-weight: 700; }
.adm-h { color: var(--warn); }
.adm-intro { margin: 0 2px 10px; }
/* Acciones de cada fila: a la derecha y siempre a la vista aunque la tabla se desplace a lo ancho */
.adm-table td.adm-acts { position: sticky; right: 0; background: var(--surface); box-shadow: -8px 0 8px -8px rgba(0, 0, 0, .6); }
.adm-table tbody tr:nth-child(even) td.adm-acts { background: var(--border); }
.adm-table thead th:last-child { position: sticky; right: 0; z-index: 2; }
.adm-acts-in { display: flex; gap: 6px; justify-content: flex-end; }
.adm-table td { vertical-align: middle; }
.adm-table td:not(.adm-acts) { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.t-users td:nth-child(4) { white-space: normal; min-width: 150px; }   /* sus empresas, en varias líneas */
/* Revisión → Infracciones · Alegaciones (alegaciones.sql) */
.adm-modes { margin: 0 0 12px; }
.adm-modes .mcnt { color: var(--warn); font-weight: 700; }
.adm-mode[hidden] { display: none; }
.adm-table td.ap-body { white-space: normal; min-width: 240px; max-width: 420px; font-style: italic; line-height: 1.45; }
.t-ap td:nth-child(6) { white-space: normal; min-width: 140px; max-width: 280px; }
.t-lic td.lic-ap { white-space: normal; max-width: 260px; }
.dlg-annul-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -4px 0 12px; }
.dlg-annul-acts:empty { display: none; }
.mono { font-family: Consolas, "Courier New", monospace; letter-spacing: .03em; }
.aj-page { background: var(--surface); border-radius: 10px; padding: 6px 16px 16px; }
.aj-page .emp-h { margin-top: 10px; }
.aj-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; margin-bottom: 8px; }
.aj-grid .emp-field input { background: var(--bg); }
.aj-check { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; font-weight: 700; cursor: pointer; }
.aj-check input { width: 18px; height: 18px; accent-color: var(--accent); }
@media (max-width: 900px) {
  /* Menú en pastillas: nombre y campanita en una línea; ID, superadmin y «Cerrar sesión» debajo */
  .emp-name-row { flex: 1 1 100%; }
  .emp-name-row b { font-size: 1.05rem; }
  .emp-user .emp-chip { margin: 0; }
  .emp-nav-i.adm-i { border: 1px solid rgba(240, 160, 32, .45); }
  .emp-nav-i.adm-i.on { border-color: var(--accent); }
  .bell-pop { position: fixed; left: 8px !important; right: 8px; top: 70px !important; bottom: auto !important; width: auto; max-width: none; max-height: calc(100vh - 90px); }
}
@media (max-width: 700px) {
  /* Tablas de administración como tarjetas de dos columnas, con las acciones abajo */
  .adm-table tbody tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-table tbody td.adm-acts { grid-column: 1 / -1; }
  .adm-table tbody td.adm-acts::before { display: none; }
  .t-rev td:nth-child(4), .t-loan td:nth-child(2), .t-users td:nth-child(1), .t-cos td:nth-child(1) { grid-column: 1 / -1; font-weight: 700; font-size: 1rem; order: -1; }
  .t-rev td:nth-child(4)::before, .t-loan td:nth-child(2)::before, .t-users td:nth-child(1)::before, .t-cos td:nth-child(1)::before { display: none; }
  .t-rev td:nth-child(5), .t-loan td:nth-child(5), .t-users td:nth-child(2), .t-users td:nth-child(4) { grid-column: 1 / -1; }
  .adm-intro { font-size: .84rem; }
  .aj-page { padding: 4px 12px 14px; }
  .emp-form .emp-field { margin-bottom: 10px; }
  .dlg-foot .emp-btn { flex: 1 1 auto; }
  .aj-grid { grid-template-columns: 1fr; }
  .adm-table td.adm-acts { position: static; box-shadow: none; background: none; }
  .adm-acts-in { justify-content: flex-start; flex-wrap: wrap; margin-top: 4px; }
  .adm-table td:not(.adm-acts) { max-width: none; }
  .chat-perm-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 6px 0; border-top: 1px solid var(--surface-2); }
  .chat-perm-row:first-child { border-top: 0; }
  .chat-perm-row > * { justify-self: start; }
  .chat-perm-row > :nth-child(2), .chat-perm-row > button { justify-self: end; }
  .drv-ph { width: 54px; height: 72px; }
}

/* ---- mapa del recorrido del servicio (detalle) ---- */
.dlg-map .emp-h { margin: 0; }
.dlg-map-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 8px; }
.dlg-map-big { border: 0; border-radius: 7px; padding: 4px 10px; background: var(--surface-2); color: var(--text); font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.dlg-map-big:hover { background: var(--border); }
.dlg-map-cv { display: block; width: 100%; height: 260px; border-radius: 8px; background: #1e2226; cursor: zoom-in; }
.dlg-map-key { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 2px; font-size: .8rem; color: var(--subtle); }
.dlg-map-key span { display: inline-flex; align-items: center; gap: 6px; }
.dlg-map-key i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dlg-map-key .mk-line { width: 16px; height: 4px; border-radius: 2px; background: #f0b446; }
.dlg-map-key .mk-start { background: #66bb6a; }
.dlg-map-key .mk-end { background: #ef5350; }
.dlg-map-key .mk-stop { width: 8px; height: 8px; background: #fff5e1; border: 2px solid #f0b446; }
.dlg-mapbig { width: min(1200px, 96vw); height: min(820px, 92vh); max-width: none; max-height: none; padding: 12px 14px; box-sizing: border-box; overflow: hidden; display: none; flex-direction: column; gap: 8px; }
.dlg-mapbig[open] { display: flex; }
.dlg-mapbig-h { margin: 0; }
.dlg-mapbig .dlg-map-cv { flex: 1; height: auto; min-height: 0; cursor: grab; touch-action: none; }
.dlg-mapbig .dlg-map-cv:active { cursor: grabbing; }
.dlg-mapbig-f { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; }
.dlg-mapbig-f .dlg-map-key { margin: 0; }
.dlg-map-hint { font-size: .8rem; color: var(--subtle); }
@media (max-width: 700px) {
  .dlg-map-cv { height: 200px; }
  .dlg-mapbig { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; padding: 10px; }
  .dlg-map-hint { display: none; }
}

/* ---- rutas autorizadas: Empresas → Rutas y Catálogo de rutas (superadmin) ---- */
.rt-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 10px; }
.rt-card { display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid transparent; border-radius: 12px; padding: 12px 14px; color: var(--text); font: inherit; }
button.rt-card { cursor: pointer; }
button.rt-card:hover { background: var(--surface-2); }
.rt-card.on { border-color: var(--accent); background: #2a3a2e; }
.rt-top { display: flex; align-items: center; gap: 10px; }
.rt-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .98rem; }
.rt-pill { flex: none; font-size: .74rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: rgba(255, 255, 255, .08); white-space: nowrap; }
.rt-sub { margin-top: 4px; font-size: .82rem; color: var(--subtle); }
.rt-note { margin-top: 4px; font-size: .82rem; font-style: italic; color: #cdd2d6; }
.rt-reason { margin-top: 4px; font-size: .82rem; color: #f3a1a1; }
.rt-warn { margin-top: 4px; font-size: .82rem; color: #f3cc6b; }
.cat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; }
.cat-head .adm-intro { flex: 1 1 420px; margin-top: 0; }
.cat-mode { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cat-mode-l { font-size: .74rem; font-weight: 700; color: var(--subtle); margin-right: 4px; }
.cat-chip { border: 0; border-radius: 99px; padding: 6px 14px; background: var(--surface); color: var(--subtle); font: inherit; font-size: .86rem; font-weight: 700; cursor: pointer; }
.cat-chip:hover { background: var(--surface-2); }
.cat-chip.on { background: var(--accent); color: #fff; }
.cat-wrap { display: grid; grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 10px; }
.cat-list { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 300px); min-height: 200px; overflow-y: auto; padding-right: 4px; }
.cat-left, .cat-right { min-width: 0; }
.cat-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cat-title h3 { margin: 0; font-size: 1.35rem; }
.cat-sub { margin: 4px 0 0; font-size: .84rem; color: var(--subtle); overflow-wrap: anywhere; }
.cat-note { margin: 8px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--surface); font-style: italic; color: #cdd2d6; font-size: .88rem; }
.cat-alert { margin: 5px 0; padding: 7px 12px; border-radius: 7px; background: #3a2f12; color: #f3cc6b; font-size: .88rem; }
.cat-alert.bad { background: #3a1d1d; color: #f3a1a1; }
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.cat-tile { background: var(--surface); border-radius: 8px; padding: 8px 10px; }
.cat-tile small { display: block; font-size: .7rem; font-weight: 700; color: var(--subtle); letter-spacing: .02em; }
.cat-tile b { display: block; font-size: 1.15rem; margin-top: 2px; }
.cat-tile b.bad { color: #f08080; }
.cat-ver { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 8px; }
.cat-ver .emp-h { margin: 0; }
.cat-sel { flex: 1 1 260px; min-width: 0; width: 100%; max-width: 560px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .88rem; }
.cat-plan .cat-cv { height: 420px; }
.cat-plan-empty { margin: 0; padding: 40px 16px; text-align: center; background: #1e2226; border-radius: 8px; }
.cat-cos { display: flex; flex-direction: column; gap: 8px; }
.cat-co { background: var(--surface); border-radius: 10px; padding: 10px 14px; }
.cat-co .rt-name { flex: 0 1 auto; }
.cat-kind { font-size: .8rem; color: var(--subtle); }
.cat-kind.req { color: #f0b429; }
.cat-kind.prop { color: #60a5fa; }
.rt-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cat-co-svc { margin-left: auto; font-size: .8rem; color: var(--subtle); white-space: nowrap; }
.cat-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.rt-key i { display: inline-block; width: 16px; height: 8px; border-radius: 2px; }
.rt-key .pk-st { width: 10px; height: 10px; border-radius: 50%; background: rgb(205, 228, 250); box-shadow: inset 0 0 0 2px rgb(70, 150, 230); }
.rt-key .pk-pl { background: rgb(70, 150, 230); box-shadow: 0 0 0 1.5px rgb(205, 228, 250); }
.rt-key .pk-sd { background: repeating-linear-gradient(90deg, rgba(176, 138, 240, .9) 0 5px, transparent 5px 8px); }
.rt-key .pk-dm { width: 9px; height: 9px; border-radius: 1px; transform: rotate(45deg); background: rgb(240, 242, 244); }
.rt-key .pk-pu { width: 10px; height: 10px; border-radius: 3px; background: rgb(214, 92, 160); }
.rt-key .pk-en { width: 8px; height: 8px; border-radius: 1px; background: rgb(200, 210, 214); }
@media (max-width: 900px) {
  .cat-wrap { grid-template-columns: minmax(0, 1fr); }
  .cat-list { max-height: 46vh; }
  .cat-plan .cat-cv { height: 300px; }
}
@media (max-width: 700px) {
  .rt-list { grid-template-columns: 1fr; }
  .cat-acts .emp-btn { flex: 1 1 auto; }
  .cat-tile b { font-size: 1.05rem; }
}
