.stream-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: .85rem; }
.stream-grid-virtual { display: block; max-height: 70vh; overflow-y: auto; }
.streams-panel-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .5rem; }
.stream-view-selector { display: inline-flex; align-items: center; gap: .4rem; color: #cbd5e1; font-size: .78rem; font-weight: 650; }
.stream-view-select-wrap { position: relative; display: inline-flex; align-items: center; }
.stream-view-icon { position: absolute; left: .65rem; z-index: 1; width: 16px; height: 16px; color: #94a3b8; pointer-events: none; }
.stream-view-select-button { display: inline-flex; min-width: 9.5rem; min-height: 48px; align-items: center; justify-content: space-between; gap: 1.5rem; padding: .75rem 2.75rem .75rem 2.35rem; border: 1px solid rgba(148, 163, 184, .42); border-radius: 10px; background: linear-gradient(145deg, #1b293b, #0d1624); box-shadow: inset 0 1px rgba(255, 255, 255, .08), 0 3px 10px rgba(0, 0, 0, .18); color: #f1f5f9; font: inherit; font-size: .84rem; font-weight: 650; line-height: 1.5; cursor: pointer; }
.stream-view-select-button:hover { border-color: rgba(251, 113, 133, .7); background: linear-gradient(145deg, #23344a, #111c2d); }
.stream-view-select-button:focus-visible, .stream-view-menu button:focus-visible { outline: 2px solid #fb7185; outline-offset: 2px; }
.stream-view-select-wrap::after { position: absolute; right: .75rem; width: .5rem; height: .5rem; border-right: 2px solid #94a3b8; border-bottom: 2px solid #94a3b8; transform: rotate(45deg) translateY(-2px); content: ""; pointer-events: none; }
.stream-view-menu { position: absolute; top: calc(100% + .35rem); right: 0; z-index: 20; display: grid; min-width: 100%; gap: .3rem; padding: .45rem; border: 1px solid rgba(148, 163, 184, .35); border-radius: 10px; background: #111a2a; box-shadow: 0 10px 24px rgba(0, 0, 0, .3); }
.stream-view-menu button { display: flex; min-height: 48px; align-items: center; gap: .7rem; padding: .75rem .8rem; border: 0; border-radius: 7px; background: transparent; color: #cbd5e1; font: inherit; font-size: .84rem; font-weight: 650; text-align: left; white-space: nowrap; cursor: pointer; }
.stream-view-menu button svg { width: 17px; height: 17px; color: #94a3b8; }
.stream-view-menu button:hover, .stream-view-menu button.selected { background: rgba(148, 163, 184, .12); color: #f8fafc; }
.stream-view-menu button.selected svg { color: #fb7185; }
.streams-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 .9rem; }
.streams-toolbar-button { min-height: 36px; padding: .4rem .8rem; border: 1px solid rgba(148, 163, 184, .28); border-radius: 8px; background: rgba(15, 23, 32, .8); color: #e2e8f0; font-size: .8rem; font-weight: 650; cursor: pointer; }
.streams-toolbar-button:hover:not(:disabled) { background: rgba(30, 41, 52, .95); }
.streams-toolbar-button:disabled { cursor: not-allowed; opacity: .5; }
.streams-toolbar-primary { border: 0; background-color: #b9101c; background-image: linear-gradient(180deg, #ff6974 0%, #ff2a3b 26%, #e11626 54%, #b9101c 80%, #8d0b15 100%); color: #fff; box-shadow: none; }
.streams-toolbar-primary:hover:not(:disabled) { background-color: #c81220; background-image: linear-gradient(180deg, #ff8790 0%, #ff3f4d 26%, #ed1d2e 54%, #c81220 80%, #9f0d18 100%); box-shadow: none; }
.streams-toolbar-active { border-color: rgba(234, 179, 8, .6); color: #facc15; }
.streams-toolbar-button:focus-visible { outline: 2px solid #fb7185; outline-offset: 2px; }

.stream-card { display: flex; flex-direction: column; gap: .75rem; min-width: 0; padding: .9rem 1rem; border: 1px solid rgba(148, 163, 184, .2); border-radius: 13px; background: rgba(5, 10, 15, .6); transition: border-color .2s ease, box-shadow .2s ease; }
.stream-card-selected { box-shadow: 0 0 0 1px rgba(148, 163, 184, .5); }
.stream-card-healthy { border-color: rgba(34, 197, 94, .4); }
.stream-card-warning { border-color: rgba(234, 179, 8, .55); }
.stream-card-critical { border-color: rgba(239, 68, 68, .75); animation: stream-critical-pulse 1.6s ease-in-out infinite; }
.stream-card-offline { border-color: rgba(100, 116, 139, .3); }
@keyframes stream-critical-pulse { 0%, 100% { box-shadow: 0 0 0 rgba(239, 68, 68, 0); } 50% { box-shadow: 0 0 16px rgba(239, 68, 68, .35); } }
@media (prefers-reduced-motion: reduce) { .stream-card-critical { animation: none; } }
.stream-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; }
.stream-card-identity { display: grid; min-width: 0; gap: .2rem; }
.stream-card-identity strong { overflow: hidden; color: #f1f5f9; font-size: .95rem; text-overflow: ellipsis; white-space: nowrap; }
.stream-card-identity small { color: #8290a0; font-size: .72rem; }
.stream-health-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .5rem; border: 1px solid; border-radius: 999px; font-size: .62rem; font-weight: 750; letter-spacing: .03em; white-space: nowrap; }
.stream-health-badge > span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.stream-health-healthy { border-color: rgba(34, 197, 94, .6); color: #4ade80; }
.stream-health-warning { border-color: rgba(234, 179, 8, .6); color: #facc15; }
.stream-health-critical { border-color: rgba(239, 68, 68, .7); color: #f87171; }
.stream-health-offline { border-color: rgba(100, 116, 139, .4); color: #94a3b8; }
.stream-card-meters { display: grid; gap: .4rem; }
.stream-card-meter-row { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); align-items: center; gap: .5rem; color: #94a3b8; font-size: .7rem; }
.stream-card-readout { display: flex; gap: 1.5rem; margin: 0; }
.stream-card-readout dt { color: #8290a0; font-size: .65rem; font-weight: 600; text-transform: uppercase; }
.stream-card-readout dd { margin: 0; color: #e2e8f0; font-size: .85rem; font-variant-numeric: tabular-nums; }
.stream-card-alerts { display: flex; flex-wrap: wrap; gap: .35rem; min-height: 1.5rem; font-size: .75rem; }
.stream-alert-chip { padding: .15rem .5rem; border-radius: 6px; background: rgba(127, 29, 29, .35); color: #fecaca; font-weight: 650; }
.stream-alert-none { color: #8290a0; }
.stream-alert-error { color: #fca5a5; }
.stream-card-actions { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; }
.stream-card-details { padding: 0; border: 0; background: transparent; color: #cbd5e1; font-size: .8rem; cursor: pointer; }
.stream-card-details:hover { color: #fff; }
.stream-card-controls { display: flex; gap: .2rem; }
.stream-list { display: grid; gap: .5rem; }
.stream-list-item { display: grid; grid-template-columns: 15fr 60fr 35fr; align-items: center; gap: .55rem; min-width: 0; padding: .4rem .6rem; border: 1px solid rgba(148, 163, 184, .2); border-left: 3px solid rgba(100, 116, 139, .3); border-radius: 10px; background: rgba(5, 10, 15, .6); }
.stream-list-item > * { box-sizing: border-box; min-width: 0; padding-inline: 20px; }
.stream-list-icon-column { display: grid; align-content: center; justify-items: start; gap: .2rem; width: 100%; min-width: 0; }
.stream-list-icon-column .stream-list-identity { overflow: hidden; }
.stream-list-icon-column img { display: block; width: 32px; height: 32px; object-fit: contain; }
.stream-list-item-selected { box-shadow: 0 0 0 1px rgba(148, 163, 184, .5); }
.stream-list-item-healthy { border-left-color: rgba(34, 197, 94, .7); }
.stream-list-item-warning { border-left-color: rgba(234, 179, 8, .8); }
.stream-list-item-critical { border-left-color: rgba(239, 68, 68, .9); }
.stream-list-meters { display: grid; grid-template-columns: 1fr; gap: .35rem; }
.stream-list-meter { display: grid; gap: .15rem; }
.stream-list-meter > div { display: flex; justify-content: space-between; gap: .5rem; color: #94a3b8; font-size: .7rem; }
.stream-list-meter strong { color: #e2e8f0; font-weight: 600; font-variant-numeric: tabular-nums; }
.stream-list-information { display: flex; align-items: center; gap: .35rem; min-width: 0; }
.stream-list-info-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .35rem; width: 100%; min-width: 0; }
.stream-list-info-actions .stream-list-information { width: 100%; min-width: 0; }
.stream-list-identity { display: block; min-width: 0; flex: 1 1 auto; }
.stream-list-identity strong { overflow: hidden; color: #f1f5f9; font-size: .9rem; text-overflow: ellipsis; white-space: nowrap; }
.stream-list-identity span { color: #8290a0; font-size: .72rem; }
.stream-list-alerts { display: flex; flex: 1 1 auto; flex-wrap: nowrap; gap: .2rem; min-width: 0; overflow: hidden; font-size: .65rem; }
.stream-list-alerts > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stream-list-actions { display: flex; align-items: center; justify-content: flex-end; width: 100%; min-width: 0; }
.stream-list-action-buttons { display: flex; align-items: center; justify-content: flex-end; gap: .2rem; width: 100%; min-width: 0; }
.stream-list-actions .stream-card-details { white-space: nowrap; }

.dashboard-drawer-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .5); }
.dashboard-details-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(720px, 100vw); overflow-y: auto; padding: 1rem; border-left: 1px solid rgba(148, 163, 184, .25); background: #0b1118; }

@media (min-width: 900px) { .dashboard-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) { .stream-list-item { grid-template-columns: 15fr 85fr; } .stream-list-icon-column { grid-row: span 2; } .stream-list-meters { grid-column: 2; } .stream-list-info-actions { grid-column: 2; } }
@media (max-width: 620px) { .streams-panel-actions { width: 100%; justify-content: stretch; } .stream-view-selector, .stream-view-selector select, .streams-panel-actions .add-stream-button { flex: 1; } .stream-list-item { grid-template-columns: 15fr 85fr; align-items: start; } .stream-list-information { align-items: flex-start; flex-direction: column; } .stream-list-actions { justify-content: space-between; width: 100%; } }
