﻿* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: #eef2f6;
            min-height: 100vh;
            padding: 14px 20px 20px;
            color: #111827;
        }

        .app-navbar {
            max-width: 1400px;
            margin: 0 auto 14px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            padding: 12px 14px;
            border-radius: 18px;
            background:
                linear-gradient(100deg, rgba(255,244,228,0.10), transparent 24%, rgba(255,244,228,0.03) 50%, transparent 78%),
                linear-gradient(90deg, rgba(4,15,25,0.98) 0%, rgba(8,27,43,0.96) 48%, rgba(15,63,90,0.94) 100%);
            border: 1px solid rgba(224, 195, 153, 0.16);
            box-shadow: 0 18px 44px rgba(0, 18, 31, 0.22);
        }

        .app-navbar-brand {
            display: flex;
            align-items: center;
            gap: 10px;
            min-width: max-content;
            color: white;
            font-weight: 800;
            letter-spacing: 0;
            text-decoration: none;
        }

        .brand-mark {
            width: 36px;
            height: 36px;
            border-radius: 12px;
            display: grid;
            place-items: center;
            background: linear-gradient(135deg, #ff7a18, #0f766e);
            color: white;
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
        }

        .app-navbar-menu {
            display: flex;
            flex-wrap: wrap;
            justify-content: flex-end;
            align-items: center;
            gap: 8px;
        }

        .nav-action-btn {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            min-height: 36px;
            margin-top: 0;
            padding: 8px 12px;
            border-radius: 10px;
            background: rgba(255,255,255,0.06);
            border: 1px solid rgba(255,255,255,0.14);
            color: rgba(255,255,255,0.9);
            font-size: 0.9em;
            font-weight: 700;
            box-shadow: none;
            text-decoration: none;
        }

        .nav-action-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 10px 20px rgba(0,0,0,0.16);
            background: rgba(255,255,255,0.12);
        }

        .nav-action-btn.active {
            background: #ff6b2c;
            border-color: #ff6b2c;
            color: white;
        }

        .nav-user-chip {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            min-height: 36px;
            padding: 8px 12px;
            border-radius: 10px;
            background: rgba(255,255,255,0.08);
            border: 1px solid rgba(255,255,255,0.12);
            color: rgba(255,255,255,0.86);
            font-size: 0.84em;
            font-weight: 700;
        }

        .role-chip {
            border-radius: 999px;
            padding: 2px 7px;
            background: rgba(255,255,255,0.14);
            color: rgba(255,255,255,0.88);
            font-size: 0.82em;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            background: white;
            border-radius: 15px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            overflow: hidden;
        }

        header {
            background: linear-gradient(135deg, #111827 0%, #0f766e 100%);
            color: white;
            padding: 30px;
            text-align: left;
        }

        header h1 {
            font-size: 2.2em;
            margin-bottom: 10px;
            letter-spacing: 0;
        }

        header p {
            font-size: 1.1em;
            opacity: 0.9;
        }

        .content {
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
            gap: 20px;
            padding: 30px;
        }

        .content.single-panel {
            grid-template-columns: 1fr;
        }

        .app-page {
            display: none;
        }

        .app-page.active {
            display: block;
        }

        .app-page.content.active {
            display: grid;
        }

        .workspace-header {
            grid-column: 1 / -1;
            padding: 18px 20px;
            border-radius: 10px;
            background: #f8fafc;
            border: 1px solid #e5e7eb;
        }

        .workspace-header h2 {
            color: #111827;
            margin: 3px 0 4px;
            font-size: 1.35em;
        }

        [hidden] {
            display: none !important;
        }

        .report-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 12px;
        }

        .report-card {
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 14px;
            background: #ffffff;
        }

        .audio-player-card {
            margin-top: 10px;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 12px;
            background: #f8fafc;
        }

        .command-center {
            background: #f8fafc;
            border-bottom: 1px solid #e5e7eb;
            padding: 24px 30px 30px;
        }

        .dashboard-hero {
            position: relative;
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
            gap: 18px;
            padding: 20px;
            margin-bottom: 16px;
            border-radius: 16px;
            background:
                radial-gradient(circle at top left, rgba(20, 184, 166, .22), transparent 34%),
                radial-gradient(circle at bottom right, rgba(245, 158, 11, .18), transparent 30%),
                linear-gradient(135deg, #0b1f2d 0%, #12384d 48%, #164e63 100%);
            color: white;
            overflow: hidden;
        }

        .hero-main,
        .hero-side {
            position: relative;
            z-index: 1;
            min-width: 0;
        }

        .hero-radio-mount {
            min-width: 0;
        }

        .hero-radio-mount .dashboard-radio {
            border-radius: 18px;
            height: 330px;
            min-height: 330px;
            max-height: 330px;
        }

        .hero-kpi-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 10px;
            margin-top: 12px;
        }

        .hero-kpi {
            min-width: 0;
            padding: 12px;
            border-radius: 14px;
            background: rgba(255,255,255,.09);
            border: 1px solid rgba(255,255,255,.14);
        }

        .hero-kpi .stat-value {
            font-size: 1.35rem;
            font-weight: 800;
            line-height: 1.05;
            color: #fff;
        }

        .hero-kpi .stat-label {
            font-size: .72rem;
            color: rgba(255,255,255,.72);
            margin-top: 4px;
            font-weight: 700;
        }

        .hero-kpi .stat-sub {
            font-size: .68rem;
            color: rgba(255,255,255,.56);
            margin-top: 2px;
        }

        .speedo-card {
            min-height: 100%;
            padding: 14px;
            border-radius: 18px;
            background: rgba(255,255,255,.1);
            border: 1px solid rgba(255,255,255,.14);
            backdrop-filter: blur(10px);
            display: flex;
            flex-direction: column;
        }

        .speedo-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-bottom: 8px;
        }

        .speedo-title {
            font-size: .92rem;
            font-weight: 850;
            color: #fff;
        }

        .speedo-status-badge {
            padding: 6px 10px;
            border-radius: 999px;
            font-size: .72rem;
            font-weight: 800;
            text-transform: uppercase;
            background: rgba(255,255,255,.12);
            border: 1px solid rgba(255,255,255,.16);
        }

        .speedo-canvas-wrap {
            position: relative;
            width: 100%;
            max-width: 425px;
            margin: 0 auto;
        }

        .speedo-canvas-wrap canvas {
            display: block;
            width: 100%;
            height: auto;
            filter: drop-shadow(0 18px 28px rgba(0,0,0,.18));
        }

        .speedo-dual-legend {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            align-items: center;
        }

        .speedo-dual-legend {
            justify-content: center;
            margin-top: 8px;
        }

        .speedo-dual-chip {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 7px 10px;
            border-radius: 999px;
            background: rgba(255,255,255,.12);
            border: 1px solid rgba(255,255,255,.16);
            font-size: .72rem;
            font-weight: 700;
            color: rgba(255,255,255,.82);
        }

        .speedo-dual-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            display: inline-block;
            flex: 0 0 auto;
        }

        .speedo-meta {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px;
            margin-top: auto;
            padding-top: 14px;
        }

        .speedo-meta-stat {
            padding: 12px;
            border-radius: 14px;
            background: rgba(255,255,255,.09);
            border: 1px solid rgba(255,255,255,.14);
        }

        .speedo-meta-stat .val {
            font-size: 1.2rem;
            font-weight: 800;
            color: #fff;
        }

        .speedo-meta-stat .lbl {
            font-size: .68rem;
            color: rgba(255,255,255,.68);
            font-weight: 700;
        }

        .stats-wall {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 14px;
            margin-bottom: 16px;
        }

        .chart-card {
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 14px;
            min-height: 220px;
        }

        .section-title {
            font-size: .94rem;
            font-weight: 750;
            color: #374151;
            margin-bottom: 12px;
        }

        .sf-flow-kpis {
            display: grid;
            grid-template-columns: repeat(6, minmax(0, 1fr));
            gap: 10px;
            margin-bottom: 16px;
        }

        .sf-flow-kpi {
            min-width: 0;
            padding: 12px;
            border-radius: 12px;
            background: white;
            border: 1px solid #e5e7eb;
        }

        .sf-flow-kpi .val {
            font-size: 1.2rem;
            font-weight: 850;
            color: #111827;
            line-height: 1.05;
        }

        .sf-flow-kpi .lbl {
            font-size: .7rem;
            color: #6b7280;
            margin-top: 4px;
            font-weight: 700;
        }

        .progress-list {
            display: grid;
            gap: 9px;
        }

        .progress-item {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            gap: 10px;
            align-items: center;
            font-size: .86rem;
        }

        .progress-track {
            height: 8px;
            border-radius: 999px;
            background: #e5e7eb;
            overflow: hidden;
            margin-top: 5px;
        }

        .progress-track span {
            display: block;
            height: 100%;
            border-radius: inherit;
            background: #0f766e;
        }

        .mini-stat-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px;
        }

        .mini-stat {
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 12px;
            text-align: center;
            background: #f8fafc;
        }

        .mini-stat .val {
            font-size: 1.3rem;
            font-weight: 850;
            color: #111827;
        }

        .mini-stat .lbl {
            font-size: .72rem;
            color: #6b7280;
            margin-top: 3px;
        }

        .tenant-toolbar {
            display: flex;
            align-items: flex-end;
            justify-content: space-between;
            gap: 16px;
            margin-bottom: 18px;
        }

        .tenant-toolbar h2 {
            color: #111827;
            font-size: 1.45em;
            margin: 4px 0;
            letter-spacing: 0;
        }

        .eyebrow {
            color: #0f766e;
            font-size: 0.78em;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0;
        }

        .muted {
            color: #6b7280;
            font-size: 0.92em;
            line-height: 1.45;
        }

        .toolbar-actions {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: flex-end;
            gap: 10px;
        }

        .tenant-select {
            min-width: 240px;
            background: white;
        }

        .health-pill {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            border-radius: 999px;
            padding: 7px 12px;
            font-size: 0.86em;
            font-weight: 700;
            background: #ecfdf5;
            color: #047857;
            border: 1px solid #a7f3d0;
        }

        .health-pill.watch {
            background: #fffbeb;
            color: #92400e;
            border-color: #fde68a;
        }

        .health-pill.critical {
            background: #fef2f2;
            color: #b91c1c;
            border-color: #fecaca;
        }

        .health-dot,
        .live-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: currentColor;
            display: inline-block;
        }

        .live-dot {
            color: #10b981;
            animation: pulse 1.4s ease-in-out infinite;
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; transform: scale(1); }
            50% { opacity: 0.45; transform: scale(0.72); }
        }

        .metric-grid {
            display: grid;
            grid-template-columns: repeat(6, minmax(0, 1fr));
            gap: 12px;
            margin-bottom: 16px;
        }

        .metric-card {
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 14px;
            min-height: 96px;
        }

        .metric-label {
            color: #6b7280;
            font-size: 0.82em;
            line-height: 1.35;
        }

        .metric-value {
            color: #111827;
            font-size: 1.8em;
            font-weight: 800;
            line-height: 1.1;
            margin-top: 6px;
        }

        .metric-note {
            color: #4b5563;
            font-size: 0.82em;
            margin-top: 6px;
            overflow-wrap: anywhere;
        }

        .ops-grid {
            display: grid;
            grid-template-columns: 1.2fr 1fr;
            gap: 14px;
        }

        .ops-panel {
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 14px;
            min-height: 190px;
        }

        .ops-panel h3 {
            color: #111827;
            font-size: 1em;
            margin-bottom: 10px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 8px;
        }

        .ops-list {
            display: grid;
            gap: 8px;
        }

        .ops-row {
            display: grid;
            grid-template-columns: 1fr auto;
            gap: 10px;
            align-items: center;
            padding: 9px 0;
            border-top: 1px solid #f3f4f6;
            color: #374151;
            font-size: 0.9em;
        }

        .ops-row:first-child {
            border-top: 0;
        }

        .ops-row strong {
            color: #111827;
        }

        .stream-toolbar {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 12px;
        }

        .stream-toolbar button,
        .stream-actions button {
            margin-top: 0;
            padding: 7px 10px;
            font-size: 0.82em;
            border-radius: 6px;
        }

        .live-stream-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 10px;
        }

        .live-monitor-shell {
            grid-column: 1 / -1;
            background: #f4f6fb;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            overflow: hidden;
            min-height: 620px;
        }

        .live-monitor-top-bar {
            background: rgba(255,255,255,.96);
            border-bottom: 1px solid #dee2e6;
            padding: 8px 12px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            flex-wrap: wrap;
        }

        .live-monitor-brand {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            color: #ff4500;
            font-weight: 800;
            letter-spacing: 0;
            white-space: nowrap;
        }

        .live-monitor-stats {
            display: flex;
            align-items: center;
            gap: 14px;
            flex-wrap: wrap;
            font-size: .82rem;
            color: #4b5563;
        }

        .live-monitor-stats strong {
            color: #ff4500;
        }

        .live-monitor-controls,
        .live-monitor-source-bar {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 8px;
        }

        .live-monitor-source-bar {
            padding: 10px 12px;
            background: #ffffff;
            border-bottom: 1px solid #e5e7eb;
        }

        .live-monitor-source-bar input {
            min-width: 160px;
            flex: 1 1 160px;
        }

        .live-monitor-btn {
            margin-top: 0;
            padding: 7px 10px;
            border-radius: 5px;
            font-size: .78rem;
            font-weight: 750;
            background: #ffffff;
            color: #374151;
            border: 1px solid #d1d5db;
            box-shadow: none;
        }

        .live-monitor-btn:hover {
            transform: none;
            box-shadow: none;
            border-color: #ff4500;
            color: #ff4500;
        }

        .live-monitor-btn.active,
        .live-monitor-btn.primary {
            background: #ff4500;
            border-color: #ff4500;
            color: #ffffff;
        }

        .live-monitor-btn.success {
            background: #198754;
            border-color: #198754;
            color: #ffffff;
        }

        .live-monitor-btn.danger {
            background: #dc3545;
            border-color: #dc3545;
            color: #ffffff;
        }

        .live-monitor-grid {
            display: grid;
            gap: 5px;
            padding: 8px;
            min-height: 420px;
        }

        .live-monitor-grid.grid-1 { grid-template-columns: 1fr; }
        .live-monitor-grid.grid-2 { grid-template-columns: 1fr 1fr; }
        .live-monitor-grid.grid-4 { grid-template-columns: 1fr 1fr; }
        .live-monitor-grid.grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
        .live-monitor-grid.grid-8 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
        .live-monitor-grid.grid-9 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
        .live-monitor-grid.grid-16 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

        .live-monitor-cell {
            position: relative;
            display: flex;
            flex-direction: column;
            min-height: 220px;
            background: #ffffff;
            border: 2px solid #dee2e6;
            border-radius: 8px;
            overflow: hidden;
            cursor: pointer;
            transition: border-color .18s, box-shadow .18s;
        }

        .live-monitor-cell.active {
            border-color: #198754;
        }

        .live-monitor-cell.most-recent {
            border-color: #22d3ee;
            box-shadow: 0 0 16px rgba(34,211,238,.35);
        }

        .live-monitor-cell.selected {
            border-color: #ff4500;
            box-shadow: 0 0 12px rgba(255,69,0,.22);
        }

        .live-monitor-cell.storyboard-selected {
            border-color: #7c3aed;
            box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
        }

        .live-monitor-cell-header,
        .live-monitor-cell-footer {
            position: absolute;
            left: 0;
            right: 0;
            z-index: 2;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            background: rgba(255,255,255,.94);
            color: #4b5563;
            font-size: .74rem;
            padding: 5px 10px;
        }

        .live-monitor-cell-header {
            top: 0;
            border-bottom: 1px solid #e5e7eb;
        }

        .live-monitor-cell-footer {
            bottom: 0;
            border-top: 1px solid #e5e7eb;
        }

        .live-monitor-cell-name {
            color: #ff4500;
            font-weight: 800;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .live-monitor-cell-body {
            flex: 1;
            display: grid;
            place-items: center;
            min-height: 220px;
            background: #111827;
            color: #9ca3af;
            text-align: center;
        }

        .live-monitor-cell-body img,
        .live-monitor-cell-body video {
            width: 100%;
            height: 100%;
            min-height: 220px;
            object-fit: cover;
            display: block;
        }

        .live-monitor-placeholder {
            padding: 38px 20px;
            color: #9ca3af;
        }

        .live-monitor-placeholder i {
            display: block;
            font-size: 3rem;
            color: #d1d5db;
            margin-bottom: 10px;
        }

        .live-monitor-fps {
            border-radius: 4px;
            padding: 2px 7px;
            background: #198754;
            color: #ffffff;
            font-size: .68rem;
            font-weight: 800;
        }

        .live-monitor-fps.offline {
            background: #6b7280;
        }

        .live-monitor-playback-bar {
            display: grid;
            grid-template-columns: minmax(120px, 180px) auto minmax(0, 1fr) auto;
            gap: 12px;
            align-items: center;
            padding: 10px 12px;
            background: rgba(255,255,255,.96);
            border-top: 1px solid #dee2e6;
        }

        .live-monitor-playback-label {
            color: #ff4500;
            font-size: .84rem;
            font-weight: 800;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .live-monitor-timeline input[type="range"] {
            width: 100%;
            accent-color: #ff4500;
        }

        .live-monitor-timeline-info {
            display: flex;
            justify-content: space-between;
            gap: 10px;
            color: #6b7280;
            font-size: .72rem;
        }

        .quick-settings-card {
            padding: 0;
        }

        .quick-settings-card summary {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            cursor: pointer;
            padding: 13px 15px;
            font-weight: 800;
            color: #111827;
            list-style: none;
        }

        .quick-settings-card summary::-webkit-details-marker {
            display: none;
        }

        .quick-settings-body {
            padding: 0 15px 15px;
            border-top: 1px solid #e5e7eb;
        }

        .settings-summary-chip {
            color: #0f766e;
            font-size: .78rem;
            font-weight: 750;
            text-align: right;
        }

        .live-stream-card {
            min-width: 0;
            overflow: hidden;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            background: #ffffff;
        }

        .live-stream-preview {
            position: relative;
            aspect-ratio: 16 / 9;
            background: #111827;
            color: #d1d5db;
            display: grid;
            place-items: center;
            font-size: 0.82em;
            overflow: hidden;
        }

        .live-stream-preview img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .stream-card-body {
            padding: 10px;
        }

        .stream-title-row {
            display: flex;
            justify-content: space-between;
            gap: 8px;
            align-items: flex-start;
            margin-bottom: 6px;
        }

        .stream-title-row strong {
            color: #111827;
            overflow-wrap: anywhere;
        }

        .stream-meta,
        .stream-message {
            color: #6b7280;
            font-size: 0.82em;
            line-height: 1.35;
            overflow-wrap: anywhere;
        }

        .stream-progress {
            height: 7px;
            background: #e5e7eb;
            border-radius: 999px;
            overflow: hidden;
            margin: 9px 0;
        }

        .stream-progress span {
            display: block;
            height: 100%;
            border-radius: inherit;
            background: #0f766e;
        }

        .stream-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-top: 10px;
        }

        .severity {
            border-radius: 999px;
            padding: 3px 8px;
            background: #e5e7eb;
            color: #374151;
            font-size: 0.78em;
            font-weight: 700;
            text-transform: uppercase;
        }

        .severity.critical {
            background: #fee2e2;
            color: #b91c1c;
        }

        .severity.warning {
            background: #fef3c7;
            color: #92400e;
        }

        .severity.error {
            background: #fee2e2;
            color: #b91c1c;
        }

        .severity.info {
            background: #dbeafe;
            color: #1d4ed8;
        }

        .severity.active {
            background: #dcfce7;
            color: #047857;
        }

        .severity.stopped,
        .severity.created {
            background: #f3f4f6;
            color: #4b5563;
        }

        .mini-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.88em;
        }

        .mini-table th,
        .mini-table td {
            text-align: left;
            padding: 8px 6px;
            border-top: 1px solid #f3f4f6;
            vertical-align: top;
        }

        .mini-table th {
            color: #6b7280;
            font-weight: 700;
            border-top: 0;
        }

        .empty-state {
            color: #6b7280;
            border: 1px dashed #d1d5db;
            border-radius: 8px;
            padding: 14px;
            line-height: 1.45;
            background: #f9fafb;
        }

        .panel {
            background: #f8f9fa;
            border-radius: 10px;
            padding: 20px;
            border: 1px solid #e0e0e0;
            min-width: 0;
        }

        .panel h2 {
            color: #333;
            margin-bottom: 15px;
            padding-bottom: 10px;
            border-bottom: 2px solid #0f766e;
        }

        .status-badge {
            display: inline-block;
            padding: 5px 15px;
            border-radius: 20px;
            font-size: 0.9em;
            font-weight: bold;
            margin: 10px 0;
        }

        .status-pending {
            background: #ffd700;
            color: #333;
        }

        .status-processing {
            background: #4CAF50;
            color: white;
        }

        .status-completed {
            background: #2196F3;
            color: white;
        }

        .status-stopped {
            background: #6b7280;
            color: white;
        }

        .status-error {
            background: #f44336;
            color: white;
        }

        button {
            background: #1d4ed8;
            color: white;
            border: none;
            padding: 12px 24px;
            border-radius: 5px;
            font-size: 1em;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
            margin-top: 10px;
        }

        button:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(29, 78, 216, 0.28);
        }

        button:active {
            transform: translateY(0);
        }

        .search-box {
            display: flex;
            gap: 10px;
            margin-bottom: 15px;
            flex-wrap: wrap;
            min-width: 0;
        }

        input[type="text"],
        input[type="url"],
        input[type="file"],
        select {
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 5px;
            font-size: 0.95em;
            flex: 1;
            min-width: 150px;
            max-width: 100%;
        }

        .results {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            gap: 15px;
            margin-top: 20px;
        }

        .result-card {
            background: white;
            border: 1px solid #ddd;
            border-radius: 8px;
            padding: 15px;
            transition: box-shadow 0.2s;
        }

        .result-card:hover {
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }

        .result-card h4 {
            color: #0f766e;
            margin-bottom: 10px;
            font-size: 0.95em;
        }

        .result-card p {
            color: #666;
            font-size: 0.9em;
            margin-bottom: 8px;
            line-height: 1.4;
        }

        .tag {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: #1d4ed8;
            color: white;
            padding: 3px 10px;
            border-radius: 15px;
            font-size: 0.8em;
            margin: 2px;
            border: 0;
            cursor: pointer;
            line-height: 1.4;
            vertical-align: middle;
        }

        .tag:hover {
            filter: brightness(0.95);
            transform: none;
            box-shadow: 0 2px 8px rgba(31, 41, 55, 0.15);
        }

        .color-tag {
            border: 1px solid rgba(17, 24, 39, 0.2);
            color: #111827;
            text-shadow: 0 1px 1px rgba(255,255,255,0.55);
        }

        .color-swatch {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            border: 1px solid rgba(17, 24, 39, 0.35);
            background: var(--swatch, #667eea);
        }

        .evidence-panel {
            margin-top: 14px;
            background: white;
            border: 1px solid #ddd;
            border-radius: 8px;
            padding: 12px;
        }

        .evidence-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
            gap: 10px;
            margin-top: 10px;
        }

        .evidence-card {
            border: 1px solid #e5e7eb;
            border-radius: 6px;
            overflow: hidden;
            background: #fff;
            cursor: pointer;
        }

        .evidence-card img {
            display: block;
            width: 100%;
            aspect-ratio: 16 / 9;
            object-fit: cover;
            background: #111827;
        }

        .evidence-card div {
            padding: 6px;
            font-size: 0.78em;
            color: #374151;
        }

        .frame-highlight {
            outline: 4px solid #f59e0b;
            outline-offset: -4px;
            box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.25);
        }

        .highlight-note {
            padding: 8px 10px;
            background: #fff7ed;
            color: #9a3412;
            border-top: 1px solid #fed7aa;
            font-size: 0.9em;
        }

        .summary-box {
            background: white;
            border: 1px solid #ddd;
            border-radius: 8px;
            padding: 15px;
            margin-top: 20px;
            line-height: 1.6;
            color: #333;
            min-width: 0;
        }

        .spinner {
            border: 4px solid #f3f3f3;
            border-top: 4px solid #0f766e;
            border-radius: 50%;
            width: 30px;
            height: 30px;
            animation: spin 1s linear infinite;
            display: inline-block;
            margin-right: 10px;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .loading {
            text-align: center;
            padding: 20px;
        }

        .tabs {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            border-bottom: 2px solid #e0e0e0;
        }

        .tab-button {
            background: transparent;
            color: #0f766e;
            border: none;
            border-bottom: 3px solid transparent;
            padding: 10px 20px;
            cursor: pointer;
            font-weight: bold;
        }

        .tab-button.active {
            color: #0f766e;
            border-bottom-color: #0f766e;
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        .stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
            margin-bottom: 20px;
        }

        .stat-box {
            background: linear-gradient(135deg, #0f766e 0%, #1d4ed8 100%);
            color: white;
            padding: 20px;
            border-radius: 8px;
            text-align: center;
        }

        .stat-box .number {
            font-size: 2em;
            font-weight: bold;
        }

        .stat-box .label {
            font-size: 0.95em;
            opacity: 0.9;
        }

        .progress-wrap {
            margin: 14px 0;
        }

        #progressText {
            overflow-wrap: anywhere;
            line-height: 1.45;
        }

        #videoStatus {
            overflow-wrap: anywhere;
            line-height: 1.45;
        }

        .progress-bar {
            width: 100%;
            height: 14px;
            background: #e5e7eb;
            border-radius: 999px;
            overflow: hidden;
            border: 1px solid #d1d5db;
        }

        .progress-fill {
            height: 100%;
            width: 0%;
            background: #2563eb;
            transition: width 0.3s ease;
        }

        .upload-progress {
            display: grid;
            gap: 8px;
            max-width: 560px;
        }

        .upload-progress-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            font-size: 0.95em;
        }

        #recordedVideoCard.is-uploading {
            opacity: 0.82;
        }

        #recordedVideoCard button:disabled,
        #recordedVideoCard input:disabled {
            cursor: wait;
        }

        .live-frame {
            margin-top: 14px;
            background: white;
            border: 1px solid #ddd;
            border-radius: 8px;
            overflow: hidden;
        }

        .live-frame img {
            display: block;
            width: 100%;
            max-height: 360px;
            object-fit: contain;
            background: #111827;
        }

        .live-frame .caption {
            padding: 12px;
            color: #333;
            font-size: 0.95em;
            line-height: 1.4;
        }

        .stream-data {
            margin-top: 14px;
            background: #fff;
            border: 1px solid #ddd;
            border-radius: 8px;
            padding: 12px;
        }

        .stream-text {
            color: #111827;
            line-height: 1.45;
            overflow-wrap: anywhere;
        }

        .raw-json-window {
            margin-top: 10px;
        }

        .raw-json-window pre {
            max-height: 220px;
            overflow: auto;
            white-space: pre-wrap;
            overflow-wrap: anywhere;
            background: #111827;
            color: #e5e7eb;
            padding: 12px;
            border-radius: 6px;
            font-size: 0.82em;
        }

        body.modal-open {
            overflow: hidden;
        }

        .modal-backdrop {
            position: fixed;
            inset: 0;
            z-index: 1000;
            display: grid;
            place-items: center;
            padding: 20px;
            background: rgba(15, 23, 42, 0.56);
        }

        .modal-backdrop[hidden] {
            display: none !important;
        }

        .modal-card {
            width: min(760px, 100%);
            max-height: min(86vh, 920px);
            overflow: hidden;
            border-radius: 12px;
            background: #ffffff;
            border: 1px solid #e5e7eb;
            box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
        }

        .modal-wide {
            width: min(980px, 100%);
        }

        .modal-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 14px 16px;
            border-bottom: 1px solid #e5e7eb;
            background: #f8fafc;
        }

        .modal-head h3 {
            margin: 0;
            font-size: 1rem;
            color: #111827;
        }

        .modal-body {
            max-height: calc(86vh - 58px);
            overflow: auto;
            padding: 16px;
        }

        .icon-btn {
            display: inline-grid;
            place-items: center;
            width: 34px;
            height: 34px;
            padding: 0;
            border-radius: 8px;
            border: 1px solid #d1d5db;
            background: #ffffff;
            color: #111827;
            box-shadow: none;
        }

        .logs-filters-card,
        .logs-stream-card {
            border: 1px solid #e5e7eb;
            border-radius: 10px;
            background: #ffffff;
            padding: 14px;
        }

        .logs-stream-card {
            margin-top: 16px;
            border-left: 4px solid #0f766e;
        }

        .logs-filter-head,
        .logs-sticky-pager,
        .logs-pager-actions {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
        }

        .logs-filter-head h3 {
            margin: 0;
        }

        .logs-filter-grid {
            display: grid;
            grid-template-columns: minmax(220px, 2fr) repeat(6, minmax(120px, 1fr));
            gap: 10px;
            align-items: end;
            margin-top: 12px;
        }

        .logs-filter-actions {
            display: flex;
            gap: 8px;
        }

        .log-card {
            border: 1px solid #e5e7eb;
            border-radius: 10px;
            overflow: hidden;
            margin-bottom: 10px;
            background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
            transition: box-shadow .15s;
        }

        .log-card:hover {
            box-shadow: 0 8px 22px rgba(8, 27, 43, .10);
        }

        .log-card.lc-warning {
            border-left: 4px solid #f59e0b;
        }

        .log-card.lc-error {
            border-left: 4px solid #dc2626;
        }

        .lc-head,
        .lc-foot {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 8px;
            padding: 10px 12px;
        }

        .lc-head {
            border-bottom: 1px solid #f3f4f6;
            background: #f8fafc;
        }

        .lc-body {
            padding: 12px;
        }

        .lc-body p {
            margin: 0;
            line-height: 1.45;
        }

        .lc-foot {
            border-top: 1px solid #f3f4f6;
            background: #ffffff;
        }

        .lc-detail {
            padding: 12px;
            border-top: 1px solid #e5e7eb;
            background: #f8fafc;
        }

        .lc-num,
        .lc-log-id,
        .lc-ts,
        .lc-name,
        .badge-lite {
            font-size: .82rem;
            font-weight: 700;
        }

        .lc-num {
            display: inline-grid;
            place-items: center;
            width: 26px;
            height: 26px;
            border-radius: 999px;
            background: #111827;
            color: #ffffff;
        }

        .lc-ts {
            color: #6b7280;
        }

        .lc-spacer {
            flex: 1 1 auto;
        }

        .badge-lite {
            border: 1px solid #d1d5db;
            border-radius: 999px;
            padding: 3px 8px;
            color: #374151;
            background: #ffffff;
        }

        .link-button {
            background: transparent !important;
            color: #2563eb;
            border: 0;
            box-shadow: none;
            padding: 0;
            margin: 0;
            font-weight: 700;
        }

        .lc-dl {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 10px;
            margin: 0;
        }

        .lc-di {
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 9px;
            background: #ffffff;
        }

        .lc-di dt {
            font-size: .72rem;
            color: #6b7280;
            font-weight: 800;
            margin-bottom: 4px;
        }

        .lc-di dd {
            margin: 0;
            overflow-wrap: anywhere;
        }

        .lc-di pre {
            white-space: pre-wrap;
            overflow-wrap: anywhere;
            max-height: 260px;
            overflow: auto;
            margin: 0;
            font-size: .78rem;
        }

        .pagination-inline {
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }

        .pagination-inline button {
            min-width: 32px;
            min-height: 30px;
            padding: 5px 8px;
            border-radius: 8px;
            background: #ffffff;
            color: #111827;
            border: 1px solid #d1d5db;
            box-shadow: none;
        }

        .pagination-inline button.active {
            background: #2563eb;
            border-color: #2563eb;
            color: #ffffff;
        }

        .live-dot {
            display: inline-block;
            width: 8px;
            height: 8px;
            border-radius: 999px;
            margin-right: 5px;
            background: #9ca3af;
        }

        .live-dot.is-live {
            background: #22c55e;
            box-shadow: 0 0 0 4px rgba(34, 197, 94, .16);
        }

        .shimmer-card {
            min-height: 72px;
            border-radius: 10px;
            margin-bottom: 10px;
            background: linear-gradient(90deg, #f3f4f6 0%, #ffffff 50%, #f3f4f6 100%);
            background-size: 200% 100%;
            animation: shimmerMove 1.25s linear infinite;
            border: 1px solid #e5e7eb;
        }

        @keyframes shimmerMove {
            from { background-position: 200% 0; }
            to { background-position: -200% 0; }
        }

        @media (max-width: 1100px) {
            .logs-filter-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }

        @media (max-width: 720px) {
            .logs-filter-grid,
            .logs-filter-actions,
            .logs-sticky-pager,
            .logs-pager-actions {
                grid-template-columns: 1fr;
                flex-direction: column;
                align-items: stretch;
            }

            .lc-spacer {
                display: none;
            }
        }

        .settings-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px;
            margin-top: 10px;
        }

        .settings-grid label {
            display: flex;
            flex-direction: column;
            gap: 5px;
            color: #444;
            font-size: 0.9em;
        }

        .settings-grid input,
        .settings-grid select {
            min-width: 0;
            width: 100%;
        }

        .settings-grid input[type="checkbox"] {
            width: auto;
            align-self: flex-start;
        }

        .preset-row {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 10px;
        }

        .status-line {
            margin-top: 10px;
            color: #374151;
            overflow-wrap: anywhere;
            line-height: 1.45;
        }

        .status-line.error {
            color: #b91c1c;
        }

        @media (max-width: 1024px) {
            .app-navbar {
                align-items: flex-start;
                flex-direction: column;
            }

            .app-navbar-menu {
                justify-content: flex-start;
                width: 100%;
            }

            .content {
                grid-template-columns: 1fr;
            }

            .metric-grid,
            .ops-grid,
            .stats-wall,
            .dashboard-hero {
                grid-template-columns: 1fr 1fr;
            }

            .sf-flow-kpis {
                grid-template-columns: repeat(3, minmax(0, 1fr));
            }

            .live-monitor-grid.grid-6,
            .live-monitor-grid.grid-8,
            .live-monitor-grid.grid-9,
            .live-monitor-grid.grid-16 {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }

            .live-monitor-playback-bar {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 720px) {
            body {
                padding: 10px;
            }

            header,
            .command-center,
            .content {
                padding: 18px;
            }

            .nav-action-btn,
            .nav-user-chip {
                width: 100%;
                justify-content: center;
            }

            .tenant-toolbar {
                align-items: stretch;
                flex-direction: column;
            }

            .toolbar-actions {
                justify-content: stretch;
            }

            .tenant-select,
            .toolbar-actions button {
                width: 100%;
            }

            .metric-grid,
            .ops-grid,
            .stats-wall,
            .dashboard-hero,
            .hero-kpi-grid,
            .sf-flow-kpis {
                grid-template-columns: 1fr;
            }

            .live-monitor-grid.grid-1,
            .live-monitor-grid.grid-2,
            .live-monitor-grid.grid-4,
            .live-monitor-grid.grid-6,
            .live-monitor-grid.grid-8,
            .live-monitor-grid.grid-9,
            .live-monitor-grid.grid-16 {
                grid-template-columns: 1fr;
            }
        }
