body { margin: 0; font-family: Arial, sans-serif; background: #f3f4f6; color: #111827; }
.topbar { background: #111827; color: white; }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 14px 16px; }
.brand { color: white; text-decoration: none; font-weight: 800; }
.container { max-width: 1200px; margin: 0 auto; padding: 20px 16px 40px; }
.page-title { font-size: 28px; margin: 0 0 16px; }
.section-title { font-size: 22px; margin: 24px 0 12px; }
.card-grid, .channel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card { display: block; background: white; border-radius: 16px; padding: 18px; box-shadow: 0 2px 10px rgba(0,0,0,0.08); text-decoration: none; color: inherit; }
.card-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.card-sub, .muted { color: #6b7280; }
.badge { display: inline-block; margin: 8px 0; padding: 4px 8px; border-radius: 999px; background: #dbeafe; color: #1d4ed8; font-size: 12px; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.btn { border: none; border-radius: 12px; padding: 14px 10px; font-weight: 700; color: white; cursor: pointer; }
.open { background: #16a34a; }
.stop { background: #6b7280; }
.close { background: #dc2626; }
.slider-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin-top: 14px; }
.slider-row input[type=range] { grid-column: 1 / -1; width: 100%; }
.table-wrap { overflow-x: auto; background: white; padding: 12px; border-radius: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; border-bottom: 1px solid #e5e7eb; font-size: 14px; text-align: left; }
.msg { display: none; padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-weight: 700; }
.msg.ok { display: block; background: #ecfdf5; color: #166534; }
.msg.bad { display: block; background: #fef2f2; color: #991b1b; }
.blink { animation: blinkAnim 1s infinite; }
@keyframes blinkAnim { 0% { opacity: 1; } 50% { opacity: .35; } 100% { opacity: 1; } }

.monitor-page{ padding: 0; }
.monitor-title{ font-size: 28px; margin: 0; }
.monitor-now{ margin-top: 10px; color: #6b7280; font-weight: 700; }
.quick-chip-row, .group-chip-row{ display:flex; gap:10px; overflow:auto; padding-bottom:14px; scrollbar-width:none; }
.quick-chip-row::-webkit-scrollbar, .group-chip-row::-webkit-scrollbar{ display:none; }
.quick-chip, .group-chip{ padding:10px 14px; border-radius:999px; background:#fff; color:#111; text-decoration:none; font-weight:700; white-space:nowrap; }
.quick-chip.active, .group-chip.active{ background:#111827; color:#fff; }
.group-chip.manage{ background:#dbeafe; color:#1d4ed8; }
.monitor-hero, .command-log-panel{ background:#fff; border-radius:20px; padding:16px; box-shadow:0 4px 16px rgba(0,0,0,.06); margin-bottom:16px; }
.device-grid{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; }
.device-card{ display:block; text-decoration:none; color:#111; background:#fff; border-radius:18px; padding:18px; box-shadow:0 4px 16px rgba(0,0,0,.06); }
.device-name{ font-size:20px; font-weight:800; line-height:1.2; margin-bottom:10px; }
.device-status{ display:inline-flex; align-items:center; justify-content:center; padding:8px 14px; border-radius:999px; font-size:13px; font-weight:800; text-transform:uppercase; margin-bottom:14px; }
.device-status.online{ background:#e8f7ee; color:#128145; border:1px solid #bfe5cb; }
.device-status.offline{ background:#fdecec; color:#b42318; border:1px solid #f4c7c3; }
.device-metric-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.device-metric-box{ background:#f7f8fb; border:1px solid #eef1f5; border-radius:14px; padding:14px 10px; text-align:center; }
.metric-icon{ font-size:22px; line-height:1; margin-bottom:6px; }
.metric-label{ font-size:13px; color:#7b8494; margin-bottom:6px; font-weight:700; }
.metric-value{ font-size:18px; font-weight:900; line-height:1.05; }
.command-log-title{font-size:20px;font-weight:800;margin-bottom:12px;}
.command-log-scroll{max-height:340px;overflow:auto;}
.command-log-table{width:100%;border-collapse:collapse;min-width:760px;}
.command-log-table th,.command-log-table td{padding:10px 8px;border-bottom:1px solid #eef2f6;text-align:left;font-size:13px;white-space:nowrap;}
.command-log-table th{position:sticky;top:0;background:#fff;z-index:2;}
.command-status{display:inline-block;padding:4px 8px;border-radius:999px;font-size:11px;font-weight:800;text-transform:uppercase;}
.command-status.success{background:#eaf8ef;color:#1f7a3f;}
.command-status.failed{background:#fdecec;color:#c0392b;}
.command-status.requested{background:#eef4ff;color:#2457c5;}
