/* ================== RESET AGRESSIVO ================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Adicione estas regras ao seu style.css existente */

/* Controles de alerta */
.alert-controls {
    margin-top: 10px;
    padding: 12px 15px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.alert-controls strong {
    display: block;
    margin-bottom: 8px;
    color: #e2e8f0;
    font-size: 0.95em;
}

.checkbox-group {
    display: flex;
    gap: 15px;
    margin: 10px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(30, 41, 59, 0.3);
    transition: all 0.2s;
    color: #cbd5e1;
    font-size: 0.9em;
}

.checkbox-label:hover {
    background: rgba(30, 41, 59, 0.5);
}

.checkbox-label input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
}

.checkmark {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #4b5563;
    margin-right: 8px;
    position: relative;
}

.checkbox-label input[type="radio"]:checked + .checkmark {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.checkbox-label input[type="radio"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

.alert-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(100, 116, 139, 0.2);
    font-size: 0.85em;
}

.alert-mode-all {
    color: #60a5fa;
    font-weight: 600;
}

.alert-mode-file {
    color: #34d399;
    font-weight: 600;
}

.alert-count {
    background: rgba(220, 38, 38, 0.2);
    color: #f87171;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

/* Estilos para linhas com alerta ativo */
tr.alert-active {
    animation: pulse-alert 1s infinite;
}



body {
    width: 100vw;
    height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a2332 0%, #0f1419 100%);
    color: #e0e6ed;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ================== HEADER ================== */
.header{
    background: linear-gradient(135deg, #102541 0%, #152a45 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;

    /* não deixa o header crescer */
    height: 80px;
    padding: 0 20px;

    display: flex;
    align-items: center;

    /* permite a logo "passar" um pouco sem aumentar a altura */
    overflow: visible;

    /* já ajuda no item 2 (largura alinhada ao corpo) */
    margin: 0 20px;
    border-radius: 10px;
}

.header-logo{
    height: 200px;      /* aumente/diminua aqui */
    width: 350PX;
    display: block;
}


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

.header h1 {
    color: #ffffff;
    font-size: 24px;
    font-weight: 600;
}

.clock {
    font-size: 16px;
    font-weight: 500;
    color: #64b5f6;
    background: rgba(100, 181, 246, 0.1);
    padding: 8px 16px;
    border-radius: 6px;
    white-space: nowrap;
}

/* ================== MAIN CONTENT - FLEX GROW ================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 15px 20px;
    gap: 10px;
    min-height: 0;
}

/* ================== DASHBOARD ================== */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    flex-shrink: 0;
    min-height: 80px;
}

.card {
    background: linear-gradient(135deg, #1e3a5f 0%, #152a45 100%);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.card-icon {
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    flex-shrink: 0;
}

.card-content {
    flex: 1;
    min-width: 0;
}

.card-label {
    font-size: 11px;
    color: #a0aec0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-value {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
}

/* ================== CONTROLES ================== */
.controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
    min-height: 45px;
}

.controls-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-success {
    background: linear-gradient(135deg, #065f46 0%, #047857 100%);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
}

.btn-info {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
}

.btn-info:hover:not(:disabled) {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
}

.btn-primary {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 100%);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* ================== STATUS BAR ================== */
.status-bar {
    background: linear-gradient(135deg, #1e3a5f 0%, #152a45 100%);
    padding: 12px 15px;
    border-radius: 6px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    font-size: 13px;
    min-height: 45px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-item strong {
    color: #64b5f6;
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 5px;
}

.status-indicator.connected {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.status-indicator.disconnected {
    background: #dc2626;
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.5);
}

/* ================== FILTROS ================== */
.filters {
    background: linear-gradient(135deg, #1e3a5f 0%, #152a45 100%);
    padding: 12px 15px;
    border-radius: 6px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    min-height: 80px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    font-size: 12px;
    color: #a0aec0;
    font-weight: 500;
}

.filter-group input[type="text"],
.filter-group select {
    padding: 8px;
    border: 1px solid #2d3748;
    border-radius: 4px;
    background: #1a2332;
    color: #e0e6ed;
    font-size: 13px;
}

.filter-group input[type="text"]:focus,
.filter-group select:focus {
    outline: none;
    border-color: #64b5f6;
    box-shadow: 0 0 0 3px rgba(100, 181, 246, 0.1);
}

.filter-group input[type="file"] {
    padding: 6px;
    border: 1px solid #2d3748;
    border-radius: 4px;
    background: #1a2332;
    color: #e0e6ed;
    font-size: 12px;
}

/* ================== TABELA - OCUPA ESPAÇO MÁXIMO ================== */
.table-container {
    background: linear-gradient(135deg, #1e3a5f 0%, #000000 100%);
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(250, 0, 0, 0.2);
    overflow: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead {
    background: #152a45;   
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #2d3748;
    white-space: nowrap;
}

.data-table tbody tr {
    border-bottom: 1px solid #2d3748;
    transition: background 0.2s;
    height: 35px;
}

.data-table tbody tr:hover {
    background: rgba(100, 181, 246, 0.05);
}

.data-table td {
    padding: 8px 12px;
    color: #e0e6ed;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.data-table .no-data {
    text-align: center;
    padding: 30px;
    color: #a0aec0;
    font-style: italic;
}

/* Rotas monitoradas - DESTAQUE VERDE */
.data-table tbody tr.monitored {
    background: linear-gradient(135deg, rgba(0, 100, 0, 0.3) 0%, rgba(0, 80, 0, 0.3) 100%);
    border-left: 4px solid #10b981;
}

.data-table tbody tr.monitored td {
    color: #fef08a;
    font-weight: 600;
}

.data-table tbody tr.monitored:hover {
    background: linear-gradient(135deg, rgba(0, 100, 0, 0.4) 0%, rgba(0, 80, 0, 0.4) 100%);
}

/* Alertas piscando */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.data-table tbody tr.alert {
    animation: pulse 2s infinite;
}

/* ================== FOOTER ================== */
.footer {
    text-align: center;
    padding: 8px;
    color: #a0aec0;
    font-size: 12px;
    flex-shrink: 0;
    border-top: 1px solid #2d3748;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ================== MODAL GOOGLE SHEETS ================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

/* ================== STATUS GOOGLE SHEETS ================== */
.btn-gsheets-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
    border-radius: 6px;
    padding: 10px 16px;
    border: none;
    cursor: default !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
    min-width: 220px;
}

.btn-gsheets-status.connected {
    background: linear-gradient(135deg, #065f46 0%, #047857 100%) !important;
    color: white !important;
}

.btn-gsheets-status.disconnected {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
    color: white !important;
}

.btn-gsheets-status:hover {
    transform: none !important;
    cursor: default !important;
}

.status-indicator-small {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator-small.connected {
    background: #10b981 !important;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.8) !important;
}

.status-indicator-small.disconnected {
    background: #ef4444 !important;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.8) !important;
}

.status-text {
    font-weight: 600;
    font-size: 13px;
}

.status-text.connected {
    color: #10b981 !important;
}

.status-text.disconnected {
    color: #ef4444 !important;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #1e3a5f 0%, #152a45 100%);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.modal-content h2 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 20px;
}

.footer{
    margin: 0 20px;
    border-radius: 10px;
}


.modal-content p {
    color: #a0aec0;
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-buttons .btn {
    flex: 1;
}

/* ================== SCROLLBAR CUSTOMIZADA ================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a2332;
}

::-webkit-scrollbar-thumb {
    background: #2d3748;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4a5568;
}

@keyframes pulse-alert {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.35);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    }
}
/* ================== RESPONSIVO ================== */
@media (max-width: 1024px) {
    .dashboard {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .card {
        padding: 12px;
    }
    
    .card-icon {
        font-size: 24px;
    }
    
    .card-value {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 18px;
    }
    
    .clock {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .dashboard {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    
    .card {
        padding: 10px;
        gap: 8px;
    }
    
    .card-icon {
        font-size: 20px;
    }
    
    .card-value {
        font-size: 18px;
    }
    
    .card-label {
        font-size: 10px;
    }
    
    .controls {
        gap: 6px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .status-bar {
        gap: 10px;
        font-size: 12px;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .data-table th,
    .data-table td {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .data-table tbody tr {
        height: 30px;
    }
}
