:root{font-family:Segoe UI,system-ui,sans-serif;color-scheme:dark;background:#0b1018;color:#f7f9fc}
*{box-sizing:border-box}body{margin:0;background:#0b1018}main{max-width:980px;margin:auto;padding:16px 14px 100px}
header{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px}
h1{font-size:22px;margin:0}h2,h3{margin-top:0}small,.muted{color:#93a1b5}.header-actions{display:flex;align-items:center;gap:8px}
.state{font-size:11px;padding:7px 10px;border-radius:999px;background:#475569}.state.on{background:#15803d}.state.reconnect{background:#b45309}
.logout{min-height:32px;padding:6px 10px;background:#334155;font-size:11px}
.card,.device,.panel{background:#151d29;border:1px solid #29374b;border-radius:15px;padding:14px;margin-bottom:11px}
.login-card{max-width:600px;margin:auto}.boot,.empty{text-align:center;color:#aab6c7;padding:28px}
.spinner{width:28px;height:28px;border:3px solid #334155;border-top-color:#3b82f6;border-radius:50%;margin:0 auto 12px;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}
label{display:block;font-size:12px;color:#b7c1cf;margin-top:8px}
input,select{width:100%;padding:11px;margin:5px 0;border-radius:10px;border:1px solid #344258;background:#0d1420;color:white}
input[type=checkbox]{width:auto;transform:scale(1.15);margin-right:6px}
button{border:0;border-radius:10px;background:#2563eb;color:white;font-weight:800;min-height:42px;padding:0 14px;cursor:pointer}
button.secondary{background:#334155}button.danger{background:#991b1b}button.good{background:#166534}
#login{width:100%;margin-top:8px}.error{color:#fca5a5;font-size:12px;margin-top:8px;min-height:18px}
.device-head,.row-between{display:flex;justify-content:space-between;align-items:center;gap:10px}.device-title{font-weight:800}.device-state{font-size:11px;color:#a6b1c1}
.meter{height:13px;background:#090e15;border:1px solid #334155;border-radius:999px;overflow:hidden;margin:10px 0}.meter i{display:block;height:100%;width:0;background:#eab308}
.controls{display:grid;grid-template-columns:1fr 2fr;gap:8px 12px;align-items:center;font-size:12px}.controls input{margin:0}
.ptt{width:100%;min-height:68px;margin-top:10px;background:#334155}.ptt.on{background:#dc2626}
.master-select{display:flex;align-items:center;gap:8px;font-size:12px;margin-top:10px}.master-select input{width:20px;height:20px}
.master-ptt{position:fixed;left:50%;bottom:62px;transform:translateX(-50%);width:min(950px,calc(100% - 28px));min-height:66px;background:#7c2d12;z-index:5}.master-ptt.on{background:#dc2626}
nav{position:fixed;bottom:0;left:0;right:0;background:#101722;border-top:1px solid #29374b;display:flex;gap:8px;padding:7px 10px;z-index:4}
nav button{flex:1;background:#1e293b;font-size:12px}.navactive{background:#2563eb!important}

.admin-tabs{display:flex;gap:7px;overflow-x:auto;padding-bottom:8px;margin-bottom:10px}.admin-tabs button{white-space:nowrap;background:#1e293b;font-size:11px}.admin-tabs .active{background:#2563eb}
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin-bottom:12px}
.stat{background:#111927;border:1px solid #29374b;border-radius:13px;padding:14px}.stat b{display:block;font-size:28px}.stat span{color:#93a1b5;font-size:12px}
.toolbar{display:flex;gap:8px;justify-content:space-between;align-items:center;flex-wrap:wrap;margin-bottom:10px}.toolbar h2{margin:0}
.table-wrap{overflow-x:auto}.table{width:100%;border-collapse:collapse;font-size:13px}.table th,.table td{padding:10px 8px;border-bottom:1px solid #273448;text-align:left;vertical-align:middle}.table th{color:#9fb0c7;font-size:11px}
.pill{display:inline-block;padding:4px 7px;border-radius:999px;background:#334155;font-size:10px;font-weight:800}.pill.on{background:#166534}.pill.off{background:#7f1d1d}
.actions{display:flex;gap:6px;flex-wrap:wrap}.actions button{min-height:32px;padding:0 9px;font-size:11px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}.checkrow{display:flex;gap:14px;flex-wrap:wrap;align-items:center}.checkrow label{margin:0}
.endpoint{display:grid;grid-template-columns:140px 1fr auto auto auto;gap:9px;align-items:center;padding:10px 0;border-bottom:1px solid #273448}.endpoint:last-child{border-bottom:0}
.route-card{padding:10px;border:1px solid #2b3b51;border-radius:10px;margin:7px 0}.small{font-size:11px;color:#9fb0c7}
.modal{position:fixed;inset:0;background:rgba(0,0,0,.72);display:flex;align-items:center;justify-content:center;z-index:20;padding:16px}.modal-box{width:min(760px,100%);max-height:90vh;overflow:auto;background:#111927;border:1px solid #334155;border-radius:16px;padding:18px;position:relative}.modal-close{position:absolute;right:10px;top:10px;min-height:32px;width:32px;padding:0;background:#334155;font-size:20px}
.form-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}
pre.audit{white-space:pre-wrap;font-size:11px;background:#0a1019;border-radius:8px;padding:8px}
@media(max-width:700px){
  .grid2{grid-template-columns:1fr}.endpoint{grid-template-columns:1fr}.endpoint>*{width:100%}
  .table{font-size:12px}main{padding-left:10px;padding-right:10px}
}

/* V1.1.1: el atributo hidden debe ganar a display:flex del modal */
.modal[hidden]{display:none!important}

.remember-row{display:flex;align-items:center;gap:8px;margin:10px 0 12px;color:#b7c1cf}.remember-row input{width:auto;margin:0}



/* V1.2.3 - VU y controles de audio reales */
.meter-row{display:grid;grid-template-columns:28px 1fr;align-items:center;gap:8px;margin:9px 0}
.meter-row>span{font-size:10px;font-weight:900;color:#93a1b5;text-align:center}
.meter-row .meter{margin:0}
.meter i{transition:width .08s linear;background:#22c55e}
.meter i.hot{background:#eab308}
.meter i.clip{background:#ef4444}
.control-value{float:right;color:#e2e8f0;font-size:10px}
.device-state{min-width:54px;text-align:right;font-weight:800}
.controls input[type=range]{accent-color:#3b82f6}
.controls input[type=checkbox]{justify-self:start}


/* V1.2.4 - sincronización en vivo */
.toast{
  position:fixed;left:50%;top:14px;transform:translate(-50%,-20px);
  opacity:0;pointer-events:none;z-index:50;
  background:#111827;border:1px solid #475569;border-radius:999px;
  padding:9px 14px;font-size:12px;font-weight:800;
  box-shadow:0 10px 30px rgba(0,0,0,.35);
  transition:opacity .18s ease,transform .18s ease;
}
.toast.show{opacity:1;transform:translate(-50%,0)}


/* V1.2.5 - controles de operador */
.internal-device{
  border-color:#36506f;
  background:linear-gradient(180deg,#162335,#151d29);
}
.internal-device .device-title::before{
  content:"INT";
  display:inline-block;
  margin-right:8px;
  padding:3px 6px;
  border-radius:6px;
  background:#1d4ed8;
  font-size:9px;
  vertical-align:1px;
}
.floor-busy{
  border-color:#b45309!important;
  box-shadow:0 0 0 1px rgba(180,83,9,.22) inset;
}
.floor-busy .device-state{color:#fbbf24}
.headset-control{
  min-width:190px;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:4px;
}
.headset-control .remember-row{margin:0}
.headset-control select{
  width:auto;
  min-width:170px;
  padding:7px 9px;
  margin:0;
  font-size:11px;
}
@media(max-width:700px){
  .row-between{align-items:flex-start}
  .headset-control{min-width:0;align-items:stretch}
  .headset-control select{width:100%;min-width:0}
  .header-actions{flex-wrap:wrap;justify-content:flex-end}
}


/* V1.3.0 - PTT táctil robusto */
.ptt,.master-ptt{
  -webkit-user-select:none!important;user-select:none!important;
  -webkit-touch-callout:none!important;touch-action:none!important;
  -webkit-tap-highlight-color:transparent;
  cursor:pointer;overscroll-behavior:contain;
}
.basic-mode .device .ptt,.basic-mode .master-select{display:none!important}
.basic-mode .master-ptt{min-height:86px;font-size:24px}
.gate-pair{border-top:1px solid #2b3b51;margin-top:9px;padding-top:8px}
.event-card.active-event{border-color:#15803d;box-shadow:0 0 0 1px rgba(21,128,61,.25) inset}
.event-meta{display:flex;gap:12px;flex-wrap:wrap;color:#93a1b5;font-size:11px}


/* V1.3.1 - móvil compacto, desplegables, PTT fijable y safe-area */
html,body{min-height:100%;min-height:100dvh}
main{padding-bottom:calc(110px + env(safe-area-inset-bottom,0px));padding-top:calc(16px + env(safe-area-inset-top,0px))}
nav{padding-bottom:calc(7px + env(safe-area-inset-bottom,0px))}
.master-ptt{bottom:calc(62px + env(safe-area-inset-bottom,0px))}
.device{padding:10px 12px}
.compact-identity{padding:10px 12px}
.compact-head{display:grid;grid-template-columns:36px minmax(0,1fr) auto;align-items:center;gap:8px}
.device-toggle{min-height:32px;height:32px;width:32px;padding:0;background:#273448;font-size:18px;line-height:1}
.device-title{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.device-details{max-height:900px;overflow:hidden;opacity:1;transition:max-height .18s ease,opacity .15s ease,margin .18s ease}
.device.collapsed .device-details{max-height:0;opacity:0;margin:0;pointer-events:none}
.device .always-visible{display:grid!important}
.ptt-row{display:grid;grid-template-columns:minmax(76px,.28fr) minmax(0,1fr);gap:8px;margin-top:8px}
.ptt-row .ptt{margin-top:0;min-height:58px}
.ptt-row:not(:has(.ptt-lock)){grid-template-columns:1fr}
.ptt-lock{min-height:58px;padding:0 8px;background:#334155;font-size:11px}
.ptt-lock.on{background:#b45309;box-shadow:0 0 0 2px rgba(251,191,36,.25) inset}
.aviso-device{border-color:#6b4f1d;background:linear-gradient(180deg,#241d12,#151d29)}
.aviso-device .device-title::before{content:"AVISO";display:inline-block;margin-right:7px;padding:3px 6px;border-radius:6px;background:#a16207;font-size:9px;vertical-align:1px}
.basic-mode .device .ptt-row{display:none!important}
@media(max-width:700px){
  main{padding-left:8px;padding-right:8px}
  header{align-items:flex-start}
  h1{font-size:18px}
  .header-actions{gap:5px}
  .state{padding:6px 7px;font-size:9px}
  .device{margin-bottom:7px}
  .meter-row{margin:7px 0}
  .ptt-row .ptt,.ptt-lock{min-height:54px}
}


/* V1.3.1.1 - RX/TX visibles incluso plegado + MPTT junto al nombre */
.device-title-line{
  min-width:0;
  display:flex;
  align-items:center;
  gap:7px;
}
.device-title-line .device-title{
  flex:0 1 auto;
  min-width:0;
}
.mptt-badge{
  display:none;
  flex:0 0 auto;
  padding:2px 5px;
  border-radius:5px;
  background:#991b1b;
  border:1px solid #ef4444;
  color:#fff;
  font-size:9px;
  line-height:1.15;
  font-weight:900;
  letter-spacing:.3px;
  box-shadow:0 0 0 1px rgba(239,68,68,.15) inset;
}
.mptt-badge.on{display:inline-flex}
.compact-meter-strip{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  margin:7px 0 2px;
}
.compact-meter-strip .compact-meter{
  margin:0;
  min-width:0;
}
.compact-meter-strip .compact-meter:only-child{
  grid-column:1/-1;
}
@media(max-width:420px){
  .compact-meter-strip{gap:5px}
  .compact-meter-strip .meter-row{grid-template-columns:22px minmax(0,1fr);gap:4px}
  .compact-meter-strip .meter-row>span{font-size:9px}
  .mptt-badge{font-size:8px;padding:2px 4px}
}


/* ===== V1.4.0 · Administración de audio híbrida ===== */
.comm-admin-hero{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;background:linear-gradient(135deg,#172033,#101722);border:1px solid #30415b;border-radius:18px;padding:18px;margin-bottom:12px}
.comm-admin-hero h2{margin:3px 0 7px;font-size:25px}.comm-admin-hero p{max-width:760px;margin:0;color:#afbdd0;line-height:1.45}.eyebrow{font-size:10px;letter-spacing:1.5px;color:#7dd3fc;font-weight:900}
.comm-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin-bottom:11px}.comm-stats>div{background:#151d29;border:1px solid #29374b;border-radius:13px;padding:12px}.comm-stats b{display:block;font-size:24px}.comm-stats span{font-size:11px;color:#9fb0c7}
.comm-legend{display:flex;gap:14px;align-items:center;flex-wrap:wrap}.audio-mode-badge{display:inline-flex;align-items:center;padding:4px 8px;border-radius:999px;font-size:10px;font-weight:900;letter-spacing:.4px;white-space:nowrap}.audio-mode-badge.half{background:#102b45;border:1px solid #2875a7;color:#93d5ff}.audio-mode-badge.full{background:#173827;border:1px solid #36a269;color:#94f2ba}
.comm-group-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(310px,1fr));gap:11px;margin-bottom:12px}.comm-group-card{background:#151d29;border:1px solid #29374b;border-left:4px solid #2875a7;border-radius:15px;padding:14px}.comm-group-card.mode-full{border-left-color:#36a269}.comm-group-top{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}.comm-group-top h3{margin:0 0 4px;font-size:18px}.comm-behaviour{display:grid;grid-template-columns:70px 1fr;gap:9px;margin:13px 0;padding:10px;background:#101722;border-radius:10px;font-size:12px}.comm-behaviour span{color:#aebdd0}.comm-link-list{display:flex;flex-wrap:wrap;gap:6px;min-height:30px;margin-bottom:11px}.bridge-chip{padding:5px 7px;border-radius:8px;background:#111a27;border:1px solid #2d3b50;font-size:10px}.bridge-chip.full{border-color:#2f7650;color:#a6f4c5}.bridge-chip.half{border-color:#2b6288;color:#a8d9ff}
.comm-matrix-panel{margin-top:14px}.audio-matrix th,.audio-matrix td{text-align:center;min-width:64px}.audio-matrix th:first-child{text-align:left;position:sticky;left:0;background:#151d29;z-index:1}.matrix-row-btn{padding:5px 7px;background:transparent;border:0;color:#dce7f6;text-align:left}.matrix-self{font-size:9px;font-weight:900;color:#8294ad}.matrix-link{display:inline-block;padding:3px 5px;border-radius:6px;font-size:9px;font-weight:900}.matrix-link.half{background:#102b45;color:#93d5ff}.matrix-link.full{background:#173827;color:#94f2ba}
.link-editor-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.link-editor-head h2{margin:3px 0 5px}.bridge-editor-row{display:grid;grid-template-columns:minmax(150px,1.4fr) minmax(150px,1fr) minmax(120px,.8fr) auto;gap:8px;align-items:center;padding:9px 0;border-bottom:1px solid #243247}.bridge-editor-row:last-child{border-bottom:0}.bridge-editor-row select{margin:0}.bridge-help p{line-height:1.7}.mode-picker{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:7px 0 12px}.mode-picker label{cursor:pointer}.mode-picker input{position:absolute;opacity:0;pointer-events:none}.mode-picker span{display:block;background:#101722;border:1px solid #2c3c52;border-radius:12px;padding:12px}.mode-picker small{display:block;color:#92a5bf;margin-top:4px}.mode-picker input:checked+span{border-color:#3b82f6;box-shadow:0 0 0 2px rgba(59,130,246,.14)}.mode-picker input[value="full"]:checked+span{border-color:#36a269;box-shadow:0 0 0 2px rgba(54,162,105,.14)}
@media(max-width:720px){.comm-admin-hero{flex-direction:column}.comm-stats{grid-template-columns:repeat(2,1fr)}.comm-group-grid{grid-template-columns:1fr}.bridge-editor-row{grid-template-columns:1fr 1fr}.bridge-editor-row>div:first-child{grid-column:1/-1}.mode-picker{grid-template-columns:1fr}.comm-legend{align-items:flex-start;flex-direction:column}}

/* V1.4.4 · alias global + identificador técnico VMIA */
.device-technical-name {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.72em;
  font-weight: 600;
  opacity: 0.62;
  white-space: nowrap;
  vertical-align: baseline;
}

/* ==========================================================
   V1.4.4 · RESUMEN EXTERIOR DE GRUPOS
   ========================================================== */

.group-card-summary {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.group-summary-identity {
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255,255,255,.035);
}

.group-summary-block {
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.group-summary-title {
  margin-bottom: 6px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  opacity: .68;
}

.group-members-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.group-member-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 7px;
  background: rgba(255,255,255,.055);
  font-size: .78rem;
}

.group-member-chip b {
  font-size: .67rem;
  opacity: .72;
}

.group-comm-lines {
  display: grid;
  gap: 4px;
}

.group-comm-line {
  display: grid;
  grid-template-columns: 22px 18px 1fr;
  align-items: center;
  min-width: 0;
  font-size: .8rem;
}

.group-comm-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  font-size: .68rem;
  font-weight: 900;
  background: rgba(255,255,255,.08);
}

.group-comm-arrow {
  text-align: center;
  font-weight: 800;
  opacity: .75;
}

.comm-group-card .device-technical-name,
.group-comm-line .small,
.group-summary-identity .small {
  font-size: .72em;
  opacity: .58;
}


/* ==========================================================
   V1.4.4 · GRUPOS HORIZONTALES RX / TX / IC
   ========================================================== */

/* Una tarjeta por fila */
.comm-group-grid {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 14px !important;
}

.comm-group-card {
  width: 100%;
  box-sizing: border-box;
}


/* ----------------------------------------------------------
   CUERPO HORIZONTAL
   ---------------------------------------------------------- */

.group-card-summary-horizontal {
  display: grid !important;
  grid-template-columns:
    minmax(220px, 0.75fr)
    minmax(480px, 2.25fr);
  gap: 18px;
  align-items: stretch;
  margin-top: 10px;
}


.group-summary-left {
  min-width: 0;
  padding-right: 16px;
  border-right: 1px solid rgba(255,255,255,.09);
}


.group-summary-right {
  min-width: 0;
}


/* ----------------------------------------------------------
   IDENTIDAD
   ---------------------------------------------------------- */

.group-summary-identity {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.045);
}


/* ----------------------------------------------------------
   MIEMBROS
   ---------------------------------------------------------- */

.group-members-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.group-member-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(255,255,255,.06);
  font-size: .76rem;
  line-height: 1.1;
}

.group-member-chip b {
  font-size: .65rem;
  opacity: .72;
}

.group-member-more {
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  font-size: .7rem;
  opacity: .65;
}


/* ----------------------------------------------------------
   RX / TX / IC
   ---------------------------------------------------------- */

.group-comm-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}


.group-comm-column {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.035);
}


.group-comm-column-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  font-size: .74rem;
}


.group-comm-code {
  width: auto !important;
  min-width: 27px;
  height: 20px;
  padding: 0 5px;
  border-radius: 5px;
  font-size: .62rem !important;
  font-weight: 900;
  letter-spacing: .03em;
}


.group-comm-items {
  display: grid;
  gap: 4px;
}


.group-comm-item {
  min-width: 0;
  font-size: .76rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}


.group-comm-item .small {
  font-size: .72em;
  opacity: .55;
}


.group-comm-more {
  margin-top: 3px;
  font-size: .67rem;
  font-weight: 700;
  opacity: .58;
}


/* ----------------------------------------------------------
   BOTONES
   ---------------------------------------------------------- */

.comm-group-card > .actions,
.comm-group-card .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}


/* ----------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------- */

@media (max-width: 950px) {

  .group-card-summary-horizontal {
    grid-template-columns: 1fr;
  }

  .group-summary-left {
    padding-right: 0;
    border-right: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,.09);
  }

  .group-comm-columns {
    grid-template-columns: 1fr;
  }
}


/* VMIA BRANDING V0.9.9 */
.vmia-auth-brand{display:flex;justify-content:center;align-items:center;margin:0 auto 14px;max-width:560px}
.vmia-auth-brand img{display:block;width:min(100%,520px);height:auto;border-radius:12px;object-fit:contain}
.vmia-brand-icon{width:34px;height:34px;flex:0 0 auto;object-fit:cover;border-radius:9px;margin-right:9px;border:1px solid rgba(255,255,255,.12)}
@media(max-width:520px){.vmia-auth-brand{margin-bottom:10px}.vmia-auth-brand img{max-width:360px}.vmia-brand-icon{width:30px;height:30px;border-radius:8px;margin-right:7px}}


/* ==========================================================
   VMIA · CABECERA CORPORATIVA
   ========================================================== */

.vmia-main-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin-bottom:18px;
  padding:0;
}

.vmia-header-brand{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  min-width:0;
}

.vmia-header-logo{
  display:block;
  width:min(390px,42vw);
  height:auto;
  max-height:105px;
  object-fit:contain;
  object-position:left center;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.09);
  box-shadow:0 5px 22px rgba(0,0,0,.26);
}

.vmia-header-identity{
  margin-top:5px;
  margin-left:4px;
  font-size:10px;
  color:#8292a8;
}

.vmia-main-header .header-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:7px;
}

.vmia-main-header .state{
  padding:7px 10px;
  font-size:10px;
  min-width:auto;
}


/* ==========================================================
   LOGIN / ARRANQUE
   ========================================================== */

.login-card{
  max-width:620px;
  padding:16px;
}

.vmia-auth-brand{
  max-width:100%;
  margin:0 auto 17px;
  padding:0;
}

.vmia-auth-brand img{
  display:block;
  width:100%;
  max-width:100%;
  height:auto;
  max-height:150px;
  object-fit:cover;
  object-position:center;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 7px 24px rgba(0,0,0,.25);
}

.login-card h2{
  margin:4px 0 16px;
  font-size:23px;
}

.login-card input{
  background:#0c1521;
  border-color:#3c4c63;
}

.login-card input:focus{
  outline:none;
  border-color:#3b82f6;
  box-shadow:0 0 0 2px rgba(59,130,246,.13);
}


/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media(max-width:700px){

  .vmia-main-header{
    flex-direction:column;
    align-items:stretch;
    gap:8px;
  }

  .vmia-header-brand{
    align-items:center;
  }

  .vmia-header-logo{
    width:min(100%,420px);
    max-height:110px;
    object-position:center;
  }

  .vmia-header-identity{
    margin-left:0;
  }

  .vmia-main-header .header-actions{
    justify-content:center;
  }

  .login-card{
    padding:12px;
  }

  .vmia-auth-brand img{
    max-height:125px;
  }
}


/* ==========================================================
   VMIA · CORRECCIÓN FINAL BRANDING
   ========================================================== */

/* Quitar icono blanco pequeño superior */
.vmia-brand-icon{
  display:none !important;
}


/* ----------------------------------------------------------
   LOGO SUPERIOR
   ---------------------------------------------------------- */

.vmia-header-logo{
  display:block !important;

  width:min(360px,42vw) !important;

  /* IMPORTANTÍSIMO: nunca recortar */
  height:auto !important;
  max-height:none !important;

  object-fit:contain !important;
  object-position:left center !important;

  border-radius:12px;
}


/* ----------------------------------------------------------
   LOGO LOGIN / ARRANQUE
   ---------------------------------------------------------- */

.vmia-auth-brand{
  width:100% !important;
  max-width:540px !important;

  margin:0 auto 18px !important;

  overflow:visible !important;
}


.vmia-auth-brand img{
  display:block !important;

  width:100% !important;
  max-width:540px !important;

  /* mantener proporción original completa */
  height:auto !important;
  max-height:none !important;

  object-fit:contain !important;
  object-position:center center !important;

  border-radius:12px;
}


/* ----------------------------------------------------------
   LOGIN
   ---------------------------------------------------------- */

.login-card{
  max-width:620px;
}


/* ----------------------------------------------------------
   MÓVIL
   ---------------------------------------------------------- */

@media(max-width:700px){

  .vmia-header-logo{
    width:min(100%,360px) !important;
    max-height:none !important;
    object-position:center !important;
  }

  .vmia-auth-brand{
    max-width:100% !important;
  }

  .vmia-auth-brand img{
    width:100% !important;
    max-width:100% !important;
    max-height:none !important;
  }
}

img.vmia-brand-icon,
header img[src*="vmia_icon"],
header img[src*="vmia-icon"]{
  display:none !important;
}


/* ==========================================================
   VMIA · BRANDING ALPHA DEFINITIVO
   ========================================================== */

/* No mostrar el antiguo icono cuadrado dentro de la cabecera */
.vmia-brand-icon,
header img.vmia-brand-icon,
header img[src*="vmia_icon"],
header img[src*="vmia-icon"] {
  display:none !important;
}


/* Logo horizontal superior */
.vmia-main-header .vmia-header-logo {
  display:block !important;
  width:min(520px,52vw) !important;
  max-width:100% !important;

  height:auto !important;
  max-height:none !important;

  object-fit:contain !important;
  object-position:left center !important;

  background:transparent !important;
  border:none !important;
  border-radius:0 !important;
  box-shadow:none !important;

  padding:0 !important;
  margin:0 !important;
}


/* Logo del login / arranque */
#loginCard .vmia-auth-brand,
#bootCard .vmia-auth-brand {
  width:100% !important;
  max-width:580px !important;

  margin:0 auto 18px !important;
  padding:0 !important;

  background:transparent !important;
  border:none !important;
  box-shadow:none !important;
  overflow:visible !important;
}


#loginCard .vmia-auth-brand img,
#bootCard .vmia-auth-brand img {
  display:block !important;

  width:100% !important;
  max-width:580px !important;

  height:auto !important;
  max-height:none !important;

  object-fit:contain !important;
  object-position:center center !important;

  background:transparent !important;
  border:none !important;
  border-radius:0 !important;
  box-shadow:none !important;

  padding:0 !important;
  margin:0 auto !important;
}


@media(max-width:700px) {

  .vmia-main-header .vmia-header-logo {
    width:100% !important;
    max-width:440px !important;
  }

  #loginCard .vmia-auth-brand img,
  #bootCard .vmia-auth-brand img {
    max-width:100% !important;
  }
}


/* V1.4.4 PUBLIC MAP VIEW */
#mapView{
  width:100%;
}

.map-frame{
  display:block;
  width:100%;
  height:calc(100dvh - 145px);
  min-height:420px;
  border:1px solid #29374b;
  border-radius:15px;
  background:#0a1019;
}

@media(max-width:600px){
  .map-frame{
    height:calc(100dvh - 135px);
    min-height:320px;
    border-radius:11px;
  }
}

/* ==========================================================
   VMIA APK · AJUSTE FINAL EVENTO
   ========================================================== */


/* Por defecto el usuario continúa arriba en navegador. */
.compact-user-identity{
  display:none;
}


/* ----------------------------------------------------------
   SOLO WEBVIEW APK
   ---------------------------------------------------------- */

html.vmia-android main{
  padding-top:2px !important;
  padding-bottom:72px !important;
}


/* Cabecera compacta */
html.vmia-android .vmia-main-header{
  flex-direction:column !important;
  align-items:stretch !important;

  gap:4px !important;

  margin-top:0 !important;
  margin-bottom:6px !important;

  padding-top:0 !important;
}


/* Logo + SALIR */
html.vmia-android .vmia-header-brand{
  display:flex !important;

  flex-direction:row !important;

  align-items:center !important;
  justify-content:flex-start !important;

  gap:8px !important;

  width:100% !important;

  min-height:0 !important;

  margin:0 !important;
  padding:0 !important;
}


html.vmia-android
.vmia-main-header
.vmia-header-logo{

  width:180px !important;
  max-width:52vw !important;

  height:auto !important;

  margin:0 !important;

  object-position:left center !important;
}


/* El nombre pasa a la tarjeta de identidad. */
html.vmia-android .vmia-header-identity{
  display:none !important;
}


/* SALIR inmediatamente después del logo */
html.vmia-android
.vmia-header-brand
.logout{

  flex:0 0 auto !important;

  min-height:36px !important;

  padding:5px 12px !important;

  margin:0 !important;

  font-size:11px !important;

  white-space:nowrap !important;
}


/* ----------------------------------------------------------
   ONLINE / AUDIO / CALIDAD / GPS
   Siempre una sola línea
   ---------------------------------------------------------- */

html.vmia-android
.vmia-main-header
.header-actions{

  display:flex !important;

  flex-direction:row !important;

  flex-wrap:nowrap !important;

  justify-content:flex-start !important;
  align-items:center !important;

  gap:4px !important;

  width:100% !important;

  overflow:hidden !important;
}


html.vmia-android
.header-actions
.state{

  flex:0 1 auto !important;

  min-width:0 !important;

  padding:5px 6px !important;

  font-size:8.5px !important;

  line-height:1.15 !important;

  white-space:nowrap !important;

  word-break:normal !important;
}


html.vmia-android #qualityState{
  white-space:nowrap !important;
}


/* ----------------------------------------------------------
   Tarjeta identidad
   ---------------------------------------------------------- */

html.vmia-android .compact-identity{

  padding:8px 10px !important;

  margin-top:0 !important;
  margin-bottom:6px !important;
}


html.vmia-android
.compact-identity
.row-between{

  align-items:center !important;
}


html.vmia-android
.compact-user-identity{

  display:block !important;

  flex:0 0 auto !important;

  margin-left:10px !important;

  text-align:right !important;

  color:#93a1b5 !important;

  font-size:10px !important;
  font-weight:800 !important;

  white-space:nowrap !important;
}


/* ----------------------------------------------------------
   Menos separación entre tarjetas
   ---------------------------------------------------------- */

html.vmia-android .device{
  margin-bottom:5px !important;
}


html.vmia-android .meter-row{
  margin-top:5px !important;
  margin-bottom:5px !important;
}


/* ----------------------------------------------------------
   Zona derecha libre para hacer scroll.
   Reducimos PTT SOLO desde la derecha.
   ---------------------------------------------------------- */

html.vmia-android
.device
.ptt-row.always-visible{

  padding-right:52px !important;
}


/* PTT Maestro fijo: mantiene izquierda,
   deja corredor táctil libre a la derecha. */
html.vmia-android .master-ptt{

  left:10px !important;
  right:68px !important;

  width:auto !important;

  transform:none !important;

  bottom:58px !important;
}


/* ----------------------------------------------------------
   Barra inferior sin doble safe-area
   ---------------------------------------------------------- */

html.vmia-android nav{

  bottom:0 !important;

  gap:6px !important;

  padding:6px 8px !important;

  padding-bottom:6px !important;
}


html.vmia-android nav button{

  min-height:48px !important;

  padding-left:7px !important;
  padding-right:7px !important;
}


/* ==========================================================
   VMIA APK · MASTER PTT FINAL
   ========================================================== */


/*
 * MASTER PTT sigue fijo para poder transmitir en cualquier
 * punto de la pantalla.
 *
 * La lista reserva espacio abajo para que el último dispositivo
 * pueda desplazarse completamente por encima del botón.
 */

html.vmia-android #deviceList{
  padding-bottom:170px !important;
  scroll-padding-bottom:170px !important;
}


/* Dejar MASTER PTT justo encima de la navegación inferior. */
html.vmia-android #masterPTT.master-ptt{

  position:fixed !important;

  left:16px !important;
  right:76px !important;

  width:auto !important;

  bottom:74px !important;

  transform:none !important;

  min-height:64px !important;

  margin:0 !important;

  z-index:40 !important;

  border-radius:14px !important;

  font-size:18px !important;
  font-weight:900 !important;

  white-space:nowrap !important;
}


/*
 * Un poco más de separación al último dispositivo.
 * Así no queda pegado al MASTER PTT cuando llegamos al final.
 */
html.vmia-android #deviceList .device:last-child{
  margin-bottom:12px !important;
}


/* La barra inferior queda por encima de la lista,
   pero por debajo funcionalmente del MASTER PTT. */
html.vmia-android nav{
  z-index:50 !important;
}

