*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[v-cloak] { display: none !important; }
:root {
  --bg-primary: #eaeef4; --bg-secondary: #f2f5fa; --bg-card: #ffffff;
  --bg-card-hover: #f5f8fc; --bg-tertiary: #e3e8f0; --accent: #0a6fd4; --accent-glow: rgba(10,111,212,0.18);
  --accent-secondary: #1487e6; --text-primary: #14202e; --text-secondary: #5e6e80;
  --text-muted: #93a1b0; --danger: #e23b54; --danger-bg: rgba(226,59,84,0.08);
  --warning: #cf8a1a; --border: rgba(15,30,50,0.09); --radius: 16px;
  --radius-sm: 10px; --font-display: 'Inter', sans-serif; --font-body: 'Inter', sans-serif;
  --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
  --ok: #15a06b;
}
body { font-family: var(--font-body); background: var(--bg-primary); color: var(--text-primary); min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; letter-spacing: -0.01em; }
/* Tabular figures for all numeric/display text so digits align cleanly */
.t-value, .q-value, .tank-pct, .info-value, .telemetry-card .t-value { font-feature-settings: 'tnum' 1, 'cv01' 1; }
.bg-effects { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-effects .orb { position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.3; animation: orbFloat 20s ease-in-out infinite; }
.bg-effects .orb-1 { width: 500px; height: 500px; background: var(--accent); top: -150px; right: -100px; opacity: 0.08; }
.bg-effects .orb-2 { width: 400px; height: 400px; background: var(--accent-secondary); bottom: -100px; left: -100px; opacity: 0.06; animation-delay: -10s; }
.bg-effects .grid-overlay { position: absolute; inset: 0; background-image: linear-gradient(rgba(15,30,50,0.022) 1px, transparent 1px), linear-gradient(90deg, rgba(15,30,50,0.022) 1px, transparent 1px); background-size: 60px 60px; }
@keyframes orbFloat { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(30px,-20px) scale(1.05); } 66% { transform: translate(-20px,15px) scale(0.95); } }
#app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
/* Navbar */
.navbar { display: flex; align-items: center; justify-content: space-between; padding: 20px 28px; border-bottom: 1px solid var(--border); backdrop-filter: blur(20px); background: rgba(255,255,255,0.72); position: sticky; top: 0; z-index: 100; }
.navbar-brand { display: flex; align-items: center; gap: 12px; }
.navbar-brand .logo-icon { width: 38px; height: 38px; background: linear-gradient(135deg, var(--accent), var(--accent-secondary)); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.navbar-brand h1 { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; }
.navbar-brand h1 span { color: var(--accent); }
.navbar-user { display: flex; align-items: center; gap: 14px; }
.navbar-user img { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--border); }
.navbar-user .user-name { font-size: 0.875rem; font-weight: 500; color: var(--text-secondary); }
/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; border: none; border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: var(--transition); line-height: 1; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-secondary)); color: #fff; box-shadow: 0 4px 20px var(--accent-glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px var(--accent-glow); }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-card-hover); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(255,77,106,0.2); }
.btn-danger:hover { background: rgba(255,77,106,0.18); }
.btn-google { background: #fff; color: #3c4043; padding: 14px 28px; font-size: 0.95rem; border-radius: 12px; border: 1px solid rgba(15,30,50,0.1); box-shadow: 0 2px 12px rgba(20,40,80,0.12); }
.btn-google:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,0.3); }
.btn-google svg { width: 20px; height: 20px; }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; }
/* Auth */
.auth-screen { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { text-align: center; max-width: 420px; width: 100%; }
.auth-logo { width: 80px; height: 80px; background: linear-gradient(135deg, var(--accent), var(--accent-secondary)); border-radius: 24px; display: flex; align-items: center; justify-content: center; font-size: 36px; margin: 0 auto 28px; box-shadow: 0 8px 40px var(--accent-glow); animation: logoEntrance 0.8s cubic-bezier(0.16,1,0.3,1) both; }
@keyframes logoEntrance { from { opacity:0; transform:scale(0.5) rotate(-10deg); } to { opacity:1; transform:scale(1) rotate(0); } }
.auth-card h2 { font-family: var(--font-display); font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 10px; animation: fadeUp 0.6s 0.2s both; }
.auth-card p { color: var(--text-secondary); font-size: 1rem; line-height: 1.6; margin-bottom: 36px; animation: fadeUp 0.6s 0.35s both; }
.auth-actions { animation: fadeUp 0.6s 0.5s both; }
@keyframes fadeUp { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }
.auth-footer { margin-top: 32px; font-size: 0.8rem; color: var(--text-muted); animation: fadeUp 0.6s 0.65s both; }
/* Dashboard & Device List */
.dashboard { flex: 1; padding: 32px 28px; max-width: 800px; width: 100%; margin: 0 auto; }
.dashboard-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.dashboard-header h2 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
.device-count { color: var(--text-secondary); font-size: 0.85rem; margin-top: 4px; }
.empty-state { text-align: center; padding: 60px 20px; animation: fadeUp 0.5s both; }
.empty-state .empty-icon { width: 100px; height: 100px; border-radius: 30px; background: var(--bg-card); border: 2px dashed rgba(15,30,50,0.14); display: flex; align-items: center; justify-content: center; font-size: 42px; margin: 0 auto 24px; }
.empty-state h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; margin-bottom: 10px; }
.empty-state p { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 28px; line-height: 1.6; }
.device-grid { display: flex; flex-direction: column; gap: 14px; }
/* Device card — list view (clickable) */
.device-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; display: flex; align-items: center; gap: 18px; transition: var(--transition); animation: fadeUp 0.4s both; cursor: pointer; box-shadow: 0 2px 14px rgba(20,40,80,0.05); }
.device-card:hover { background: var(--bg-card-hover); border-color: rgba(15,30,50,0.14); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(20,40,80,0.12); }
.device-icon { width: 50px; height: 50px; border-radius: 14px; background: linear-gradient(135deg, rgba(0,212,170,0.15), rgba(0,136,255,0.1)); border: 1px solid rgba(0,212,170,0.2); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.device-info { flex: 1; min-width: 0; }
.device-info h4 { font-weight: 600; font-size: 1rem; margin-bottom: 4px; }
.device-info .device-id-label { font-size: 0.8rem; color: var(--text-muted); }
.device-info .device-added { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.device-status { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 500; }
.device-status .dot { width: 7px; height: 7px; border-radius: 50%; }
.device-status.online { color: var(--accent); }
.device-status.online .dot { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.device-status.offline { color: var(--text-muted); }
.device-status.offline .dot { background: var(--text-muted); }
.device-chevron { color: var(--text-muted); font-size: 1.2rem; transition: var(--transition); }
.device-card:hover .device-chevron { color: var(--accent); transform: translateX(3px); }
/* ===== Device Detail Page ===== */
.detail-page { flex: 1; padding: 32px 28px; max-width: 800px; width: 100%; margin: 0 auto; animation: fadeUp 0.35s both; }
.detail-back { display: inline-flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 0.88rem; font-weight: 500; cursor: pointer; transition: var(--transition); background: none; border: none; font-family: var(--font-body); }
.detail-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.detail-back:hover { color: var(--accent); }
.detail-back svg { transition: var(--transition); }
.detail-back:hover svg { transform: translateX(-3px); }
.detail-header { display: flex; align-items: center; gap: 18px; margin-bottom: 28px; }
.detail-header .device-icon { width: 60px; height: 60px; font-size: 28px; border-radius: 18px; }
.detail-header-info h2 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.detail-header-info .detail-id { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }
.detail-header-actions { margin-left: auto; display: flex; gap: 10px; }
.detail-status-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; padding: 14px 20px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.detail-status-bar .device-status { font-size: 0.85rem; }
.detail-status-bar .last-update { font-size: 0.8rem; color: var(--text-muted); margin-left: auto; }
/* Telemetry cards */
.telemetry-section h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; color: var(--text-secondary); }
.telemetry-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 28px; }
.telemetry-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 20px; text-align: center; transition: var(--transition); }
.telemetry-card:hover { border-color: rgba(15,30,50,0.14); }
.telemetry-card .t-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; }
.telemetry-card .t-value { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; color: var(--accent); line-height: 1; }
.telemetry-card .t-unit { font-size: 0.85rem; color: var(--text-secondary); font-weight: 400; }
.telemetry-card.pump-on .t-value { color: var(--accent); }
.telemetry-card.pump-off .t-value { color: var(--text-muted); }
/* Water level visual bar */
.water-level-visual { position: relative; width: 100%; height: 8px; background: rgba(15,30,50,0.08); border-radius: 4px; margin-top: 12px; overflow: hidden; }
.water-level-fill { height: 100%; border-radius: 4px; transition: width 0.8s cubic-bezier(0.4,0,0.2,1); background: linear-gradient(90deg, var(--accent), var(--accent-secondary)); }
/* Controls section */
.controls-section h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; color: var(--text-secondary); }
.pump-controls { display: flex; gap: 14px; }
.pump-btn { flex: 1; padding: 18px 24px; border-radius: var(--radius); font-family: var(--font-body); font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: var(--transition); border: none; display: flex; align-items: center; justify-content: center; gap: 10px; }
.pump-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.pump-btn-on { background: linear-gradient(135deg, rgba(0,212,170,0.15), rgba(0,212,170,0.08)); border: 1px solid rgba(0,212,170,0.3); color: var(--accent); }
.pump-btn-on:hover:not(:disabled) { background: linear-gradient(135deg, rgba(0,212,170,0.25), rgba(0,212,170,0.15)); box-shadow: 0 4px 20px var(--accent-glow); }
.pump-btn-off { background: var(--danger-bg); border: 1px solid rgba(255,77,106,0.3); color: var(--danger); }
.pump-btn-off:hover:not(:disabled) { background: rgba(255,77,106,0.18); }
.no-data-msg { text-align: center; color: var(--text-muted); font-size: 0.9rem; padding: 40px 20px; background: var(--bg-card); border: 1px dashed var(--border); border-radius: var(--radius); }
/* Mode toggle */
.mode-section { margin-bottom: 28px; }
.mode-section h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; color: var(--text-secondary); }
.mode-toggle { display: flex; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.mode-toggle button { flex: 1; padding: 14px 20px; border: none; background: none; color: var(--text-muted); font-family: var(--font-body); font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: var(--transition); display: flex; align-items: center; justify-content: center; gap: 8px; }
.mode-toggle button:disabled { opacity: 0.5; cursor: not-allowed; }
.mode-toggle button.active-mode { background: linear-gradient(135deg, rgba(0,212,170,0.15), rgba(0,212,170,0.08)); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(0,212,170,0.3); }
.mode-toggle button:hover:not(.active-mode):not(:disabled) { color: var(--text-primary); background: var(--bg-card-hover); }
.mode-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 10px; }
/* Threshold settings */
.threshold-section { margin-bottom: 28px; }
.threshold-section h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; color: var(--text-secondary); }
.threshold-row { display: flex; gap: 14px; align-items: flex-end; }
.threshold-field { flex: 1; }
.threshold-field label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.threshold-field input { width: 100%; padding: 12px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-family: var(--font-body); font-size: 0.95rem; outline: none; transition: var(--transition); }
.threshold-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.threshold-save { padding: 12px 20px; border: none; border-radius: var(--radius-sm); background: linear-gradient(135deg, rgba(0,136,255,0.15), rgba(0,136,255,0.08)); border: 1px solid rgba(0,136,255,0.3); color: var(--accent-secondary); font-family: var(--font-body); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: var(--transition); white-space: nowrap; }
.threshold-save:hover:not(:disabled) { background: linear-gradient(135deg, rgba(0,136,255,0.25), rgba(0,136,255,0.15)); }
.threshold-save:disabled { opacity: 0.5; cursor: not-allowed; }
.threshold-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 10px; }
/* Device info panel */
.info-section { margin-top: 28px; }
.info-section h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; color: var(--text-secondary); display: flex; align-items: center; justify-content: space-between; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.info-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; }
.info-item .info-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.info-item .info-value { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); word-break: break-all; }
.btn-refresh { padding: 6px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text-secondary); font-family: var(--font-body); font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: var(--transition); display: inline-flex; align-items: center; gap: 6px; }
.btn-refresh:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-refresh:disabled { opacity: 0.5; cursor: not-allowed; }
/* Admin / Advanced section */
.admin-section { margin-top: 32px; border-top: 1px solid var(--border); padding-top: 24px; }
.admin-section h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; color: var(--text-secondary); }
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-admin { padding: 10px 20px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text-primary); font-family: var(--font-body); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: var(--transition); display: inline-flex; align-items: center; gap: 8px; }
.btn-admin:hover:not(:disabled) { border-color: var(--accent); }
.btn-admin:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-admin.danger { border-color: var(--danger); color: var(--danger); }
.btn-admin.danger:hover:not(:disabled) { background: rgba(255,77,106,0.1); }
.ota-progress { margin-top: 16px; }
.ota-progress-label { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 6px; font-weight: 600; }
.ota-progress-bar { width: 100%; height: 10px; background: var(--bg-tertiary); border-radius: 6px; overflow: hidden; }
.ota-progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #00e6a0); border-radius: 6px; transition: width 0.3s ease; }
/* Pending command badge */
.pending-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 0.75rem; font-weight: 600; color: var(--warning); background: rgba(255,184,77,0.1); padding: 3px 10px; border-radius: 20px; animation: pulse 1.5s infinite; }
.pending-spinner { width: 12px; height: 12px; border: 2px solid rgba(255,184,77,0.3); border-top-color: var(--warning); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* WS status */
.ws-status { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; padding: 4px 10px; border-radius: 20px; }
.ws-status.connected { color: var(--accent); background: rgba(0,212,170,0.08); }
.ws-status.disconnected { color: var(--danger); background: rgba(255,77,106,0.08); }
.ws-status.connecting { color: var(--warning); background: rgba(255,184,77,0.08); }
.ws-status .ws-dot { width: 6px; height: 6px; border-radius: 50%; }
.ws-status.connected .ws-dot { background: var(--accent); }
.ws-status.disconnected .ws-dot { background: var(--danger); }
.ws-status.connecting .ws-dot { background: var(--warning); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.3; } }
/* Modal, Toast, Spinner, Responsive */
.modal-overlay { position: fixed; inset: 0; background: rgba(20,32,52,0.4); backdrop-filter: blur(8px); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; animation: modalOverlayIn 0.25s both; }
@keyframes modalOverlayIn { from { opacity:0; } to { opacity:1; } }
.modal { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 20px; width: 100%; max-width: 440px; padding: 32px; animation: modalIn 0.35s cubic-bezier(0.16,1,0.3,1) both; }
@keyframes modalIn { from { opacity:0; transform:scale(0.92) translateY(20px); } to { opacity:1; transform:scale(1) translateY(0); } }
.modal h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }
.modal .modal-desc { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 28px; line-height: 1.5; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.form-group input { width: 100%; padding: 14px 16px; background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-family: var(--font-body); font-size: 0.95rem; outline: none; transition: var(--transition); }
.form-group input::placeholder { color: var(--text-muted); }
.form-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-group .input-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 6px; }
.form-error { font-size: 0.82rem; color: var(--danger); margin-bottom: 16px; padding: 10px 14px; background: var(--danger-bg); border-radius: var(--radius-sm); border: 1px solid rgba(255,77,106,0.15); }
.modal-actions { display: flex; gap: 10px; margin-top: 8px; }
.modal-actions .btn { flex: 1; }
.confirm-body { color: var(--text-secondary); font-size: 0.92rem; line-height: 1.6; margin-bottom: 24px; }
.confirm-device-name { color: var(--text-primary); font-weight: 600; }
.toast-container { position: fixed; top: 28px; right: 28px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast { padding: 14px 20px; border-radius: var(--radius-sm); font-size: 0.88rem; font-weight: 500; animation: toastIn 0.35s cubic-bezier(0.16,1,0.3,1) both; box-shadow: 0 8px 30px rgba(0,0,0,0.3); }
.toast-success { background: rgba(0,212,170,0.15); border: 1px solid rgba(0,212,170,0.3); color: var(--accent); }
.toast-error { background: var(--danger-bg); border: 1px solid rgba(255,77,106,0.3); color: var(--danger); }
@keyframes toastIn { from { opacity:0; transform:translateY(-20px) scale(0.95); } to { opacity:1; transform:translateY(0) scale(1); } }
.spinner { width: 20px; height: 20px; border: 2.5px solid rgba(15,30,50,0.12); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
.spinner-dark { border-color: rgba(15,30,50,0.18); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-screen { flex: 1; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 16px; }
/* ===== Light-theme system nodes + tank visual + water quality ===== */
.nodes-wrap { margin-bottom: 22px; }
.node-line { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 9px 14px; display: flex; align-items: center; gap: 12px; box-shadow: 0 1px 8px rgba(20,40,80,0.04); font-size: 0.82rem; }
.node-line .nl-node { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.node-line .nl-divider { width: 1px; align-self: stretch; background: var(--border); flex-shrink: 0; }
.node-line .nl-role { font-weight: 700; color: var(--text-primary); }
.node-line .nl-wifi { display: flex; align-items: center; gap: 5px; color: var(--text-secondary); margin-left: auto; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-line .nl-wifi.nl-muted { color: var(--text-muted); }
.node-line .nl-status { display: flex; align-items: center; gap: 6px; font-weight: 600; flex-shrink: 0; }
.node-line .nl-status .dot { width: 8px; height: 8px; border-radius: 50%; }
.node-line .nl-status.online { color: var(--ok); }
.node-line .nl-status.online .dot { background: var(--ok); box-shadow: 0 0 8px rgba(21,160,107,0.4); }
.node-line .nl-status.offline { color: var(--text-muted); }
.node-line .nl-status.offline .dot { background: var(--text-muted); }
.detail-lastupdate { font-size: 0.74rem; color: var(--text-muted); margin-top: 4px; }
.detail-footer-actions { margin-top: 28px; display: flex; justify-content: center; }
/* Tank */
.tank-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; padding: 26px 24px 30px; margin-bottom: 22px; box-shadow: 0 4px 24px rgba(20,40,80,0.06); }
.tank-card-topbar { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.battery { display: flex; align-items: center; gap: 6px; }
.battery .batt-state { font-size: 0.8rem; line-height: 1; width: 12px; text-align: center; }
.battery.charging .batt-state { color: var(--ok); }
.battery.discharging .batt-state { color: var(--warning); }
.battery.idle .batt-state { color: var(--text-muted); }
.batt-glyph { position: relative; width: 40px; height: 18px; border: 2px solid var(--text-secondary); border-radius: 5px; padding: 2px; }
.batt-glyph::after { content: ''; position: absolute; right: -5px; top: 50%; transform: translateY(-50%); width: 3px; height: 7px; background: var(--text-secondary); border-radius: 0 2px 2px 0; }
.batt-fill { height: 100%; border-radius: 2px; background: var(--ok); transition: width 0.5s ease; }
.batt-glyph.low .batt-fill { background: var(--danger); }
.batt-pct { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); font-feature-settings: 'tnum' 1; }
.tank-card-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.tank-card-head h3 { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.01em; }
.tank-card-head .tank-sub { font-size: 0.85rem; color: var(--text-secondary); margin-top: 3px; }
.tank-card-head .tds-chip { text-align: right; }
.tank-card-head .tds-chip .tds-label { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.tank-card-head .tds-chip .tds-val { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; color: var(--accent); line-height: 1.1; }
.tank-card-head .tds-chip .tds-val .u { font-size: 0.72rem; font-weight: 600; color: var(--text-secondary); margin-left: 3px; }
.tank-wrap { display: flex; flex-direction: column; align-items: center; }
.system-visual { display: flex; align-items: center; justify-content: center; gap: 36px; }
.tank { position: relative; width: 180px; height: 240px; background: #e9edf2; border-radius: 24px; overflow: hidden; box-shadow: inset 0 2px 8px rgba(15,30,50,0.08); }
.tank-water { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg, #5ba8e0, #2b79c9); transition: height 0.9s cubic-bezier(0.4,0,0.2,1); }
.tank-water::before { content: ''; position: absolute; top: -5px; left: 0; right: 0; height: 10px; background: rgba(255,255,255,0.3); border-radius: 50%; }
.tank-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 2.7rem; font-weight: 800; color: rgba(18,40,72,0.42); letter-spacing: -0.02em; }
.tank-pct span { font-size: 1.4rem; margin-left: 1px; }
.tank-legend { display: flex; justify-content: space-between; width: 100%; max-width: 280px; margin-top: 20px; font-size: 0.78rem; font-weight: 600; }
.tank-legend .low, .tank-legend .high { color: var(--text-muted); }
.tank-legend .opt { color: var(--accent); }
/* Motor visual */
.motor-unit { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.motor { width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: color 0.3s, background 0.3s, box-shadow 0.3s; }
.motor.running { color: var(--ok); background: radial-gradient(circle, rgba(21,160,107,0.14), rgba(21,160,107,0.04)); box-shadow: 0 0 20px rgba(21,160,107,0.25); }
.motor.running svg { animation: motor-spin 1.6s linear infinite; }
.motor.stopped { color: var(--text-muted); background: radial-gradient(circle, rgba(120,135,150,0.12), rgba(120,135,150,0.03)); }
@keyframes motor-spin { to { transform: rotate(360deg); } }
.motor-label { font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); }
.motor-state { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 700; }
.motor-state .dot { width: 8px; height: 8px; border-radius: 50%; }
.motor-state.on { color: var(--ok); }
.motor-state.on .dot { background: var(--ok); box-shadow: 0 0 8px rgba(21,160,107,0.4); }
.motor-state.off { color: var(--text-muted); }
.motor-state.off .dot { background: var(--text-muted); }
@media (max-width: 600px) {
  .navbar { padding: 16px 18px; } .dashboard, .detail-page { padding: 24px 18px; }
  .device-card { padding: 18px 16px; gap: 14px; } .modal { padding: 24px 20px; }
  .auth-card h2 { font-size: 1.6rem; } .navbar-user .user-name { display: none; }
  .pump-controls { flex-direction: column; } .telemetry-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-header { flex-wrap: wrap; } .detail-header-actions { margin-left: auto; margin-top: 0; }
  .node-line { flex-wrap: wrap; } .node-line .nl-divider { display: none; } .node-line .nl-node { flex: 1 1 100%; }
  .system-visual { flex-direction: column; gap: 24px; }
}
