:root {
    color-scheme: dark;
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: #09101d;
    color: #edf3ff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
}

button {
    border: 1px solid #334363;
    border-radius: 9px;
    background: #18233a;
    color: #edf3ff;
    min-height: 42px;
    padding: 0 16px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

button:hover:not(:disabled) {
    border-color: #6687c4;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

button.primary {
    background: #e8eefc;
    color: #101827;
}

.layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 255px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px 18px;
    background: #0d1525;
    border-right: 1px solid #202c44;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 24px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: #edf3ff;
    color: #101827;
    font-size: 13px;
    font-weight: 900;
}

.brand strong,
.brand span {
    display: block;
}

.brand span {
    margin-top: 3px;
    color: #8696b5;
    font-size: 12px;
}

.navigation {
    display: grid;
    gap: 6px;
}

.nav-item {
    width: 100%;
    text-align: left;
    border-color: transparent;
    background: transparent;
}

.nav-item.active {
    background: #1a2740;
    border-color: #2c3e60;
}

.content {
    width: min(1380px, 100%);
    padding: 30px;
    margin: 0 auto;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 6px;
    font-size: 28px;
}

h2 {
    margin-bottom: 6px;
    font-size: 19px;
}

p {
    margin-bottom: 0;
    color: #91a0bc;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 31px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
}

.badge.pending {
    background: #27314a;
}

.badge.ok {
    background: #123c30;
    color: #8fe4bd;
}

.badge.error {
    background: #4a2026;
    color: #ffb1b8;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.card,
.panel {
    background: #111a2c;
    border: 1px solid #25324b;
    border-radius: 14px;
}

.card {
    padding: 18px;
}

.card span {
    display: block;
    color: #8e9db8;
    font-size: 13px;
}

.card strong {
    display: block;
    margin-top: 7px;
    font-size: 20px;
}

.panel {
    padding: 20px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
}

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

.service-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 9px;
    background: #0c1423;
}

.service-state.active {
    color: #75d9ad;
}

.service-state.inactive,
.service-state.failed {
    color: #ff939d;
}

.network-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 13px 15px;
    margin-bottom: 16px;
    background: #0c1423;
    border-radius: 9px;
    color: #9caac3;
}

.network-summary strong {
    color: #edf3ff;
}

.message {
    padding: 16px;
    border: 1px dashed #334363;
    border-radius: 10px;
    color: #9caac3;
}

.device-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fill,
        minmax(275px, 1fr)
    );
    gap: 14px;
    margin-top: 16px;
}

.device-card {
    padding: 16px;
    background: #0c1423;
    border: 1px solid #283650;
    border-radius: 12px;
}

.device-card h3 {
    margin: 0 0 8px;
    font-size: 17px;
}

.device-card dl {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 7px 10px;
    margin: 14px 0 0;
    font-size: 13px;
}

.device-card dt {
    color: #8090ad;
}

.device-card dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.source-tags {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.source-tag {
    padding: 4px 7px;
    border-radius: 999px;
    background: #1d2a42;
    color: #a9bae0;
    font-size: 11px;
    font-weight: 800;
}

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid #202c44;
    }

    .navigation {
        grid-template-columns: repeat(3, 1fr);
    }

    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .content {
        padding: 20px 14px;
    }

    .topbar,
    .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .cards,
    .services,
    .navigation {
        grid-template-columns: 1fr;
    }
}

.device-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.device-actions button {
    flex: 1;
}

.setup-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    justify-content: flex-end;
    background: rgba(4, 10, 20, 0.72);
    backdrop-filter: blur(4px);
}

.setup-overlay[hidden] {
    display: none;
}

.setup-drawer {
    width: min(520px, 100%);
    height: 100%;
    overflow-y: auto;
    padding: 28px;
    background: #101927;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: -20px 0 50px rgba(0, 0, 0, 0.35);
}

.setup-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 28px;
}

.setup-header h2 {
    margin: 4px 0 8px;
}

.eyebrow {
    margin: 0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.65;
}

#camera-setup-form {
    display: grid;
    gap: 18px;
}

#camera-setup-form label {
    display: grid;
    gap: 8px;
    font-size: 14px;
}

#camera-setup-form input,
#camera-setup-form select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: #0b1320;
    color: inherit;
    font: inherit;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.setup-actions {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.setup-actions button {
    flex: 1;
}

.stream-result {
    padding: 15px;
    border: 1px solid rgba(80, 200, 140, 0.35);
    border-radius: 10px;
    background: rgba(80, 200, 140, 0.08);
}

.stream-result dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 14px;
    margin: 0;
}

.stream-result dt {
    opacity: 0.65;
}

.stream-result dd {
    margin: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 620px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .setup-actions {
        flex-direction: column;
    }
}

.added-tag {
    border-color: rgba(60, 210, 130, 0.45);
    background: rgba(60, 210, 130, 0.14);
    color: #74e6ad;
}

/* ========================================
   OWS Vision - Tarjetas de cámaras
   ======================================== */

.camera-card {
    padding: 0;
    overflow: hidden;
}

.camera-thumbnail {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #070d17;
    border-bottom: 1px solid #283650;
}

.camera-thumbnail img {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    opacity: 0;
    transition: opacity 180ms ease;
}

.camera-thumbnail img.loaded {
    opacity: 1;
}

.camera-thumbnail-fallback {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    padding: 20px;
    color: #74829d;
    font-size: 13px;
    text-align: center;
}

.camera-live-status {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    backdrop-filter: blur(8px);
}

.camera-live-status.online {
    color: #bff8dc;
    background: rgba(16, 110, 72, 0.88);
}

.camera-live-status.offline {
    color: #ffd3d3;
    background: rgba(135, 38, 38, 0.88);
}

.camera-card-content {
    padding: 16px;
}

.camera-card-content h3 {
    min-height: 42px;
}

.camera-card .device-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

@media (max-width: 600px) {
    .camera-card-content h3 {
        min-height: auto;
    }
}

/* Estados reales de cámaras */

.camera-state-tags {
    margin-top: 10px;
}

.source-tag.state-ok {
    color: #bdf8d8;
    background: rgba(17, 116, 73, 0.9);
    border: 1px solid rgba(86, 222, 155, 0.28);
}

.source-tag.state-error {
    color: #ffd0d0;
    background: rgba(139, 35, 42, 0.92);
    border: 1px solid rgba(255, 111, 118, 0.28);
}

.source-tag.state-disabled {
    color: #c3ccdb;
    background: #2b3547;
    border: 1px solid #3b4860;
}

/* Estados especializados de analítica y eventos */

.source-tag.state-ai {
    color: #efe2ff;
    background: rgba(112, 51, 190, 0.92);
    border: 1px solid rgba(190, 135, 255, 0.36);
}

.source-tag.state-motion {
    color: #ffe8b5;
    background: rgba(161, 94, 13, 0.94);
    border: 1px solid rgba(255, 181, 67, 0.34);
}

/* OWS_CAMERA_EDITOR_V1 */

.camera-editor-drawer {
    width: min(760px, 100%);
}

#camera-editor-form {
    display: grid;
    gap: 20px;
}

#camera-editor-form label {
    display: grid;
    gap: 8px;
    font-size: 14px;
}

#camera-editor-form input,
#camera-editor-form select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: #0b1320;
    color: inherit;
    font: inherit;
}

#camera-editor-form input[readonly] {
    color: #9aa9c1;
    background: #101827;
}

.editor-section {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(5, 11, 20, 0.3);
}

.editor-section h3 {
    margin: 0;
    font-size: 16px;
}

.editor-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
}

.editor-section-header p {
    margin: 6px 0 0;
    color: #8f9db5;
    font-size: 13px;
    line-height: 1.45;
}

.field-help {
    display: block;
    color: #8290a8;
    font-size: 12px;
    line-height: 1.4;
}

.toggle-grid {
    display: grid;
    grid-template-columns: repeat(
        3,
        minmax(0, 1fr)
    );
    gap: 12px;
}

#camera-editor-form .toggle-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: #0b1320;
}

#camera-editor-form .toggle-field input {
    width: auto;
    margin: 0;
}

.stream-table-container {
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.stream-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.stream-table th,
.stream-table td {
    padding: 11px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
    white-space: nowrap;
}

.stream-table th {
    color: #8e9bb2;
    background: rgba(255, 255, 255, 0.035);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stream-table tr:last-child td {
    border-bottom: 0;
}

.stream-status {
    display: inline-flex;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.stream-status.available {
    color: #bdf8d8;
    background: rgba(17, 116, 73, 0.9);
}

.stream-status.unavailable {
    color: #ffd0d0;
    background: rgba(139, 35, 42, 0.92);
}

.stream-selection-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.stream-tools {
    display: flex;
    justify-content: flex-end;
}

.device-actions button[data-edit-camera] {
    cursor: pointer;
    opacity: 1;
}

@media (max-width: 720px) {
    .toggle-grid,
    .stream-selection-grid {
        grid-template-columns: 1fr;
    }

    .editor-section-header {
        flex-direction: column;
    }

    .editor-section-header button {
        width: 100%;
    }
}


/* OWS_OPERATIONAL_STATUS_UI_V1 */

.operational-panel {
    display: grid;
    gap: 16px;
    margin: 20px 0;
    padding: 18px;
    border: 1px solid rgba(100, 159, 255, 0.22);
    border-radius: 14px;
    background:
        linear-gradient(
            145deg,
            rgba(16, 32, 56, 0.94),
            rgba(6, 15, 28, 0.96)
        );
}

.operational-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
}

.operational-header h3,
.operational-header p {
    margin: 0;
}

.operational-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.operational-title-row h3 {
    font-size: 19px;
}

#editor-operational-summary {
    margin-top: 7px;
    color: #94a4bd;
    font-size: 13px;
    line-height: 1.45;
}

.operational-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.operational-badge.operational {
    color: #bdf8d8;
    background: rgba(17, 116, 73, 0.9);
}

.operational-badge.warning {
    color: #ffe7ad;
    background: rgba(142, 90, 13, 0.94);
}

.operational-badge.error {
    color: #ffd0d0;
    background: rgba(139, 35, 42, 0.94);
}

.operational-badge.loading {
    color: #cfdbef;
    background: #344159;
}

.operational-grid {
    display: grid;
    grid-template-columns: repeat(
        3,
        minmax(0, 1fr)
    );
    gap: 12px;
}

.operational-card {
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 11px;
    background: rgba(4, 11, 22, 0.62);
}

.operational-card-label {
    color: #8392aa;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.operational-card strong {
    color: #d7deea;
    font-size: 15px;
    line-height: 1.25;
}

.operational-card strong[data-state="ok"] {
    color: #7ce5ae;
}

.operational-card strong[data-state="warning"] {
    color: #ffc96d;
}

.operational-card strong[data-state="error"] {
    color: #ff9297;
}

.operational-card strong[data-state="active"] {
    color: #d5a7ff;
}

.operational-card small {
    overflow-wrap: anywhere;
    color: #8290a8;
    font-size: 11px;
    line-height: 1.45;
}

.operational-warnings {
    display: grid;
    gap: 8px;
}

.operational-warning {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 9px;
    padding: 11px 12px;
    border-radius: 9px;
    font-size: 12px;
    line-height: 1.45;
}

.operational-warning.warning {
    color: #ffe7b0;
    border: 1px solid rgba(255, 186, 72, 0.24);
    background: rgba(115, 70, 8, 0.42);
}

.operational-warning.error {
    color: #ffd1d1;
    border: 1px solid rgba(255, 101, 109, 0.26);
    background: rgba(107, 25, 31, 0.5);
}

.operational-updated {
    margin: 0;
    color: #6f7e95;
    font-size: 11px;
    text-align: right;
}

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

@media (max-width: 560px) {
    .operational-header {
        flex-direction: column;
    }

    .operational-header button {
        width: 100%;
    }

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

    .operational-warning {
        grid-template-columns: 1fr;
    }
}


/* OWS_CAMERA_ONBOARDING_UI_V2 */

.camera-onboarding-drawer {
    width: min(820px, 100%);
}

#camera-setup-form {
    display: grid;
    gap: 20px;
}

#camera-setup-form label {
    display: grid;
    gap: 8px;
    font-size: 14px;
}

#camera-setup-form input,
#camera-setup-form select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: #0b1320;
    color: inherit;
    font: inherit;
}

#camera-setup-form input[readonly] {
    color: #9aa9c1;
    background: #101827;
}

.onboarding-section {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(5, 11, 20, 0.3);
}

.onboarding-section h3 {
    margin: 0;
    font-size: 16px;
}

#camera-setup-form .toggle-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: #0b1320;
}

#camera-setup-form .toggle-field input {
    width: auto;
    margin: 0;
}

.onboarding-summary {
    display: grid;
    grid-template-columns: repeat(
        3,
        minmax(0, 1fr)
    );
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(85, 160, 255, 0.24);
    border-radius: 12px;
    background: rgba(15, 37, 68, 0.55);
}

.onboarding-summary div {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.onboarding-summary span {
    color: #8291aa;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.onboarding-summary strong {
    overflow-wrap: anywhere;
    color: #d7e6ff;
    font-size: 12px;
    line-height: 1.45;
}

@media (max-width: 720px) {
    .onboarding-summary {
        grid-template-columns: 1fr;
    }
}


/* OWS_LIVE_VIEW_V1 */

.live-panel {
    min-height: calc(100vh - 140px);
}

.live-toolbar {
    align-items: center;
}

.live-layout-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.live-layout-button.active {
    color: #dceaff;
    border-color: rgba(89, 155, 255, 0.55);
    background: rgba(39, 87, 158, 0.65);
}

.live-workspace {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 16px;
    margin-top: 18px;
    min-height: 610px;
}

.live-camera-sidebar {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    background: rgba(5, 12, 23, 0.62);
}

.live-camera-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.live-camera-sidebar-header span {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    min-height: 24px;
    border-radius: 999px;
    color: #cfe0fa;
    background: #273750;
    font-size: 11px;
    font-weight: 800;
}

.live-camera-list {
    display: grid;
    gap: 8px;
    max-height: 690px;
    padding: 10px;
    overflow-y: auto;
}

.live-camera-item {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
    width: 100%;
    padding: 8px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: inherit;
    background: #0c1525;
    text-align: left;
}

.live-camera-item:hover,
.live-camera-item.selected {
    border-color: rgba(82, 151, 255, 0.46);
    background: #13233c;
}

.live-camera-item img {
    width: 58px;
    height: 42px;
    border-radius: 6px;
    object-fit: cover;
    background: #050b14;
}

.live-camera-item span {
    display: grid;
    align-content: center;
    min-width: 0;
}

.live-camera-item strong,
.live-camera-item small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-camera-item strong {
    font-size: 12px;
}

.live-camera-item small {
    margin-top: 4px;
    color: #7f8ea6;
    font-size: 10px;
}

.live-camera-item em {
    grid-column: 2;
    font-size: 9px;
    font-style: normal;
    font-weight: 800;
    text-transform: uppercase;
}

.live-camera-item em.online {
    color: #73dba3;
}

.live-camera-item em.offline {
    color: #ff8c92;
}

.live-stage {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 610px;
}

.live-stage > .message {
    align-self: center;
    justify-self: center;
}

.live-grid {
    display: grid;
    gap: 10px;
    width: 100%;
    min-height: 610px;
}

.live-grid.layout-1 {
    grid-template-columns: 1fr;
}

.live-grid.layout-2 {
    grid-template-columns: repeat(
        2,
        minmax(0, 1fr)
    );
}

.live-grid.layout-4 {
    grid-template-columns: repeat(
        2,
        minmax(0, 1fr)
    );
    grid-template-rows: repeat(
        2,
        minmax(0, 1fr)
    );
}

.live-tile {
    position: relative;
    min-width: 0;
    min-height: 250px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: #000;
}

.live-tile video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
}

.live-tile-overlay {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 45px 24px 12px;
    pointer-events: none;
    background:
        linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.78),
            transparent
        );
}

.live-tile-overlay div {
    display: grid;
    gap: 4px;
}

.live-tile-overlay strong {
    font-size: 13px;
}

.live-tile-overlay span {
    color: #aab5c6;
    font-size: 10px;
}

.live-tile-status {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
}

.live-tile-status.online {
    color: #bdf8d8;
    background: rgba(17, 116, 73, 0.92);
}

.live-tile-status.loading {
    color: #d8e4f7;
    background: rgba(54, 72, 102, 0.92);
}

.live-tile-status.warning {
    color: #ffe6a8;
    background: rgba(145, 91, 9, 0.94);
}

.live-tile-status.error {
    color: #ffd0d0;
    background: rgba(139, 35, 42, 0.94);
}

.live-remove-camera {
    position: absolute;
    top: 9px;
    right: 9px;
    z-index: 4;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 999px;
    color: #e6edf8;
    background: rgba(7, 14, 25, 0.78);
    font-size: 18px;
}

@media (max-width: 1000px) {
    .live-workspace {
        grid-template-columns: 1fr;
    }

    .live-camera-list {
        grid-template-columns: repeat(
            2,
            minmax(0, 1fr)
        );
        max-height: 250px;
    }
}

@media (max-width: 720px) {
    .live-layout-controls {
        justify-content: flex-start;
    }

    .live-grid.layout-2,
    .live-grid.layout-4 {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .live-camera-list {
        grid-template-columns: 1fr;
    }

    .live-tile {
        min-height: 280px;
    }
}


/* OWS_RECORDINGS_EVENTS_UI_V1 */

.recordings-panel,
.events-panel {
    min-height: calc(100vh - 140px);
}

.recordings-header,
.events-header {
    align-items: flex-end;
}

.recording-filters,
.event-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: flex-end;
    gap: 10px;
}

.recording-filters label,
.event-filters label {
    display: grid;
    gap: 5px;
    color: #8291a8;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.recording-filters select,
.recording-filters input,
.event-filters select,
.event-filters input {
    min-width: 145px;
}

.recording-summary,
.events-summary {
    display: grid;
    grid-template-columns: repeat(
        4,
        minmax(0, 1fr)
    );
    gap: 10px;
    margin-top: 18px;
}

.events-summary {
    grid-template-columns: repeat(
        3,
        minmax(0, 1fr)
    );
}

.recording-summary > div,
.events-summary > div {
    display: grid;
    gap: 5px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(8, 17, 31, 0.72);
}

.recording-summary strong,
.events-summary strong {
    font-size: 20px;
}

.recording-summary span,
.events-summary span {
    color: #7f8da2;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.recording-workspace {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        290px;
    gap: 16px;
    margin-top: 16px;
}

.recording-main {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.recording-player-shell {
    position: relative;
    min-height: 480px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: #000;
}

.recording-player-shell video {
    width: 100%;
    height: 100%;
    min-height: 480px;
    display: block;
    object-fit: contain;
    background: #000;
}

.recording-player-message {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #8290a5;
    pointer-events: none;
}

.recording-player-status {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    color: #dce7f8;
    background: rgba(27, 39, 59, 0.9);
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    pointer-events: none;
}

.recording-player-status.ready {
    color: #c3f8da;
    background: rgba(20, 110, 70, 0.92);
}

.recording-player-status.loading {
    background: rgba(45, 69, 104, 0.94);
}

.recording-player-status.warning {
    color: #ffe5a5;
    background: rgba(142, 90, 10, 0.94);
}

.recording-player-status.error {
    color: #ffd2d4;
    background: rgba(137, 34, 43, 0.94);
}

.timeline-panel {
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    background: rgba(8, 17, 31, 0.76);
}

.timeline-title {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 12px;
}

.timeline-title span {
    color: #7f8da3;
    font-size: 10px;
}

.timeline-hours {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    color: #738198;
    font-size: 9px;
}

.recording-timeline {
    position: relative;
    height: 46px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background:
        repeating-linear-gradient(
            to right,
            transparent,
            transparent calc(4.166666% - 1px),
            rgba(255, 255, 255, 0.05)
                calc(4.166666% - 1px),
            rgba(255, 255, 255, 0.05)
                4.166666%
        ),
        #07101e;
}

.recording-timeline-segments {
    position: absolute;
    inset: 0;
}

.timeline-segment {
    position: absolute;
    top: 8px;
    bottom: 8px;
    min-width: 2px;
    padding: 0;
    border: 0;
    border-radius: 2px;
    background: #3c8cf4;
}

.timeline-segment:hover {
    filter: brightness(1.3);
}

.timeline-segment.selected {
    background: #69c996;
    box-shadow:
        0 0 0 2px
        rgba(105, 201, 150, 0.28);
}

.recording-timeline-cursor {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 4;
    display: none;
    width: 2px;
    background: #f4c15d;
    pointer-events: none;
}

.timeline-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 10px;
    color: #8290a5;
    font-size: 9px;
}

.timeline-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.timeline-legend i {
    width: 18px;
    height: 7px;
    border-radius: 2px;
}

.timeline-legend i.continuous {
    background: #3c8cf4;
}

.timeline-legend i.selected {
    background: #69c996;
}

.recording-segments-panel {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    background: rgba(7, 15, 28, 0.75);
}

.recording-segments-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.recording-segments-title span {
    display: inline-grid;
    place-items: center;
    min-width: 25px;
    min-height: 25px;
    border-radius: 999px;
    background: #263750;
    font-size: 10px;
    font-weight: 900;
}

.recording-segment-list {
    display: grid;
    gap: 7px;
    max-height: 650px;
    padding: 10px;
    overflow-y: auto;
}

.recording-segment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: inherit;
    background: #0c1626;
    text-align: left;
}

.recording-segment-item:hover,
.recording-segment-item.selected {
    border-color: rgba(75, 145, 245, 0.52);
    background: #142640;
}

.recording-segment-item span {
    display: grid;
    gap: 4px;
}

.recording-segment-item small {
    color: #7f8ea5;
    font-size: 9px;
}

.recording-segment-item em {
    color: #78aef6;
    font-size: 9px;
    font-style: normal;
    font-weight: 900;
}

.events-summary {
    margin-bottom: 16px;
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(
        3,
        minmax(0, 1fr)
    );
    gap: 14px;
}

.event-card {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    background: rgba(8, 17, 31, 0.8);
}

.event-image {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #050b13;
}

.event-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.event-no-image {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #728096;
}

.event-status {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
}

.event-status.open {
    color: #d7ffe8;
    background: rgba(16, 122, 74, 0.92);
}

.event-status.closed {
    color: #d9e5f7;
    background: rgba(51, 68, 94, 0.92);
}

.event-content {
    padding: 14px;
}

.event-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.event-title > div {
    display: grid;
    gap: 4px;
}

.event-title span,
.event-title em {
    color: #7f8da3;
    font-size: 10px;
    font-style: normal;
}

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

.event-details div {
    display: grid;
    gap: 3px;
}

.event-details dt {
    color: #718097;
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
}

.event-details dd {
    margin: 0;
    font-size: 10px;
}

.event-actions {
    display: flex;
    justify-content: flex-end;
}

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

@media (max-width: 1000px) {
    .recording-workspace {
        grid-template-columns: 1fr;
    }

    .recording-segment-list {
        max-height: 350px;
    }

    .recording-summary {
        grid-template-columns: repeat(
            2,
            minmax(0, 1fr)
        );
    }
}

@media (max-width: 720px) {
    .recording-filters,
    .event-filters {
        justify-content: flex-start;
    }

    .recording-summary,
    .events-summary,
    .events-grid {
        grid-template-columns: 1fr;
    }

    .recording-player-shell,
    .recording-player-shell video {
        min-height: 300px;
    }

    .event-details {
        grid-template-columns: 1fr;
    }
}


/* OWS_ADAPTIVE_LIVE_UI_V1 */

.live-tile-badges {
    display: flex;
    align-items: center;
    gap: 7px;
}

.live-quality-badge {
    display: inline-grid;
    place-items: center;
    min-width: 28px;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.05em;
}

.live-quality-badge.sd {
    color: #cbd6e7;
    background: rgba(59, 74, 98, 0.92);
}

.live-quality-badge.hd {
    color: #d8ecff;
    background: rgba(35, 104, 194, 0.94);
}


/* OWS_EVIDENCE_UI_V1 */

.evidence-player-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    padding: 11px 12px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 10px;
    background: rgba(8, 17, 31, 0.76);
}

.evidence-player-tools span {
    color: #83a1c9;
    font-size: 10px;
}

.live-capture-photo {
    position: absolute;
    top: 12px;
    right: 46px;
    z-index: 7;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 7px;
    background: rgba(11, 25, 44, 0.9);
}

.event-actions {
    flex-wrap: wrap;
    gap: 7px;
}

.evidence-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(1, 6, 13, 0.82);
    backdrop-filter: blur(8px);
}

.evidence-overlay[hidden] {
    display: none;
}

.evidence-modal {
    width: min(520px, 100%);
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 15px;
    background: #0b1627;
    box-shadow:
        0 30px 80px
        rgba(0, 0, 0, 0.55);
}

.evidence-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
}

.evidence-modal-header h2 {
    margin: 3px 0 5px;
}

.evidence-modal-header p {
    margin: 0;
    color: #8392a9;
}

.evidence-modal form {
    display: grid;
    gap: 15px;
}

.evidence-form-grid {
    display: grid;
    grid-template-columns: repeat(
        2,
        minmax(0, 1fr)
    );
    gap: 12px;
}

.evidence-export-status {
    min-height: 22px;
    color: #8fb4e6;
    font-size: 11px;
}

.evidence-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
}

@media (max-width: 600px) {
    .evidence-form-grid {
        grid-template-columns: 1fr;
    }
}


/* OWS_EVIDENCE_LIBRARY_UI_V1 */

.library-header {
    align-items: flex-end;
}

.library-filters {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 9px;
}

.library-filters label {
    display: grid;
    gap: 5px;
    color: #718097;
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
}

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

.library-summary > div {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(7, 15, 28, 0.72);
}

.library-summary strong {
    font-size: 18px;
}

.library-summary span {
    color: #7b899f;
    font-size: 8px;
    text-transform: uppercase;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(
        3,
        minmax(0, 1fr)
    );
    gap: 14px;
}

.library-card {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    background: rgba(8, 17, 31, 0.82);
}

.library-media {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #03070d;
}

.library-media img,
.library-media video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
}

.library-type-badge,
.library-protected-badge {
    position: absolute;
    top: 9px;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
}

.library-type-badge {
    left: 9px;
    color: #ddecff;
    background: rgba(38, 91, 164, 0.94);
}

.library-protected-badge {
    right: 9px;
    color: #d5f9e4;
    background: rgba(20, 112, 70, 0.94);
}

.library-content {
    display: grid;
    gap: 8px;
    padding: 13px;
}

.library-content > span {
    color: #8492a7;
    font-size: 10px;
}

.library-content dl {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 4px 0;
}

.library-content dl div {
    display: grid;
    gap: 2px;
}

.library-content dt {
    color: #6f7e94;
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
}

.library-content dd {
    margin: 0;
    font-size: 10px;
}

.library-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 4px;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid rgba(73, 139, 230, 0.45);
    border-radius: 7px;
    color: #e6f0ff;
    background: #162943;
    font-size: 10px;
    font-weight: 800;
    text-decoration: none;
}

.library-actions .danger {
    color: #ffd7d9;
    border-color: rgba(194, 61, 70, 0.45);
    background: rgba(108, 30, 38, 0.62);
}

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

@media (max-width: 720px) {
    .library-grid,
    .library-summary {
        grid-template-columns: 1fr;
    }

    .library-filters {
        align-items: stretch;
    }
}


/* OWS_MANUAL_CAMERA_UI_V1 */

.panel-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.password-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

#camera-setup-form .password-toggle {
    min-width: 90px;
    padding: 10px 12px;
    white-space: nowrap;
}

.camera-network-fields {
    grid-template-columns:
        minmax(140px, 1fr)
        minmax(140px, 1fr);
}

@media (max-width: 620px) {
    .panel-actions {
        width: 100%;
        justify-content: stretch;
    }

    .panel-actions button {
        flex: 1;
    }

    .password-field,
    .camera-network-fields {
        grid-template-columns: 1fr;
    }

    #camera-setup-form .password-toggle {
        width: 100%;
    }
}


/* OWS_CUSTOM_SUBNET_DISCOVERY_V1 */

.custom-subnet-discovery {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(340px, 0.9fr);
    align-items: center;
    gap: 18px;
    margin: 18px 0;
    padding: 16px;
    border: 1px solid rgba(84, 150, 255, 0.22);
    border-radius: 12px;
    background: rgba(15, 35, 64, 0.42);
}

.custom-subnet-discovery strong {
    display: block;
    margin-bottom: 5px;
}

.custom-subnet-discovery p {
    margin: 0;
    color: #8d9cb4;
    font-size: 13px;
    line-height: 1.45;
}

.custom-subnet-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.custom-subnet-controls input {
    min-width: 0;
    padding: 11px 13px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 9px;
    color: inherit;
    background: #0b1320;
    font: inherit;
}

@media (max-width: 760px) {
    .custom-subnet-discovery {
        grid-template-columns: 1fr;
    }

    .custom-subnet-controls {
        grid-template-columns: 1fr;
    }

    .custom-subnet-controls button {
        width: 100%;
    }
}


/* OWS_CONTINUOUS_PLAYBACK_TIMELINE_V1 */
.recording-playback-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    background: rgba(8, 17, 31, 0.76);
}

.recording-navigation-controls,
.recording-control-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.recording-playback-controls button {
    min-width: 38px;
    padding: 7px 9px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    color: #dce7f8;
    background: #142238;
    font-size: 9px;
    font-weight: 900;
}

.recording-playback-controls button.active {
    border-color: rgba(105, 201, 150, 0.7);
    color: #d9ffea;
    background: #1c6648;
}

.recording-timeline-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-color: #3c587b #07101e;
    scrollbar-width: thin;
}

.recording-timeline-canvas {
    min-width: 100%;
    transition: width 180ms ease;
}

.recording-segment-item.selected {
    border-color: rgba(105, 201, 150, 0.72);
    background: #173b33;
}

/* OWS_NODE_HEALTH_DASHBOARD_V1 */
.badge.warning {
    background: #4a3b18;
    color: #ffd882;
}

.node-health-overview,
.node-health-columns {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.node-health-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 22px;
    border: 1px solid #24334f;
    border-radius: 15px;
    background:
        linear-gradient(
            135deg,
            #121d31,
            #0c1627
        );
}

.node-health-eyebrow {
    display: block;
    margin-bottom: 6px;
    color: #7f91b1;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.node-health-hero strong {
    display: block;
    margin-bottom: 6px;
    font-size: 24px;
}

.health-text-healthy {
    color: #8fe4bd;
}

.health-text-degraded,
.health-text-warning {
    color: #ffd882;
}

.health-text-critical {
    color: #ff9ea8;
}

.node-health-cards {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.node-metric-card {
    min-width: 0;
    padding: 17px;
    border: 1px solid #253451;
    border-radius: 13px;
    background: #111c2f;
}

.node-metric-card.warning {
    border-color: #725c25;
}

.node-metric-card.critical {
    border-color: #7d3540;
}

.node-metric-card span,
.node-metric-card small,
.node-camera-stat span,
.node-camera-stat small,
.node-service-row small {
    display: block;
    color: #8798b7;
}

.node-metric-card strong {
    display: block;
    margin: 7px 0;
    font-size: 23px;
}

.node-metric-card small {
    font-size: 11px;
}

.node-health-columns {
    grid-template-columns: 1fr 1fr;
}

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

.node-camera-stat {
    padding: 14px;
    border: 1px solid #263650;
    border-radius: 11px;
    background: #0d1728;
}

.node-camera-stat strong {
    display: block;
    margin: 5px 0;
    font-size: 22px;
}

.node-camera-stat small {
    font-size: 11px;
}

.node-health-alerts {
    display: grid;
    gap: 9px;
}

.node-alert {
    padding: 12px 14px;
    border: 1px solid #2b3c58;
    border-left-width: 4px;
    border-radius: 9px;
    background: #0d1728;
}

.node-alert strong,
.node-alert span {
    display: block;
}

.node-alert span {
    margin-top: 4px;
    color: #91a0bc;
    font-size: 12px;
}

.node-alert.healthy {
    border-left-color: #49bd87;
}

.node-alert.warning {
    border-left-color: #e1ad3f;
}

.node-alert.critical {
    border-left-color: #e9606d;
}

.node-service-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.node-service-row {
    align-items: center;
}

.node-service-row small {
    margin-top: 3px;
    font-size: 10px;
}

.node-health-updated {
    margin-top: 14px;
    font-size: 11px;
}

.service-state.not-installed {
    color: #91a0bc;
}

@media (max-width: 900px) {
    .node-health-cards {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .node-health-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .node-health-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .node-health-cards,
    .node-camera-health,
    .node-service-grid {
        grid-template-columns: 1fr;
    }
}

/* OWS_PERMISSION_UI_POLISH_V1 */

[hidden] {
    display: none !important;
}

.camera-retirement-section {
    padding: 16px;
    border: 1px solid #b42318;
    border-radius: 12px;
}

.access-create-panel {
    margin-top: 1rem;
}

.access-security-badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 11px;
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.08);
    color: #7dd3fc;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.access-create-form {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.access-create-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    background:
        linear-gradient(
            145deg,
            rgba(15, 23, 42, 0.56),
            rgba(15, 23, 42, 0.18)
        );
}

.access-field {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.access-field-label {
    color: #e2e8f0;
    font-size: 0.86rem;
    font-weight: 700;
}

.access-field input,
.access-field select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 10px;
    background: #0b1320;
    color: #f8fafc;
    font: inherit;
    box-sizing: border-box;
}

.access-field input:focus,
.access-field select:focus {
    border-color: rgba(56, 189, 248, 0.75);
    outline: 3px solid rgba(56, 189, 248, 0.12);
}

.access-field small {
    min-height: 1.2em;
    color: #94a3b8;
    font-size: 0.76rem;
    line-height: 1.35;
}

.access-create-footer {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
}

.access-create-message {
    min-height: 44px;
    margin: 0;
}

.access-create-submit {
    min-width: 180px;
    min-height: 44px;
    padding-inline: 22px;
}

.access-password-notice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-left: 3px solid rgba(250, 204, 21, 0.72);
    border-radius: 8px;
    background: rgba(250, 204, 21, 0.06);
    color: #cbd5e1;
    font-size: 0.8rem;
    line-height: 1.45;
}

.access-password-notice strong {
    color: #fde68a;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .access-create-grid {
        grid-template-columns: 1fr;
    }

    .access-create-footer {
        grid-template-columns: 1fr;
    }

    .access-create-submit {
        width: 100%;
    }

    .access-password-notice {
        display: grid;
    }
}


.camera-operation-mode-field #editor-recording-mode {
    display: block;
    width: 100% !important;
    max-width: 340px !important;
}

.camera-operation-retention-field {
    width: min(100%, 190px);
}

.camera-retention-control {
    display: flex;
    width: 190px !important;
    max-width: 100%;
}

.camera-retention-control #editor-retention-days {
    flex: 0 0 140px !important;
    width: 140px !important;
    min-width: 0;
}

.camera-retention-control span {
    flex: 0 0 auto;
}

@media (max-width: 620px) {
    .camera-operation-mode-field,
    .camera-operation-retention-field,
    .camera-retention-control {
        width: 100% !important;
    }

    .camera-retention-control #editor-retention-days {
        flex: 1 1 auto !important;
        width: 100% !important;
    }
}

/* OWS_CAMERA_OPERATION_GRID_V1 */

.camera-operation-fields {
    display: grid;
    grid-template-columns:
        minmax(220px, 1.25fr)
        minmax(160px, 0.75fr);
    gap: 16px;
    align-items: start;
    margin-bottom: 16px;
}

.camera-operation-fields > label {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.camera-operation-fields select,
.camera-operation-fields input {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
}

.camera-retention-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    width: 100% !important;
    max-width: none !important;
}

.camera-retention-control #editor-retention-days {
    width: 100% !important;
    min-width: 0;
    flex: none !important;
}

.camera-retention-control span {
    white-space: nowrap;
}

@media (max-width: 760px) {
    .camera-operation-fields {
        grid-template-columns: 1fr;
    }
}

/* OWS_NODE_GENERAL_SETTINGS_UI_V1 */

.node-settings-panel {
    margin-bottom: 18px;
}

.node-settings-form {
    display: grid;
    gap: 18px;
}

.node-settings-section {
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    background: rgba(8, 17, 31, 0.56);
}

.node-settings-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 16px;
}

.node-settings-section-header h3 {
    margin: 0 0 5px;
}

.node-settings-section-header p {
    margin: 0;
    color: #8d9cb4;
    font-size: 13px;
    line-height: 1.45;
}

.node-settings-field-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.node-settings-wide {
    grid-column: 1 / -1;
}

.node-settings-field-grid textarea {
    width: 100%;
    min-height: 92px;
    resize: vertical;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 9px;
    color: inherit;
    background: #0b1320;
    font: inherit;
}

.node-settings-save-row {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        auto;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
}

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

.node-settings-readonly-grid > div {
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    background: #0b1424;
}

.node-settings-readonly-grid dt {
    margin-bottom: 6px;
    color: #7f8da3;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.node-settings-readonly-grid dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: #edf3ff;
    font-size: 14px;
    line-height: 1.45;
}

@media (max-width: 760px) {
    .node-settings-field-grid,
    .node-settings-readonly-grid,
    .node-settings-save-row {
        grid-template-columns: 1fr;
    }

    .node-settings-section-header {
        flex-direction: column;
    }

    .node-settings-save-row button {
        width: 100%;
    }
}


/* OWS_RECORDING_STATUS_POSITION_V1 */

.recording-player-status {
    right: 12px;
    left: auto;
    max-width: calc(100% - 24px);
    text-align: right;
}


/* OWS_NODE_OFFLINE_MODE_V1 */
.node-offline-banner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin: 0 0 18px;
    padding: 14px 18px;
    border: 1px solid rgba(245, 158, 11, .45);
    border-radius: 14px;
    background: rgba(120, 53, 15, .30);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .16);
}

.node-offline-banner[hidden] {
    display: none;
}

.node-offline-banner.restricted {
    border-color: rgba(239, 68, 68, .62);
    background: linear-gradient(
        135deg,
        rgba(127, 29, 29, .58),
        rgba(69, 10, 10, .42)
    );
}

.node-offline-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(245, 158, 11, .18);
    color: #fbbf24;
    font-size: 1.2rem;
    font-weight: 800;
}

.node-offline-banner.restricted .node-offline-icon {
    background: rgba(239, 68, 68, .22);
    color: #fca5a5;
}

.node-offline-copy,
.node-offline-meta {
    display: grid;
    gap: 4px;
}

.node-offline-copy strong {
    color: #f8fafc;
    font-size: .98rem;
}

.node-offline-copy span,
.node-offline-meta span {
    color: #cbd5e1;
    font-size: .79rem;
}

.node-offline-meta {
    text-align: right;
    white-space: nowrap;
}

.node-offline-meta strong {
    color: #fbbf24;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.node-offline-banner.restricted
.node-offline-meta strong {
    color: #fca5a5;
}

.node-is-restricted
[data-offline-restricted="1"] {
    cursor: not-allowed;
    opacity: .48;
}

@media (max-width: 760px) {
    .node-offline-banner {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .node-offline-meta {
        grid-column: 2;
        text-align: left;
    }
}


/* OWS_BATCH1A_LIVE_UI_V1 */

.mobile-navigation-toggle,
.mobile-navigation-backdrop {
    display: none;
}

.live-toolbar {
    align-items: flex-start;
}

.live-layout-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.live-layout-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.live-layout-button[hidden] {
    display: none !important;
}

.live-layout-button.active {
    border-color: #72a3ff;
    background: #23477d;
    box-shadow: 0 0 0 1px rgba(114, 163, 255, 0.25);
}

.live-refresh-button {
    white-space: nowrap;
}

.live-tile {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
}

.live-video-shell {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #000;
}

.live-tile video {
    min-height: 0;
}

.live-tile-overlay {
    padding: 12px;
}

.live-tile-overlay > div:first-child {
    min-width: 0;
    padding-right: 8px;
}

.live-tile-overlay strong,
.live-tile-overlay span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-tile-badges {
    flex: 0 0 auto;
    justify-items: end;
}

.live-tile-actions {
    position: relative;
    z-index: 5;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 7px 9px;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    background: #09111f;
}

.live-tile-action {
    display: inline-grid;
    place-items: center;
    width: 36px;
    min-width: 36px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 8px;
    font-size: 17px;
    line-height: 1;
}

.live-tile-action span {
    pointer-events: none;
}

.live-remove-camera,
.live-capture-photo {
    position: static !important;
    inset: auto !important;
}

.live-tile:fullscreen,
.live-tile:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    border: 0;
    border-radius: 0;
    background: #000;
}

.live-tile:fullscreen .live-video-shell,
.live-tile:-webkit-full-screen .live-video-shell {
    min-height: 0;
}

.live-tile:fullscreen video,
.live-tile:-webkit-full-screen video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (max-width: 900px) {
    body.navigation-open {
        overflow: hidden;
    }

    .mobile-navigation-toggle {
        position: sticky;
        top: 0;
        z-index: 1201;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        min-height: 50px;
        border: 0;
        border-radius: 0;
        border-bottom: 1px solid #202c44;
        background: #0d1525;
        text-align: left;
    }

    .mobile-navigation-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1198;
        display: block;
        background: rgba(0, 0, 0, 0.56);
        backdrop-filter: blur(2px);
    }

    .mobile-navigation-backdrop[hidden] {
        display: none;
    }

    .layout {
        display: block;
        min-height: calc(100vh - 50px);
    }

    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1200;
        width: min(320px, 88vw);
        height: 100vh;
        padding-top: 68px;
        overflow-y: auto;
        border-right: 1px solid #202c44;
        border-bottom: 0;
        transform: translateX(-105%);
        transition: transform 180ms ease;
        box-shadow: 24px 0 60px rgba(0, 0, 0, 0.42);
    }

    body.navigation-open .sidebar {
        transform: translateX(0);
    }

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

    .nav-item {
        min-height: 48px;
    }

    .content {
        width: 100%;
        padding: 20px 16px 28px;
    }

    .live-toolbar,
    .live-layout-controls {
        width: 100%;
    }

    .live-layout-controls {
        justify-content: space-between;
    }

    .live-layout-options {
        flex: 1 1 auto;
    }

    .live-workspace {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .live-camera-sidebar {
        overflow: visible;
    }

    .live-camera-list {
        display: flex;
        gap: 8px;
        max-height: none;
        padding: 10px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .live-camera-item {
        flex: 0 0 min(270px, 82vw);
        scroll-snap-align: start;
    }

    .live-stage,
    .live-grid {
        min-height: 0;
    }
}

@media (max-width: 720px) {
    .topbar {
        gap: 12px;
    }

    h1 {
        font-size: 23px;
    }

    .panel {
        padding: 14px;
        border-radius: 12px;
    }

    .live-layout-controls {
        align-items: stretch;
    }

    .live-layout-options {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .live-layout-button,
    .live-refresh-button {
        min-height: 44px;
        padding-inline: 12px;
    }

    .live-refresh-button {
        flex: 1 1 100%;
    }

    .live-grid.layout-2,
    .live-grid.layout-4 {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .live-tile {
        min-height: 0;
        aspect-ratio: auto;
    }

    .live-video-shell {
        aspect-ratio: 16 / 9;
    }

    .live-tile-overlay {
        gap: 8px;
        padding: 9px;
    }

    .live-tile-overlay strong {
        font-size: 12px;
    }

    .live-tile-overlay span {
        font-size: 9px;
    }

    .live-tile-actions {
        min-height: 52px;
        justify-content: space-between;
        padding: 8px;
    }

    .live-tile-action {
        width: 42px;
        min-width: 42px;
        height: 38px;
        min-height: 38px;
    }
}

@media (max-width: 420px) {
    .content {
        padding-inline: 10px;
    }

    .live-layout-options {
        grid-template-columns: 1fr;
    }

    .live-camera-item {
        flex-basis: 86vw;
    }

    .live-tile-overlay {
        align-items: flex-start;
    }

    .live-tile-badges {
        max-width: 45%;
    }
}


/* OWS_BATCH1A_LIVE_UI_V2
   Nombres legibles y mosaicos que se completan automáticamente. */

.live-camera-item {
    min-width: 0;
}

.live-camera-item > span {
    min-width: 0;
}

.live-camera-item strong {
    display: -webkit-box;
    min-width: 0;
    overflow: hidden;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: normal;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.live-camera-item small {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 1180px) {
    .live-workspace {
        grid-template-columns: 280px minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .live-camera-item {
        grid-template-columns: 58px minmax(150px, 1fr);
        min-width: 230px;
    }

    .live-camera-item strong {
        -webkit-line-clamp: 2;
    }
}


/* OWS_BATCH1A_MOBILE_UX_V3 */

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.mobile-navigation-close {
    display: none;
}

.drawer-close-button {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    border-radius: 50%;
    font-size: 26px;
    line-height: 1;
}

.live-panel,
.live-workspace,
.live-stage,
.live-grid,
.live-tile,
.live-video-shell,
.live-tile video {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.live-stage,
.live-grid,
.live-tile,
.live-video-shell {
    overflow: hidden;
}

.evidence-player-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
}

.evidence-player-tools button {
    width: 100%;
    min-width: 0;
    white-space: nowrap;
}

#recording-evidence-message {
    grid-column: 1 / -1;
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .mobile-navigation-close {
        position: absolute;
        top: 14px;
        right: 14px;
        z-index: 2;
        display: inline-grid;
        place-items: center;
        width: 40px;
        min-width: 40px;
        height: 40px;
        min-height: 40px;
        padding: 0;
        border-radius: 50%;
        font-size: 25px;
        line-height: 1;
    }

    .sidebar .brand {
        position: relative;
        padding-right: 46px;
    }

    .topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
        width: 100%;
    }

    .topbar > * {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .topbar > :last-child {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 8px 12px;
    }

    .topbar > :last-child button {
        width: 100%;
        max-width: 100%;
    }

    .live-panel {
        padding-inline: 12px;
    }

    .live-workspace {
        width: 100%;
        max-width: 100%;
    }

    .live-stage,
    .live-grid {
        contain: inline-size;
    }

    .live-tile video {
        object-fit: contain;
    }
}

@media (max-width: 600px) {
    .setup-drawer {
        width: 100%;
        max-width: 100%;
        padding: 18px 14px 24px;
    }

    .setup-header {
        position: sticky;
        top: -18px;
        z-index: 20;
        margin: 0 -14px 18px;
        padding: 18px 14px 14px;
        background: #101927;
        border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    }

    .drawer-close-button {
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
    }

    .live-video-shell {
        width: 100%;
        max-width: 100%;
        aspect-ratio: 16 / 9;
    }

    .live-video-shell video {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
    }

    .evidence-player-tools {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 9px;
    }

    .evidence-player-tools button {
        padding-inline: 8px;
        font-size: 13px;
    }
}


/* OWS_BATCH1A_MOBILE_LIVE_FIX_V6 */

@media (max-width: 900px) {
    .content,
    .view,
    .panel,
    .live-panel,
    .live-workspace,
    .live-stage,
    .live-grid,
    .live-tile,
    .live-video-shell {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .content,
    .view,
    .live-panel,
    .live-workspace,
    .live-stage {
        overflow-x: clip !important;
    }

    .live-grid,
    .live-grid.layout-1,
    .live-grid.layout-2,
    .live-grid.layout-4 {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-rows: none !important;
        gap: 12px;
    }

    .live-tile {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto;
        contain: layout paint;
    }

    .live-video-shell {
        position: relative;
        display: block;
        aspect-ratio: 16 / 9;
        overflow: hidden !important;
        background: #000;
    }

    .live-video-shell video {
        position: absolute !important;
        inset: 0 !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
        object-fit: contain !important;
        object-position: center center !important;
        transform: none !important;
    }

    .live-camera-sidebar {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .live-camera-list {
        display: grid !important;
        grid-auto-flow: column;
        grid-auto-columns: minmax(250px, 82vw);
        grid-template-columns: none !important;
        gap: 10px;
        width: 100%;
        max-width: 100%;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 10px;
        overscroll-behavior-x: contain;
        touch-action: pan-x;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding: 10px;
    }

    .live-camera-item {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        scroll-snap-align: start;
        touch-action: pan-x;
        user-select: none;
        -webkit-user-select: none;
    }

    .live-camera-item img {
        pointer-events: none;
    }
}

@media (max-width: 420px) {
    .live-camera-list {
        grid-auto-columns: calc(100vw - 54px);
    }

    .live-panel {
        padding-inline: 10px !important;
    }
}


/* OWS_BATCH1A_SESSION_HEADER_V7 */

.node-session-card {
    flex: 0 1 auto;
    display: grid;
    grid-template-columns:
        minmax(150px, auto)
        minmax(155px, auto)
        auto;
    align-items: center;
    gap: 14px;
    margin-left: auto;
    padding: 8px;
    border: 1px solid rgba(115, 151, 210, 0.24);
    border-radius: 13px;
    background:
        linear-gradient(
            145deg,
            rgba(22, 35, 58, 0.88),
            rgba(10, 20, 36, 0.92)
        );
    box-shadow:
        0 10px 24px
        rgba(0, 0, 0, 0.18);
}

.node-session-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.node-session-avatar {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(123, 174, 255, 0.38);
    border-radius: 50%;
    color: #e7f1ff;
    background:
        linear-gradient(
            145deg,
            #315f9e,
            #1a3d70
        );
    font-size: 12px;
    font-weight: 900;
}

.node-session-identity {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.node-session-name,
.node-session-role,
.node-session-time,
.node-session-date {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.node-session-name {
    color: #f2f7ff;
    font-size: 13px;
}

.node-session-role {
    color: #8295b4;
    font-size: 10px;
}

.node-session-clock {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding-left: 14px;
    border-left: 1px solid rgba(255, 255, 255, 0.09);
    line-height: 1.15;
    text-align: right;
}

.node-session-time {
    color: #edf4ff;
    font-size: 13px;
}

.node-session-date {
    color: #8295b4;
    font-size: 10px;
    text-transform: capitalize;
}

.node-session-logout {
    min-height: 38px;
    padding-inline: 13px;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .node-session-card {
        width: 100%;
        max-width: 100%;
        grid-template-columns:
            minmax(0, 1fr)
            minmax(120px, auto);
        gap: 10px;
        margin: 0;
        padding: 10px;
    }

    .node-session-logout {
        grid-column: 1 / -1;
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 430px) {
    .node-session-card {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(105px, auto);
        padding: 9px;
    }

    .node-session-avatar {
        width: 34px;
        height: 34px;
        font-size: 11px;
    }

    .node-session-name,
    .node-session-time {
        font-size: 12px;
    }

    .node-session-role,
    .node-session-date {
        font-size: 9px;
    }
}


/* OWS_BATCH1A_ACCESS_CARDS_V8 */

#access-summary {
    display: flex;
    align-items: center;
    min-height: 46px;
    margin-top: 4px;
    padding: 12px 14px;
    border-style: solid;
    border-color: rgba(91, 144, 226, 0.22);
    background:
        linear-gradient(
            135deg,
            rgba(29, 55, 91, 0.54),
            rgba(10, 22, 39, 0.72)
        );
    color: #c9d8ef;
    font-weight: 700;
}

#access-user-list {
    display: grid;
    gap: 12px;
    margin-top: 16px !important;
}

#access-user-list .access-user-card {
    position: relative;
    grid-template-columns:
        minmax(190px, 1.25fr)
        minmax(150px, 0.9fr)
        minmax(175px, 1fr)
        minmax(190px, auto) !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 16px !important;
    overflow: hidden;
    border-color: rgba(118, 150, 201, 0.22) !important;
    border-radius: 14px !important;
    background:
        linear-gradient(
            145deg,
            rgba(17, 31, 52, 0.98),
            rgba(10, 21, 38, 0.98)
        );
    box-shadow:
        0 10px 24px
        rgba(0, 0, 0, 0.14);
}

#access-user-list .access-user-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background:
        linear-gradient(
            to bottom,
            #4f8ee8,
            #5cc99b
        );
}

#access-user-list .access-user-card.disabled {
    opacity: 0.58;
    filter: saturate(0.72);
}

#access-user-list .access-user-card.disabled::before {
    background: #6b7280;
}

#access-user-list .access-user-identity,
#access-user-list .access-user-meta {
    min-width: 0;
}

#access-user-list .access-user-identity {
    display: grid;
    align-content: center;
    gap: 4px;
    padding-left: 6px;
}

#access-user-list .access-user-identity strong {
    overflow: hidden;
    color: #f1f6ff;
    font-size: 15px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#access-user-list .access-user-identity span {
    color: #83a3cf;
    font-size: 11px;
}

#access-user-list .access-user-meta {
    display: grid;
    align-content: center;
    gap: 5px;
    min-height: 64px;
    padding: 10px 11px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    background: rgba(5, 13, 25, 0.48);
}

#access-user-list .access-user-meta strong {
    overflow: hidden;
    color: #e5edf9;
    font-size: 13px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#access-user-list .access-user-meta span {
    margin-top: 0;
    color: #7f90aa;
    font-size: 10px;
    line-height: 1.35;
}

#access-user-list .access-user-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: center;
    justify-content: stretch !important;
    gap: 8px !important;
    min-width: 190px;
}

#access-user-list .access-user-actions button {
    width: 100%;
    min-width: 0;
    min-height: 38px !important;
    padding-inline: 10px;
    font-size: 12px;
    white-space: nowrap;
}

#access-user-list .access-user-actions .danger {
    grid-column: 1 / -1;
    border-color: rgba(239, 68, 68, 0.52) !important;
    background: rgba(113, 31, 40, 0.30);
    color: #ffb3b8 !important;
}

#access-user-list .access-user-actions .danger:disabled {
    border-color: rgba(148, 163, 184, 0.18) !important;
    background: rgba(71, 85, 105, 0.14);
    color: #8190a7 !important;
}

@media (max-width: 1100px) {
    #access-user-list .access-user-card {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(0, 1fr) !important;
    }

    #access-user-list .access-user-actions {
        grid-column: 1 / -1;
        min-width: 0;
    }
}

@media (max-width: 700px) {
    #refresh-access-users {
        width: 100%;
    }

    #access-user-list .access-user-card {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        padding: 14px !important;
    }

    #access-user-list .access-user-meta {
        min-height: 0;
    }

    #access-user-list .access-user-actions {
        grid-column: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #access-user-list .access-user-actions button {
        min-height: 42px !important;
        font-size: 12px;
    }
}

@media (max-width: 390px) {
    #access-user-list .access-user-actions {
        grid-template-columns: 1fr;
    }

    #access-user-list .access-user-actions .danger {
        grid-column: auto;
    }
}

/* OWS_BATCH1A_UI_POLISH_V9 */

/* Usuarios y acceso: desktop y móvil */
#access-user-list .access-user-card {
    align-items: stretch;
}

#access-user-list .access-user-identity {
    position: relative;
    padding: 12px 14px 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 11px;
    background: rgba(4, 12, 24, 0.34);
}

#access-user-list .access-user-identity strong {
    font-size: 15px;
}

#access-user-list .access-user-identity span {
    margin-top: 2px;
}

#access-user-list .access-user-card:not(.disabled)
.access-user-identity::after {
    content: "Activa";
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 7px;
    border-radius: 999px;
    color: #9cf0c5;
    background: rgba(26, 122, 78, 0.32);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

#access-user-list .access-user-card.disabled
.access-user-identity::after {
    content: "Desactivada";
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 7px;
    border-radius: 999px;
    color: #aab4c5;
    background: rgba(92, 103, 120, 0.28);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

#access-user-list .access-user-card.disabled
.access-user-actions button:last-child {
    grid-column: 1 / -1;
    border-color: rgba(70, 201, 135, 0.48) !important;
    color: #b9f7d5 !important;
    background:
        linear-gradient(
            145deg,
            rgba(24, 111, 72, 0.72),
            rgba(15, 77, 51, 0.78)
        ) !important;
}

#access-user-list .access-user-card.disabled
.access-user-actions button:last-child:hover:not(:disabled) {
    border-color: rgba(111, 232, 171, 0.72) !important;
    background:
        linear-gradient(
            145deg,
            rgba(32, 137, 89, 0.88),
            rgba(19, 94, 62, 0.92)
        ) !important;
}

#access-user-list .access-user-actions button {
    transition:
        border-color 150ms ease,
        background 150ms ease,
        transform 150ms ease;
}

#access-user-list .access-user-actions button:hover:not(:disabled) {
    transform: translateY(-1px);
}

/* Filtros de grabaciones */
.recording-filters {
    display: grid;
    grid-template-columns:
        minmax(220px, 1.35fr)
        minmax(165px, 0.8fr)
        auto;
    align-items: end;
    gap: 10px;
    width: min(100%, 650px);
}

.recording-filters label {
    gap: 7px;
    min-width: 0;
    color: #8fa3c2;
    font-size: 10px;
    letter-spacing: 0.05em;
}

.recording-filters select,
.recording-filters input {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid rgba(111, 143, 194, 0.34);
    border-radius: 9px;
    color: #edf4ff;
    background:
        linear-gradient(
            145deg,
            rgba(21, 34, 56, 0.98),
            rgba(11, 22, 39, 0.98)
        );
    font: inherit;
    font-size: 12px;
    outline: none;
}

.recording-filters select:hover,
.recording-filters input:hover {
    border-color: rgba(116, 167, 246, 0.54);
}

.recording-filters select:focus,
.recording-filters input:focus {
    border-color: #6ca2f3;
    box-shadow:
        0 0 0 3px
        rgba(70, 126, 214, 0.16);
}

.recording-filters input[type="date"] {
    color-scheme: dark;
}

.recording-filters #load-recordings {
    min-height: 42px;
    padding-inline: 18px;
    border-color: rgba(89, 145, 231, 0.48);
    background:
        linear-gradient(
            145deg,
            #223a61,
            #172c4c
        );
}

/* Modal de clip */
.evidence-modal {
    border-color: rgba(106, 149, 217, 0.28);
    background:
        linear-gradient(
            145deg,
            rgba(15, 31, 54, 0.98),
            rgba(8, 20, 37, 0.99)
        );
}

.evidence-modal form label {
    display: grid;
    gap: 7px;
    color: #b9c8de;
    font-size: 12px;
}

.evidence-modal input,
.evidence-modal select {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid rgba(111, 143, 194, 0.32);
    border-radius: 8px;
    color: #edf4ff;
    background: #0b1729;
    font: inherit;
}

.evidence-modal-actions button {
    min-height: 40px;
}

/* Mobile */
@media (max-width: 700px) {
    #access-user-list .access-user-card {
        gap: 9px !important;
        padding: 12px !important;
    }

    #access-user-list .access-user-identity {
        padding: 13px 12px;
    }

    #access-user-list .access-user-meta {
        padding: 12px;
    }

    #access-user-list .access-user-actions {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        gap: 8px !important;
    }

    #access-user-list .access-user-actions button {
        min-height: 44px !important;
    }

    #access-user-list .access-user-card.disabled
    .access-user-actions button:last-child {
        grid-column: 1 / -1;
    }

    .recordings-header {
        align-items: stretch;
    }

    .recording-filters {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .recording-filters label,
    .recording-filters select,
    .recording-filters input,
    .recording-filters #load-recordings {
        width: 100%;
    }

    .recording-filters select,
    .recording-filters input,
    .recording-filters #load-recordings {
        min-height: 46px;
    }

    .evidence-modal {
        width: min(94vw, 520px);
        max-height: 90vh;
        overflow-y: auto;
        padding: 18px;
    }

    .evidence-modal-header {
        align-items: center;
    }

    .evidence-modal-actions {
        display: grid;
        grid-template-columns:
            minmax(0, 1fr)
            minmax(0, 1.25fr);
    }

    .evidence-modal-actions button {
        width: 100%;
    }
}

@media (max-width: 390px) {
    #access-user-list .access-user-actions {
        grid-template-columns: 1fr;
    }

    #access-user-list .access-user-card.disabled
    .access-user-actions button:last-child {
        grid-column: auto;
    }

    .evidence-modal-actions {
        grid-template-columns: 1fr;
    }
}

/* OWS_BATCH1A_FILTERS_PLAYBACK_V10 */

/* Campos consistentes: Grabaciones, Eventos y Biblioteca */
.recording-filters,
.event-filters,
.library-filters {
    align-items: end;
    gap: 10px;
}

.event-filters,
.library-filters {
    display: grid;
    width: min(100%, 760px);
}

.event-filters {
    grid-template-columns:
        minmax(190px, 1.25fr)
        minmax(145px, 0.8fr)
        minmax(145px, 0.8fr)
        minmax(170px, 0.9fr)
        auto;
}

.library-filters {
    grid-template-columns:
        minmax(190px, 1.25fr)
        minmax(145px, 0.8fr)
        minmax(145px, 0.8fr)
        auto;
}

.recording-filters label,
.event-filters label,
.library-filters label {
    display: grid;
    gap: 7px;
    min-width: 0;
    color: #8fa3c2;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.recording-filters select,
.recording-filters input,
.event-filters select,
.event-filters input,
.library-filters select,
.library-filters input {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid rgba(111, 143, 194, 0.34);
    border-radius: 9px;
    color: #edf4ff;
    background:
        linear-gradient(
            145deg,
            rgba(21, 34, 56, 0.98),
            rgba(11, 22, 39, 0.98)
        );
    font: inherit;
    font-size: 12px;
    outline: none;
}

.recording-filters select:hover,
.recording-filters input:hover,
.event-filters select:hover,
.event-filters input:hover,
.library-filters select:hover,
.library-filters input:hover {
    border-color: rgba(116, 167, 246, 0.54);
}

.recording-filters select:focus,
.recording-filters input:focus,
.event-filters select:focus,
.event-filters input:focus,
.library-filters select:focus,
.library-filters input:focus {
    border-color: #6ca2f3;
    box-shadow:
        0 0 0 3px
        rgba(70, 126, 214, 0.16);
}

.recording-filters input[type="date"],
.event-filters input[type="date"],
.library-filters input[type="date"] {
    color-scheme: dark;
}

.recording-filters button,
.event-filters button,
.library-filters button {
    min-height: 42px;
    padding-inline: 18px;
    border-color: rgba(89, 145, 231, 0.48);
    background:
        linear-gradient(
            145deg,
            #223a61,
            #172c4c
        );
    white-space: nowrap;
}

/* Controles de playback más claros */
.recording-playback-controls {
    display: grid;
    grid-template-columns:
        minmax(190px, auto)
        minmax(0, 1fr)
        minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 14px;
}

.recording-navigation-controls,
.recording-control-group {
    min-width: 0;
}

.recording-navigation-controls {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.recording-navigation-controls button {
    min-width: 0;
    min-height: 40px;
    padding-inline: 12px;
    font-size: 11px;
}

.recording-control-group {
    display: grid;
    grid-template-columns:
        auto repeat(4, minmax(38px, auto));
    align-items: center;
    justify-content: end;
    gap: 7px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    background: rgba(5, 13, 25, 0.42);
}

.recording-control-group > span {
    margin-right: 4px;
    color: #9aabc3;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.recording-control-group > span strong {
    color: #edf4ff;
}

.recording-control-group button {
    min-width: 38px;
    min-height: 36px;
    padding: 6px 9px;
}

.recording-control-group button.active {
    border-color: rgba(105, 201, 150, 0.78);
    background:
        linear-gradient(
            145deg,
            rgba(31, 130, 88, 0.94),
            rgba(22, 96, 66, 0.94)
        );
    box-shadow:
        0 0 0 2px
        rgba(105, 201, 150, 0.14);
}

/* Tablet */
@media (max-width: 1100px) {
    .event-filters,
    .library-filters {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .event-filters button,
    .library-filters button {
        width: 100%;
    }

    .recording-playback-controls {
        grid-template-columns: 1fr;
    }

    .recording-control-group {
        justify-content: start;
    }
}

/* Mobile */
@media (max-width: 700px) {
    .events-header,
    .library-header {
        align-items: stretch;
    }

    .event-filters,
    .library-filters {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .event-filters label,
    .event-filters select,
    .event-filters input,
    .event-filters button,
    .library-filters label,
    .library-filters select,
    .library-filters input,
    .library-filters button {
        width: 100%;
    }

    .event-filters select,
    .event-filters input,
    .event-filters button,
    .library-filters select,
    .library-filters input,
    .library-filters button {
        min-height: 46px;
    }

    .recording-playback-controls {
        gap: 10px;
        padding: 12px;
    }

    .recording-navigation-controls {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .recording-navigation-controls button {
        width: 100%;
        min-height: 44px;
        font-size: 12px;
    }

    .recording-control-group {
        grid-template-columns:
            minmax(0, 1fr)
            repeat(4, minmax(36px, auto));
        justify-content: stretch;
        padding: 10px;
    }

    .recording-control-group > span {
        grid-column: 1 / -1;
        margin: 0 0 2px;
        font-size: 12px;
    }

    .recording-control-group button {
        width: 100%;
        min-width: 0;
        min-height: 40px;
    }
}

@media (max-width: 390px) {
    .recording-navigation-controls {
        grid-template-columns: 1fr;
    }

    .recording-control-group {
        grid-template-columns:
            repeat(4, minmax(0, 1fr));
    }

    .recording-control-group > span {
        grid-column: 1 / -1;
    }
}

/* OWS_BATCH1A_SELECT_DATE_V11 */

/* Selects consistentes en tema oscuro */
.recording-filters select,
.event-filters select,
.library-filters select {
    color-scheme: dark;
    cursor: pointer;
}

.recording-filters select option,
.event-filters select option,
.library-filters select option {
    color: #edf4ff;
    background: #101a2a;
}

/* Date picker visible y táctil */
.recording-filters input[type="date"],
.event-filters input[type="date"],
.library-filters input[type="date"] {
    position: relative;
    color-scheme: dark;
    cursor: pointer;
}

.recording-filters input[type="date"]::-webkit-calendar-picker-indicator,
.event-filters input[type="date"]::-webkit-calendar-picker-indicator,
.library-filters input[type="date"]::-webkit-calendar-picker-indicator {
    width: 18px;
    height: 18px;
    margin-left: 8px;
    padding: 3px;
    border-radius: 5px;
    cursor: pointer;
    filter:
        invert(88%)
        sepia(8%)
        saturate(476%)
        hue-rotate(179deg)
        brightness(98%)
        contrast(92%);
    opacity: 0.92;
}

.recording-filters input[type="date"]::-webkit-calendar-picker-indicator:hover,
.event-filters input[type="date"]::-webkit-calendar-picker-indicator:hover,
.library-filters input[type="date"]::-webkit-calendar-picker-indicator:hover {
    background: rgba(111, 163, 241, 0.15);
    opacity: 1;
}

/* OWS_BATCH1A_FINAL_POLISH_V12 */

/* Estado del Node */
#health-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 132px;
    max-width: 180px;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: 0.02em;
    text-align: center;
    white-space: nowrap;
    box-shadow:
        0 8px 18px
        rgba(0, 0, 0, 0.16);
}

#health-badge::before {
    content: "";
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: currentColor;
    box-shadow:
        0 0 0 4px
        color-mix(
            in srgb,
            currentColor 18%,
            transparent
        );
}

#health-badge.ok {
    border-color: rgba(72, 205, 142, 0.38);
    color: #91ecc0;
    background:
        linear-gradient(
            145deg,
            rgba(25, 113, 74, 0.82),
            rgba(15, 77, 51, 0.88)
        );
}

#health-badge.warning {
    border-color: rgba(236, 183, 63, 0.40);
    color: #ffe09a;
    background:
        linear-gradient(
            145deg,
            rgba(118, 83, 22, 0.88),
            rgba(77, 53, 14, 0.92)
        );
}

#health-badge.error {
    border-color: rgba(240, 103, 115, 0.42);
    color: #ffb0b8;
    background:
        linear-gradient(
            145deg,
            rgba(123, 42, 51, 0.90),
            rgba(83, 28, 35, 0.94)
        );
}

/* Mosaicos dinámicos */
.live-layout-options {
    flex-wrap: wrap;
}

.live-grid.layout-6 {
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    grid-template-rows:
        repeat(2, minmax(0, 1fr));
}

.live-grid.layout-8 {
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    grid-template-rows:
        repeat(2, minmax(0, 1fr));
}

.live-layout-button[hidden] {
    display: none !important;
}

/* Acciones de cámara */
#camera-list .device-actions {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 9px;
}

#camera-list [data-live-camera],
#camera-list [data-edit-camera] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    font-weight: 800;
    transition:
        transform 150ms ease,
        border-color 150ms ease,
        background 150ms ease;
}

#camera-list [data-live-camera]::before {
    content: "▶";
    font-size: 11px;
}

#camera-list [data-edit-camera]::before {
    content: "⚙";
    font-size: 14px;
}

#camera-list [data-live-camera] {
    border-color: rgba(62, 204, 150, 0.50);
    color: #c5f8e1;
    background:
        linear-gradient(
            145deg,
            rgba(25, 126, 85, 0.88),
            rgba(16, 89, 60, 0.92)
        );
}

#camera-list [data-edit-camera] {
    border-color: rgba(91, 151, 241, 0.48);
    color: #d8e8ff;
    background:
        linear-gradient(
            145deg,
            rgba(39, 83, 143, 0.88),
            rgba(25, 57, 103, 0.92)
        );
}

#camera-list [data-live-camera]:hover:not(:disabled),
#camera-list [data-edit-camera]:hover:not(:disabled) {
    transform: translateY(-1px);
}

#camera-list [data-live-camera]:disabled {
    border-color: rgba(148, 163, 184, 0.18);
    color: #7d8aa0;
    background: rgba(71, 85, 105, 0.16);
}

@media (max-width: 1100px) {
    #health-badge {
        min-width: 118px;
        max-width: 150px;
    }

    .live-grid.layout-6,
    .live-grid.layout-8 {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        grid-template-rows: auto;
    }
}

@media (max-width: 700px) {
    #health-badge {
        width: 100%;
        max-width: 100%;
        min-height: 40px;
    }

    .live-grid.layout-6,
    .live-grid.layout-8 {
        grid-template-columns: 1fr;
    }

    #camera-list .device-actions {
        grid-template-columns: 1fr;
    }

    #camera-list [data-live-camera],
    #camera-list [data-edit-camera] {
        width: 100%;
        min-height: 46px;
    }
}

/* OWS_BATCH1A_CONCLUSION_V13 */

/* Botón de cierre de sesión */
.node-session-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.node-session-logout::before {
    content: "↪";
    font-size: 16px;
    line-height: 1;
    transform: rotate(180deg);
}

/* Navegación y drawer */
.navigation {
    gap: 6px;
}

.nav-item {
    position: relative;
    overflow: hidden;
    transition:
        color 150ms ease,
        background 150ms ease,
        border-color 150ms ease,
        transform 150ms ease;
}

.nav-item::before {
    content: "";
    position: absolute;
    inset: 7px auto 7px 0;
    width: 3px;
    border-radius: 99px;
    background: transparent;
    transition: background 150ms ease;
}

.nav-item:hover:not(:disabled) {
    color: #f5f9ff;
    border-color: rgba(104, 156, 237, 0.32);
    background:
        linear-gradient(
            90deg,
            rgba(51, 93, 153, 0.26),
            rgba(29, 51, 83, 0.12)
        );
    transform: translateX(2px);
}

.nav-item:hover:not(:disabled)::before {
    background: #63a2ff;
}

.nav-item.active::before {
    background: #72b4ff;
}

/* Botones generales clasificados por JS */
.ows-action-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    font-weight: 800;
    transition:
        transform 150ms ease,
        border-color 150ms ease,
        background 150ms ease,
        box-shadow 150ms ease;
}

.ows-action-button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.ows-action-primary {
    border-color: rgba(80, 147, 246, 0.52) !important;
    color: #e5f0ff !important;
    background:
        linear-gradient(
            145deg,
            rgba(43, 94, 164, 0.94),
            rgba(28, 67, 120, 0.96)
        ) !important;
}

.ows-action-success {
    border-color: rgba(72, 205, 142, 0.48) !important;
    color: #d2f9e5 !important;
    background:
        linear-gradient(
            145deg,
            rgba(27, 128, 84, 0.90),
            rgba(18, 88, 59, 0.94)
        ) !important;
}

.ows-action-secondary {
    border-color: rgba(122, 150, 194, 0.34) !important;
    color: #d7e4f6 !important;
    background:
        linear-gradient(
            145deg,
            rgba(31, 48, 75, 0.92),
            rgba(18, 31, 51, 0.96)
        ) !important;
}

.ows-action-warning {
    border-color: rgba(230, 174, 68, 0.44) !important;
    color: #ffe2a4 !important;
    background:
        linear-gradient(
            145deg,
            rgba(111, 77, 22, 0.86),
            rgba(76, 53, 15, 0.92)
        ) !important;
}

.ows-action-danger {
    border-color: rgba(238, 78, 94, 0.52) !important;
    color: #ffc1c7 !important;
    background:
        linear-gradient(
            145deg,
            rgba(112, 31, 43, 0.90),
            rgba(76, 21, 31, 0.94)
        ) !important;
}

/* Descubrimiento */
#view-discovery .panel-actions,
.custom-subnet-controls {
    gap: 10px;
}

#add-manual-camera-discovery,
#scan-cameras,
#scan-custom-subnet {
    min-height: 44px;
}

/* Cámaras retiradas */
#retired-camera-list .device-card {
    border-color: rgba(122, 150, 194, 0.20);
    background:
        linear-gradient(
            145deg,
            rgba(15, 29, 49, 0.98),
            rgba(9, 20, 35, 0.99)
        );
}

#retired-camera-list .device-actions {
    display: grid;
    gap: 9px;
}

#retired-camera-list button {
    width: 100%;
}

/* Eventos */
.event-card {
    border-color: rgba(113, 145, 196, 0.20);
    background:
        linear-gradient(
            145deg,
            rgba(16, 30, 50, 0.98),
            rgba(8, 18, 32, 0.99)
        );
    box-shadow:
        0 10px 26px
        rgba(0, 0, 0, 0.16);
}

.event-content {
    display: grid;
    gap: 12px;
    padding: 15px;
}

.event-title {
    align-items: flex-start;
}

.event-title strong {
    color: #f1f6ff;
    font-size: 14px;
}

.event-title em {
    padding: 4px 7px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 999px;
    background: rgba(5, 13, 25, 0.48);
}

.event-details {
    gap: 8px;
    margin: 0;
}

.event-details div {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 9px;
    background: rgba(5, 13, 25, 0.44);
}

.event-details dd {
    overflow-wrap: anywhere;
    color: #dbe6f6;
    line-height: 1.35;
}

.event-actions {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 8px;
    justify-content: stretch;
}

.event-actions button {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding-inline: 8px;
    font-size: 11px;
}

/* Biblioteca */
.library-card {
    border-color: rgba(113, 145, 196, 0.20);
    background:
        linear-gradient(
            145deg,
            rgba(16, 30, 50, 0.98),
            rgba(8, 18, 32, 0.99)
        );
    box-shadow:
        0 10px 26px
        rgba(0, 0, 0, 0.16);
}

.library-content {
    gap: 10px;
    padding: 14px;
}

.library-content dl {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.library-content dl div {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 9px;
    background: rgba(5, 13, 25, 0.44);
}

.library-content dd {
    overflow-wrap: anywhere;
}

.library-actions {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.library-actions > * {
    width: 100%;
    min-width: 0;
    min-height: 40px;
}

/* Usuarios */
#access-user-list .access-user-actions button {
    position: relative;
}

#access-user-list .access-user-actions button::before {
    font-size: 14px;
    line-height: 1;
}

#access-user-list .access-user-actions
button[data-access-action="edit"]::before {
    content: "✎";
}

#access-user-list .access-user-actions
button[data-access-action="reset"]::before {
    content: "🔑";
    font-size: 12px;
}

#access-user-list .access-user-actions
button[data-access-action="activate"]::before {
    content: "✓";
}

#access-user-list .access-user-actions
button[data-access-action="deactivate"]::before {
    content: "⏻";
}

@media (max-width: 700px) {
    .event-details,
    .library-content dl {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .event-actions,
    .library-actions {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .event-actions button:last-child,
    .library-actions > :last-child {
        grid-column: 1 / -1;
    }

    #view-discovery .panel-actions {
        display: grid;
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    #view-discovery .panel-actions button {
        width: 100%;
    }
}

@media (max-width: 390px) {
    .event-details,
    .library-content dl,
    .event-actions,
    .library-actions,
    #view-discovery .panel-actions {
        grid-template-columns: 1fr;
    }

    .event-actions button:last-child,
    .library-actions > :last-child {
        grid-column: auto;
    }
}

/* OWS_BATCH1A_CAMERA_ACTIONS_V14 */

#view-cameras .panel-actions {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

#view-cameras .camera-add-action,
#view-cameras .camera-refresh-action {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    min-height: 42px;
    font-weight: 800;
    transition:
        transform 150ms ease,
        border-color 150ms ease,
        background 150ms ease,
        box-shadow 150ms ease;
}

#view-cameras .camera-add-action::before {
    content: "＋";
    font-size: 18px;
    line-height: 1;
}

#view-cameras .camera-refresh-action::before {
    content: "↻";
    font-size: 17px;
    line-height: 1;
}

#view-cameras .camera-add-action {
    border-color: rgba(64, 201, 143, 0.48);
    color: #d4f8e7;
    background:
        linear-gradient(
            145deg,
            rgba(27, 128, 84, 0.92),
            rgba(17, 87, 58, 0.96)
        );
}

#view-cameras .camera-refresh-action {
    border-color: rgba(88, 148, 239, 0.48);
    color: #dfebff;
    background:
        linear-gradient(
            145deg,
            rgba(42, 90, 158, 0.92),
            rgba(26, 62, 112, 0.96)
        );
}

#view-cameras .camera-add-action:hover:not(:disabled),
#view-cameras .camera-refresh-action:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow:
        0 8px 18px
        rgba(0, 0, 0, 0.18);
}

#view-cameras .camera-add-action:focus-visible,
#view-cameras .camera-refresh-action:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px
        rgba(92, 153, 243, 0.18);
}

@media (max-width: 700px) {
    #view-cameras .panel-actions {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    #view-cameras .camera-add-action,
    #view-cameras .camera-refresh-action {
        min-height: 46px;
    }
}

@media (max-width: 390px) {
    #view-cameras .panel-actions {
        grid-template-columns: 1fr;
    }
}

/* OWS_LIVE_VIEW_DYNAMIC_16_V1 */

.live-grid.layout-10,
.live-grid.layout-12 {
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    grid-template-rows:
        repeat(3, minmax(0, 1fr));
}

.live-grid.layout-14,
.live-grid.layout-16 {
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    grid-template-rows:
        repeat(4, minmax(0, 1fr));
}

/*
 * La esquina superior izquierda queda libre para el OSD
 * de fecha y hora generado por la propia cámara.
 */
.live-tile-overlay {
    position: absolute;
    inset: 0;
    padding: 0;
    pointer-events: none;
}

.live-tile-overlay > div:first-child {
    position: absolute;
    left: 10px;
    right: auto;
    bottom: 10px;
    max-width: calc(100% - 120px);
    padding: 6px 9px;
    border-radius: 7px;
    background: rgba(3, 9, 18, 0.72);
    backdrop-filter: blur(3px);
}

.live-tile-overlay > div:first-child strong {
    display: block;
    font-size: 13px;
    line-height: 1.25;
}

.live-tile-overlay > div:first-child span {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    opacity: 0.78;
}

.live-tile-badges {
    position: absolute;
    top: 10px;
    right: 10px;
}

#camera-list [data-live-camera] {
    white-space: nowrap;
    font-weight: 650;
}

@media (max-width: 1100px) {
    .live-grid.layout-10,
    .live-grid.layout-12,
    .live-grid.layout-14,
    .live-grid.layout-16 {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
        grid-template-rows: auto;
    }
}

@media (max-width: 700px) {
    .live-grid.layout-10,
    .live-grid.layout-12,
    .live-grid.layout-14,
    .live-grid.layout-16 {
        grid-template-columns: 1fr;
    }
}

/* OWS_LIVE_MONITOR_MODE_V1 */

.live-monitor-button {
    white-space: nowrap;
}

.live-monitor-exit {
    display: none;
}

.live-stage.monitor-mode,
.live-stage:fullscreen,
.live-stage:-webkit-full-screen {
    position: relative;
    width: 100vw;
    height: 100vh;
    padding: 10px;
    overflow: hidden;
    background: #000;
}

.live-stage.monitor-mode .live-monitor-exit,
.live-stage:fullscreen .live-monitor-exit,
.live-stage:-webkit-full-screen .live-monitor-exit {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 100;
    display: inline-grid;
    place-items: center;
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    color: #fff;
    background: rgba(4, 10, 20, 0.78);
    font-size: 28px;
    line-height: 1;
}

.live-stage.monitor-mode .live-grid,
.live-stage:fullscreen .live-grid,
.live-stage:-webkit-full-screen .live-grid {
    width: 100%;
    height: 100%;
    gap: 6px;
}

.live-stage.monitor-mode .live-tile,
.live-stage:fullscreen .live-tile,
.live-stage:-webkit-full-screen .live-tile {
    min-width: 0;
    min-height: 0;
    border-radius: 4px;
    grid-template-rows: minmax(0, 1fr);
}

.live-stage.monitor-mode .live-tile-actions,
.live-stage:fullscreen .live-tile-actions,
.live-stage:-webkit-full-screen .live-tile-actions {
    display: none;
}

.live-stage.monitor-mode .live-video-shell,
.live-stage:fullscreen .live-video-shell,
.live-stage:-webkit-full-screen .live-video-shell {
    height: 100%;
}

.live-stage.monitor-mode video,
.live-stage:fullscreen video,
.live-stage:-webkit-full-screen video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.live-stage.monitor-mode .live-tile-overlay > div:first-child,
.live-stage:fullscreen .live-tile-overlay > div:first-child,
.live-stage:-webkit-full-screen .live-tile-overlay > div:first-child {
    bottom: 8px;
    max-width: calc(100% - 100px);
}

.live-stage.monitor-mode .live-tile-overlay > div:first-child span,
.live-stage:fullscreen .live-tile-overlay > div:first-child span,
.live-stage:-webkit-full-screen .live-tile-overlay > div:first-child span {
    display: none;
}

.live-stage.monitor-mode .live-tile-badges,
.live-stage:fullscreen .live-tile-badges,
.live-stage:-webkit-full-screen .live-tile-badges {
    top: 8px;
    right: 8px;
}

@media (max-width: 700px) {
    .live-monitor-button {
        width: 100%;
    }
}

/* OWS_LIVE_MONITOR_EXIT_FIX_V2 */

.live-monitor-exit {
    display: none !important;
}

.live-stage.monitor-mode .live-monitor-exit.visible,
.live-stage:fullscreen .live-monitor-exit.visible,
.live-stage:-webkit-full-screen .live-monitor-exit.visible {
    display: inline-grid !important;
}

.live-stage.monitor-mode .live-tile-actions,
.live-stage:fullscreen .live-tile-actions,
.live-stage:-webkit-full-screen .live-tile-actions {
    display: none !important;
}

.live-stage.monitor-mode .live-monitor-exit,
.live-stage:fullscreen .live-monitor-exit,
.live-stage:-webkit-full-screen .live-monitor-exit {
    opacity: 0.72;
    transition:
        opacity 150ms ease,
        transform 150ms ease;
}

.live-stage.monitor-mode .live-monitor-exit:hover,
.live-stage:fullscreen .live-monitor-exit:hover,
.live-stage:-webkit-full-screen .live-monitor-exit:hover {
    opacity: 1;
    transform: scale(1.05);
}

/* OWS_LIVE_MONITOR_FIREFOX_FIX_V3 */

.live-stage.monitor-mode > .live-monitor-exit.visible {
    position: fixed !important;
    top: 14px !important;
    right: 14px !important;
    z-index: 2147483647 !important;
    display: grid !important;
    visibility: visible !important;
    opacity: 0.88 !important;
    pointer-events: auto !important;
}

.live-stage.monitor-mode .live-tile-actions {
    display: none !important;
    visibility: hidden !important;
}

.live-stage.monitor-mode video {
    pointer-events: none;
}

/* OWS_LIVE_CAMERA_WATERMARK_V1 */

.live-camera-watermark {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 3;
    max-width: 42%;
    overflow: hidden;
    padding: 4px 8px;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.78);
    background: rgba(2, 7, 14, 0.34);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.01em;
    text-overflow: ellipsis;
    text-shadow:
        0 1px 2px rgba(0, 0, 0, 0.95);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

.live-stage.monitor-mode .live-camera-watermark,
.live-stage:fullscreen .live-camera-watermark,
.live-stage:-webkit-full-screen .live-camera-watermark {
    right: 10px;
    bottom: 10px;
    max-width: 38%;
    color: rgba(255, 255, 255, 0.72);
    background: rgba(2, 7, 14, 0.28);
    font-size: clamp(10px, 0.85vw, 14px);
}

.live-grid.layout-8 .live-camera-watermark,
.live-grid.layout-10 .live-camera-watermark,
.live-grid.layout-12 .live-camera-watermark,
.live-grid.layout-14 .live-camera-watermark,
.live-grid.layout-16 .live-camera-watermark {
    max-width: 36%;
    padding: 3px 6px;
    font-size: 9px;
}

@media (max-width: 700px) {
    .live-camera-watermark {
        max-width: 38%;
        font-size: 9px;
    }
}

/* OWS_MOTION_AREA_EDITOR_V1 */

.motion-settings-section {
    display: grid;
    gap: 18px;
}

.motion-settings-section[hidden],
.motion-area-workspace[hidden],
.motion-area-preview-fallback[hidden] {
    display: none !important;
}

.motion-settings-grid {
    display: grid;
    grid-template-columns:
        minmax(180px, 1fr)
        minmax(150px, 0.75fr)
        minmax(130px, 0.6fr)
        minmax(130px, 0.6fr);
    gap: 14px;
    align-items: end;
}

.motion-settings-grid > label {
    display: grid;
    gap: 8px;
}

.motion-range-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px;
    gap: 10px;
    align-items: center;
}

.motion-range-row output {
    display: grid;
    place-items: center;
    min-height: 38px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.65);
}

.motion-area-mode {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 10px;
}

.motion-area-mode label {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    cursor: pointer;
}

.motion-area-workspace {
    display: grid;
    gap: 12px;
}

.motion-area-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: end;
}

.motion-area-toolbar > div {
    display: grid;
    gap: 4px;
}

.motion-area-toolbar small {
    color: #94a3b8;
}

.motion-area-canvas {
    position: relative;
    width: min(100%, 920px);
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 12px;
    background: #020617;
    user-select: none;
}

.motion-area-canvas > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.motion-area-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    touch-action: none;
    cursor: crosshair;
}

.motion-area-region {
    position: absolute;
    box-sizing: border-box;
    border: 2px solid #38bdf8;
    background: rgba(56, 189, 248, 0.16);
    cursor: move;
}

.motion-area-drawing {
    pointer-events: none;
    border-style: dashed;
}

.motion-area-region-label {
    position: absolute;
    top: 5px;
    left: 6px;
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(2, 6, 23, 0.82);
    color: #e0f2fe;
    font-size: 0.72rem;
    pointer-events: none;
}

.motion-area-region-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 4;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    min-width: 0;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(248, 113, 113, 0.7);
    background: rgba(127, 29, 29, 0.88);
    color: #fff;
    cursor: pointer;
}

.motion-area-resize-handle {
    position: absolute;
    z-index: 3;
    width: 14px;
    height: 14px;
    border: 2px solid #e0f2fe;
    border-radius: 50%;
    background: #0284c7;
}

.motion-area-resize-handle.nw {
    left: -8px;
    top: -8px;
    cursor: nwse-resize;
}

.motion-area-resize-handle.ne {
    right: -8px;
    top: -8px;
    cursor: nesw-resize;
}

.motion-area-resize-handle.sw {
    left: -8px;
    bottom: -8px;
    cursor: nesw-resize;
}

.motion-area-resize-handle.se {
    right: -8px;
    bottom: -8px;
    cursor: nwse-resize;
}

.motion-area-preview-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    text-align: center;
    color: #94a3b8;
}

@media (max-width: 860px) {
    .motion-settings-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 620px) {
    .motion-settings-grid {
        grid-template-columns: 1fr;
    }

    .motion-area-toolbar {
        display: grid;
        align-items: stretch;
    }

    .motion-area-toolbar button,
    .motion-area-canvas {
        width: 100%;
    }
}

/* OWS_EVENTS_PAGINATION_V1 */
.events-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}
.events-pagination-status {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    color: #94a3b8;
    font-size: 0.86rem;
}
.events-pagination-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.events-pagination-actions label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
}
.events-pagination-actions select {
    min-width: 82px;
}
@media (max-width: 760px) {
    .events-pagination {
        display: grid;
        align-items: stretch;
    }
    .events-pagination-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .events-pagination-actions label {
        grid-column: 1 / -1;
        justify-content: space-between;
    }
}

/* OWS_CONFIG_FORM_ALIGNMENT_V1 */

#node-general-settings-form .node-settings-field-grid {
    align-items: start;
    column-gap: 16px;
    row-gap: 18px;
}

#node-general-settings-form
.node-settings-field-grid > .access-field {
    display: grid;
    grid-template-rows:
        minmax(18px, auto)
        44px
        minmax(30px, auto);
    align-content: start;
    gap: 7px;
    min-width: 0;
    margin: 0;
}

#node-general-settings-form
.node-settings-field-grid > .access-field.node-settings-wide {
    grid-column: 1 / -1;
}

#node-general-settings-form
.node-settings-field-grid
.access-field-label {
    display: flex;
    align-items: end;
    min-height: 18px;
    margin: 0;
    line-height: 1.25;
}

#node-general-settings-form
.node-settings-field-grid
.access-field > input:not([type="checkbox"]),
#node-general-settings-form
.node-settings-field-grid
.access-field > select {
    box-sizing: border-box;
    display: block;
    width: 100%;
    min-width: 0;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    margin: 0;
    padding: 9px 12px;
    line-height: 1.2;
}

#node-general-settings-form
.node-settings-field-grid
.access-field > input[type="number"] {
    padding-right: 8px;
}

#node-general-settings-form
.node-settings-field-grid
.access-field > select {
    color-scheme: dark;
    cursor: pointer;
}

#node-general-settings-form
.node-settings-field-grid
.access-field > select option {
    color: #edf4ff;
    background: #101a2a;
}

#node-general-settings-form
.node-settings-field-grid
.access-field > small {
    display: block;
    min-height: 30px;
    margin: 0;
    line-height: 1.4;
}

#node-general-settings-form
.node-settings-field-grid
.access-field > textarea {
    box-sizing: border-box;
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 96px;
    margin: 0;
    padding: 11px 12px;
    resize: vertical;
    line-height: 1.45;
}

#node-general-settings-form
.node-settings-field-grid > .toggle-field {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 44px;
    margin: 25px 0 0;
    padding: 10px 12px;
    border: 1px solid rgba(111, 143, 194, 0.24);
    border-radius: 9px;
    background: rgba(9, 19, 34, 0.42);
    line-height: 1.35;
}

#node-general-settings-form
.node-settings-field-grid > .toggle-field
input[type="checkbox"] {
    flex: 0 0 auto;
    margin: 0;
}

#node-general-settings-form
.node-settings-field-grid > .toggle-field span {
    min-width: 0;
}

#node-general-settings-form .node-settings-save-row {
    align-items: center;
    margin-top: 6px;
}

@media (max-width: 900px) {
    #node-general-settings-form
    .node-settings-field-grid {
        column-gap: 14px;
        row-gap: 16px;
    }
}

@media (max-width: 700px) {
    #node-general-settings-form
    .node-settings-field-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    #node-general-settings-form
    .node-settings-field-grid > .access-field,
    #node-general-settings-form
    .node-settings-field-grid > .access-field.node-settings-wide,
    #node-general-settings-form
    .node-settings-field-grid > .toggle-field {
        grid-column: 1;
        width: 100%;
    }

    #node-general-settings-form
    .node-settings-field-grid > .toggle-field {
        margin-top: 0;
        min-height: 46px;
    }

    #node-general-settings-form
    .node-settings-field-grid
    .access-field > input:not([type="checkbox"]),
    #node-general-settings-form
    .node-settings-field-grid
    .access-field > select {
        height: 46px;
        min-height: 46px;
        max-height: 46px;
    }
}


/* OWS_BATCH1_LIVE_EXPLICIT_MEDIA_CONTROLS_V1 */

.live-action-label {
    display: none;
    pointer-events: none;
}

.live-action-icon {
    pointer-events: none;
}

.live-grid.layout-1 .live-tile-actions {
    gap: 10px;
}

.live-grid.layout-1 .live-tile-action {
    display: inline-flex;
    width: auto;
    min-width: 84px;
    padding-inline: 12px;
    gap: 7px;
    font-size: 14px;
    font-weight: 700;
}

.live-grid.layout-1 .live-action-label {
    display: inline;
}

.live-audio-camera:disabled {
    cursor: wait;
    opacity: 0.48;
}

.live-audio-camera:not(:disabled) {
    border-color: rgba(96, 165, 250, 0.48);
}

.live-tile:fullscreen .live-tile-actions,
.live-tile:-webkit-full-screen .live-tile-actions {
    display: flex !important;
    visibility: visible !important;
    position: relative;
    z-index: 20;
    min-height: 54px;
    padding: 8px 12px;
    background: rgba(5, 12, 24, 0.96);
}

.live-tile:fullscreen .live-tile-action,
.live-tile:-webkit-full-screen .live-tile-action {
    display: inline-flex;
    width: auto;
    min-width: 88px;
    height: 38px;
    padding-inline: 12px;
    gap: 7px;
    border-color: rgba(255, 255, 255, 0.24);
}

.live-tile:fullscreen .live-action-label,
.live-tile:-webkit-full-screen .live-action-label {
    display: inline;
}

@media (max-width: 620px) {
    .live-grid.layout-1 .live-tile-action,
    .live-tile:fullscreen .live-tile-action,
    .live-tile:-webkit-full-screen .live-tile-action {
        min-width: 42px;
        width: 42px;
        padding-inline: 0;
        justify-content: center;
    }

    .live-grid.layout-1 .live-action-label,
    .live-tile:fullscreen .live-action-label,
    .live-tile:-webkit-full-screen .live-action-label {
        display: none;
    }
}


/* OWS_BATCH1_LIVE_AUDIO_UI_FIX_V2 */

/*
 * Live usa exclusivamente controles OWS.
 * En fullscreen dejamos los identificadores por encima
 * del borde inferior para no competir con las acciones.
 */
.live-tile:fullscreen .live-camera-watermark,
.live-tile:-webkit-full-screen .live-camera-watermark {
    bottom: 30px !important;
}

.live-tile:fullscreen .live-tile-overlay > div:first-child,
.live-tile:-webkit-full-screen .live-tile-overlay > div:first-child {
    bottom: 30px !important;
}

.live-grid.layout-1 .live-camera-watermark {
    bottom: 18px;
}

.live-grid.layout-1 .live-tile-overlay > div:first-child {
    bottom: 18px;
}

/* OWS_BATCH2A_ANALYTICS_RUNTIME_UI_V1 */

.camera-card-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.camera-card-title-row h3 {
    min-width: 0;
    margin: 0;
}

.camera-internal-id {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #cbd5e1;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.analytics-panel + .analytics-panel {
    margin-top: 1rem;
}

.analytics-panel-header {
    gap: 18px;
}

.analytics-source-banner {
    display: flex;
    align-items: center;
    min-height: 46px;
    margin-bottom: 1rem;
    padding: 11px 14px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.62);
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 650;
}

.analytics-source-banner.available {
    border-color: rgba(34, 197, 94, 0.34);
    background: rgba(20, 83, 45, 0.2);
    color: #bbf7d0;
}

.analytics-source-banner.warning {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(120, 53, 15, 0.22);
    color: #fde68a;
}

.analytics-source-banner.unavailable,
.analytics-source-banner.pending {
    border-color: rgba(148, 163, 184, 0.26);
    color: #cbd5e1;
}

.analytics-source-banner.critical {
    border-color: rgba(239, 68, 68, 0.42);
    background: rgba(127, 29, 29, 0.2);
    color: #fecaca;
}

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

.analytics-summary-card,
.analytics-capacity-card {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
    padding: 15px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.52);
}

.analytics-summary-card > span,
.analytics-capacity-card > span {
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.analytics-summary-card > strong,
.analytics-capacity-card > strong {
    overflow-wrap: anywhere;
    color: #f8fafc;
    font-size: 1.05rem;
}

.analytics-summary-card > small {
    color: #94a3b8;
    line-height: 1.35;
}

.analytics-last-updated {
    margin: 13px 0 0;
    color: #94a3b8;
    font-size: 0.78rem;
}

.analytics-camera-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(310px, 1fr)
    );
    gap: 14px;
}

.analytics-camera-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.56);
}

.analytics-camera-card.healthy {
    border-color: rgba(34, 197, 94, 0.34);
}

.analytics-camera-card.warning {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(120, 53, 15, 0.12);
}

.analytics-camera-card.critical {
    border-color: rgba(239, 68, 68, 0.45);
    background: rgba(127, 29, 29, 0.12);
}

.analytics-camera-card.pending {
    border-color: rgba(59, 130, 246, 0.36);
}

.analytics-camera-card.unavailable {
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(30, 41, 59, 0.42);
}

.analytics-camera-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.analytics-camera-heading > div {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.analytics-eyebrow {
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 700;
}

.analytics-state-badge {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(71, 85, 105, 0.36);
    color: #cbd5e1;
    font-size: 0.74rem;
    font-weight: 800;
    white-space: nowrap;
}

.analytics-state-badge.healthy {
    background: rgba(22, 101, 52, 0.36);
    color: #bbf7d0;
}

.analytics-state-badge.warning {
    background: rgba(146, 64, 14, 0.38);
    color: #fde68a;
}

.analytics-state-badge.critical {
    background: rgba(153, 27, 27, 0.38);
    color: #fecaca;
}

.analytics-state-badge.pending {
    background: rgba(30, 64, 175, 0.34);
    color: #bfdbfe;
}

.analytics-engine-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.analytics-engine-chip {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 4px 9px;
    border: 1px solid rgba(96, 165, 250, 0.28);
    border-radius: 999px;
    background: rgba(30, 64, 175, 0.18);
    color: #bfdbfe;
    font-size: 0.74rem;
    font-weight: 700;
}

.analytics-engine-chip.muted {
    border-color: rgba(148, 163, 184, 0.24);
    background: rgba(71, 85, 105, 0.2);
    color: #94a3b8;
}

.analytics-camera-metrics {
    display: grid;
    grid-template-columns: repeat(
        2,
        minmax(0, 1fr)
    );
    gap: 9px;
    margin: 0;
}

.analytics-camera-metrics > div {
    min-width: 0;
    padding: 10px;
    border-radius: 10px;
    background: rgba(2, 6, 23, 0.34);
}

.analytics-camera-metrics dt {
    margin-bottom: 4px;
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 700;
}

.analytics-camera-metrics dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: #e2e8f0;
    font-size: 0.9rem;
    font-weight: 700;
}

.analytics-state-row {
    display: grid;
    grid-template-columns: repeat(
        2,
        minmax(0, 1fr)
    );
    gap: 8px 12px;
    color: #94a3b8;
    font-size: 0.78rem;
}

.analytics-state-row strong {
    color: #e2e8f0;
}

.analytics-reasons {
    color: #cbd5e1;
    font-size: 0.82rem;
    line-height: 1.45;
}

.analytics-reasons h3 {
    margin: 0 0 8px;
    color: #e2e8f0;
    font-size: 0.9rem;
}

.analytics-reasons ul {
    display: grid;
    gap: 6px;
    margin: 0;
    padding-left: 19px;
}

.analytics-reasons-empty {
    margin: 0;
    color: #64748b;
}

.analytics-capacity-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(160px, 1fr)
    );
    gap: 11px;
}

.analytics-capacity-card.warning {
    border-color: rgba(245, 158, 11, 0.4);
}

.analytics-capacity-card.critical {
    border-color: rgba(239, 68, 68, 0.4);
}

#analytics-aggregate-reasons {
    margin-top: 14px;
}

.analytics-advisory-note {
    margin: 14px 0 0;
    padding: 11px 13px;
    border-left: 3px solid rgba(96, 165, 250, 0.48);
    border-radius: 8px;
    background: rgba(30, 64, 175, 0.12);
    color: #bfdbfe;
    font-size: 0.82rem;
    line-height: 1.45;
}

@media (max-width: 720px) {
    .analytics-camera-grid {
        grid-template-columns: 1fr;
    }

    .analytics-camera-metrics,
    .analytics-state-row {
        grid-template-columns: 1fr;
    }

    .analytics-camera-heading,
    .camera-card-title-row {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* OWS_DISCOVERY_NETWORK_SETTINGS_UI_V1 */

.discovery-networks-settings-panel {
    margin-bottom: 18px;
}

.discovery-network-local {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(111, 143, 194, 0.24);
    border-radius: 10px;
    background: rgba(9, 19, 34, 0.42);
}

.discovery-network-local > div {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.discovery-network-list {
    display: grid;
    gap: 12px;
}

.discovery-network-row {
    display: grid;
    grid-template-columns:
        minmax(180px, 1.15fr)
        minmax(180px, 1fr)
        auto
        auto;
    align-items: end;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(111, 143, 194, 0.22);
    border-radius: 10px;
    background: rgba(9, 19, 34, 0.34);
}

.discovery-network-row .access-field {
    display: grid;
    gap: 7px;
    margin: 0;
}

.discovery-network-row .access-field > input {
    box-sizing: border-box;
    width: 100%;
    height: 44px;
    min-width: 0;
    margin: 0;
}

.discovery-network-enabled,
.discovery-network-remove {
    min-height: 44px;
    margin: 0;
}

@media (max-width: 900px) {
    .discovery-network-local,
    .discovery-network-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .discovery-network-local .access-security-badge {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

@media (max-width: 700px) {
    .discovery-network-local,
    .discovery-network-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .discovery-network-local .access-security-badge {
        grid-column: 1;
    }

    .discovery-network-enabled,
    .discovery-network-remove {
        width: 100%;
    }
}


/* OWS_BATCH2A_OPERATION_COMPACT_PTZ_UI_V1 */

/*
 * Operation editor: retention is max 365 (3 digits), so none of these
 * controls should consume an entire drawer row.
 */
.camera-operation-fields {
    grid-template-columns: 236px 138px 146px !important;
    justify-content: start;
    align-items: start;
    column-gap: 16px;
    row-gap: 14px;
}

.camera-operation-fields label:has(#setup-recording-mode),
.camera-operation-fields label:has(#editor-recording-mode) {
    width: 236px;
    max-width: 236px;
}

.camera-operation-fields label:has(#setup-ptz-mode),
.camera-operation-fields label:has(#editor-ptz-mode) {
    width: 138px;
    max-width: 138px;
}

.camera-operation-fields label:has(#setup-retention-days),
.camera-operation-fields label:has(#editor-retention-days) {
    width: 146px;
    max-width: 146px;
}

#setup-recording-mode,
#editor-recording-mode {
    width: 236px !important;
    max-width: 236px !important;
}

#setup-ptz-mode,
#editor-ptz-mode {
    width: 138px !important;
    max-width: 138px !important;
}

.camera-operation-fields .camera-retention-control {
    width: 146px !important;
    max-width: 146px !important;
    grid-template-columns: 78px auto !important;
    justify-content: start;
}

#setup-retention-days,
#editor-retention-days {
    width: 78px !important;
    min-width: 78px !important;
    max-width: 78px !important;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.camera-operation-fields small {
    max-width: 236px;
}

.live-video-shell {
    position: relative;
}

.live-ptz-panel {
    position: absolute;
    z-index: 12;
    right: 14px;
    bottom: 14px;
    width: min(250px, calc(100% - 28px));
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 14px;
    background: rgba(7, 13, 25, 0.92);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
}

.live-ptz-panel[hidden] {
    display: none !important;
}

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

.live-ptz-panel-head strong {
    font-size: 0.84rem;
    letter-spacing: 0.04em;
}

.live-ptz-close,
.live-ptz-direction-pad button,
.live-ptz-zoom-row button {
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(30, 41, 59, 0.94);
    color: #f8fafc;
    cursor: pointer;
    user-select: none;
    touch-action: none;
}

.live-ptz-close {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 1.1rem;
}

.live-ptz-direction-pad {
    display: grid;
    grid-template-columns: repeat(3, 44px);
    grid-template-areas:
        ". up ."
        "left stop right"
        ". down .";
    justify-content: center;
    gap: 7px;
}

.live-ptz-direction-pad button {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    font-size: 1.15rem;
    font-weight: 800;
}

.live-ptz-direction-pad button[data-tilt="0.42"] { grid-area: up; }
.live-ptz-direction-pad button[data-pan="-0.42"] { grid-area: left; }
.live-ptz-direction-pad .live-ptz-stop { grid-area: stop; }
.live-ptz-direction-pad button[data-pan="0.42"] { grid-area: right; }
.live-ptz-direction-pad button[data-tilt="-0.42"] { grid-area: down; }

.live-ptz-zoom-row {
    display: grid;
    grid-template-columns: 1fr 44px 44px;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
}

.live-ptz-zoom-row span {
    color: #cbd5e1;
    font-size: 0.78rem;
    font-weight: 700;
}

.live-ptz-zoom-row button {
    width: 44px;
    height: 38px;
    border-radius: 10px;
    font-size: 1.12rem;
    font-weight: 800;
}

.live-ptz-direction-pad button.active,
.live-ptz-zoom-row button.active {
    transform: scale(0.96);
    background: rgba(51, 65, 85, 0.98);
}

.live-ptz-direction-pad button:disabled,
.live-ptz-zoom-row button:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

.live-ptz-panel small {
    display: block;
    min-height: 1.15em;
    margin-top: 9px;
    color: #94a3b8;
    font-size: 0.7rem;
    line-height: 1.35;
}

.live-ptz-panel small[data-state="moving"] {
    color: #e2e8f0;
}

.live-ptz-panel small[data-state="error"] {
    color: #fca5a5;
}

.live-ptz-camera:disabled {
    opacity: 0.55;
}

@media (max-width: 760px) {
    .camera-operation-fields {
        grid-template-columns: minmax(0, 1fr) 138px !important;
    }

    .camera-operation-fields label:has(#setup-recording-mode),
    .camera-operation-fields label:has(#editor-recording-mode) {
        width: 100%;
        max-width: none;
    }

    #setup-recording-mode,
    #editor-recording-mode {
        width: 100% !important;
        max-width: none !important;
    }
}

@media (max-width: 520px) {
    .camera-operation-fields {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .camera-operation-fields label:has(#setup-ptz-mode),
    .camera-operation-fields label:has(#editor-ptz-mode),
    .camera-operation-fields label:has(#setup-retention-days),
    .camera-operation-fields label:has(#editor-retention-days) {
        width: min(100%, 236px);
        max-width: 236px;
    }

    .live-ptz-panel {
        right: 8px;
        bottom: 8px;
        width: min(238px, calc(100% - 16px));
    }
}


/* OWS_BATCH2A_LIVE_CONTROL_BUTTON_ALIGNMENT_V1 */
.live-ptz-close,
.live-orientation-close,
.live-ptz-direction-pad button,
.live-ptz-zoom-row button {
    box-sizing: border-box;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    line-height: 1 !important;
    text-align: center;
    vertical-align: middle;
}

.live-ptz-direction-pad button,
.live-ptz-zoom-row button {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.live-close-icon {
    position: relative;
    display: block;
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
}

.live-close-icon::before,
.live-close-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transform-origin: center;
}

.live-close-icon::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.live-close-icon::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.live-ptz-stop-icon {
    display: block;
    width: 11px;
    height: 11px;
    flex: 0 0 11px;
    border-radius: 1.5px;
    background: currentColor;
}

.live-ptz-close:focus-visible,
.live-orientation-close:focus-visible,
.live-ptz-direction-pad button:focus-visible,
.live-ptz-zoom-row button:focus-visible,
.live-orientation-options button:focus-visible {
    outline: 2px solid rgba(96, 165, 250, 0.92);
    outline-offset: 2px;
}

.live-ptz-close:hover,
.live-orientation-close:hover,
.live-ptz-direction-pad button:hover:not(:disabled),
.live-ptz-zoom-row button:hover:not(:disabled) {
    background: rgba(51, 65, 85, 0.98);
}

/* OWS_BATCH2A_LIVE_ORIENTATION_UI_V1 */
.live-orientation-panel {
    position: absolute;
    z-index: 13;
    right: 14px;
    bottom: 14px;
    width: min(286px, calc(100% - 28px));
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 14px;
    background: rgba(7, 13, 25, 0.94);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
}
.live-orientation-panel[hidden] { display: none !important; }
.live-orientation-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.live-orientation-panel-head strong { font-size: 0.84rem; letter-spacing: 0.03em; }
.live-orientation-close,
.live-orientation-options button { border: 1px solid rgba(148, 163, 184, 0.30); background: rgba(30, 41, 59, 0.94); color: #f8fafc; cursor: pointer; }
.live-orientation-close { width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 8px; }
.live-orientation-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.live-orientation-options button { min-width: 0; padding: 9px 6px; border-radius: 9px; font-size: 0.78rem; font-weight: 700; }
.live-orientation-options button.active { outline: 2px solid rgba(96, 165, 250, 0.72); outline-offset: 1px; background: rgba(30, 64, 175, 0.52); }
.live-orientation-options button:disabled { cursor: not-allowed; opacity: 0.45; }
.live-orientation-panel small { display: block; margin-top: 10px; color: #a8b6cc; line-height: 1.35; }
.live-orientation-panel small[data-state="error"] { color: #fca5a5; }
.live-orientation-panel small[data-state="success"] { color: #86efac; }
.live-orientation-panel small[data-state="working"] { color: #93c5fd; }
.live-orientation-note { opacity: 0.72; font-size: 0.68rem; }
@media (max-width: 720px) {
    .live-orientation-panel { right: 10px; bottom: 10px; width: min(300px, calc(100% - 20px)); }
    .live-orientation-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* OWS_BATCH2A_ANALYTICS_PRODUCT_UI_V2 */

.analytics-product-shell { display: grid; gap: 1rem; }

.analytics-product-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.22));
    border-radius: 18px;
    background: var(--panel-background, rgba(15, 23, 42, 0.72));
}

.analytics-product-hero h1,
.analytics-product-section-heading h2,
.analytics-product-card h3,
.analytics-product-camera-card h3,
.analytics-product-module-card h3 { margin: 0; }

.analytics-product-lead {
    max-width: 760px;
    margin: 0.45rem 0 0;
    color: var(--muted-text, #94a3b8);
    line-height: 1.55;
}

.analytics-product-hero-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.analytics-product-source,
.analytics-product-badge,
.analytics-product-flow-badge,
.analytics-product-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: fit-content;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.45rem 0.65rem;
    border: 1px solid currentColor;
}

.analytics-product-source.pending,
.analytics-product-badge.neutral { opacity: 0.82; }

.analytics-product-source.good,
.analytics-product-badge.good { color: var(--success-color, #22c55e); }

.analytics-product-source.warning,
.analytics-product-badge.warning { color: var(--warning-color, #f59e0b); }

.analytics-product-source.critical,
.analytics-product-badge.critical { color: var(--danger-color, #ef4444); }

.analytics-product-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.2rem 0 0.35rem;
    scrollbar-width: thin;
}

.analytics-product-tabs button {
    appearance: none;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.22));
    background: transparent;
    color: inherit;
    border-radius: 999px;
    padding: 0.65rem 0.9rem;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.analytics-product-tabs button.active {
    background: var(--accent-soft, rgba(59, 130, 246, 0.14));
    border-color: var(--accent-color, #3b82f6);
}

.analytics-product-message {
    border-radius: 14px;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.22));
    line-height: 1.45;
}

.analytics-product-message.warning { border-color: var(--warning-color, #f59e0b); }
.analytics-product-message.critical { border-color: var(--danger-color, #ef4444); }

.analytics-product-panel { display: grid; gap: 1rem; }

.analytics-product-section-heading,
.analytics-product-card-heading,
.analytics-product-camera-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.analytics-product-section-heading small,
.analytics-product-card small,
.analytics-product-camera-card small,
.analytics-product-module-card small,
.analytics-product-muted { color: var(--muted-text, #94a3b8); }

.analytics-product-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
}

.analytics-product-kpi,
.analytics-product-card,
.analytics-product-camera-card,
.analytics-product-module-card {
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.22));
    border-radius: 16px;
    background: var(--panel-background, rgba(15, 23, 42, 0.72));
}

.analytics-product-kpi {
    display: grid;
    gap: 0.35rem;
    min-height: 108px;
    padding: 1rem;
    align-content: center;
}

.analytics-product-kpi > span {
    color: var(--muted-text, #94a3b8);
    font-size: 0.82rem;
    font-weight: 700;
}

.analytics-product-kpi > strong {
    font-size: clamp(1.45rem, 2.8vw, 2.15rem);
    line-height: 1;
}

.analytics-product-kpi > small {
    color: var(--muted-text, #94a3b8);
    line-height: 1.35;
}

.analytics-product-kpi.good {
    border-color: color-mix(in srgb, var(--success-color, #22c55e) 45%, transparent);
}

.analytics-product-kpi.warning {
    border-color: color-mix(in srgb, var(--warning-color, #f59e0b) 45%, transparent);
}

.analytics-product-divider {
    height: 1px;
    background: var(--border-color, rgba(148, 163, 184, 0.22));
}

.analytics-product-two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.analytics-product-card,
.analytics-product-camera-card,
.analytics-product-module-card { padding: 1rem; }

.analytics-product-definition-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin: 1rem 0 0;
}

.analytics-product-definition-grid > div {
    min-width: 0;
    border-radius: 12px;
    padding: 0.65rem 0.75rem;
    background: rgba(148, 163, 184, 0.08);
}

.analytics-product-definition-grid dt {
    color: var(--muted-text, #94a3b8);
    font-size: 0.74rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.analytics-product-definition-grid dd { margin: 0; overflow-wrap: anywhere; }

.analytics-product-reason-list {
    margin: 0.85rem 0 0;
    padding-left: 1.15rem;
    color: var(--muted-text, #94a3b8);
    line-height: 1.5;
}

.analytics-product-chip-row,
.analytics-product-state-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.9rem;
}

.analytics-product-chip {
    color: inherit;
    border-color: var(--border-color, rgba(148, 163, 184, 0.28));
    font-weight: 650;
}

.analytics-product-camera-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.analytics-product-camera-card { min-width: 0; }
.analytics-product-camera-heading > div { min-width: 0; }
.analytics-product-camera-heading h3 { margin-top: 0.2rem; overflow-wrap: anywhere; }

.analytics-product-period-note,
.analytics-product-empty {
    border: 1px dashed var(--border-color, rgba(148, 163, 184, 0.3));
    border-radius: 14px;
    padding: 0.9rem 1rem;
    color: var(--muted-text, #94a3b8);
}

.analytics-product-flow-chart { display: grid; gap: 0.9rem; margin-top: 0.8rem; }
.analytics-product-flow-day { display: grid; gap: 0.45rem; }

.analytics-product-flow-line {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    align-items: center;
    gap: 0.65rem;
    font-size: 0.8rem;
}

.analytics-product-bar-track {
    height: 9px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.12);
}

.analytics-product-bar { height: 100%; min-width: 2px; border-radius: inherit; }
.analytics-product-bar.in { background: var(--success-color, #22c55e); }
.analytics-product-bar.out { background: var(--warning-color, #f59e0b); }
.analytics-product-flow-badge.in { color: var(--success-color, #22c55e); }
.analytics-product-flow-badge.out { color: var(--warning-color, #f59e0b); }

.analytics-product-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin-top: 0.75rem;
}

.analytics-product-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.analytics-product-table th,
.analytics-product-table td {
    padding: 0.72rem 0.65rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color, rgba(148, 163, 184, 0.18));
    vertical-align: top;
}

.analytics-product-table th {
    color: var(--muted-text, #94a3b8);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.analytics-product-geometry-list {
    display: grid;
    gap: 0.7rem;
    margin-top: 0.75rem;
}

.analytics-product-geometry-item {
    display: grid;
    gap: 0.25rem;
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.08);
    padding: 0.75rem;
}

.analytics-product-module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.analytics-product-module-card p,
.analytics-product-note-card p {
    line-height: 1.5;
    color: var(--muted-text, #94a3b8);
}

.analytics-product-note-card p { max-width: 900px; margin-bottom: 0; }
.analytics-product-capacity-reasons { margin-top: 0.8rem; }

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

@media (max-width: 820px) {
    .analytics-product-hero,
    .analytics-product-section-heading,
    .analytics-product-camera-heading { flex-direction: column; }

    .analytics-product-hero-actions { justify-content: flex-start; }

    .analytics-product-two-column,
    .analytics-product-camera-grid,
    .analytics-product-module-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .analytics-product-kpi-grid,
    .analytics-product-definition-grid { grid-template-columns: 1fr; }

    .analytics-product-hero,
    .analytics-product-card,
    .analytics-product-camera-card,
    .analytics-product-module-card { border-radius: 14px; }
}

/* OWS_ANALYTICS_VISUAL_GEOMETRY_EDITOR_V1 */

.analytics-geometry-editor {
    display: grid;
    gap: 1rem;
}

.analytics-geometry-editor[hidden],
.analytics-geometry-control-group[hidden],
.analytics-geometry-preview-fallback[hidden],
.analytics-geometry-empty[hidden] {
    display: none !important;
}

.analytics-geometry-editor-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.analytics-geometry-editor-intro p {
    margin: 0.35rem 0 0;
    color: var(--muted-text, #94a3b8);
    line-height: 1.5;
    max-width: 850px;
}

.analytics-geometry-select-grid,
.analytics-geometry-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.analytics-geometry-select-grid label,
.analytics-geometry-fields-grid label,
.analytics-geometry-traffic-classes {
    display: grid;
    gap: 0.4rem;
    color: var(--muted-text, #94a3b8);
    font-size: 0.82rem;
    font-weight: 700;
}

.analytics-geometry-select-grid select,
.analytics-geometry-fields-grid input,
.analytics-geometry-fields-grid select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.25));
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.72);
    color: inherit;
    padding: 0.62rem 0.72rem;
    font: inherit;
}

.analytics-geometry-enable-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.2));
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
    background: rgba(148, 163, 184, 0.06);
}

.analytics-geometry-enable-row label {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 700;
}

.analytics-geometry-enable-row small,
.analytics-geometry-toolbar small {
    color: var(--muted-text, #94a3b8);
}

.analytics-geometry-workspace {
    display: grid;
    gap: 0.75rem;
}

.analytics-geometry-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.analytics-geometry-toolbar > div:first-child {
    display: grid;
    gap: 0.25rem;
}

.analytics-geometry-toolbar-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.analytics-geometry-canvas {
    position: relative;
    width: min(100%, 1000px);
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.25));
    border-radius: 14px;
    background: #020617;
    user-select: none;
}

.analytics-geometry-canvas > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.analytics-geometry-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: crosshair;
}

.analytics-geometry-line {
    stroke: #38bdf8;
    stroke-width: 8;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
}

.analytics-geometry-handle {
    fill: #0ea5e9;
    stroke: #e0f2fe;
    stroke-width: 5;
    vector-effect: non-scaling-stroke;
    cursor: grab;
}

.analytics-geometry-point-label,
.analytics-geometry-side-label {
    fill: #f8fafc;
    stroke: #020617;
    stroke-width: 4;
    paint-order: stroke;
    font-weight: 800;
    pointer-events: none;
}

.analytics-geometry-point-label {
    font-size: 30px;
}

.analytics-geometry-side-label {
    font-size: 34px;
}

.analytics-geometry-preview-fallback,
.analytics-geometry-empty {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    padding: 2rem;
    text-align: center;
    color: var(--muted-text, #94a3b8);
    pointer-events: none;
}

.analytics-geometry-empty {
    z-index: 4;
    align-content: end;
    padding-bottom: 1rem;
    background: linear-gradient(
        to top,
        rgba(2, 6, 23, 0.72),
        transparent 35%
    );
}

.analytics-geometry-direction-summary {
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
    background: rgba(56, 189, 248, 0.06);
    font-weight: 700;
    line-height: 1.45;
}

.analytics-geometry-control-group {
    display: grid;
    gap: 0.8rem;
    border-top: 1px solid var(--border-color, rgba(148, 163, 184, 0.18));
    padding-top: 1rem;
}

.analytics-geometry-traffic-class-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.55rem;
}

.analytics-geometry-traffic-class-grid label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.2));
    border-radius: 10px;
    padding: 0.65rem;
    color: inherit;
    font-size: 0.82rem;
    font-weight: 650;
}

.analytics-geometry-advanced {
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.2));
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
}

.analytics-geometry-advanced summary {
    cursor: pointer;
    font-weight: 750;
}

.analytics-geometry-advanced .analytics-geometry-fields-grid {
    margin-top: 0.8rem;
}

.analytics-geometry-editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.analytics-geometry-editor-message {
    color: var(--muted-text, #94a3b8);
    line-height: 1.45;
}

.analytics-geometry-editor-message.success {
    color: var(--success-color, #22c55e);
}

.analytics-geometry-editor-message.warning {
    color: var(--warning-color, #f59e0b);
}

.analytics-geometry-editor-message.error {
    color: var(--danger-color, #ef4444);
}

.analytics-geometry-editor-message.working {
    color: #38bdf8;
}

#analytics-geometry-camera-warning {
    color: var(--warning-color, #f59e0b);
}

@media (max-width: 900px) {
    .analytics-geometry-traffic-class-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .analytics-geometry-editor-intro,
    .analytics-geometry-editor-footer,
    .analytics-geometry-toolbar {
        display: grid;
    }

    .analytics-geometry-select-grid,
    .analytics-geometry-fields-grid,
    .analytics-geometry-traffic-class-grid {
        grid-template-columns: 1fr;
    }

    .analytics-geometry-toolbar-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .analytics-geometry-toolbar-actions button {
        width: 100%;
    }
}


/* OWS_ANALYTICS_CONFIGURATION_STUDIO_V1 */

.analytics-studio { display: grid; gap: 1rem; }

.analytics-studio[hidden],
.analytics-studio-control-group[hidden],
.analytics-studio-advanced[hidden],
.analytics-studio-preview-fallback[hidden],
.analytics-studio-empty[hidden],
#analytics-studio-finish-zone[hidden] {
    display: none !important;
}

.analytics-studio-heading,
.analytics-studio-context-heading,
.analytics-studio-section-heading,
.analytics-studio-footer,
.analytics-studio-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.analytics-studio-heading p,
.analytics-studio-context-heading p,
.analytics-studio-camera-help,
.analytics-studio-field-note {
    margin: 0.35rem 0 0;
    color: var(--muted-text, #94a3b8);
    line-height: 1.5;
}

.analytics-studio-camera-row {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
    gap: 1rem;
    align-items: end;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.2));
    border-radius: 14px;
    padding: 1rem;
    background: rgba(148, 163, 184, 0.05);
}

.analytics-studio-camera-row label,
.analytics-studio-fields-grid label {
    display: grid;
    gap: 0.4rem;
    color: var(--muted-text, #94a3b8);
    font-size: 0.82rem;
    font-weight: 700;
}

.analytics-studio-camera-row select,
.analytics-studio-fields-grid select,
.analytics-studio-fields-grid input {
    min-height: 42px;
    width: 100%;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.25));
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.75);
    color: inherit;
    padding: 0.62rem 0.72rem;
    font: inherit;
}

.analytics-studio-warning {
    color: var(--warning-color, #f59e0b);
}

.analytics-studio-section-heading h4,
.analytics-studio-context-heading h4 {
    margin: 0;
}

.analytics-studio-section-heading small {
    color: var(--muted-text, #94a3b8);
    max-width: 520px;
    text-align: right;
}

.analytics-studio-module-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.analytics-studio-module-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    gap: 0.65rem 0.75rem;
    min-height: 154px;
    text-align: left;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.22));
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.52);
    color: inherit;
    padding: 0.9rem;
    font: inherit;
}

button.analytics-studio-module-card { cursor: pointer; }

button.analytics-studio-module-card:hover {
    border-color: rgba(56, 189, 248, 0.55);
}

.analytics-studio-module-card.active {
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.18);
    background: rgba(56, 189, 248, 0.07);
}

.analytics-studio-module-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.08);
    color: #38bdf8;
    font-size: 1.2rem;
    font-weight: 800;
}

.analytics-studio-module-copy {
    display: grid;
    gap: 0.25rem;
}

.analytics-studio-module-copy strong { font-size: 0.95rem; }

.analytics-studio-module-copy small {
    color: #38bdf8;
    font-weight: 700;
}

.analytics-studio-module-copy > span {
    color: var(--muted-text, #94a3b8);
    font-size: 0.8rem;
    line-height: 1.4;
}

.analytics-studio-module-state {
    grid-column: 1 / -1;
    display: inline-flex;
    width: fit-content;
    border-radius: 999px;
    border: 1px solid currentColor;
    padding: 0.35rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 800;
}

.analytics-studio-module-state.good {
    color: var(--success-color, #22c55e);
}

.analytics-studio-module-state.warning {
    color: var(--warning-color, #f59e0b);
}

.analytics-studio-module-state.neutral {
    color: var(--muted-text, #94a3b8);
}

.analytics-studio-context {
    display: grid;
    gap: 1rem;
    border-top: 1px solid var(--border-color, rgba(148, 163, 184, 0.18));
    padding-top: 1rem;
}

.analytics-studio-title-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.analytics-studio-enable {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.22));
    border-radius: 999px;
    padding: 0.55rem 0.75rem;
    font-weight: 750;
}

.analytics-studio-workspace { display: grid; gap: 0.75rem; }

.analytics-studio-toolbar small {
    display: block;
    margin-top: 0.25rem;
    color: var(--muted-text, #94a3b8);
    max-width: 720px;
}

.analytics-studio-toolbar-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.analytics-studio-canvas {
    position: relative;
    width: min(100%, 1080px);
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.25));
    border-radius: 14px;
    background: #020617;
    user-select: none;
}

.analytics-studio-canvas > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.analytics-studio-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: crosshair;
}

.analytics-studio-line {
    stroke: #38bdf8;
    stroke-width: 8;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.analytics-studio-zone {
    fill: rgba(34, 197, 94, 0.18);
    stroke: #22c55e;
    stroke-width: 7;
    vector-effect: non-scaling-stroke;
}

.analytics-studio-zone-open {
    fill: none;
    stroke: #f59e0b;
    stroke-width: 7;
    stroke-dasharray: 14 10;
    vector-effect: non-scaling-stroke;
}

.analytics-studio-handle {
    fill: #0ea5e9;
    stroke: #e0f2fe;
    stroke-width: 5;
    vector-effect: non-scaling-stroke;
    cursor: grab;
}

.analytics-studio-handle.zone { fill: #22c55e; }

.analytics-studio-point-label,
.analytics-studio-side-label,
.analytics-studio-zone-label {
    fill: #f8fafc;
    stroke: #020617;
    stroke-width: 4;
    paint-order: stroke;
    font-weight: 800;
    pointer-events: none;
}

.analytics-studio-point-label { font-size: 30px; }
.analytics-studio-side-label { font-size: 34px; }
.analytics-studio-zone-label { font-size: 38px; }

.analytics-studio-preview-fallback,
.analytics-studio-empty {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    padding: 2rem;
    text-align: center;
    color: var(--muted-text, #94a3b8);
    pointer-events: none;
}

.analytics-studio-empty {
    z-index: 4;
    align-content: end;
    padding-bottom: 1rem;
    background: linear-gradient(
        to top,
        rgba(2, 6, 23, 0.72),
        transparent 35%
    );
}

.analytics-studio-direction-summary {
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
    background: rgba(56, 189, 248, 0.05);
    font-weight: 700;
    line-height: 1.45;
}

.analytics-studio-control-group {
    display: grid;
    gap: 0.8rem;
}

.analytics-studio-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    align-items: end;
}

.analytics-studio-field-note {
    border: 1px dashed var(--border-color, rgba(148, 163, 184, 0.25));
    border-radius: 10px;
    padding: 0.7rem;
}

.analytics-studio-vehicle-classes,
.analytics-studio-advanced {
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.22));
    border-radius: 12px;
    padding: 0.8rem;
}

.analytics-studio-class-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.5rem;
}

.analytics-studio-class-grid label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.18));
    border-radius: 10px;
    padding: 0.6rem;
}

.analytics-studio-advanced summary {
    cursor: pointer;
    font-weight: 750;
}

.analytics-studio-advanced .analytics-studio-fields-grid {
    margin-top: 0.8rem;
}

.analytics-studio-message {
    color: var(--muted-text, #94a3b8);
    line-height: 1.45;
    max-width: 820px;
}

.analytics-studio-message.success { color: var(--success-color, #22c55e); }
.analytics-studio-message.warning { color: var(--warning-color, #f59e0b); }
.analytics-studio-message.error { color: var(--danger-color, #ef4444); }
.analytics-studio-message.working { color: #38bdf8; }

@media (max-width: 1150px) {
    .analytics-studio-module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .analytics-studio-class-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .analytics-studio-heading,
    .analytics-studio-context-heading,
    .analytics-studio-section-heading,
    .analytics-studio-footer,
    .analytics-studio-toolbar {
        display: grid;
    }

    .analytics-studio-camera-row,
    .analytics-studio-fields-grid {
        grid-template-columns: 1fr;
    }

    .analytics-studio-section-heading small {
        text-align: left;
    }

    .analytics-studio-toolbar-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .analytics-studio-module-grid,
    .analytics-studio-class-grid {
        grid-template-columns: 1fr;
    }
}


/* OWS_ANALYTICS_GEOMETRY_FRESHNESS_UX_V1 */

.analytics-studio-config-health {
    display: grid;
    grid-template-columns: minmax(210px, auto) minmax(0, 1fr);
    gap: 0.8rem;
    align-items: stretch;
}

.analytics-studio-config-health > div:first-child {
    display: grid;
    align-content: center;
    gap: 0.3rem;
    min-width: 210px;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.22));
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
    background: rgba(148, 163, 184, 0.05);
}

.analytics-studio-config-label {
    color: var(--muted-text, #94a3b8);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.analytics-studio-geometry-review-warning {
    display: grid;
    gap: 0.28rem;
    border: 1px solid rgba(245, 158, 11, 0.5);
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
    background: rgba(245, 158, 11, 0.07);
    color: var(--warning-color, #f59e0b);
}

.analytics-studio-geometry-review-warning[hidden] {
    display: none !important;
}

.analytics-studio-geometry-review-warning span {
    color: var(--muted-text, #94a3b8);
    line-height: 1.45;
}

@media (max-width: 760px) {
    .analytics-studio-config-health {
        grid-template-columns: 1fr;
    }
}


/* OWS_SECURITY_OBJECT_CONFIGURATION_UI_V1 */

.analytics-security-panel {
    display: grid;
    gap: 1rem;
    border-top: 1px solid var(--border-color, rgba(148, 163, 184, 0.18));
    padding-top: 1rem;
}

.analytics-security-panel[hidden] {
    display: none !important;
}

.analytics-security-heading,
.analytics-security-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.analytics-security-heading p {
    margin: 0.35rem 0 0;
    color: var(--muted-text, #94a3b8);
    line-height: 1.5;
    max-width: 850px;
}

.analytics-security-dependency-note,
.analytics-security-scope-note,
.analytics-security-guide {
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
    line-height: 1.45;
}

.analytics-security-dependency-note {
    border: 1px solid rgba(56, 189, 248, 0.35);
    background: rgba(56, 189, 248, 0.06);
    color: #38bdf8;
}

.analytics-security-dependency-note[hidden] {
    display: none !important;
}

.analytics-security-scope-note {
    display: grid;
    gap: 0.3rem;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(148, 163, 184, 0.05);
}

.analytics-security-scope-note span,
.analytics-security-guide span {
    color: var(--muted-text, #94a3b8);
}

.analytics-security-guide {
    display: grid;
    gap: 0.3rem;
    border: 1px solid rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.05);
}

.analytics-security-filters {
    display: grid;
    grid-template-columns:
        minmax(260px, 1fr)
        minmax(220px, 0.6fr);
    gap: 0.75rem;
}

.analytics-security-filters label {
    display: grid;
    gap: 0.4rem;
    color: var(--muted-text, #94a3b8);
    font-size: 0.82rem;
    font-weight: 700;
}

.analytics-security-filters input,
.analytics-security-filters select {
    min-height: 42px;
    width: 100%;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.25));
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.75);
    color: inherit;
    padding: 0.62rem 0.72rem;
    font: inherit;
}

.analytics-security-summary {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.analytics-security-summary span {
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.2));
    border-radius: 999px;
    padding: 0.4rem 0.65rem;
    color: var(--muted-text, #94a3b8);
    font-size: 0.78rem;
    font-weight: 750;
}

.analytics-security-class-list {
    display: grid;
    gap: 0.55rem;
    max-height: 720px;
    overflow: auto;
    padding-right: 0.2rem;
}

.analytics-security-class-row {
    display: grid;
    grid-template-columns:
        minmax(230px, 1.1fr)
        minmax(250px, 1fr)
        minmax(220px, 0.85fr);
    gap: 0.85rem;
    align-items: center;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.18));
    border-radius: 12px;
    padding: 0.78rem 0.85rem;
    background: rgba(15, 23, 42, 0.4);
}

.analytics-security-class-row[hidden] {
    display: none !important;
}

.analytics-security-class-main {
    display: grid;
    gap: 0.4rem;
}

.analytics-security-detect-toggle {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.analytics-security-detect-toggle > span {
    display: grid;
    gap: 0.16rem;
}

.analytics-security-detect-toggle small,
.analytics-security-confidence small {
    color: var(--muted-text, #94a3b8);
}

.analytics-security-required {
    display: inline-flex;
    width: fit-content;
    border: 1px solid rgba(56, 189, 248, 0.45);
    border-radius: 999px;
    padding: 0.25rem 0.45rem;
    color: #38bdf8;
    font-size: 0.7rem;
    font-weight: 800;
}

.analytics-security-confidence {
    display: grid;
    gap: 0.3rem;
}

.analytics-security-confidence > label {
    display: grid;
    gap: 0.3rem;
    font-size: 0.78rem;
    font-weight: 750;
}

.analytics-security-confidence-control {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) 52px;
    gap: 0.6rem;
    align-items: center;
}

.analytics-security-confidence-control output {
    text-align: right;
    font-weight: 850;
}

.analytics-security-event-controls {
    display: grid;
    gap: 0.45rem;
}

.analytics-security-event-controls label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
}

.analytics-security-message {
    color: var(--muted-text, #94a3b8);
    line-height: 1.45;
}

.analytics-security-message.success {
    color: var(--success-color, #22c55e);
}

.analytics-security-message.error {
    color: var(--danger-color, #ef4444);
}

.analytics-security-message.working {
    color: #38bdf8;
}

@media (max-width: 1050px) {
    .analytics-security-class-row {
        grid-template-columns: 1fr 1fr;
    }

    .analytics-security-event-controls {
        grid-column: 1 / -1;
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .analytics-security-heading,
    .analytics-security-footer {
        display: grid;
    }

    .analytics-security-filters,
    .analytics-security-class-row,
    .analytics-security-event-controls {
        grid-template-columns: 1fr;
    }
}
