/* Estilos GDM Cameras & Tema Claro Limpo para Radzen Blazor */
:root {
    --gdm-green: #10a345;
    --gdm-green-hover: #0d8a3a;
    --gdm-green-light: #dcfce7;
    --gdm-dark: #07211b;
    --rz-primary: #10a345;
    --rz-primary-light: #22c55e;
    --rz-primary-lighter: rgba(16, 163, 69, 0.12);
    --rz-primary-dark: #0d8a3a;
    --rz-primary-darker: #0a6e2e;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: var(--rz-text-font-family, 'Inter', 'Segoe UI', Roboto, system-ui, sans-serif);
}

.mono {
    font-family: 'JetBrains Mono', Consolas, monospace;
}

/* ==================== TELA DE LOGIN GDM CAMERAS ==================== */
.gdm-login-shell {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    background: #071318 url('/assets/fundologin.png') center center / cover no-repeat;
}

.gdm-login-shell::before {
    content: "";
    position: absolute;
    inset: -30px;
    background: inherit;
    filter: blur(26px) brightness(0.42);
    z-index: 0;
}

.gdm-login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1050px;
    min-height: 620px;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.38fr 1fr;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
}

.gdm-login-left {
    position: relative;
    background: #061417;
    overflow: hidden;
}

.gdm-login-left img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gdm-login-right {
    position: relative;
    background: #ffffff;
    color: #0f172a;
    padding: 2.5rem 2.85rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gdm-login-version {
    position: absolute;
    top: 18px;
    right: 24px;
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 500;
}

.gdm-login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.1rem;
}

.gdm-login-brand img {
    height: 64px;
    width: auto;
    object-fit: contain;
}

.gdm-login-welcome {
    text-align: center;
    font-size: 1.85rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.25rem 0;
    letter-spacing: -0.02em;
}

.gdm-login-subtitle {
    text-align: center;
    font-size: 0.94rem;
    color: #64748b;
    margin: 0 0 1.65rem 0;
}

.gdm-field-group {
    margin-bottom: 1.1rem;
}

.gdm-field-label {
    display: block;
    font-size: 0.86rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.4rem;
}

.gdm-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    height: 46px;
    padding: 0 0.85rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.gdm-input-wrap:focus-within {
    background: #ffffff;
    border-color: var(--gdm-green);
    box-shadow: 0 0 0 3px rgba(16, 163, 69, 0.14);
}

.gdm-input-icon {
    color: #475569;
    font-size: 1.2rem;
    margin-right: 0.65rem;
    display: flex;
    align-items: center;
    user-select: none;
}

.gdm-input-wrap input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    height: 100%;
    font-size: 0.92rem;
    color: #0f172a;
}

.gdm-input-wrap input::placeholder {
    color: #94a3b8;
}

.gdm-eye-btn {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gdm-eye-btn:hover {
    color: #0f172a;
}

.gdm-login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0.25rem 0 1.35rem 0;
    font-size: 0.84rem;
}

.gdm-remember-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #334155;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.gdm-remember-label input[type="checkbox"] {
    accent-color: var(--gdm-green);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.gdm-forgot-link {
    color: var(--gdm-green);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.gdm-forgot-link:hover {
    text-decoration: underline;
}

.gdm-btn-entrar {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 10px;
    background: var(--gdm-green);
    color: #ffffff;
    font-size: 0.98rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    box-shadow: 0 6px 16px rgba(16, 163, 69, 0.25);
}

.gdm-btn-entrar:hover:not(:disabled) {
    background: var(--gdm-green-hover);
}

.gdm-btn-entrar:disabled {
    opacity: 0.7;
    cursor: wait;
}

.gdm-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.15rem 0;
    color: #94a3b8;
    font-size: 0.82rem;
}

.gdm-divider::before,
.gdm-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.gdm-btn-qrcode {
    width: 100%;
    height: 44px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f1f5f9;
    color: #1e293b;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.gdm-btn-qrcode:hover {
    background: #e2e8f0;
}

@media (max-width: 860px) {
    .gdm-login-card {
        grid-template-columns: 1fr;
        max-width: 440px;
    }
    .gdm-login-left {
        display: none;
    }
}

/* ==================== CARDS E MODAIS SEM FUNDO PRETO ESQUISITO ==================== */
.cam-card-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--rz-border-color, #e2e8f0);
}

.cam-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cam-card-top-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    gap: 4px;
}

.cam-card-hover-play {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.cam-card-img-wrap:hover .cam-card-hover-play {
    opacity: 1;
}

.kpi-clickable {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-clickable:hover {
    transform: translateY(-2px);
}

.view-icon-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--rz-border-color, #e2e8f0);
    border-radius: 6px;
    background: var(--rz-base-background-color, #f8fafc);
}

/* Backdrop suave (sem aquele fundo preto pesado) */
.live-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.32);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* Superfície clara sólida para o Modal de Cadastro e Modal Ao Vivo */
.gdm-modal-surface {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-radius: 14px !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22) !important;
}

.gdm-modal-surface.dark-modal {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

.live-modal-box {
    width: 100%;
    max-width: 1040px;
    border-radius: 14px;
    overflow: hidden;
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25) !important;
}

.live-video-stage {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.live-video-stage img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Selo do modo do Ao Vivo (vídeo / foto / pausado) */
.live-video-stage { position: relative; }
.gdm-live-modo {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    background: rgba(15, 23, 42, 0.72);
    pointer-events: none;
    letter-spacing: 0.02em;
}
.gdm-live-modo.gdm-live-video { background: rgba(220, 38, 38, 0.88); }
.gdm-live-modo.gdm-live-foto { background: rgba(217, 119, 6, 0.9); }

/* Link da localização (abre no Google Maps) */
.gdm-map-link {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    color: var(--gdm-green);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.gdm-map-link:hover {
    text-decoration: underline;
}

/* Relatórios */
.gdm-rel-card {
    height: 100%;
}

.gdm-rel-icone {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Rodapé de créditos (GDM Automação Comercial) */
.gdm-footer {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 0.45rem 1.25rem;
}

.gdm-footer-conteudo {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.25rem 1rem;
    font-size: 0.74rem;
    color: #64748b;
}

.gdm-footer-conteudo strong {
    color: #00363a;
}

.gdm-footer-conteudo a {
    color: var(--gdm-green);
    font-weight: 600;
    text-decoration: none;
}

.gdm-footer-conteudo a:hover {
    text-decoration: underline;
}

[data-theme="dark"] .gdm-footer,
.rz-material-dark .gdm-footer {
    background: transparent;
    border-top-color: rgba(255, 255, 255, 0.12);
}

.gdm-login-creditos {
    margin-top: 1.25rem;
    padding-top: 0.85rem;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    font-size: 0.72rem;
    line-height: 1.5;
    color: #64748b;
}

.gdm-login-creditos strong {
    color: #00363a;
}

@media (max-width: 640px) {
    .gdm-footer-conteudo {
        justify-content: center;
        text-align: center;
    }
}

/* Avatar / foto de perfil */
.gdm-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    color: #fff;
    font-weight: 700;
    user-select: none;
    box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(15, 23, 42, 0.25);
}

.gdm-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.gdm-avatar-iniciais {
    line-height: 1;
    letter-spacing: 0.02em;
}

.gdm-avatar-online {
    position: absolute;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 0 2px #fff;
}

/* Meu Perfil */
.gdm-perfil-foto {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0 1rem;
}

.gdm-perfil-upload {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--gdm-green);
    color: var(--gdm-green);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.gdm-perfil-upload:hover {
    background: #e8f6ee;
}

.gdm-perfil-upload input[type=file] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.gdm-perfil-bloqueado {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.74rem;
    color: #64748b;
    margin-top: 0.2rem;
}

/* Menu do usuário no topo: só a bolinha (foto/iniciais), estilo Google */
.gdm-menu-usuario .rz-navigation-item-icon-children,
.gdm-menu-usuario .rzi-chevron-down {
    display: none !important;
}

.gdm-menu-usuario .rz-navigation-item-link {
    padding: 2px !important;
    border-radius: 50%;
}

.gdm-menu-usuario > .rz-navigation-item > .rz-navigation-item-wrapper:hover .gdm-avatar,
.gdm-menu-usuario .rz-navigation-item-link:hover .gdm-avatar {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(23, 163, 79, 0.45);
}

.gdm-menu-usuario-topo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 230px;
    padding: 1rem 1rem 0.85rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 0.25rem;
    text-align: center;
}

.gdm-menu-usuario-nome {
    margin-top: 0.35rem;
    font-weight: 700;
    font-size: 0.92rem;
    color: #0f172a;
}

.gdm-menu-usuario-email {
    font-size: 0.76rem;
    color: #64748b;
    margin-bottom: 0.3rem;
    word-break: break-all;
}

/* Retomando sessão após F5 */
.gdm-carregando-sessao {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.9rem;
}

.gdm-carregando-sessao img {
    height: 48px;
    width: auto;
}

/* =================== MAPA DAS CÂMERAS =================== */
.gdm-mapa {
    width: 100%;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    z-index: 0;
}

.gdm-mapa-info {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

/* Ícone da câmera no mapa */
.gdm-pin-wrap {
    background: transparent !important;
    border: none !important;
}

.gdm-pin {
    position: relative;
    width: 34px;
    height: 42px;
}

.gdm-pin-bola {
    position: absolute;
    left: 0;
    top: 0;
    width: 34px;
    height: 34px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: var(--cor);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.45);
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

.gdm-pin-bola svg {
    transform: rotate(45deg);
}

.gdm-pin:hover .gdm-pin-bola {
    transform: rotate(-45deg) scale(1.15);
}

.gdm-pin-qtd {
    position: absolute;
    top: -7px;
    right: -9px;
    min-width: 19px;
    height: 19px;
    padding: 0 4px;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 19px;
    text-align: center;
    border: 2px solid #fff;
    box-sizing: border-box;
}

/* Alerta (off): halo pulsando para chamar atenção */
.gdm-pin-alerta::after {
    content: "";
    position: absolute;
    left: 2px;
    top: 2px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--cor);
    opacity: 0.45;
    z-index: -1;
    animation: gdmPinPulso 1.6s ease-out infinite;
}

@keyframes gdmPinPulso {
    0% { transform: scale(1); opacity: 0.45; }
    100% { transform: scale(2.3); opacity: 0; }
}

/* Quadradinho (popup) com a imagem */
.gdm-mapa-popup .leaflet-popup-content-wrapper {
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
}

.gdm-mapa-popup .leaflet-popup-content {
    margin: 0;
    width: auto !important;
}

.gdm-mapa-pop {
    padding: 0.55rem;
}

.gdm-mapa-pop-titulo {
    font-size: 0.78rem;
    font-weight: 700;
    color: #00363a;
    margin: 0 1.2rem 0.45rem 0.1rem;
}

.gdm-mapa-grade {
    display: grid;
    grid-template-columns: repeat(2, 240px);
    gap: 0.5rem;
    max-height: 420px;
    overflow-y: auto;
}

@media (max-width: 640px) {
    .gdm-mapa-grade { grid-template-columns: 1fr; }
}

.gdm-mapa-card {
    width: 240px;
    cursor: pointer;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.gdm-mapa-card:hover {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
    transform: translateY(-1px);
}

.gdm-mapa-card-img {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0f172a;
}

.gdm-mapa-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gdm-mapa-card-status {
    position: absolute;
    left: 6px;
    top: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}

.gdm-mapa-card-nome {
    padding: 0.35rem 0.5rem 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gdm-mapa-card-sub {
    padding: 0 0.5rem 0.4rem;
    font-size: 0.7rem;
    color: #64748b;
    font-family: ui-monospace, Consolas, monospace;
}

/* Legenda */
.gdm-mapa-legenda {
    background: rgba(255, 255, 255, 0.95);
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    box-shadow: 0 1px 5px rgba(15, 23, 42, 0.25);
    font-size: 0.75rem;
    color: #0f172a;
    line-height: 1.6;
}

.gdm-leg-bola {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.gdm-leg-sem {
    color: #64748b;
    font-style: italic;
    border-top: 1px solid #e2e8f0;
    margin-top: 0.2rem;
    padding-top: 0.2rem;
}
