body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    color: #222;
    background-color: #f9f9f9;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
}

.header {
    background-color: #1e1e2f;
    color: white;
    padding: 1rem 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
}

.logo span {
    color: #00bcd4;
}

.nav {
    float: right;
}

.nav .btn {
    background: #00bcd4;
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
}

.hero {
    background: linear-gradient(135deg, #00bcd4, #009688);
    color: white;
    text-align: center;
    padding: 4rem 1rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.btn-primary {
    background: white;
    color: #009688;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
}

.features {
    padding: 3rem 0;
    background-color: #ffffff;
}

.features h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.card {
    background: #fafafa;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.footer {
    background-color: #1e1e2f;
    color: white;
    text-align: center;
    padding: 1rem 0;
}


/* ======= Login moderno ======= */
.auth-page {
  background: radial-gradient(1200px 600px at 10% -10%, #00bcd4 0%, transparent 50%),
              radial-gradient(1000px 500px at 110% 10%, #009688 0%, transparent 55%),
              #f5f7fb;
  min-height: 100vh;
}

.login-wrapper {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,.08);
  padding: 2rem;
  animation: floatIn .4s ease;
}

@keyframes floatIn {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.brand {
  display: flex; align-items: center; gap: .6rem;
  font-weight: 800; font-size: 1.3rem; color: #1e1e2f;
  margin-bottom: .5rem;
}
.brand .accent { color: #00bcd4; }
.logo-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: linear-gradient(135deg,#00bcd4,#009688);
}

.login-title {
  margin: 0 0 1.2rem 0;
  font-size: 1.4rem; color: #1e1e2f;
}

.alert {
  padding: .75rem .9rem;
  border-radius: 10px;
  font-size: .95rem;
  margin-bottom: 1rem;
}
.alert.error { background: #ffe8e8; color: #b80000; border: 1px solid #ffcccc; }

.form-group { margin-bottom: 1rem; }
label { display:block; font-weight:600; margin-bottom:.4rem; color:#333; }

.input {
  width: 100%;
  padding: .75rem .9rem;
  border-radius: 10px;
  border: 1px solid #dfe3ea;
  background: #fbfcfe;
  outline: none;
  transition: box-shadow .15s ease, border-color .15s ease, transform .05s ease;
}
.input:focus {
  border-color: #00bcd4;
  box-shadow: 0 0 0 4px rgba(0,188,212,.15);
  background: #fff;
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}
.toggle-pass {
  position: absolute;
  right: .5rem; top: 50%; transform: translateY(-50%);
  border: none; background: transparent; cursor: pointer;
  font-size: 1.05rem; line-height: 1;
  opacity: .7;
}
.toggle-pass:hover { opacity: 1; }

.form-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; margin-top: .5rem;
}

.checkbox { display: flex; align-items: center; gap: .45rem; font-size: .95rem; color:#444; }

.btn {
  display: inline-block;
  padding: .7rem 1rem;
  border-radius: 10px;
  border: none;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
}
.btn-full { width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, #00bcd4, #009688);
  color: #fff;
  box-shadow: 0 6px 14px rgba(0, 188, 212, 0.3);
  transition: transform .05s ease, box-shadow .15s ease;
}
.btn-primary:hover { box-shadow: 0 8px 18px rgba(0, 188, 212, 0.4); }
.btn-primary:active { transform: translateY(1px); }

.helper-links {
  margin-top: 1rem; text-align: center;
}
.helper-links a {
  color: #009688; text-decoration: none; font-weight: 600;
}
.helper-links a:hover { text-decoration: underline; }



/* ===== SCADA Panel ===== */
.scada-page { background: #f5f7fb; }

.topbar { background:#1e1e2f; color:#fff; padding:.8rem 0; margin-bottom:1rem; }
.flex-between { display:flex; justify-content:space-between; align-items:center; }
.brand { font-weight:800; font-size:1.2rem; }
.brand .accent { color:#00bcd4; }

.headline h1 { margin:.2rem 0; }
.muted { color:#666; font-size:.9rem; }

.grid-machines {
  display:grid;
  gap:1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin: 1rem 0 2rem;
}

.machine-card {
  background:#fff;
  border-radius:12px;
  padding:1rem;
  box-shadow:0 6px 18px rgba(0,0,0,.06);
  border:1px solid #eef1f6;
}

.card-top { display:flex; justify-content:space-between; align-items:center; gap:.75rem; }
.machine-name { font-weight:700; font-size:1.05rem; color:#222; }

.status-badges { display:flex; gap:.4rem; flex-wrap:wrap; }
.badge {
  font-size:.78rem; font-weight:700;
  padding:.25rem .55rem; border-radius:999px;
  border:1px solid transparent;
}

/* Power */
.badge.power.on      { background:#e6fff8; color:#066; border-color:#bff3e6; }
.badge.power.off     { background:#f1f2f6; color:#444; border-color:#e1e4ea; }

/* Mode */
.badge.mode.running   { background:#e9fbef; color:#126c2e; border-color:#c6efcf; }
.badge.mode.standby   { background:#fff6e6; color:#8a6a12; border-color:#ffe0ad; }
.badge.mode.alarm     { background:#fff0f0; color:#b80000; border-color:#ffd1d1; }
.badge.mode.emergency { background:#ffe8e8; color:#900; border-color:#ffcccc; }
.badge.mode.maintenance { background:#eef4ff; color:#2a4c9b; border-color:#d7e3ff; }
.badge.mode.offline   { background:#f1f2f6; color:#555; border-color:#e1e4ea; }

.kpis { display:flex; gap:.8rem; margin:.8rem 0 0 0; }
.kpi { flex:1; background:#fbfcfe; border:1px solid #eef1f6; border-radius:10px; padding:.6rem .7rem; }
.kpi-label { font-size:.78rem; color:#666; }
.kpi-value { font-weight:800; font-size:1.1rem; color:#1e1e2f; }
.unit { font-size:.8rem; margin-left:.15rem; color:#666; }

.event-line {
  display:flex; align-items:center; gap:.5rem;
  margin:.8rem 0 .6rem; color:#444; font-size:.9rem;
}
.dot { width:8px; height:8px; border-radius:50%; display:inline-block; }
.dot.running { background:#18b663; }
.dot.standby { background:#f4b400; }
.dot.alarm { background:#e53935; }
.dot.emergency { background:#b71c1c; }
.dot.maintenance { background:#3f51b5; }
.dot.offline { background:#9e9e9e; }
.event-ts { margin-left:auto; color:#888; font-size:.8rem; }

.card-actions { display:flex; gap:.5rem; }
.btn.tiny { padding:.35rem .6rem; border-radius:8px; font-size:.8rem; }
.btn.small { padding:.45rem .75rem; border-radius:10px; font-size:.9rem; }
.btn.outline { background:#fff; color:#009688; border:1px solid #bfe7e1; }


/* ===== Panel TÃƒÂ©cnico ===== */
.pill-row { display:flex; gap:.5rem; flex-wrap:wrap; margin:.6rem 0 1rem; }
.pill { padding:.25rem .6rem; border-radius:999px; font-weight:700; font-size:.8rem; border:1px solid transparent; }
.pill.danger { background:#ffe8e8; color:#900; border-color:#ffcccc; }
.pill.warn   { background:#fff6e6; color:#8a6a12; border-color:#ffe0ad; }
.pill.info   { background:#eef4ff; color:#2a4c9b; border-color:#d7e3ff; }
.pill.muted  { background:#f1f2f6; color:#555; border-color:#e1e4ea; }

.alerts h2, .ops h2 { margin:.6rem 0; }

.alert-card {
  background:#fff; border:1px solid #eef1f6; border-left-width:6px;
  border-radius:12px; padding:1rem; margin:.8rem 0;
  box-shadow:0 6px 18px rgba(0,0,0,.05);
}
.alert-card.emergency { border-left-color:#b71c1c; }
.alert-card.alarm     { border-left-color:#e53935; }
.alert-card.maintenance { border-left-color:#3f51b5; }
.alert-card.offline   { border-left-color:#9e9e9e; }

.alert-header { display:flex; justify-content:space-between; align-items:center; gap:.75rem; }
.alert-header .name { font-weight:800; font-size:1.05rem; }
.alert-header .badges { display:flex; gap:.4rem; flex-wrap:wrap; }

.alert-body { display:grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap:.5rem .75rem; margin:.7rem 0; }
.kv span { display:block; font-size:.78rem; color:#666; }
.kv { background:#fbfcfe; border:1px solid #eef1f6; border-radius:10px; padding:.55rem .7rem; }

.mini-grid { display:grid; gap:.8rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.mini {
  background:#fff; border:1px solid #eef1f6; border-radius:12px; padding:.7rem .8rem;
  box-shadow:0 4px 12px rgba(0,0,0,.04);
}
.mini .row { display:flex; justify-content:space-between; align-items:center; }
.mini-name { font-weight:700; color:#222; }
.mini-mode { font-size:.85rem; color:#555; }
.numbers { gap:1rem; margin-top:.35rem; }
.n span { display:block; font-size:.78rem; color:#666; }
.n { font-weight:800; color:#1e1e2f; }

/* ===== Panel TÃƒÂ©cnico ===== */
.pill-row { display:flex; gap:.5rem; flex-wrap:wrap; margin:.6rem 0 1rem; }
.pill { padding:.25rem .6rem; border-radius:999px; font-weight:700; font-size:.8rem; border:1px solid transparent; }
.pill.danger { background:#ffe8e8; color:#900; border-color:#ffcccc; }
.pill.warn   { background:#fff6e6; color:#8a6a12; border-color:#ffe0ad; }
.pill.info   { background:#eef4ff; color:#2a4c9b; border-color:#d7e3ff; }
.pill.muted  { background:#f1f2f6; color:#555; border-color:#e1e4ea; }

.alerts h2, .ops h2 { margin:.6rem 0; }

.alert-card {
  background:#fff; border:1px solid #eef1f6; border-left-width:6px;
  border-radius:12px; padding:1rem; margin:.8rem 0;
  box-shadow:0 6px 18px rgba(0,0,0,.05);
}
.alert-card.emergency { border-left-color:#b71c1c; }
.alert-card.alarm     { border-left-color:#e53935; }
.alert-card.maintenance { border-left-color:#3f51b5; }
.alert-card.offline   { border-left-color:#9e9e9e; }

.alert-header { display:flex; justify-content:space-between; align-items:center; gap:.75rem; }
.alert-header .name { font-weight:800; font-size:1.05rem; }
.alert-header .badges { display:flex; gap:.4rem; flex-wrap:wrap; }

.alert-body { display:grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap:.5rem .75rem; margin:.7rem 0; }
.kv span { display:block; font-size:.78rem; color:#666; }
.kv { background:#fbfcfe; border:1px solid #eef1f6; border-radius:10px; padding:.55rem .7rem; }

.mini-grid { display:grid; gap:.8rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.mini {
  background:#fff; border:1px solid #eef1f6; border-radius:12px; padding:.7rem .8rem;
  box-shadow:0 4px 12px rgba(0,0,0,.04);
}
.mini .row { display:flex; justify-content:space-between; align-items:center; }
.mini-name { font-weight:700; color:#222; }
.mini-mode { font-size:.85rem; color:#555; }
.numbers { gap:1rem; margin-top:.35rem; }
.n span { display:block; font-size:.78rem; color:#666; }
.n { font-weight:800; color:#1e1e2f; }


/* ===== Panel Operario ===== */
.op-card {
  background:#fff; border:1px solid #eef1f6; border-radius:12px;
  padding:1rem; box-shadow:0 6px 18px rgba(0,0,0,.06);
}
.op-head { display:flex; justify-content:space-between; align-items:center; gap:.75rem; }
.op-head .name { font-weight:800; font-size:1.05rem; }
.op-head .badges { display:flex; gap:.4rem; flex-wrap:wrap; }

.ok-line { margin-top:.7rem; color:#2d7f4f; font-weight:600; display:flex; align-items:center; gap:.4rem; }

.op-form { margin-top:.7rem; }
.form-row { margin-bottom:.7rem; }
.input { width:100%; padding:.65rem .8rem; border-radius:10px; border:1px solid #dfe3ea; background:#fbfcfe; }
.input:focus { border-color:#00bcd4; box-shadow:0 0 0 4px rgba(0,188,212,.15); outline:none; }

.mini .n span, .kpi-label { font-size:.78rem; color:#666; }

.badge { font-size:.78rem; font-weight:700; padding:.25rem .55rem; border-radius:999px; border:1px solid transparent; }
.badge.power.on    { background:#e6fff8; color:#066; border-color:#bff3e6; }
.badge.power.off   { background:#f1f2f6; color:#444; border-color:#e1e4ea; }
.badge.mode.running{ background:#e9fbef; color:#126c2e; border-color:#c6efcf; }
.badge.mode.standby{ background:#fff6e6; color:#8a6a12; border-color:#ffe0ad; }
.badge.mode.alarm  { background:#fff0f0; color:#b80000; border-color:#ffd1d1; }
.badge.mode.emergency{ background:#ffe8e8; color:#900; border-color:#ffcccc; }
.badge.mode.maintenance{ background:#eef4ff; color:#2a4c9b; border-color:#d7e3ff; }
.badge.mode.offline{ background:#f1f2f6; color:#555; border-color:#e1e4ea; }

/* Contenedor para que Chart.js tenga altura real */
.chart-box {
  position: relative;
  height: 260px;       /* ajusta a gusto: 200Ã¢â‚¬â€œ320px */
  width: 100%;
}
.chart-box canvas {
  width: 100% !important;
  height: 100% !important; /* fundamental para Chart.js 3 */
  display: block;
}


/* Layout principal: 2 columnas (contenido + sidebar) */
.layout-2cols {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.25rem;
}

/* Sidebar y tarjetas de stats */
.sidebar .stat-card {
  background: #fff;
  border: 1px solid #eef1f6;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  margin-bottom: 1rem;
}

.stat-title { font-weight: 700; color: #333; margin-bottom: .35rem; }
.big { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.mid { font-size: 1.2rem; font-weight: 700; }
.unit { font-size: .9rem; color: #666; margin-left: .2rem; }
.small-label { color: #666; font-size: .8rem; }

.triplet { display: grid; grid-template-columns: repeat(3,1fr); gap: .6rem; }

/* Barra de progreso simple */
.meter {
  background: #eef2f7;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-top: .5rem;
}
.meter > span {
  display: block;
  height: 100%;
  background: #18b663;
}

/* Ajuste de rejilla de mÃ¡quinas para que respire con la sidebar */
.grid-machines {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/*pagina cliente*/

/* Stage un poco mÃ¡s ancho */
.container {
  width: 92%;
  max-width: 1280px;   /* antes 1200px */
  margin: auto;
}

/* Dos columnas: contenido + sidebar mÃ¡s ancha */
.layout-2cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px; /* antes 340px */
  gap: 1.5rem;                                  /* un poco mÃ¡s de aire */
  align-items: start;
}

/* Sidebar pegadita a la derecha y con scroll agradable (opcional) */
.sidebar { position: sticky; top: 84px; }

/* Tarjeta de la sidebar + badges que envuelven y no se cortan */
.sidebar .stat-card { overflow: visible; }
.sidebar .badges {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .5rem;
}
.sidebar .badge {
  font-size: .75rem;          /* un poquito mÃ¡s chica para que no corte */
  padding: .22rem .5rem;
}

/* Barra de progreso alineada */
.meter { margin-top: .55rem; }
.meter > span { transition: width .25s ease; }

/* --- Toolbar izquierda (nuevo) --- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem .8rem;
  align-items: center;
  margin: .6rem 0 1rem;
}
.toolbar .search {
  flex: 1 1 260px;
  max-width: 420px;
}
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip {
  border: 1px solid #dfe3ea;
  background: #fff;
  color: #333;
  padding: .35rem .6rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .82rem;
  cursor: pointer;
}
.chip:hover { background: #f7fafc; }
.chip.active {
  border-color: #00bcd4;
  background: #e6fbff;
  color: #066;
}

/* Stage ancho */
.container {
  width: 92%;
  max-width: 1280px;
  margin: auto;
}

/* Dos columnas: contenido + sidebar */
.layout-2cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1.5rem;
  align-items: start;
}

/* Columna izquierda (toolbar + grilla) */
.leftcol { display: flex; flex-direction: column; gap: .8rem; min-width: 0; }

/* Sidebar fija a la derecha */
.sidebar { position: sticky; top: 84px; }

/* Grilla de mÃ¡quinas (deja UNA sola definiciÃ³n de esta clase) */
.grid-machines {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Toolbar izquierda */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem .8rem;
  align-items: center;
  margin: .2rem 0 .6rem;
}
.toolbar .search { flex: 1 1 260px; max-width: 420px; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip {
  border: 1px solid #dfe3ea;
  background: #fff;
  color: #333;
  padding: .35rem .6rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .82rem;
  cursor: pointer;
}
.chip:hover { background: #f7fafc; }
.chip.active { border-color: #00bcd4; background: #e6fbff; color: #066; }

/* Sidebar: que no corten badges */
.sidebar .stat-card { overflow: visible; }
.sidebar .badges { display: flex; flex-wrap: wrap; gap: .4rem .5rem; }
.sidebar .badge { font-size: .75rem; padding: .22rem .5rem; }

/* Progreso suave */
.meter { margin-top: .55rem; }
.meter > span { transition: width .25s ease; }

/* Material Symbols */
.material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

/* Accesos rápidos (2 columnas x 5) */
.quick-icons { margin: .25rem 0 1rem; }
.icon-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .6rem;
}
.icon-tile {
  background: #fff;
  border: 1px solid #eef1f6;
  border-radius: 12px;
  padding: .8rem .6rem;
  text-decoration: none;
  color: #222;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  transition: transform .05s ease, box-shadow .15s ease, border-color .15s ease;
}
.icon-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0,0,0,.09);
  border-color: #dfe6f2;
}
.icon-tile .material-symbols-rounded {
  font-size: 26px;
  line-height: 1;
  color: #009688;
  margin-bottom: .25rem;
}
.icon-tile small {
  font-weight: 700;
  font-size: .78rem;
  color: #333;
  text-align: center;
}

/* Responsive: en móviles el panel de iconos se arma en fila */
@media (max-width: 980px) {
  .icon-grid { grid-template-columns: repeat(5, 1fr); }
}


/* ====== Left rail para los íconos (sin cambiar el HTML) ====== */
.leftcol{
  display: grid;
  grid-template-columns: 88px 1fr;   /* rail izq + contenido */
  grid-auto-rows: min-content;
  align-items: start;
  column-gap: 1rem;
}

/* El rail (íconos) va en la columna 1 y ocupa toda la altura de la col izq */
.leftcol .quick-icons{
  grid-column: 1;
  grid-row: 1 / span 999;   /* ocupa todas las filas */
  position: sticky;
  top: 84px;                /* igual que el sidebar derecho */
}

/* Toolbar + tarjetas van en la columna 2 */
.leftcol .toolbar,
.leftcol .grid-machines{
  grid-column: 2;
}

/* El grid de íconos pasa a ser vertical (una sola columna) */
.quick-icons .icon-grid{
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

/* Baldosas compactas, cuadradas */
.icon-tile{
  width: 100%;
  aspect-ratio: 1 / 1;           /* cuadradas */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: .4rem;
  border-radius: 12px;
  background:#fff;
  border:1px solid #eef1f6;
  box-shadow:0 6px 18px rgba(0,0,0,.06);
  text-decoration:none;
  color:#222;
}
.icon-tile .material-symbols-rounded{
  font-size: 22px;
  color:#009688;
  line-height:1;
  margin-bottom:.15rem;
}
.icon-tile small{
  font-weight:700;
  font-size:.72rem;
  text-align:center;
}

/* Hover sutil */
.icon-tile:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0,0,0,.09);
  border-color:#dfe6f2;
  transition: transform .05s ease, box-shadow .15s ease, border-color .15s ease;
}

/* RESPONSIVE: en pantallas chicas volvemos a poner los íconos arriba en 2 filas */
@media (max-width: 1024px){
  .leftcol{ display:block; }
  .leftcol .quick-icons{
    position: static;
    margin-bottom: .75rem;
  }
  .quick-icons .icon-grid{
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: .6rem;
  }
  .icon-tile{ aspect-ratio: auto; padding: .6rem .5rem; }
}






