/* ============================================================================
   SANITIX PORTAL — ESTILOS DO PORTAL DO CLIENTE (portal.css)
   Cyan Glow & Dark Glassmorphic Theme
   ============================================================================ */

:root {
    --font-header: 'Outfit', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;

    --bg-portal: hsl(222, 47%, 7%);
    --bg-surface: hsla(217, 33%, 17%, 0.8);
    --bg-input: hsl(222, 47%, 11%);
    --border: rgba(255, 255, 255, 0.15);
    
    --primary: hsl(180, 100%, 45%);       /* Cyan Glow */
    --green: hsl(142, 70%, 45%);         /* Emerald */
    --orange: hsl(38, 92%, 50%);         /* Amber */
    --purple: hsl(270, 90%, 65%);
    
    --text: hsl(210, 40%, 98%);
    --muted: hsl(215, 16%, 80%);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-portal);
    color: var(--text);
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-header);
    font-weight: 600;
}

.portal-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.portal-header {
    background-color: hsl(222, 47%, 11%);
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(16px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), hsl(210, 100%, 55%));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-portal);
    box-shadow: 0 0 15px rgba(0, 229, 230, 0.35);
    font-weight: 800;
}

.brand h1 {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(90deg, #ffffff, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.portal-subtitle {
    font-size: 0.75rem;
    color: var(--green);
    font-weight: 600;
    text-transform: uppercase;
}

.client-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 20px;
}

.client-selector label {
    font-size: 0.8rem;
    color: var(--muted);
}

.client-selector select {
    background: transparent;
    border: none;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    outline: none;
}

.portal-main {
    padding: 24px 32px;
    max-width: 100% !important;
    width: 100% !important;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-sizing: border-box;
}

/* NAVEGAÇÃO EM ABAS ULTRA-PREMIUM (100% DE LARGURA DA TELA) */
.portal-nav-tabs {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 10px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 12px;
    margin-top: 10px;
    width: 100% !important;
}

.portal-tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--muted, #94a3b8);
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    width: 100% !important;
    box-sizing: border-box;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.portal-tab-btn:hover {
    background: rgba(0, 229, 230, 0.15);
    color: #ffffff;
    border-color: rgba(0, 229, 230, 0.4);
    transform: translateY(-2px);
}

.portal-tab-btn.active {
    background: linear-gradient(135deg, rgba(0, 229, 230, 0.25), rgba(59, 130, 246, 0.2)) !important;
    border: 1px solid #00e5e6 !important;
    color: #00e5e6 !important;
    box-shadow: 0 4px 15px rgba(0, 229, 230, 0.25) !important;
}

.portal-tab-content {
    display: none;
    width: 100%;
}

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

.welcome-banner {
    background: linear-gradient(135deg, rgba(0, 229, 230, 0.15), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(0, 229, 230, 0.3);
    padding: 26px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.welcome-banner h2 {
    font-size: 1.6rem;
    font-weight: 700;
}

.badge-status-online {
    background: rgba(16, 185, 129, 0.2);
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.portal-kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 16px !important;
    width: 100% !important;
}

.portal-kpi-card {
    background-color: var(--bg-surface);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    padding: 20px 24px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 100% !important;
    box-sizing: border-box;
}

.kpi-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon.blue { background: rgba(0, 229, 230, 0.15); color: var(--primary); border: 1px solid rgba(0, 229, 230, 0.3); }
.kpi-icon.green { background: rgba(16, 185, 129, 0.15); color: var(--green); border: 1px solid rgba(16, 185, 129, 0.3); }
.kpi-icon.purple { background: rgba(168, 85, 247, 0.15); color: var(--purple); border: 1px solid rgba(168, 85, 247, 0.3); }
.kpi-icon.orange { background: rgba(245, 158, 11, 0.15); color: var(--orange); border: 1px solid rgba(245, 158, 11, 0.3); }

.kpi-label { font-size: 0.8rem; color: var(--muted); display: block; }
.kpi-val { font-family: var(--font-header); font-size: 1.8rem; font-weight: 700; line-height: 1.2; }

.portal-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 20px;
}

.portal-panel {
    background-color: var(--bg-surface);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.portal-panel.full-width {
    grid-column: 1 / -1;
}

.panel-head {
    margin-bottom: 16px;
}

.panel-head h3 {
    font-size: 1.15rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-responsive { width: 100%; overflow-x: auto; }

.portal-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
    text-align: left;
}

.portal-table th {
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
}

.portal-table td {
    padding: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-green { background: rgba(16, 185, 129, 0.15); color: var(--green); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-blue { background: rgba(0, 229, 230, 0.15); color: var(--primary); border: 1px solid rgba(0, 229, 230, 0.3); }
.badge-orange { background: rgba(245, 158, 11, 0.15); color: var(--orange); border: 1px solid rgba(245, 158, 11, 0.3); }

.btn-portal-sm {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-portal-sm:hover { background: rgba(255, 255, 255, 0.15); }
.btn-portal-sm.primary {
    background: linear-gradient(135deg, var(--primary), hsl(210, 100%, 55%));
    color: var(--bg-portal);
    border-color: transparent;
    box-shadow: 0 0 12px rgba(0, 229, 230, 0.35);
    font-weight: 700;
}

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal-overlay.hidden { display: none; }
.portal-modal-card {
    background: hsl(222, 47%, 11%); border: 1px solid var(--border);
    border-radius: 16px; padding: 22px; width: 100%; max-width: 420px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-close { background: transparent; border: none; color: var(--muted); font-size: 1.5rem; }
.pix-box { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.pix-textarea {
    width: 100%; background: var(--bg-portal); border: 1px solid var(--border);
    color: var(--text); padding: 10px; border-radius: 8px; font-family: monospace; font-size: 0.8rem; resize: none;
}
.btn-copy-pix {
    background: var(--green); color: #fff; border: none; padding: 12px;
    border-radius: 8px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
}

/* ============================================================================
   RESPONSIVIDADE NATIVA ULTRA-PREMIUM PARA SMARTPHONES & TABLETS (PWA MOBILE)
   ============================================================================ */

/* BARRA INFERIOR NATIVA MOBILE PWA */
.portal-mobile-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 62px;
    background: rgba(11, 19, 41, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(0, 229, 230, 0.2);
    z-index: 9999;
    justify-content: space-around;
    align-items: center;
    padding: 0 4px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6);
}

.mobile-nav-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
    padding: 6px 0;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-nav-btn i {
    width: 20px;
    height: 20px;
}

.mobile-nav-btn.active, .mobile-nav-btn:hover {
    color: #00e5e6;
}

.mobile-nav-btn.active i {
    filter: drop-shadow(0 0 8px rgba(0, 229, 230, 0.8));
    transform: scale(1.15);
}

@media (max-width: 1024px) {
    .portal-kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }

    .portal-nav-tabs {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px;
    }

    .portal-main div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

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

.portal-container {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box;
}

.table-responsive {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    display: block !important;
}

.portal-panel {
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box;
}

#portal-embedded-leaflet-map {
    width: 100% !important;
    min-height: 350px !important;
    position: relative !important;
    z-index: 1 !important;
    display: block !important;
    box-sizing: border-box;
}

/* ==============================
   BOTÃO TOGGLE MOBILE (escondido no desktop)
   ============================== */
.mobile-actions-toggle {
    display: none;
    background: rgba(0, 229, 230, 0.15);
    border: 1px solid rgba(0, 229, 230, 0.4);
    color: #00e5e6;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

/* Mobile Cards Container (escondido no desktop) */
.mobile-cards-container {
    display: none;
    padding: 6px 2px;
    gap: 10px;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

/* Card Mobile Genérico */
.mobile-data-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.mobile-data-card:active {
    border-color: rgba(0, 229, 230, 0.5);
}

.mobile-data-card .card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.mobile-data-card .card-label {
    font-size: 0.72rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.mobile-data-card .card-value {
    font-size: 0.88rem;
    color: #e2e8f0;
    font-weight: 600;
    text-align: right;
}

.mobile-data-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 2px;
}

.mobile-data-card .card-header .card-id {
    color: #00e5e6;
    font-weight: 800;
    font-size: 0.95rem;
}

.mobile-data-card .card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.mobile-data-card .card-actions button {
    flex: 1;
    min-width: 0;
    font-size: 0.78rem !important;
    padding: 8px 10px !important;
    justify-content: center;
}

/* Botão toggle KPI — escondido no desktop */
.mobile-kpi-toggle {
    display: none;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: var(--font-body);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.mobile-kpi-toggle:active {
    background: rgba(0, 229, 230, 0.15);
    border-color: rgba(0, 229, 230, 0.4);
    color: #00e5e6;
}

/* ==============================
   MEDIA QUERY MOBILE (< 768px) — LAYOUT EDGE-TO-EDGE NATIVO
   ============================== */
@media (max-width: 768px) {
    /* ---- BARRA INFERIOR NATIVA ---- */
    .portal-mobile-bottom-bar {
        display: flex !important;
    }

    /* ---- TABS DESKTOP OCULTAS ---- */
    .portal-nav-tabs {
        display: none !important;
    }

    /* ---- CONTAINER PRINCIPAL: ZERO PADDING LATERAL ---- */
    .portal-container {
        padding: 0 0 80px 0 !important;
    }

    /* ---- PORTAL MAIN: ZERO PADDING LATERAL ---- */
    .portal-main {
        padding: 8px 0 !important;
        gap: 8px !important;
    }

    /* ---- BOTÃO TOGGLE KPI ---- */
    .mobile-kpi-toggle {
        display: flex !important;
        margin: 0 8px 4px 8px;
        width: calc(100% - 16px);
    }

    /* ---- KPI GRID COLAPSÁVEL ---- */
    .portal-kpi-collapsible {
        display: none !important;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .portal-kpi-collapsible.mobile-open {
        display: grid !important;
        max-height: 800px;
        overflow: visible;
    }

    /* ---- HEADER MOBILE COLAPSÁVEL ---- */
    .btn-portal-mobile-logout {
        display: inline-flex !important;
    }

    .mobile-actions-toggle {
        display: flex !important;
    }

    .portal-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 10px 12px;
        border-radius: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .portal-header .brand {
        justify-content: space-between;
        width: 100%;
        display: flex;
        align-items: center;
    }

    .brand h1 {
        font-size: 1.1rem !important;
    }

    /* ---- AÇÕES COLAPSÁVEIS: FECHADAS POR PADRÃO ---- */
    .client-selector-collapsible {
        display: none !important;
        max-height: 0;
        overflow: hidden;
        border-radius: 0 !important;
        padding: 0 !important;
        border: none !important;
    }

    .client-selector-collapsible.mobile-open {
        display: flex !important;
        max-height: 600px;
        overflow: visible;
        flex-direction: column !important;
        gap: 8px !important;
        padding: 12px 0 0 0 !important;
        margin-top: 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    .client-selector-collapsible.mobile-open label {
        font-size: 0.78rem;
        margin-bottom: 0;
    }

    .client-selector-collapsible.mobile-open select {
        width: 100%;
        padding: 10px;
        font-size: 0.85rem;
    }

    .client-selector-collapsible.mobile-open button {
        width: 100%;
        justify-content: center;
        padding: 10px 12px !important;
        font-size: 0.82rem !important;
    }

    /* ---- CARTÃO CLIENTE MOBILE: EDGE-TO-EDGE ---- */
    #portal-client-info-card {
        padding: 12px !important;
        margin: 0 !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }

    #portal-client-info-card > div {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    /* ---- KPI GRID: EDGE-TO-EDGE ---- */
    .portal-kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
        padding: 0 4px !important;
    }

    .portal-kpi-card {
        padding: 10px 12px !important;
        border-radius: 10px !important;
        gap: 10px !important;
    }

    .kpi-icon {
        width: 36px !important;
        height: 36px !important;
    }

    .portal-kpi-card .kpi-val {
        font-size: 1.15rem !important;
    }

    .kpi-label {
        font-size: 0.7rem !important;
    }

    /* ---- PAINÉIS: EDGE-TO-EDGE SEM MARGEM ---- */
    .portal-panel {
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }

    .portal-panel .panel-head {
        padding: 12px !important;
    }

    .panel-head {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px !important;
    }

    .panel-head h3 {
        font-size: 0.85rem !important;
        line-height: 1.3 !important;
    }

    /* ---- GRÁFICOS 2 COLUNAS → 1 COLUNA ---- */
    .portal-main div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        padding: 0 !important;
    }

    /* ---- MÉTRICAS 3 COLUNAS → 1 COLUNA ---- */
    div[style*="grid-template-columns: repeat(3, 1fr)"] {
        grid-template-columns: 1fr !important;
        gap: 6px !important;
    }

    /* ---- TABELAS DESKTOP OCULTAS / CARDS MOBILE VISÍVEIS ---- */
    .desktop-only-table {
        display: none !important;
    }

    .mobile-cards-container {
        display: flex !important;
        padding: 8px 4px !important;
    }

    /* ---- MAPA LEAFLET MOBILE: MAXIMIZADO EDGE-TO-EDGE ---- */
    .map-panel-head {
        display: none !important; /* Oculta título e badge do mapa no celular */
    }

    .tracking-status-mobile {
        display: none !important; /* Oculta a box de tracking no celular se estiver na aba do mapa */
    }

    #portal-embedded-leaflet-map {
        height: calc(100vh - 140px) !important; /* Quase a tela toda */
        min-height: 500px !important;
        border-radius: 0 !important;
        border: none !important;
    }

    .portal-map-wrapper {
        padding: 0 !important;
    }

    /* ---- GRÁFICO SVG DONUT MOBILE ---- */
    div[style*="align-items:center; justify-content:space-around"] {
        flex-direction: column !important;
        gap: 12px !important;
        padding: 12px 8px !important;
    }

    /* ---- STATUS BAR WRAP ---- */
    div[style*="justify-content:space-between; align-items:center; font-size:0.82rem"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px !important;
    }

    /* ---- MODAIS MOBILE ---- */
    .portal-modal-card {
        max-width: 100vw !important;
        width: 100vw !important;
        padding: 16px !important;
        border-radius: 16px 16px 0 0 !important;
        margin: 0 !important;
    }

    /* ---- TOAST MOBILE ---- */
    #portal-toast-container {
        left: 8px !important;
        right: 8px !important;
        max-width: 100% !important;
    }
}

/* ============================================================================
   ESTILOS DE HISTÓRICO & LAUDOS AGRUPADOS POR DIA COM FOTOS (portal.css)
   ============================================================================ */

.portal-daily-section {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    margin-bottom: 20px;
    overflow: hidden;
    backdrop-filter: blur(12px);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.portal-daily-section:hover {
    border-color: rgba(0, 229, 230, 0.35);
}

.portal-day-header {
    background: linear-gradient(135deg, rgba(0, 229, 230, 0.1), rgba(168, 85, 247, 0.08));
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.portal-day-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
}

.portal-day-title i {
    color: var(--primary, #00e5e6);
}

.portal-day-badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

.portal-day-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
    padding: 18px 20px;
}

@media (max-width: 768px) {
    .portal-day-grid {
        grid-template-columns: 1fr !important;
        padding: 12px 10px !important;
        gap: 12px !important;
    }
}

.portal-service-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s ease;
    position: relative;
}

.portal-service-card:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(0, 229, 230, 0.4);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.portal-service-card.impediment-card {
    border-left: 4px solid #ef4444 !important;
    background: rgba(239, 68, 68, 0.04);
}

.portal-service-card.completed-card {
    border-left: 4px solid #10b981 !important;
}

.portal-service-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.portal-service-tag {
    font-family: var(--font-header);
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.portal-service-meta {
    font-size: 0.78rem;
    color: var(--muted, #94a3b8);
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
}

.portal-photo-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 4px 0;
}

.portal-photo-box {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #020617;
    border: 1px solid rgba(255, 255, 255, 0.12);
    aspect-ratio: 4 / 3;
    cursor: pointer;
    group: relative;
}

.portal-photo-box:hover .portal-photo-overlay {
    opacity: 1;
}

.portal-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.portal-photo-box:hover .portal-photo-img {
    transform: scale(1.06);
}

.portal-photo-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 2;
}

.portal-photo-badge.before {
    background: rgba(245, 158, 11, 0.85);
    color: #000;
}

.portal-photo-badge.after {
    background: rgba(16, 185, 129, 0.85);
    color: #000;
}

.portal-photo-badge.evidence {
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
}

.portal-photo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 229, 230, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: #ffffff;
    font-size: 1.2rem;
    z-index: 3;
}

.portal-service-audit {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.75rem;
    color: #94a3b8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.portal-service-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
    flex-wrap: wrap;
}

/* MODAL LIGHTBOX HD */
#modal-portal-photo-lightbox {
    z-index: 99999;
}

.lightbox-card {
    background: #090e1a;
    border: 1.5px solid rgba(0, 229, 230, 0.4);
    border-radius: 16px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 229, 230, 0.2);
}

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

.lightbox-body {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    max-height: calc(85vh - 120px);
    overflow: hidden;
}

.lightbox-img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-footer {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #94a3b8;
}

/* ==========================================================================
   BANNER DE INSTALAÇÃO PWA PARA IOS (APPLE SAFARI) - PORTAL DO CLIENTE
   ========================================================================== */
.ios-pwa-prompt-banner {
    position: fixed;
    bottom: 20px;
    left: 16px;
    right: 16px;
    background: rgba(15, 23, 42, 0.96);
    border: 1.5px solid #00e5e6;
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 229, 230, 0.2);
    z-index: 9999999;
    backdrop-filter: blur(16px);
    animation: slideUpPrompt 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpPrompt {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.ios-pwa-prompt-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ios-pwa-icon img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: block;
}

.ios-pwa-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.8rem;
    color: #cbd5e1;
    line-height: 1.35;
}

.ios-pwa-text strong {
    color: #ffffff;
    font-size: 0.88rem;
}

.ios-pwa-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #94a3b8;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.ios-pwa-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* ============================================================================
   MODAIS DE RECUPERAÇÃO E ALTERAÇÃO DE SENHA DO PORTAL (PRIORIDADE MÁXIMA)
   ============================================================================ */
#modal-portal-forgot-password,
#modal-portal-set-new-password,
#modal-portal-change-password {
    z-index: 100000000 !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    background: rgba(5, 10, 20, 0.96) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
}

#modal-portal-forgot-password:not(.hidden),
#modal-portal-set-new-password:not(.hidden),
#modal-portal-change-password:not(.hidden) {
    display: flex !important;
}

#modal-portal-forgot-password .portal-modal-card,
#modal-portal-set-new-password .portal-modal-card,
#modal-portal-change-password .portal-modal-card {
    border-radius: 20px !important;
    border-top: 1.5px solid #00e5e6 !important;
    border: 1.5px solid #00e5e6 !important;
    max-height: 90vh !important;
    margin: auto !important;
    box-shadow: 0 25px 60px rgba(0,0,0,0.9), 0 0 35px rgba(0, 229, 230, 0.25) !important;
}

/* ============================================================================
   SISTEMA DE DIÁLOGOS & POP-UPS GLASSMORPHISM ULTRA-PREMIUM (SANITIX DIALOG)
   ============================================================================ */
.sanitix-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 8, 18, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 99999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.sanitix-dialog-overlay.active {
    display: flex !important;
    opacity: 1 !important;
}
.sanitix-dialog-card {
    background: linear-gradient(145deg, #0f172a, #0b132b);
    border: 1.5px solid rgba(0, 229, 230, 0.35);
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(0, 229, 230, 0.2);
    width: 100%;
    max-width: 480px;
    padding: 24px;
    color: #ffffff;
    position: relative;
    transform: scale(0.92) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}
.sanitix-dialog-overlay.active .sanitix-dialog-card {
    transform: scale(1) translateY(0);
}
.sanitix-dialog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #00e5e6, #a855f7, #3b82f6);
}
.sanitix-dialog-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    margin-bottom: 16px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}
.sanitix-dialog-icon.info {
    background: rgba(0, 229, 230, 0.15);
    color: #00e5e6;
    border: 1px solid rgba(0, 229, 230, 0.4);
}
.sanitix-dialog-icon.success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
}
.sanitix-dialog-icon.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}
.sanitix-dialog-icon.error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}
.sanitix-dialog-icon.question {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.4);
}



