/* ==========================================================
   HAMCONTACT - TEMA ESCURO
   Tema "Radio Night"
   Aplicado com: html[data-theme="dark"]
   ========================================================== */

:root {
    color-scheme: light;
}

/* ==========================================================
   FERRAMENTAS - COMPLEMENTO DO TEMA ESCURO
   ========================================================== */

html[data-theme="dark"] .ferramenta-card,
html[data-theme="dark"] .codigo-q-card,
html[data-theme="dark"] .alfabeto-card,
html[data-theme="dark"] .uf-prefixo-botao,
html[data-theme="dark"] .prefixo-classe,
html[data-theme="dark"] .prefixo-especial-item,
html[data-theme="dark"] .comparacao-item {
    background-color: var(--hc-surface) !important;
    border-color: var(--hc-border) !important;
    color: var(--hc-text) !important;
}

html[data-theme="dark"] .medida-item,
html[data-theme="dark"] .prefixo-faixa,
html[data-theme="dark"] .metricas-perdas > div,
html[data-theme="dark"] .atalhos-frequencia button,
html[data-theme="dark"] .codigo-abas {
    background-color: var(--hc-surface-2) !important;
    border-color: var(--hc-border) !important;
    color: var(--hc-text) !important;
}

html[data-theme="dark"] .desenho-antena,
html[data-theme="dark"] .mapa-prefixos-container {
    background: linear-gradient(180deg, rgba(13,110,253,.13), rgba(25,135,84,.10)) !important;
}

html[data-theme="dark"] .svg-cabo {
    stroke: #dce6ef !important;
}

html[data-theme="dark"] .svg-suporte {
    stroke: #91a1b2 !important;
}

html[data-theme="dark"] .resultado-cidade-item small,
html[data-theme="dark"] .uf-prefixo-botao small,
html[data-theme="dark"] .prefixo-especial-item span {
    color: #aebdcb !important;
}


html[data-theme="dark"] {
    color-scheme: dark;
    --bs-body-bg:#111923;
    --bs-body-color:#e7edf4;
    --bs-secondary-color:#b7c6d6;
    --bs-tertiary-bg:#1a2633;
    --bs-border-color:#40546a;
    --bs-emphasis-color:#f3f7fc;

    --hc-bg: #090d12;
    --hc-bg-soft: #0d131b;
    --hc-surface: #111923;
    --hc-surface-2: #151f2b;
    --hc-surface-3: #1a2633;

    --hc-border: #263646;
    --hc-border-soft: #1d2a37;

    --hc-text: #e7edf4;
    --hc-text-soft: #a9b7c6;
    --hc-muted: #7f90a2;

    --hc-primary: #4ea1ff;
    --hc-primary-soft: #12263d;

    --hc-success: #39d98a;
    --hc-warning: #f3bd4a;
    --hc-danger: #ff6573;

    --hc-shadow:
        0 7px 24px rgba(0, 0, 0, .34);
}


/* ==========================================================
   BASE
   ========================================================== */

html[data-theme="dark"] body {
    background:
        radial-gradient(
            circle at top,
            #111925 0,
            var(--hc-bg) 440px
        ) !important;

    color:
        var(--hc-text) !important;
}


html[data-theme="dark"] .app-page {
    color:
        var(--hc-text);
}


html[data-theme="dark"] .text-secondary {
    color:
        var(--hc-text-soft) !important;
}


html[data-theme="dark"] .section-label,
html[data-theme="dark"] .kpi-label,
html[data-theme="dark"] .indicativo-stat-label,
html[data-theme="dark"] .campo-observacao,
html[data-theme="dark"] .form-text {
    color:
        var(--hc-muted) !important;
}


html[data-theme="dark"] .section-title,
html[data-theme="dark"] .signal-title,
html[data-theme="dark"] .usuarios-title,
html[data-theme="dark"] .usuarios-section-title,
html[data-theme="dark"] .usuarios-resource-title,
html[data-theme="dark"] .relatorio-title,
html[data-theme="dark"] .indicativo-detail-title,
html[data-theme="dark"] .kpi-value {
    color:
        var(--hc-text) !important;
}


/* ==========================================================
   HEADER
   ========================================================== */

html[data-theme="dark"] .app-header {
    background:
        linear-gradient(
            180deg,
            #101822,
            #0a1017
        ) !important;

    border-bottom:
        1px solid #233241 !important;

    box-shadow:
        0 4px 18px rgba(0, 0, 0, .30);
}


html[data-theme="dark"] .app-title,
html[data-theme="dark"] .app-subtitle {
    color:
        #f2f7fb !important;
}


/* ==========================================================
   CARDS
   ========================================================== */

html[data-theme="dark"] .card,
html[data-theme="dark"] .app-card,
html[data-theme="dark"] .signal-card,
html[data-theme="dark"] .local-card,
html[data-theme="dark"] .vu-card,
html[data-theme="dark"] .anatel-card {
    background:
        var(--hc-surface) !important;

    border-color:
        var(--hc-border) !important;

    color:
        var(--hc-text) !important;

    box-shadow:
        var(--hc-shadow);
}


html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-footer {
    background:
        var(--hc-surface-2) !important;

    border-color:
        var(--hc-border) !important;

    color:
        var(--hc-text) !important;
}


/* ==========================================================
   FORMULÁRIOS
   ========================================================== */

html[data-theme="dark"] .form-label,
html[data-theme="dark"] .form-check-label {
    color:
        #c6d2df !important;
}


html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] textarea.form-control {
    background-color:
        #0c131b !important;

    border-color:
        #304254 !important;

    color:
        #edf3f8 !important;

    box-shadow:
        none !important;
}


html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus,
html[data-theme="dark"] textarea.form-control:focus {
    background-color:
        #0e1721 !important;

    border-color:
        var(--hc-primary) !important;

    color:
        #fff !important;

    box-shadow:
        0 0 0 .18rem rgba(78, 161, 255, .16) !important;
}


html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color:
        #617285 !important;
}


html[data-theme="dark"] .form-select {
    color-scheme:
        dark;
}


html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="time"] {
    color-scheme:
        dark;
}


html[data-theme="dark"] .form-check-input {
    background-color:
        #111b25;

    border-color:
        #405267;
}


html[data-theme="dark"] .form-check-input:checked {
    background-color:
        #2687ee;

    border-color:
        #2687ee;
}


/* ==========================================================
   BOTÕES
   ========================================================== */

html[data-theme="dark"] .btn-outline-primary {
    border-color:
        #3d8ee8 !important;

    color:
        #70b4ff !important;
}


html[data-theme="dark"] .btn-outline-primary:hover {
    background:
        #1b70c8 !important;

    color:
        #fff !important;
}


html[data-theme="dark"] .btn-outline-secondary {
    border-color:
        #4a5c6f !important;

    color:
        #bac6d1 !important;
}


html[data-theme="dark"] .btn-outline-danger {
    border-color:
        #d95564 !important;

    color:
        #ff7e8b !important;
}


/* ==========================================================
   OPERADOR / ESTAÇÃO
   ========================================================== */

html[data-theme="dark"] .operador-indicativo,
html[data-theme="dark"] .indicativo-principal {
    color:
        #62adff !important;
}


html[data-theme="dark"] .operador-nome,
html[data-theme="dark"] .operador-local,
html[data-theme="dark"] .indicativo-nome,
html[data-theme="dark"] .indicativo-local,
html[data-theme="dark"] .ultimo-contato,
html[data-theme="dark"] .local-resumo {
    color:
        var(--hc-text-soft) !important;
}


html[data-theme="dark"] .estacao-operador-card {
    background:
        linear-gradient(
            180deg,
            #121c27,
            #0e161f
        ) !important;

    border-color:
        #294057 !important;
}


html[data-theme="dark"] .estacao-operador-title {
    color:
        #b9c9d8 !important;
}


html[data-theme="dark"] .estacao-operador-help {
    color:
        #71869a !important;
}


/* ==========================================================
   SINAL / RST / LEDS
   ========================================================== */

html[data-theme="dark"] .signal-rst-box {
    background:
        #0d1720 !important;

    border-color:
        #2f4356 !important;
}


html[data-theme="dark"] .signal-rst-box .rst-label {
    color:
        #8799aa !important;
}


html[data-theme="dark"] .signal-rst-box .rst-number {
    color:
        #61e6a1 !important;
}


html[data-theme="dark"] .signal-led-label {
    color:
        #bcc9d5 !important;
}


/*
 * O visor preto dos LEDs já combina naturalmente com o tema.
 */
html[data-theme="dark"] .signal-led-strip {
    border-color:
        #364758 !important;

    box-shadow:
        inset 0 1px 2px rgba(255,255,255,.04),
        0 0 0 1px rgba(0,0,0,.30),
        0 4px 14px rgba(0,0,0,.28) !important;
}


/*
 * Mantém a face do S-Meter clara, como instrumento físico.
 * Escurecemos somente sua moldura.
 */
html[data-theme="dark"] .px-meter {
    filter:
        drop-shadow(0 4px 10px rgba(0,0,0,.28));
}


/* ==========================================================
   DATA/HORA / ÁREAS SUAVES
   ========================================================== */

html[data-theme="dark"] .contato-datahora-prioritaria,
html[data-theme="dark"] .usuario-indicativo-card,
html[data-theme="dark"] .usuario-switch,
html[data-theme="dark"] .ham-menu-user,
html[data-theme="dark"] .indicativo-stats > div {
    background:
        #0d151e !important;

    border-color:
        #263747 !important;

    color:
        var(--hc-text) !important;
}


/* ==========================================================
   BOTÃO STICKY
   ========================================================== */

html[data-theme="dark"] .contato-actions-sticky {
    background:
        rgba(13, 20, 29, .94) !important;

    border-color:
        #2b3b4c !important;

    box-shadow:
        0 7px 25px rgba(0,0,0,.42) !important;
}


/* ==========================================================
   TABELAS
   ========================================================== */

html[data-theme="dark"] .table {
    --bs-table-bg:
        transparent;

    --bs-table-color:
        var(--hc-text);

    --bs-table-border-color:
        #263747;

    --bs-table-striped-bg:
        rgba(255,255,255,.025);

    --bs-table-striped-color:
        var(--hc-text);

    --bs-table-hover-bg:
        #172534;

    --bs-table-hover-color:
        #fff;
}


html[data-theme="dark"] .table thead th,
html[data-theme="dark"] .relatorio-table thead th {
    background:
        #121d28 !important;

    color:
        #9fb0bf !important;

    border-color:
        #293b4c !important;
}


html[data-theme="dark"] .table-responsive,
html[data-theme="dark"] .relatorio-table-wrapper {
    border-color:
        #273949 !important;
}


html[data-theme="dark"] .historico-table tbody tr,
html[data-theme="dark"] .relatorio-table tbody tr {
    color:
        var(--hc-text) !important;
}

/* Grades e listas que possuem fundo claro próprio. O !important é
   necessário porque algumas telas antigas definem branco no CSS local. */
html[data-theme="dark"] table,
html[data-theme="dark"] table tbody,
html[data-theme="dark"] table tbody tr,
html[data-theme="dark"] table tbody td,
html[data-theme="dark"] .historico-table,
html[data-theme="dark"] .historico-table tbody,
html[data-theme="dark"] .historico-table tbody tr,
html[data-theme="dark"] .historico-table tbody td,
html[data-theme="dark"] .lista-contatos-table,
html[data-theme="dark"] .lista-contatos-table tbody tr,
html[data-theme="dark"] .lista-contatos-table tbody td {
    background-color:#111c27 !important;
    color:#dbe7f2 !important;
    border-color:#2a3d4f !important;
}

html[data-theme="dark"] table tbody tr:nth-child(even),
html[data-theme="dark"] table tbody tr:nth-child(even) td,
html[data-theme="dark"] .historico-table tbody tr:nth-child(even),
html[data-theme="dark"] .historico-table tbody tr:nth-child(even) td,
html[data-theme="dark"] .lista-contatos-table tbody tr:nth-child(even),
html[data-theme="dark"] .lista-contatos-table tbody tr:nth-child(even) td {
    background-color:#152330 !important;
}

html[data-theme="dark"] table tbody tr:hover,
html[data-theme="dark"] table tbody tr:hover td,
html[data-theme="dark"] .historico-table tbody tr:hover,
html[data-theme="dark"] .historico-table tbody tr:hover td {
    background-color:#1b3042 !important;
    color:#fff !important;
}

html[data-theme="dark"] table a,
html[data-theme="dark"] .historico-table a {
    color:#77baff !important;
}


html[data-theme="dark"] .relatorio-table tbody tr.is-selected {
    background:
        #17304b !important;
}


html[data-theme="dark"] .relatorio-call {
    color:
        #69b0ff !important;
}


/* ==========================================================
   USUÁRIOS
   ========================================================== */

html[data-theme="dark"] .usuario-list-item,
html[data-theme="dark"] .resource-item {
    background:
        #101923 !important;

    border-color:
        #263747 !important;

    color:
        var(--hc-text) !important;
}


html[data-theme="dark"] .usuario-list-item:hover,
html[data-theme="dark"] .resource-item:hover {
    background:
        #172534 !important;

    border-color:
        #365877 !important;
}


html[data-theme="dark"] .usuario-list-item.active {
    background:
        #17304b !important;

    border-color:
        #448fd8 !important;
}


html[data-theme="dark"] .usuario-list-login,
html[data-theme="dark"] .resource-model,
html[data-theme="dark"] .usuarios-empty,
html[data-theme="dark"] .resource-empty {
    color:
        var(--hc-muted) !important;
}


html[data-theme="dark"] .resource-icon {
    background:
        #16283b !important;
}


/* ==========================================================
   RELATÓRIOS
   ========================================================== */

html[data-theme="dark"] .filtros-subtitle,
html[data-theme="dark"] .grid-help,
html[data-theme="dark"] .indicativo-detail-empty,
html[data-theme="dark"] .indicativo-local {
    color:
        var(--hc-muted) !important;
}


html[data-theme="dark"] .indicativo-detail-empty,
html[data-theme="dark"] .resource-empty {
    border-color:
        #344658 !important;
}


html[data-theme="dark"] .indicativo-call {
    color:
        #5faaff !important;
}


html[data-theme="dark"] .chart-card canvas {
    filter:
        none;
}


/* ==========================================================
   MAPAS
   ========================================================== */

html[data-theme="dark"] .leaflet-container {
    background:
        #101820 !important;

    border:
        1px solid #293b4b;
}


html[data-theme="dark"] .leaflet-tile-pane {
    filter:
        brightness(.64)
        contrast(1.15)
        saturate(.72);
}


html[data-theme="dark"] .leaflet-control-zoom a,
html[data-theme="dark"] .leaflet-control-attribution {
    background:
        #131d27 !important;

    color:
        #b8c5d1 !important;

    border-color:
        #334555 !important;
}


html[data-theme="dark"] .leaflet-popup-content-wrapper,
html[data-theme="dark"] .leaflet-popup-tip {
    background:
        #121b25 !important;

    color:
        #e6edf3 !important;
}


html[data-theme="dark"] .leaflet-popup-content a {
    color:
        #68afff !important;
}


/* ==========================================================
   MENU OFFCANVAS
   ========================================================== */

html[data-theme="dark"] .offcanvas,
html[data-theme="dark"] .modal-content {
    background:
        #0e151e !important;

    border-color:
        #293b4c !important;

    color:
        var(--hc-text) !important;
}


html[data-theme="dark"] .offcanvas-header,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
    border-color:
        #273847 !important;
}


html[data-theme="dark"] .ham-menu-radio {
    background:
        #14283d !important;
}


html[data-theme="dark"] .ham-menu-title {
    color:
        #f1f6fa !important;
}


html[data-theme="dark"] .ham-menu-subtitle,
html[data-theme="dark"] .ham-menu-user-login {
    color:
        #8395a7 !important;
}


html[data-theme="dark"] .ham-menu-item {
    color:
        #d3dde6 !important;
}


html[data-theme="dark"] .ham-menu-item:hover,
html[data-theme="dark"] .ham-menu-item:focus-visible {
    background:
        #172a3d !important;

    color:
        #75b8ff !important;
}


html[data-theme="dark"] .ham-menu-item.active {
    background:
        #17314a !important;

    color:
        #79bcff !important;
}


html[data-theme="dark"] .ham-menu-divider {
    background:
        #273747 !important;
}

/* Conteúdo gerado dinamicamente: Anatel, revisões e listas auxiliares. */
html[data-theme="dark"] .modal-content .bg-light,
html[data-theme="dark"] .modal-content .alert-light,
html[data-theme="dark"] .anatel-card .bg-light,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .dropdown-menu {
    background-color: var(--hc-surface-2) !important;
    border-color: var(--hc-border) !important;
    color: var(--hc-text) !important;
}

html[data-theme="dark"] .modal-content strong,
html[data-theme="dark"] .modal-content h1,
html[data-theme="dark"] .modal-content h2,
html[data-theme="dark"] .modal-content h3,
html[data-theme="dark"] .modal-content h4,
html[data-theme="dark"] .modal-content h5,
html[data-theme="dark"] .modal-content h6 {
    color: var(--hc-text) !important;
}


/* ==========================================================
   MODAIS / CLOSE
   ========================================================== */

html[data-theme="dark"] .btn-close {
    filter:
        invert(1)
        grayscale(1)
        brightness(1.7);
}


/* ==========================================================
   ALERTAS
   ========================================================== */

html[data-theme="dark"] .alert-success {
    background:
        #10291f !important;

    border-color:
        #255e47 !important;

    color:
        #9de8c4 !important;
}


html[data-theme="dark"] .alert-warning {
    background:
        #2c2513 !important;

    border-color:
        #6d5a25 !important;

    color:
        #f5d77e !important;
}


html[data-theme="dark"] .alert-danger {
    background:
        #2c161a !important;

    border-color:
        #6e3039 !important;

    color:
        #ffadb6 !important;
}


html[data-theme="dark"] .alert-primary {
    background:
        #10243a !important;

    border-color:
        #285482 !important;

    color:
        #9ecfff !important;
}


/* ==========================================================
   FOOTER / ASSINATURA
   ========================================================== */

html[data-theme="dark"] .dev-signature-card {
    background:
        #101821 !important;

    border-color:
        #2b3a49 !important;
}


html[data-theme="dark"] .dev-title {
    color:
        #7e90a1 !important;
}


html[data-theme="dark"] .dev-email {
    color:
        #c7d3de !important;
}


/* ==========================================================
   TRANSIÇÃO SUAVE
   ========================================================== */

body,
.card,
.app-card,
.form-control,
.form-select,
.offcanvas,
.modal-content,
.ham-menu-item {
    transition:
        background-color .16s ease,
        border-color .16s ease,
        color .16s ease;
}


/* Evita animação durante a inicialização do tema. */
html.theme-loading *,
html.theme-loading *::before,
html.theme-loading *::after {
    transition:
        none !important;
}

/* Superfícies dinâmicas de consulta e mapa, sem recolorir documentos/QSL. */
html[data-theme="dark"] .mapa-legenda {
    background:#142334!important;color:#f0f5fc!important;border:1px solid #72869e;
}
html[data-theme="dark"] .mapa-legenda .legenda-star{color:#ff7380}
html[data-theme="dark"] .map-popup-titulo,
html[data-theme="dark"] .map-popup-contato,
html[data-theme="dark"] .map-popup-destaque{color:#ecf3fc!important}
html[data-theme="dark"] .map-popup-subtitulo,
html[data-theme="dark"] .map-popup-restantes{color:#bbcde1!important}
html[data-theme="dark"] .map-popup-ultimo{background:#283a52!important;color:#fff!important}
html[data-theme="dark"] #dadosIndicativo,
html[data-theme="dark"] .anatel-card,
html[data-theme="dark"] .consulta-grid>.card,
html[data-theme="dark"] #resultadoIndicativoModalBody .alert-light,
html[data-theme="dark"] #resultadoIndicativoModalBody .alert-secondary,
html[data-theme="dark"] #resultadoIndicativoModalBody .bg-light,
html[data-theme="dark"] .anatel-card .card-header{
    background:#142334!important;color:#e6eff9!important;border-color:#496078!important;
}
html[data-theme="dark"] #dadosIndicativo .text-dark,
html[data-theme="dark"] .consulta-dado strong{color:#e6eff9!important}
html[data-theme="dark"] .consulta-fonte-vazia{background:#192c41;color:#c5d4e5}
html[data-theme="dark"] .consulta-anatel-registro{border-color:#496078}
html[data-theme="dark"] #modalResultadoIndicativo .btn-outline-dark{color:#e6eff9;border-color:#8fa6bf}
.hc-noticia-conhecido{border-left:5px solid #1478e8!important;background:#eaf4ff!important}
.hc-noticia-conhecido>small{display:block;font-weight:600;margin-top:5px}
html[data-theme="dark"] .hc-noticia-conhecido{background:#1b3652!important;color:#edf6ff!important;border-left-color:#78baff!important}
