﻿:root {
    --background: #0c0d10;
    --sidebar: #111318;
    --surface: #17191f;
    --surface-light: #222630;
    --border: #2c313c;
    --text: #f5f6f8;
    --muted: #969daa;
    --primary: #ff6a00;
    --success: #35d07f;
    --danger: #ff5364;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background: var(--background);
}

button {
    font: inherit;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

/* MENU LATERAL */

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 250px;
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px 28px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #111;
    background: var(--primary);
    font-size: 22px;
    font-weight: 800;
}

.brand strong,
.brand span {
    display: block;
}

.brand strong {
    font-size: 15px;
}

.brand span {
    margin-top: 3px;
    font-size: 11px;
    color: var(--muted);
}

.navigation {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.navigation-item {
    width: 100%;
    height: auto;
    padding: 13px 15px;
    border: 0;
    border-radius: 8px;
    text-align: left;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
}

    .navigation-item:hover {
        color: white;
        background: var(--surface-light);
    }

    .navigation-item.active {
        color: white;
        background: rgba(255, 106, 0, 0.17);
        border-left: 3px solid var(--primary);
    }

.sidebar-footer {
    margin-top: auto;
    padding: 15px 8px;
    color: var(--muted);
    font-size: 12px;
}

.system-indicator {
    width: 8px;
    height: 8px;
    display: inline-block;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--success);
}

/* ÁREA PRINCIPAL */

.main-area {
    width: calc(100% - 250px);
    min-height: 100vh;
    margin-left: 250px;
}

.topbar {
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 30px;
    background: var(--sidebar);
    border-bottom: 1px solid var(--border);
}

    .topbar h1 {
        margin: 0;
        font-size: 23px;
    }

    .topbar p {
        margin: 5px 0 0;
        color: var(--muted);
        font-size: 13px;
    }

.operator {
    display: flex;
    align-items: center;
    gap: 11px;
}

.operator-avatar {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface-light);
    color: var(--primary);
    font-weight: 700;
}

.operator strong,
.operator span {
    display: block;
}

.operator span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.content {
    padding: 28px 30px;
}

/* TELAS */

.page {
    display: none;
}

    .page.active {
        display: block;
    }

/* CARDS */

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.summary-card,
.panel {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.summary-card {
    padding: 20px;
}

    .summary-card span,
    .summary-card small {
        display: block;
        color: var(--muted);
    }

    .summary-card strong {
        display: block;
        margin: 12px 0 6px;
        font-size: 32px;
    }

.alert-card strong {
    color: var(--primary);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 20px;
}

.panel {
    padding: 20px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
}

    .panel-header h2,
    .panel h2 {
        margin: 0;
        font-size: 18px;
    }

    .panel-header p {
        margin: 5px 0 0;
        color: var(--muted);
        font-size: 12px;
    }

/* BOTÕES */

.primary-button,
.secondary-button,
.table-button {
    border: 0;
    border-radius: 7px;
    cursor: pointer;
}

.primary-button {
    padding: 10px 15px;
    color: #111;
    background: var(--primary);
    font-weight: 700;
}

.secondary-button {
    width: 100%;
    padding: 11px 15px;
    color: white;
    background: var(--surface-light);
}

.table-button {
    padding: 7px 12px;
    color: white;
    background: var(--surface-light);
    border: 1px solid var(--border);
}

/* TABELA */

.table-wrapper {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

td {
    font-size: 13px;
}

/* STATUS */

.status-badge {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 700;
}

    .status-badge.online {
        color: var(--success);
        background: rgba(53, 208, 127, 0.14);
    }

    .status-badge.offline {
        color: var(--danger);
        background: rgba(255, 83, 100, 0.14);
    }

/* VÍDEO */

.video-layout {
    display: grid;
    grid-template-columns: minmax(600px, 1fr) 300px;
    gap: 20px;
}

.video-container {
    position: relative;
    min-height: 590px;
    overflow: hidden;
    border-radius: 9px;
    background: #050506;
}

#live-player {
    width: 100%;
    height: 590px;
    display: none;
    border: 0;
    background: black;
}

.video-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 8px;
    text-align: center;
    color: var(--muted);
}

    .video-placeholder strong {
        color: white;
    }

.camera-details dl {
    margin: 18px 0 25px;
}

    .camera-details dl div {
        padding: 13px 0;
        border-bottom: 1px solid var(--border);
    }

.camera-details dt {
    color: var(--muted);
    font-size: 11px;
}

.camera-details dd {
    margin: 5px 0 0;
    overflow-wrap: anywhere;
    font-size: 13px;
}

.sensor-row,
.recording-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.sensor-info strong,
.sensor-info span {
    display: block;
}

.sensor-info span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--muted);
}

.timeline-item {
    display: flex;
    gap: 13px;
}

.timeline-marker {
    width: 9px;
    height: 9px;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--primary);
}

.timeline-item p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 1200px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid,
    .video-layout {
        grid-template-columns: 1fr;
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.secondary-small-button {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text);
    background: var(--surface-light);
}

    .secondary-small-button:hover {
        background: #2a2f39;
    }

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
}

    .modal-overlay.hidden {
        display: none;
    }

.modal-window {
    width: min(760px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.45);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

    .modal-header h2 {
        margin: 0;
        font-size: 21px;
    }

    .modal-header p {
        margin: 6px 0 0;
        color: var(--muted);
        font-size: 13px;
    }

.modal-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    color: var(--muted);
    background: var(--surface-light);
    font-size: 24px;
    line-height: 1;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-field {
    display: grid;
    gap: 7px;
}

.form-field-full {
    grid-column: 1 / -1;
}

.form-field label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.form-field input,
.form-field select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    color: var(--text);
    background: #0f1116;
}

    .form-field input:focus,
    .form-field select:focus {
        border-color: var(--primary);
    }

.form-message {
    min-height: 22px;
    margin-top: 16px;
    color: var(--danger);
    font-size: 13px;
}

    .form-message.success {
        color: var(--success);
    }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

@media (max-width: 760px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-field-full {
        grid-column: auto;
    }
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.danger-button {
    color: #ff6675;
    border-color: rgba(255, 83, 100, 0.35);
    background: rgba(255, 83, 100, 0.09);
}

    .danger-button:hover {
        color: white;
        background: #d93d4d;
    }

.recording-filters {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 190px auto;
    align-items: end;
    gap: 14px;
    margin-bottom: 24px;
}

.recording-search-button {
    height: 42px;
}

.recording-player-panel {
    margin-top: 20px;
}

    .recording-player-panel.hidden {
        display: none;
    }

.recording-player {
    width: 100%;
    max-height: 620px;
    border-radius: 9px;
    background: #000;
}

.recording-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

    .recording-row:last-child {
        border-bottom: 0;
    }

.recording-period strong,
.recording-period span {
    display: block;
}

.recording-period span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 900px) {
    .recording-filters {
        grid-template-columns: 1fr;
    }
}

.lpr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 18px;
}

.lpr-card {
    overflow: hidden;
    border: 1px solid var(--border-color, #273244);
    border-radius: 16px;
    background: var(--panel-background, #111827);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.lpr-card-image {
    display: block;
    width: 100%;
    height: 190px;
    object-fit: cover;
    background: #080d14;
}

.lpr-card-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 190px;
    background: #080d14;
    color: #7f8da3;
}

.lpr-card-content {
    padding: 16px;
}

.lpr-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.lpr-plate {
    padding: 7px 12px;
    border: 2px solid #263141;
    border-radius: 6px;
    background: #f4f5f7;
    color: #111827;
    font-family: monospace;
    font-size: 22px;
    letter-spacing: 2px;
}

.lpr-confidence {
    font-size: 14px;
    font-weight: 700;
    color: #25c47a;
}

.lpr-card-details {
    display: grid;
    gap: 7px;
    margin-top: 15px;
    color: #9eabc0;
    font-size: 14px;
}

.alarm-events-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.alarm-summary-card {
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

    .alarm-summary-card span,
    .alarm-summary-card small {
        display: block;
        color: var(--muted);
    }

    .alarm-summary-card strong {
        display: block;
        margin: 10px 0 4px;
        font-size: 28px;
    }

.alarm-event-filters {
    display: grid;
    grid-template-columns: 1fr 1fr 190px auto;
    align-items: end;
    gap: 12px;
    margin-bottom: 22px;
}

.alarm-event-row {
    display: grid;
    grid-template-columns: 5px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 17px 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #111318;
    margin-bottom: 10px;
}

.alarm-event-indicator {
    width: 5px;
    height: 100%;
    min-height: 52px;
    border-radius: 5px;
}

.alarm-event-row.new
.alarm-event-indicator {
    background: var(--danger);
}

.alarm-event-row.restored
.alarm-event-indicator {
    background: var(--success);
}

.alarm-event-main {
    min-width: 0;
}

.alarm-event-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .alarm-event-title strong {
        font-size: 15px;
    }

.alarm-event-code {
    padding: 3px 7px;
    border-radius: 5px;
    color: var(--muted);
    background: var(--surface-light);
    font-size: 11px;
}

.alarm-event-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
}

    .alarm-event-details strong {
        color: var(--text);
    }

.alarm-event-status {
    display: grid;
    justify-items: end;
    gap: 7px;
}

    .alarm-event-status time {
        color: var(--muted);
        font-size: 11px;
    }

.alarm-event-badge {
    padding: 5px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

    .alarm-event-badge.new {
        color: #ffadb5;
        background: rgba(255, 83, 100, 0.14);
    }

    .alarm-event-badge.restored {
        color: #8debb6;
        background: rgba(53, 208, 127, 0.14);
    }

@media (max-width: 900px) {
    .alarm-events-summary {
        grid-template-columns: 1fr;
    }

    .alarm-event-filters {
        grid-template-columns: 1fr;
    }

    .alarm-event-row {
        grid-template-columns: 5px 1fr;
    }

    .alarm-event-status {
        grid-column: 2;
        justify-items: start;
    }
}

.alarm-event-sensor {
    width: 100%;
    color: var(--text);
    font-size: 13px;
}

    .alarm-event-sensor strong {
        color: var(--primary);
    }

.zonas-modal-window {
    width: min(1050px, 96vw);
}

.zonas-layout {
    display: grid;
    grid-template-columns: minmax(300px, 0.9fr) minmax(380px, 1.2fr);
    gap: 24px;
}

.zonas-form-panel,
.zonas-list-panel {
    min-width: 0;
}

.zonas-form-panel {
    padding-right: 24px;
    border-right: 1px solid var(--border);
}

    .zonas-form-panel h3,
    .zonas-list-panel h3 {
        margin: 0 0 18px;
        font-size: 16px;
    }

.zonas-list-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 18px;
}

    .zonas-list-header h3 {
        margin-bottom: 4px;
    }

    .zonas-list-header p {
        margin: 0;
        color: var(--muted);
        font-size: 12px;
    }

.zona-row {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    margin-bottom: 9px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #111318;
}

.zona-number {
    display: grid;
    place-items: center;
    min-height: 42px;
    border-radius: 7px;
    color: var(--primary);
    background: var(--surface-light);
    font-size: 14px;
    font-weight: 800;
}

.zona-info {
    display: grid;
    gap: 4px;
}

    .zona-info > strong {
        font-size: 14px;
    }

    .zona-info > span {
        color: var(--muted);
        font-size: 11px;
    }

.zona-camera-info strong {
    color: var(--text);
}

.zona-camera-info.muted {
    opacity: 0.7;
}

.zona-actions {
    display: flex;
    gap: 7px;
}

@media (max-width: 900px) {
    .zonas-layout {
        grid-template-columns: 1fr;
    }

    .zonas-form-panel {
        padding-right: 0;
        padding-bottom: 22px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .zona-row {
        grid-template-columns: 50px 1fr;
    }

    .zona-actions {
        grid-column: 2;
    }
}

.alarm-event-camera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

    .alarm-event-camera span {
        color: var(--muted);
        font-size: 12px;
    }

    .alarm-event-camera strong {
        color: var(--text);
    }

/* =========================================================
   TIMELINE DE GRAVAÇÕES
   ========================================================= */

.recording-timeline-panel {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.015);
}

    .recording-timeline-panel.hidden {
        display: none;
    }

.recording-timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

    .recording-timeline-header strong,
    .recording-timeline-header span {
        display: block;
    }

    .recording-timeline-header span {
        margin-top: 4px;
        color: var(--muted);
        font-size: 12px;
    }

.recording-timeline {
    position: relative;
    padding-top: 26px;
    user-select: none;
}

.recording-timeline-hours {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 22px;
}

    .recording-timeline-hours span {
        position: absolute;
        transform: translateX(-50%);
        color: var(--muted);
        font-size: 10px;
        white-space: nowrap;
    }

        .recording-timeline-hours span:first-child {
            transform: translateX(0);
        }

        .recording-timeline-hours span:last-child {
            transform: translateX(-100%);
        }

.recording-timeline-track {
    position: relative;
    height: 44px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: repeating-linear-gradient( to right, transparent 0, transparent calc(12.5% - 1px), rgba(255,255,255,.07) calc(12.5% - 1px), rgba(255,255,255,.07) 12.5% ), rgba(0,0,0,.16);
}

.recording-timeline-segments {
    position: absolute;
    inset: 0;
}

.recording-timeline-segment {
    position: absolute;
    top: 8px;
    bottom: 8px;
    min-width: 2px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    border-top: 1px solid rgba(255, 145, 60, 0.9);
    background: var(--primary);
    background: rgba(255, 106, 0, 0.78);
    opacity: .8;
    cursor: pointer;
    transition: opacity .15s ease, transform .15s ease;
    --primary: #ff6a00;
    opacity: 0.85;
}

    .recording-timeline-segment:hover {
        opacity: 1;
        transform: scaleY(1.08);
        background: #ff6a00;
    }

.recording-timeline-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    transform: translateX(-1px);
    background: #fff;
    z-index: 4;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(255,255,255,.65);
}

    .recording-timeline-playhead::before {
        content: "";
        position: absolute;
        top: 0;
        left: 50%;
        width: 8px;
        height: 8px;
        transform: translate(-50%, -2px) rotate(45deg);
        background: #fff;
    }

    .recording-timeline-playhead.hidden,
    .recording-timeline-tooltip.hidden {
        display: none;
    }

.recording-timeline-tooltip {
    position: absolute;
    top: 50px;
    z-index: 20;
    transform: translateX(-50%);
    padding: 5px 7px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #0b0e13;
    color: #fff;
    font-size: 11px;
    pointer-events: none;
    white-space: nowrap;
}

.recording-timeline-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 11px;
}

    .recording-timeline-legend span {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

.recording-legend-recorded,
.recording-legend-playhead {
    display: inline-block;
    width: 16px;
    height: 5px;
    border-radius: 3px;
}

.recording-legend-recorded {
    background: var(--accent);
}

.recording-legend-playhead {
    width: 2px;
    height: 12px;
    background: #fff;
}

.recording-player-clock {
    display: inline-block;
    margin-top: 6px;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
    .recording-timeline-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .recording-timeline-hours span:nth-child(even) {
        display: none;
    }
}


/* =========================================================
   PLAYER DE GRAVAÇÃO - CONTROLES CUSTOMIZADOS
   Timeline absoluta no lugar da barra nativa do navegador
   ========================================================= */

.recording-player-shell {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}

    .recording-player-shell .recording-player {
        display: block;
        width: 100%;
        max-height: 72vh;
        background: #000;
    }

.recording-custom-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    padding: 12px 14px 10px;
    background: linear-gradient( to top, rgba(0,0,0,.94), rgba(0,0,0,.72) 62%, rgba(0,0,0,0) );
}

    .recording-custom-controls.hidden {
        display: none;
    }

.recording-controls-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.recording-control-button {
    flex: 0 0 auto;
    height: 32px;
    min-width: 34px;
    padding: 0 8px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 6px;
    background: rgba(17,24,39,.82);
    color: #fff;
    cursor: pointer;
    font-size: 12px;
}

    .recording-control-button:hover {
        background: rgba(31,41,55,.96);
    }

.recording-current-clock,
.recording-end-clock {
    flex: 0 0 auto;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.recording-bottom-timeline {
    position: relative;
    flex: 1 1 auto;
    min-width: 180px;
    height: 44px;
}

.recording-bottom-hours {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 15px;
    pointer-events: none;
}

    .recording-bottom-hours span {
        position: absolute;
        transform: translateX(-50%);
        color: rgba(255,255,255,.58);
        font-size: 8px;
        white-space: nowrap;
    }

        .recording-bottom-hours span:first-child {
            transform: translateX(0);
        }

        .recording-bottom-hours span:last-child {
            transform: translateX(-100%);
        }

.recording-bottom-track {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 3px;
    height: 18px;
    overflow: visible;
    border-radius: 5px;
    background: repeating-linear-gradient( to right, rgba(255,255,255,.03) 0, rgba(255,255,255,.03) calc(12.5% - 1px), rgba(255,255,255,.14) calc(12.5% - 1px), rgba(255,255,255,.14) 12.5% ), rgba(255,255,255,.08);
}

    .recording-bottom-track .recording-timeline-segment {
        top: 3px;
        bottom: 3px;
        border-radius: 3px;
    }

    .recording-bottom-track .recording-timeline-playhead {
        top: -2px;
        bottom: -2px;
    }

.recording-bottom-timeline .recording-timeline-tooltip {
    top: -28px;
}

.recording-player-shell:fullscreen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

    .recording-player-shell:fullscreen .recording-player {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        object-fit: contain;
    }

    .recording-player-shell:fullscreen .recording-custom-controls {
        position: fixed;
    }

@media (max-width: 900px) {
    .recording-controls-row {
        gap: 6px;
    }

    .recording-control-button {
        padding: 0 6px;
    }

    .recording-bottom-hours span:nth-child(even) {
        display: none;
    }
}

/* =========================================================
   VMS TIMELINE V3 — extensão sobre o player customizado V2
   ========================================================= */

.recording-vms-header {
    align-items: flex-end;
}

.recording-vms-search {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

    .recording-vms-search .form-field {
        min-width: 130px;
    }

.recording-speed-select {
    flex: 0 0 auto;
    height: 32px;
    padding: 0 6px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 6px;
    background: rgba(17,24,39,.92);
    color: #fff;
    font-size: 12px;
}

.recording-zoom-label {
    flex: 0 0 auto;
    min-width: 30px;
    color: #fff;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
}

.recording-bottom-timeline {
    cursor: grab;
    touch-action: none;
}

    .recording-bottom-timeline.dragging {
        cursor: grabbing;
    }

.recording-timeline-events {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}

.recording-event-marker {
    position: absolute;
    top: -10px;
    width: 18px;
    height: 18px;
    transform: translateX(-50%);
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    line-height: 14px;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,.55);
}

.recording-selection-range {
    position: absolute;
    top: 2px;
    bottom: 2px;
    z-index: 2;
    border-top: 1px solid rgba(255,255,255,.65);
    border-bottom: 1px solid rgba(255,255,255,.65);
    background: rgba(255,255,255,.13);
    pointer-events: none;
}

.recording-selection-marker {
    position: absolute;
    top: -14px;
    z-index: 9;
    width: 20px;
    height: 20px;
    transform: translateX(-50%);
    border-radius: 4px;
    background: #fff;
    color: #111827;
    text-align: center;
    font-size: 11px;
    font-weight: 900;
    line-height: 20px;
    pointer-events: none;
}

    .recording-selection-marker.start {
        border-bottom-left-radius: 0;
    }

    .recording-selection-marker.end {
        border-bottom-right-radius: 0;
    }

.recording-frame-preview {
    position: absolute;
    bottom: 52px;
    z-index: 50;
    width: 190px;
    overflow: hidden;
    transform: translateX(-50%);
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 8px;
    background: #080b10;
    box-shadow: 0 10px 28px rgba(0,0,0,.55);
    pointer-events: none;
}

    .recording-frame-preview img {
        display: block;
        width: 190px;
        height: 108px;
        object-fit: cover;
        background: #000;
    }

    .recording-frame-preview strong {
        display: block;
        padding: 5px 7px;
        color: #fff;
        text-align: center;
        font-size: 11px;
        font-variant-numeric: tabular-nums;
    }

.recording-timeline-center-time {
    position: absolute;
    left: 50%;
    bottom: 52px;
    z-index: 49;
    transform: translateX(-50%);
    padding: 5px 8px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 6px;
    background: rgba(0,0,0,.82);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    pointer-events: none;
}

    .recording-selection-range.hidden,
    .recording-selection-marker.hidden,
    .recording-frame-preview.hidden,
    .recording-timeline-center-time.hidden {
        display: none;
    }

@media (max-width: 1100px) {
    .recording-vms-header {
        align-items: stretch;
        flex-direction: column;
    }

    .recording-vms-search {
        flex-wrap: wrap;
    }

    .recording-controls-row {
        flex-wrap: wrap;
    }

    .recording-bottom-timeline {
        flex-basis: 100%;
        order: 20;
        min-width: 100%;
    }
}

/* ================================================================
   SICURA GUARDIAN — MOSAICO DE VÍDEO AO VIVO
   PATCH INCREMENTAL
   Cole este bloco NO FINAL do sicura.css atual.
   ================================================================ */

.live-legacy-hidden {
    display: none !important;
}

.live-mosaic-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 16px;
    min-height: calc(100vh - 180px);
}

.live-camera-sidebar {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 14px;
    overflow: hidden;
}

.live-camera-sidebar-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

    .live-camera-sidebar-header h2 {
        margin: 0;
    }

    .live-camera-sidebar-header p {
        margin: 4px 0 0;
        color: var(--muted);
        font-size: 11px;
        line-height: 1.45;
    }

.live-camera-search {
    width: 100%;
    margin-bottom: 10px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #0e1117;
    color: var(--text);
    outline: none;
}

    .live-camera-search:focus {
        border-color: var(--primary);
    }

.live-camera-list {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    max-height: calc(100vh - 290px);
    overflow-y: auto;
    padding-right: 3px;
}

.live-camera-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #10131a;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

    .live-camera-item:hover {
        border-color: #4a5362;
        background: #151922;
    }

    .live-camera-item.in-use {
        border-color: rgba(255, 106, 0, .45);
        background: rgba(255, 106, 0, .08);
    }

.live-camera-icon {
    flex: 0 0 auto;
    color: #22c55e;
    font-size: 8px;
}

.live-camera-item-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

    .live-camera-item-info strong,
    .live-camera-item-info small {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .live-camera-item-info strong {
        font-size: 12px;
    }

    .live-camera-item-info small {
        margin-top: 2px;
        color: var(--muted);
        font-size: 10px;
    }

.live-camera-used {
    flex: 0 0 auto;
    color: var(--primary);
    font-size: 9px;
    font-weight: 700;
}

.live-mosaic-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 12px;
}

.live-mosaic-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

    .live-mosaic-toolbar h2 {
        margin: 0;
    }

    .live-mosaic-toolbar p {
        margin: 3px 0 0;
        color: var(--muted);
        font-size: 11px;
    }

.live-mosaic-toolbar-actions,
.live-layout-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}

    .live-layout-buttons .table-button.active {
        border-color: var(--primary);
        background: var(--primary);
        color: #111;
    }

.live-mosaic-grid {
    display: grid;
    flex: 1;
    gap: 4px;
    min-height: 580px;
    overflow: hidden;
    border-radius: 8px;
    background: #050607;
}

.live-grid-1 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

.live-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
}

.live-grid-9 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
}

.live-grid-16 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(0, 1fr));
}

.live-mosaic-cell {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 1px solid #252b35;
    background: #000;
    cursor: pointer;
}

    .live-mosaic-cell.active {
        border-color: var(--primary);
        box-shadow: inset 0 0 0 1px var(--primary);
    }

    .live-mosaic-cell iframe {
        width: 100%;
        height: 100%;
        min-height: 0;
        display: block;
        border: 0;
        background: #000;
        pointer-events: none;
    }

.live-grid-1 .live-mosaic-cell iframe {
    min-height: 580px;
}

.live-grid-4 .live-mosaic-cell iframe {
    min-height: 285px;
}

.live-grid-9 .live-mosaic-cell iframe {
    min-height: 188px;
}

.live-grid-16 .live-mosaic-cell iframe {
    min-height: 140px;
}

.live-empty-slot {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    color: #6f7785;
}

    .live-empty-slot strong {
        color: #8d96a6;
        font-size: 12px;
    }

    .live-empty-slot span {
        font-size: 10px;
    }

.live-cell-overlay {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 8px 16px;
    background: linear-gradient( to bottom, rgba(0, 0, 0, .82), rgba(0, 0, 0, .36) 72%, transparent );
    pointer-events: none;
}

.live-cell-title {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 6px;
}

    .live-cell-title strong {
        overflow: hidden;
        color: #fff;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 11px;
        text-shadow: 0 1px 3px #000;
    }

.live-cell-status {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, .65);
}

.live-cell-actions {
    display: flex;
    gap: 5px;
    pointer-events: auto;
}

.live-cell-button {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 5px;
    background: rgba(17, 24, 39, .82);
    color: #fff;
    cursor: pointer;
}

    .live-cell-button:hover {
        background: rgba(31, 41, 55, .96);
    }

    .live-cell-button.danger:hover {
        border-color: rgba(255, 77, 90, .65);
        background: rgba(255, 77, 90, .25);
    }

.live-mosaic-cell:fullscreen {
    width: 100vw;
    height: 100vh;
    background: #000;
}

    .live-mosaic-cell:fullscreen iframe {
        width: 100vw;
        height: 100vh;
        min-height: 100vh;
    }

@media (max-width: 1100px) {
    .live-mosaic-layout {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .live-camera-used {
        display: none;
    }
}

@media (max-width: 820px) {
    .live-mosaic-layout {
        grid-template-columns: 1fr;
    }

    .live-camera-list {
        max-height: 220px;
    }

    .live-mosaic-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .live-mosaic-toolbar-actions {
        flex-wrap: wrap;
    }
}

/* ================================================================
   SICURA GUARDIAN — LOCALIZAÇÃO DE SENSOR + MAPA SATÉLITE
   PATCH INCREMENTAL
   Cole este bloco NO FINAL do sicura.css atual.
   ================================================================ */

.sensor-location-card {
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: rgba(255,255,255,.015);
}

.sensor-location-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}

    .sensor-location-actions .form-hint {
        margin: 0 0 0 4px;
    }

.sensor-map-modal-window {
    width: min(980px, 96vw);
    max-width: 980px;
}

.sensor-map-toolbar {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #10131a;
}

.sensor-map-coordinate {
    display: flex;
    flex-direction: column;
    min-width: 145px;
}

    .sensor-map-coordinate span {
        color: var(--muted);
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: .05em;
    }

    .sensor-map-coordinate strong {
        margin-top: 2px;
        color: var(--text);
        font-size: 12px;
        font-variant-numeric: tabular-nums;
    }

.sensor-map-hint {
    margin-left: auto;
    color: var(--muted);
    font-size: 11px;
}

.sensor-location-map {
    width: 100%;
    height: min(62vh, 620px);
    min-height: 420px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #07090d;
}

    .sensor-location-map .leaflet-container {
        background: #07090d;
    }

    .sensor-location-map .leaflet-control-attribution {
        font-size: 9px;
    }

    .sensor-location-map .leaflet-bar a {
        color: #111;
    }

@media (max-width: 760px) {
    .sensor-map-toolbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .sensor-map-hint {
        margin-left: 0;
    }

    .sensor-location-map {
        min-height: 360px;
        height: 55vh;
    }
}

/* ================================================================
   SICURA GUARDIAN — MAPA OPERACIONAL DE SENSORES
   PATCH INCREMENTAL
   Cole este bloco NO FINAL do sicura.css atual.
   ================================================================ */

.operational-map-panel {
    padding: 14px;
}

.operational-map-header {
    margin-bottom: 12px;
}

.operational-map-header-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.operational-map-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 190px auto 90px;
    gap: 10px;
    align-items: end;
    margin-bottom: 10px;
}

.operational-map-search-field {
    min-width: 0;
}

.operational-map-basemap {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .operational-map-basemap > span {
        color: var(--muted);
        font-size: 10px;
    }

.operational-map-basemap-buttons {
    display: flex;
    gap: 5px;
}

    .operational-map-basemap-buttons
    .table-button.active {
        border-color: var(--primary);
        background: var(--primary);
        color: #111;
    }

.operational-map-counter {
    display: flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #10131a;
}

    .operational-map-counter strong {
        color: var(--primary);
        font-size: 16px;
    }

    .operational-map-counter span {
        color: var(--muted);
        font-size: 9px;
    }

.operational-map-body {
    position: relative;
}

.operational-map {
    width: 100%;
    height: calc(100vh - 260px);
    min-height: 590px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #050607;
}

.operational-map-legend {
    position: absolute;
    z-index: 500;
    right: 12px;
    bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 138px;
    padding: 9px 10px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 8px;
    background: rgba(10,13,18,.90);
    backdrop-filter: blur(7px);
    color: #fff;
    box-shadow: 0 6px 22px rgba(0,0,0,.35);
}

    .operational-map-legend strong {
        margin-bottom: 1px;
        font-size: 11px;
    }

    .operational-map-legend span {
        display: flex;
        align-items: center;
        gap: 7px;
        color: #d8dde7;
        font-size: 10px;
    }

.map-legend-dot {
    display: grid;
    place-items: center;
    width: 23px;
    height: 23px;
    border-radius: 6px;
    background: #1b202a;
    font-style: normal;
    font-size: 12px;
}

.sensor-map-marker-wrapper {
    background: transparent;
    border: 0;
}

.sensor-map-marker {
    position: relative;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 2px solid #fff;
    border-radius: 10px 10px 10px 2px;
    transform: rotate(-45deg);
    box-shadow: 0 4px 14px rgba(0,0,0,.55), 0 0 0 2px rgba(0,0,0,.15);
}

    .sensor-map-marker > span {
        transform: rotate(45deg);
        font-size: 16px;
    }

    .sensor-map-marker.camera {
        background: #ff6a00;
    }

    .sensor-map-marker.lpr {
        background: #2563eb;
    }

    .sensor-map-marker.alarm {
        background: #dc2626;
    }

    .sensor-map-marker.access {
        background: #7c3aed;
    }

    .sensor-map-marker.radar {
        background: #0891b2;
    }

    .sensor-map-marker.iot,
    .sensor-map-marker.other {
        background: #475569;
    }

.sensor-map-popup {
    min-width: 220px;
    color: #111827;
}

.sensor-map-popup-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
}

    .sensor-map-popup-title > span {
        font-size: 20px;
    }

    .sensor-map-popup-title div {
        display: flex;
        min-width: 0;
        flex-direction: column;
    }

    .sensor-map-popup-title strong {
        max-width: 220px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 12px;
    }

    .sensor-map-popup-title small {
        margin-top: 1px;
        color: #64748b;
        font-size: 10px;
    }

.sensor-map-popup-coordinates {
    margin-bottom: 8px;
    color: #64748b;
    font-size: 9px;
    font-variant-numeric: tabular-nums;
}

.sensor-map-popup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

    .sensor-map-popup-actions button {
        padding: 5px 7px;
        border: 1px solid #d1d5db;
        border-radius: 5px;
        background: #f8fafc;
        color: #111827;
        font-size: 10px;
        cursor: pointer;
    }

        .sensor-map-popup-actions button:hover {
            border-color: #ff6a00;
            background: #fff7ed;
        }

.recording-map-button {
    align-self: end;
    min-height: 36px;
}

@media (max-width: 1100px) {
    .operational-map-toolbar {
        grid-template-columns: minmax(220px, 1fr) 180px;
    }

    .operational-map-basemap,
    .operational-map-counter {
        grid-column: auto;
    }
}

@media (max-width: 720px) {
    .operational-map-toolbar {
        grid-template-columns: 1fr;
    }

    .operational-map-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .operational-map-header-actions,
    .operational-map-basemap-buttons {
        flex-wrap: wrap;
    }

    .operational-map {
        min-height: 500px;
        height: 65vh;
    }

    .operational-map-legend {
        display: none;
    }
}


/* ================================================================
   SICURA GUARDIAN — GRAVAÇÕES POR DATA + HORA
   PATCH INCREMENTAL
   Cole este bloco NO FINAL do sicura.css atual.
   ================================================================ */

#page-gravacoes
#recordings-list.recordings-file-list-hidden {
    display: none !important;
}

#page-gravacoes
.recording-search-button {
    display: none !important;
}

#page-gravacoes
.recording-filters {
    grid-template-columns: minmax(280px, 1fr) 145px 135px auto;
    align-items: end;
}

#page-gravacoes
.recording-time-field {
    min-width: 125px;
}

#page-gravacoes
#recording-time {
    width: 100%;
}

@media (max-width: 900px) {
    #page-gravacoes
    .recording-filters {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    #page-gravacoes
    .recording-filters {
        grid-template-columns: 1fr;
    }
}

.live - cell - status.offline {
    background: #ef4444 !important;
    box - shadow: 0 0 8px rgba(239, 68, 68, .65) !important;
}

.live - camera - item.sensor - offline.live - camera - icon {
    color: #ef4444 !important;
}


/* ================================================================
   SICURA GUARDIAN — CLIENTE NO SENSOR
   PATCH INCREMENTAL
   Cole este bloco NO FINAL do sicura.css atual.
   ================================================================ */

.sensor-client-field {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255,255,255,.015);
}

    .sensor-client-field select {
        width: 100%;
    }

    .sensor-client-field .form-hint {
        display: block;
        margin-top: 6px;
    }
