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

body {
    font-family: Arial, sans-serif;
    background-color: #f0f2f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 1rem;
}

.header {
    text-align: center;
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 980px;
}

.operador-info {
    font-size: 1.5rem;
    font-weight: 500;
    color: #343a40;
    margin-top: 0.5rem;
}

.logo {
    max-height: 60px;
    margin-bottom: 0.5rem;
}

.card {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 980px;
    margin-bottom: 1rem;
}

.fullscreen-btn {
    position: fixed;
    top: 15px;
    right: 15px;
    background-color: #0d6efd;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    z-index: 99999;
}

.button-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 1rem;
    align-items: stretch;
}

.button-grid > .parada-button:last-child:nth-child(4n + 1) {
    grid-column: 1 / -1;
}

.button-grid > .parada-button:nth-last-child(2):nth-child(4n + 1),
.button-grid > .parada-button:last-child:nth-child(4n + 2) {
    grid-column: span 2;
}

.button-grid > .parada-button:nth-last-child(3):nth-child(4n + 1) {
    grid-column: span 2;
}

.parada-button {
    padding: 1rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 2px solid #dee2e6;
    background-color: #f8f9fa;
    color: #495057;
    min-height: 120px;
    height: 120px;
    width: 100%;
    text-decoration: none;
}

.parada-button i {
    font-size: 2.1rem;
    margin-bottom: 0.7rem;
    display: block;
}

.parada-button span {
    display: block;
    line-height: 1.25;
    word-break: break-word;
}

.parada-button.active {
    background-color: #e35d6a !important;
    color: white !important;
    border-color: #dc3545;
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.parada-button.active-productive {
    background-color: #5cb85c !important;
    color: white !important;
    border-color: #4cae4c;
    box-shadow: 0 4px 8px rgba(92, 184, 92, 0.3);
}

.parada-button.inactive {
    background-color: #f8f9fa;
    color: #495057;
    border-color: #dee2e6;
}

.parada-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
}

.counters-container {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    max-width: 980px;
    margin-bottom: 1rem;
}

.counter-card {
    flex: 1;
    padding: 0.75rem !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.counter-card label {
    font-weight: bold;
    color: #6c757d;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.counter-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.counter-value {
    font-size: 1.8rem;
    font-weight: bold;
    font-family: monospace;
    color: #0d6efd;
    min-width: 30px;
    text-align: center;
}

.counter-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-weight: bold;
}

.report-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    border-left: 4px solid #dee2e6;
}

.timer-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.timer-display {
    font-family: "Courier New", monospace;
    font-size: 1.8rem;
    font-weight: bold;
    color: #495057;
}

.sair-btn {
    background-color: #dc3545;
    color: white;
    border: 2px solid #b02a37;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

@media (max-width: 992px) {
    .button-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }

    .button-grid > .parada-button {
        grid-column: auto !important;
    }

    .button-grid > .parada-button:last-child:nth-child(3n + 1) {
        grid-column: 1 / -1 !important;
    }

    .button-grid > .parada-button:nth-last-child(2):nth-child(3n + 1) {
        grid-column: span 2 !important;
    }
}

@media (max-width: 768px) {
    body {
        justify-content: flex-start;
    }

    .card {
        padding: 1rem;
    }

    .button-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .button-grid > .parada-button {
        grid-column: auto !important;
    }

    .button-grid > .parada-button:last-child:nth-child(2n + 1) {
        grid-column: 1 / -1 !important;
    }

    .parada-button {
        min-height: 110px;
        height: 110px;
        font-size: 0.82rem;
        padding: 0.9rem 0.6rem;
    }

    .parada-button i {
        font-size: 1.9rem;
        margin-bottom: 0.55rem;
    }

    .counters-container {
        flex-wrap: wrap;
    }

    .counter-card {
        flex-basis: 48%;
    }
}

@media (max-width: 480px) {
    .button-grid {
        grid-template-columns: 1fr;
    }

    .button-grid > .parada-button,
    .button-grid > .parada-button:last-child,
    .button-grid > .parada-button:nth-last-child(2),
    .button-grid > .parada-button:nth-last-child(3) {
        grid-column: auto !important;
    }

    .counter-card {
        flex-basis: 100%;
    }

    .timer-section {
        flex-direction: column;
        align-items: stretch;
    }

    .timer-display {
        text-align: center;
    }

    .sair-btn {
        width: 100%;
    }
}

.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.custom-modal {
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.custom-modal h3 {
    color: #343a40;
    margin-bottom: 1rem;
    font-weight: 800;
    font-size: 1.8rem;
}

.custom-modal p {
    color: #495057;
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    line-height: 1.4;
}

.modal-footer {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.btn-modal-sim {
    background: #198754;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    flex: 1;
    font-size: 1rem;
    transition: background 0.3s;
}

.btn-modal-nao {
    background: #0d6efd;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    flex: 1;
    font-size: 1rem;
    transition: background 0.3s;
}

.btn-modal-sim:hover {
    background: #157347;
}

.btn-modal-nao:hover {
    background: #0b5ed7;
}

.timeout-label {
    display: block;
    margin-top: 2rem;
    font-size: 0.95rem;
    color: #dc3545;
    font-weight: bold;
    font-family: monospace;
}

.lunch-lock-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 110, 253, 0.95);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    color: white;
    text-align: center;
    padding: 20px;
}

#lunchContent {
    max-width: 700px;
}

.lunch-lock-overlay i {
    font-size: 5rem;
    margin-bottom: 2rem;
}

.lunch-lock-overlay h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.lunch-lock-overlay p {
    font-size: 1.5rem;
    opacity: 0.95;
}

.return-modal {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    color: #333;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 90%;
}
