:root {
    --bg-color: #f1f5f9; /* Fundo claro para melhor leitura */
    --card-bg: rgba(255, 255, 255, 0.85); /* Cartões claros */
    --text-main: #1e293b;
    --text-muted: #64748b;
    
    /* Cores Oficiais CEUNSP */
    --primary: #00386B; /* Azul Marinho profundo do logo */
    --primary-hover: #00254d;
    --secondary: #C4263A; /* Vermelho da estrela */
    --secondary-hover: #a11f2f;
    
    --success: #10b981;
    --danger: var(--secondary); /* Alertas usam o vermelho oficial */
    --glass-border: rgba(0, 56, 107, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Glassmorphism Header */
.glass-header {
    background: rgba(196, 38, 58, 0.95); /* Header no Vermelho Carmesim oficial */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem;
    color: white;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-content img.logo-header {
    height: 30px;
    object-fit: contain;
    filter: brightness(0) invert(1); /* Deixa o logo branco no header escuro */
}

/* Sync Indicator */
.sync-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    background: rgba(255,255,255,0.2);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status-dot.offline { background-color: #fcd34d; }
.status-dot.online { background-color: #6ee7b7; }

/* Botão Coordenação (Topo direito na Home) */
.btn-coord {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.5);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    margin-left: 10px;
}
.btn-coord:hover {
    background: rgba(255,255,255,0.2);
}

/* Logo Hero (Tela Inicial) */
.hero-logo-container {
    text-align: center;
    padding: 2rem 1rem 1rem 1rem;
}
.hero-logo-container img {
    max-width: 200px;
    height: auto;
}

/* Views Management */
.view {
    display: none;
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    width: 100%;
    animation: fadeIn 0.3s ease-out;
}
.view.active {
    display: block;
}

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

/* Home View */
h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
    text-align: center;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.nav-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-main);
    box-shadow: var(--glass-shadow);
}

.nav-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    background: #fff;
}

.card-icon {
    font-size: 2rem;
    background: rgba(0, 56, 107, 0.05);
    padding: 1rem;
    border-radius: 12px;
}

.card-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--primary);
}

.card-info p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Sincronização Action */
.sync-action {
    text-align: center;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}
.sync-action p {
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-primary:hover {
    background: var(--primary-hover);
}

.glow-effect {
    box-shadow: 0 0 15px rgba(0, 56, 107, 0.3);
}

/* View Header (Para Mapa e Formulário) */
.view-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn-back {
    background: rgba(0, 56, 107, 0.1);
    color: var(--primary);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-back:hover {
    background: rgba(0, 56, 107, 0.2);
}

/* Interactive Map */
.map-container {
    position: relative;
    width: 100%;
    overflow-x: auto;
    background: #fff;
    border-radius: 12px;
    padding: 10px;
    box-shadow: var(--glass-shadow);
}

.interactive-map {
    position: relative;
    min-width: 600px; /* Garante scroll no mobile se a tela for estreita */
}

/* A estrutura do mapa vai ser gerada em blocos via CSS Grid para B e G */
.dummy-map {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 20px;
    background: #e2e8f0;
    border-radius: 8px;
    min-height: 400px;
}

.dummy-room {
    background: white;
    border: 2px solid var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--primary);
    cursor: pointer;
    transition: 0.2s;
    height: 80px;
}
.dummy-room:hover {
    background: var(--primary);
    color: white;
}
.dummy-room.audited {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

/* Formulário de Auditoria */
.audit-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.audit-item {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.item-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
}

.item-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.action-buttons {
    display: flex;
    gap: 1rem;
}

.btn-ok, .btn-nok {
    flex: 1;
    padding: 1rem;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s, filter 0.2s, opacity 0.2s;
    color: white;
}

.btn-ok {
    background-color: var(--success);
}
.btn-nok {
    background-color: var(--danger);
}

.btn-ok:active, .btn-nok:active {
    transform: scale(0.96);
}

.btn-ok.selected, .btn-nok.selected {
    box-shadow: inset 0 0 0 3px rgba(255,255,255,0.5);
    filter: brightness(1.1);
}

.btn-ok:not(.selected), .btn-nok:not(.selected) {
    opacity: 0.4;
}

/* Campos de Problema (Escondidos por padrão) */
.problem-details {
    display: none;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0,0,0,0.1);
    animation: fadeIn 0.3s;
}
.problem-details.open {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
}

.input-group input, .input-group textarea {
    background: #fff;
    border: 1px solid #cbd5e1;
    color: var(--text-main);
    padding: 0.8rem;
    border-radius: 8px;
    font-family: inherit;
    transition: border 0.2s;
}
.input-group input:focus, .input-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 56, 107, 0.1);
}

.btn-ticket {
    background: rgba(196, 38, 58, 0.1); /* Fundo vermelho sutil */
    color: var(--danger);
    border: 2px dashed var(--danger);
    padding: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-ticket:hover {
    background: rgba(196, 38, 58, 0.2);
}
.btn-ticket.requested {
    background: var(--danger);
    color: white;
    border-style: solid;
}

.form-actions {
    margin-top: 2rem;
    text-align: center;
}

.pulse-effect {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 56, 107, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 56, 107, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 56, 107, 0); }
}

/* Modal Login Coordenação */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-overlay.active { display: flex; }

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}
.modal-content h3 { color: var(--primary); margin-bottom: 1rem; }
.modal-content input {
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.2rem;
    letter-spacing: 5px;
}
.modal-content .btn-primary { width: 100%; justify-content: center; margin-bottom: 0.5rem; }
.modal-content .btn-cancel {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 500;
}

.hotspot {
    position: absolute;
    background-color: rgba(59, 130, 246, 0.2);
    border: 2px dashed rgba(59, 130, 246, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: #1e3a8a;
    border-radius: 4px;
    transition: all 0.2s;
}

.hotspot:hover {
    background-color: rgba(59, 130, 246, 0.5);
    border-color: #2563eb;
    color: #ffffff;
}

.hotspot.audited {
    background-color: rgba(16, 185, 129, 0.3);
    border-color: #10b981;
    color: #064e3b;
}

#map-hotspots {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#map-hotspots .hotspot {
    pointer-events: auto;
}

#map-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}
