* { box-sizing: border-box; }
body { font-family: -apple-system, Segoe UI, Roboto, sans-serif; margin: 0; background: #f4f6f8; color: #1a1a1a; }
.topbar { background: #12213b; color: #fff; padding: 14px 24px; display: flex; justify-content: space-between; align-items: center; }
.topbar a { color: #cfd8e3; margin-left: 18px; text-decoration: none; font-size: 14px; }
.topbar a:hover { color: #fff; }
.brand { font-weight: 600; }
.content { padding: 28px; max-width: 1100px; margin: 0 auto; }
.content:has(.flota-wide) { max-width: 1600px; }
.cards { display: flex; gap: 16px; margin: 20px 0; }
.card { background: #fff; border: 1px solid #dde3ea; border-radius: 8px; padding: 20px 24px; text-decoration: none; color: #12213b; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card:hover { border-color: #12213b; }
.hint { color: #667085; font-size: 14px; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; margin-top: 12px; }
.data-table th, .data-table td { border-bottom: 1px solid #eaecef; padding: 8px 10px; text-align: left; font-size: 14px; }
.data-table th { background: #f0f2f5; }
.btn, button { background: #12213b; color: #fff; border: none; padding: 8px 14px; border-radius: 6px; cursor: pointer; text-decoration: none; display: inline-block; font-size: 14px; }
.btn-danger { background: #b3261e; }
.form label { display: block; margin-top: 10px; font-size: 13px; color: #444; }
.form input, .form select { width: 100%; padding: 8px; margin-top: 4px; border: 1px solid #ccd2d9; border-radius: 6px; }
.form button { margin-top: 16px; }
.login-body { display: flex; align-items: center; justify-content: center; height: 100vh; background: #12213b; }
.login-box { background: #fff; padding: 32px; border-radius: 10px; width: 320px; }
.login-box h1 { margin: 0 0 4px; font-size: 20px; }
.subtitle { margin: 0 0 20px; color: #667085; font-size: 13px; }
.login-box label { display: block; margin-top: 12px; font-size: 13px; }
.login-box input { width: 100%; padding: 9px; margin-top: 4px; border: 1px solid #ccd2d9; border-radius: 6px; }
.login-box button { width: 100%; margin-top: 20px; padding: 10px; }
.error { color: #b3261e; font-size: 13px; }

/* === Dashboard de Flota === */
.kpi-row { display: flex; gap: 14px; margin-bottom: 16px; }
.kpi-card { flex: 1; background: #fff; border-radius: 8px; padding: 14px 18px; border-left: 5px solid #ccc; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.kpi-total { border-left-color: #1e88e5; }
.kpi-elec { border-left-color: #1e88e5; }
.kpi-bat { border-left-color: #c62828; }
.kpi-off { border-left-color: #9e9e9e; }
.kpi-label { font-size: 12px; color: #667085; font-weight: 600; letter-spacing: .03em; }
.kpi-value { font-size: 26px; font-weight: 700; margin-top: 4px; }

.flota-main { display: grid; grid-template-columns: 230px 1fr 260px; gap: 12px; height: calc(100vh - 230px); min-height: 480px; margin-bottom: 20px; }
.flota-sidebar { background: #fff; border-radius: 8px; padding: 12px; overflow-y: auto; }
.sidebar-header { font-weight: 700; margin-bottom: 8px; }
.buscador { width: 100%; padding: 7px; margin-bottom: 8px; border: 1px solid #ccd2d9; border-radius: 6px; }
.lista-maquinas { list-style: none; margin: 0; padding: 0; }
.maquina-item { padding: 7px 4px; font-size: 13px; cursor: pointer; border-bottom: 1px solid #f0f2f5; display: flex; align-items: center; gap: 6px; }
.maquina-item:hover { background: #f4f6f8; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-ok { background: #2e7d32; }
.dot-offline { background: #9e9e9e; }
.dot-elec_error { background: #1e88e5; }
.dot-bat_low { background: #c62828; }

.flota-mapa { background: #fff; border-radius: 8px; overflow: hidden; }
#mapa-flota { width: 100%; height: 100%; }

.flota-panel { background: #12213b; color: #fff; border-radius: 8px; padding: 14px; overflow-y: auto; }
.panel-header { font-weight: 700; margin-bottom: 10px; }
.panel-detalle .hint { color: #cfd8e3; }
.detalle-dispositivo h3 { margin: 0 0 6px; }
.detalle-tabla { width: 100%; margin-top: 10px; font-size: 13px; }
.detalle-tabla td { padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
.detalle-tabla td:first-child { color: #9fb0c9; width: 45%; }
.detalle-dispositivo .btn { margin-top: 12px; display: inline-block; }

.flota-tablas { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.tabla-alerta { background: #fff; border-radius: 8px; padding: 12px; }
.tabla-alerta h3 { margin: 0 0 8px; font-size: 15px; }
.tabla-elec h3 { color: #1e88e5; }
.tabla-bat h3 { color: #c62828; }
.tabla-off h3 { color: #667085; }

.icono-maquina-circulo { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
