.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    background: #343a40;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.dashboard-header {
    background: #2b3035;
    color: #ffffff;
    padding: 8px 16px;
    border-bottom: 1px solid #495057;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.left-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.dashboard-title {
    color: #e9ecef;
    font-size: 1.35em;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin: 0;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 20px;
    background: rgba(108, 117, 125, 0.1);
    border: 1px solid rgba(108, 117, 125, 0.2);
    color: #6c757d;
    transition: all 0.3s ease;
}

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

.status-checking {
    background: #ffc107;
    animation: pulse-dot 2s infinite;
}

.status-online {
    background: #28a745;
    box-shadow: 0 0 6px rgba(40, 167, 69, 0.6);
}

.status-offline {
    background: #dc3545;
    box-shadow: 0 0 6px rgba(220, 53, 69, 0.6);
}

.status-indicator.online {
    background: rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.3);
    color: #155724;
}

.status-indicator.offline {
    background: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.3);
    color: #721c24;
}

.status-indicator.checking {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
    color: #856404;
}

@keyframes pulse-dot {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

.dashboard-date {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    font-size: 0.9em;
    padding: 0;
}

.nav-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-link {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 15px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9em;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.dashboard-content {
    padding: 6px 16px;
    background: #343a40;
}

.rifas-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    min-width: 720px;
}

.rifas-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 1.1em;
    font-weight: 600;
}

.rifas-table td {
    padding: 18px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.rifas-table tr:hover {
    background: #f8f9fa;
}

.rifas-table tr:last-child td {
    border-bottom: none;
}

.edicao-cell, .coluna-edicao {
    font-weight: bold;
    font-size: 1.1em;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
    word-break: break-word;
}

.edicao-cell:hover, .coluna-edicao:hover {
    color: #764ba2;
    transform: scale(1.05);
}

.erro-tag {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 600;
    margin-top: 5px;
    display: inline-block;
}

.status-circle, .status-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.0em;
    margin: 0 auto;
    transition: all 0.3s ease;
    border: 2px solid;
}

.status-cell {
    text-align: center;
}

/* Removido: célula de PDF */

.status-0 {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    color: #6c757d;
    border-color: #dee2e6;
}

.status-progresso {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
    border-color: #ffc107;
    animation: pulse 2s infinite;
}

.status-100 {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
    border-color: #28a745;
}

.status-error {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border-color: #dc3545;
}

.status-percent {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border-color: #007bff;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes highlight-new {
    0% { background: #d4edda; transform: scale(1); }
    50% { background: #c3e6cb; transform: scale(1.02); }
    100% { background: #d4edda; transform: scale(1); }
}

/* Removido: animação de PDF */

.linha-destaque {
    animation: highlight-new 0.8s ease-in-out;
}

/* Removido: classe de PDF novo */

/* Removido: ícone de PDF */

/* Removido: hover de PDF */

/* Removido: estado disabled do PDF */

/* Removido: hover disabled do PDF */

/* Removido: loading de PDF */

/* Removido: spinner de PDF */

/* Removido: ícone em loading de PDF */

/* Removido: keyframes spinner PDF */

/* Removido: estado processamento de PDF */

/* Removido: keyframes processamento de PDF */

.data-separator {
    background: transparent;
}

.data-header {
    padding: 10px 10px 8px 15px !important;
    border: none !important;
    background: transparent;
}

.data-title {
    background: transparent;
    color: #495057;
    padding: 12px 20px;
    border-radius: 0;
    font-weight: 700;
    font-size: 1.1em;
    text-align: center;
    box-shadow: none;
    margin: 0 auto;
    max-width: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.data-display {
    background: transparent;
    color: #495057;
    padding: 15px 20px 10px 20px;
    font-weight: 700;
    font-size: 1.1em;
    text-align: center;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.data-spacer {
    background: transparent;
}

.data-spacer td {
    border: none !important;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
    backdrop-filter: blur(2px);
}

.loading-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: 1.2em;
    color: #667eea;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-compact {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    border-left: 4px solid #667eea;
}

.loading-compact .loading-spinner {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.loading-compact .loading-text {
    font-size: 0.9em;
    color: #667eea;
    margin: 0;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: modalShow 0.3s ease;
}

@keyframes modalShow {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    margin: -30px -30px 20px -30px;
    border-radius: 20px 20px 0 0;
    text-align: center;
}

.modal-title {
    font-size: 1.5em;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 15px 25px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
}

.btn-whatsapp {
    background: linear-gradient(135deg, #25d366 0%, #20ba5a 100%);
}

.btn-link {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    opacity: 0.7;
}

.message {
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 5px solid;
    display: none;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.dashboard-footer {
    background: #343a40;
    padding: 15px 30px;
    border-top: 1px solid #495057;
    margin-top: 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}
.footer-actions .nav-link {
    background: #495057;
    color: #ffffff;
    border-color: rgba(255,255,255,0.2);
}
.footer-actions .nav-link:hover {
    background: #6c757d;
}

.status-container {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.ultima-atualizacao {
    color: #ffffff;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
}



@media (max-width: 768px) {
    .dashboard-header {
        padding: 12px 20px;
    }

    .header-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .left-section {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }

    .dashboard-title {
        font-size: 1.2em;
    }

    .dashboard-date {
        font-size: 0.85em;
    }

    .nav-links {
        justify-content: center;
    }

    .nav-link {
        font-size: 0.85em;
        padding: 5px 10px;
    }

    .dashboard-content { padding: 10px; }

    .rifas-table { font-size: 0.85em; }

    .rifas-table th,
    .rifas-table td { padding: 8px 6px; }

    .status-circle,
    .pdf-icon {
        width: 32px;
        height: 32px;
    }
    .status-badge { width: 28px; height: 28px; font-size: 0.8em; }
    .edicao-cell {
        font-size: 1.0em;
    }
}

    .modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .modal-actions {
        flex-direction: column;
    }

    .dashboard-footer {
        padding: 12px 20px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .status-container {
        flex-direction: column;
        gap: 8px;
    }

    .ultima-atualizacao {
        font-size: 0.8em;
    }


    
    .status-indicator {
        font-size: 0.8em;
        padding: 6px 10px;
    }

.cards-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.api-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 10px;
    margin-bottom: 12px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.card-title {
    color: #667eea;
    font-weight: 700;
    font-size: 1.05em;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #495057;
    font-weight: 600;
}

.copy-icon {
    cursor: pointer;
    user-select: none;
}
.copy-icon:hover {
    opacity: 0.8;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 6px;
}

.metric {
    text-align: center;
}

.metric-label {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 700;
    margin-bottom: 4px;
}

.label-progress { background: #0d6efd; color: #fff; }
.label-sold { background: #28a745; color: #fff; }
.label-reserved { background: #ffc107; color: #212529; }
.label-free { background: #dee2e6; color: #212529; }
.label-total { background: #6c757d; color: #fff; }

.metric-value {
    font-size: 1.05em;
    font-weight: 700;
}

/* Grayscale styling for first (previous-concluded) item */
.cards-list .api-card:first-child { background: #f1f3f5; border: 1px solid #e9ecef; box-shadow: none; }
.cards-list .api-card:first-child .card-title { color: #adb5bd; }
.cards-list .api-card:first-child .card-meta { color: #adb5bd; }
.cards-list .api-card:first-child .metric-label { background: #e9ecef; color: #6c757d; }
.cards-list .api-card:first-child .metric-value { color: #6c757d; }

#table-body tr:first-child .edicao-cell { color: #adb5bd; }
#table-body tr:first-child .status-badge {
    background: linear-gradient(135deg, #e9ecef 0%, #f1f3f5 100%);
    color: #6c757d;
    border-color: #e9ecef;
    animation: none;
}
.cards-list .api-card:last-child { margin-bottom: 0; }

#last-container { margin-bottom: 24px; }
body {
    background: #343a40;
}

/* Cabeçalho de data para mobile (dashboard API) */
.mobile-date-header {
    background: #2b3035;
    color: #e9ecef;
    border: 1px solid #495057;
    border-radius: 12px;
    padding: 8px 12px;
    font-weight: 700;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 6px 2px 4px 2px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
