/* =========================
   Variables globales
   ========================= */
:root{
  --bg:#f5f7fb;
  --card:#697477;
  --ink:#fff;
  --txt:#fff;
  --txtHeader:#697477;
  --muted:#fff;
  --b:#fff;
  --shadow:2px 9px 25px -3px #000000;

  --btn:#111827;
  --btn-ink:#fff;
  --danger:#dc2626;
  --danger-dark:#b91c1c;
  --ok:#16a34a;
}

/* =========================
   Base
   ========================= */
*{ 
  box-sizing:border-box 
}
html,body{
  height:100% 
}
body{
  margin:0;
  background:var(--bg);
  color:var(--txt);
  font-family:system-ui,Segoe UI,Roboto,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}
h1,h2,h3,h4,h5{ 
  margin:0 0 10px 0; 
  color:var(--ink); 
}
p{ 
  margin:0 0 10px 0; 
  color:var(--ink); 
}
.small{ 
  color:var(--muted); 
  font-size:13px 
}
.muted{ 
  color:var(--muted) 
}

/* =========================
   Layout
   ========================= */
.container{ 
  max-width:1100px; 
  margin:20px auto; 
  padding:0 14px 
}
header.top{
  position:sticky; 
  top:0; 
  z-index:10;
  background:#fff; 
  border-bottom:1px solid var(--b);
  padding:10px 14px; 
  display:flex; 
  gap:12px; 
  align-items:center; 
  justify-content:space-between;
}
.hrow{ 
  display:flex; gap:10px; 
  align-items:center 
}
.brand{ 
  font-weight:700;
  color: var(--txtHeader);
}
/* =========================
   LOGIN
   ========================= */
body.bodylogin{
	align-content: center;
}
.wrap{
	margin: 0 1rem;
}
.card.login{
	display: flex;
  	flex-direction: column;
  	align-items: center;
  	max-width:440px;
  	margin-inline: auto;
}
/* =========================
   Tarjetas
   ========================= */
.card{
  background:var(--card);
  border-radius:1rem;
  box-shadow:var(--shadow);
  -webkit-box-shadow: 2px 9px 25px -3px #000000; 
  padding:16px;
}

.card.wide{ margin-bottom:16px; max-width:none } /* panel */
.card.device{ max-width:none; width:100% }       /* tarjeta dispositivo */

.devices{
  display:flex;
  flex-direction:column;
}

/* =========================
   Tabla
   ========================= */
.table-wrap{ 
  overflow:auto;
}
.table{
  width:100%; 
  border-collapse:collapse; 
  font-size:14px;
}
.table th,.table td{
  padding:8px 10px; 
  border-bottom:1px solid var(--b); 
  text-align:left;
}
.table th{ 
  color:var(--muted); 
  font-weight:600 
}

@media (max-width:480px){
  .table thead{
  	display: none;
  }
  .table tbody tr{
  	display: flex;
    flex-direction: column;
  }
  .table tbody tr td{
    text-align:center;
  }
  .table th,.table td{
  	border-bottom:none; 
  }
  .table tr{
  	border-bottom:2px solid var(--b);
  }
}

/* =========================
   Inputs
   ========================= */
.input{
  width:100%; padding:10px 12px;
  border:1px solid var(--b);
  border-radius:12px;
  background:#fff; font-size:15px;
}
.input:focus{ 
  outline:none; 
  box-shadow:0 0 0 3px rgba(59,130,246,.15); 
}

/* utilidades de ancho (1 sola definición) */
.w90{
  width:90px
}
.w100{
  width:100px
}
.w110{
  width:110px}.w120{width:120px}.w140{width:140px}.w160{width:160px}
.flex1{flex:1}

/* =========================
   Botones
   ========================= */
.btn{
  appearance:none; border:1px solid transparent;
  border-radius:12px; padding:10px 14px;
  background:var(--btn); color:var(--btn-ink);
  cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:6px;
  text-decoration:none; white-space:nowrap;
}
.btn:hover{ filter:brightness(0.98) }
.btn.primary{ background:var(--btn); color:#fff }
.btn.outline{ background:#fff; color:var(--btn); border-color:var(--b) }
.btn.ghost{ background:#fff; color:var(--btn); border:1px dashed var(--b) }
.btn.danger{ background:var(--danger); color:#fff; border-color:var(--danger) }
.btn.danger:hover{ background:var(--danger-dark); border-color:var(--danger-dark) }

/* =========================
   Badges / avisos / puntos
   ========================= */
.badge{ padding:2px 10px; border-radius:999px; border:1px solid var(--b); display:inline-block }
.badge.green{ background:#eaffea; border-color:#b6e8b6 }
.badge.red{ background:#ffe8e8; border-color:#f3b2b2 }
.badge.gray{ background:#f2f4f7 }

.notice{ min-height:18px; font-size:13px; margin-top:6px; color:#374151 }
.notice.ok{ color:var(--ok) }
.notice.error{ color:var(--danger) }

.state-dot{
  width:10px; height:10px; border-radius:50%;
  background:#ef4444; display:inline-block;
  border:1px solid rgba(0,0,0,.08);
}
.state-dot.on{ background:#22c55e }

/* =========================
   Switch (toggle)
   ========================= */
.switch{
  width:42px; height:24px; border-radius:999px;
  background:#e5e7eb; border:1px solid #d1d5db;
  position:relative; cursor:pointer; transition:.15s;
}
.switch::after{
  content:""; position:absolute; top:2px; left:2px;
  width:20px; height:20px; border-radius:50%; background:#fff;
  transition:.15s; box-shadow:0 1px 2px rgba(0,0,0,.08);
}
.switch.on{ background:#22c55e; border-color:#16a34a }
.switch.on::after{ left:20px }

/* =========================
   Filas / helpers
   ========================= */
.row{ 
  display:flex; 
  gap:10px; 
  align-items:center;
  margin:5px 0;
}
.center{ display:grid; place-items:center }

/* =========================
   Correcciones específicas
   ========================= */
/* Asegura que los inputs dentro de tabla no crezcan de más */
.table .input{ height:36px; padding:8px 10px; font-size:14px }

/* Botones alineados dentro de celda de acciones */
.table .btn{ height:36px; padding:8px 12px; font-size:14px }

/* Espaciado dentro de tarjetas de dispositivo */
.card.device h4{ margin-bottom:6px }
.card.device .row.actions{ margin-top:6px }
