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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
}

.main-layout {
    display: flex;
    height: 100vh;
    width: 100%;
    position: relative;
}

.sidebar {
    width: 280px;
    background: #2c3e50;
    color: white;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1000;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 15px;
    background: #1a252f;
    border-bottom: 1px solid #3e5a6b;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.close-sidebar {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    display: none;
    width: auto;
    padding: 0;
    margin: 0;
}

#indice-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#indice-menu li {
    border-bottom: 1px solid #3e5a6b;
}

#indice-menu a {
    display: block;
    padding: 12px 18px;
    color: #ecf0f1;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

#indice-menu a:hover {
    background: #1abc9c;
    color: white;
    padding-left: 24px;
}

#indice-menu a.active {
    background: #1abc9c;
    color: white;
    border-left: 4px solid #f1c40f;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 20px 20px;
    background: #f5f5f5;
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #2c3e50;
    padding: 8px 16px;
    margin-bottom: 20px;
    border-radius: 0 0 12px 12px;
}

.top-bar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.user-email {
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    word-break: break-word;
}

.top-bar-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.top-bar-buttons button {
    width: auto;
    margin: 0;
    padding: 5px 10px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.btn-zip {
    background-color: #28a745;
}
.btn-zip:hover {
    background-color: #218838;
}
.btn-danger {
    background-color: #dc3545;
}
.btn-danger:hover {
    background-color: #c82333;
}

.hamburger-wrapper {
    display: none;
    align-items: center;
    gap: 4px;
    background: rgba(0,0,0,0.2);
    padding: 4px 8px;
    border-radius: 8px;
}

.hamburger {
    width: 22px;
    height: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background: white;
    border-radius: 3px;
}

.hamburger-label {
    font-size: 0.7rem;
    color: white;
    font-weight: bold;
}

.attachment-counter-container {
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 0.75rem;
    text-align: center;
    margin-top: 8px;
    color: white;
}
.attachment-counter-container strong {
    color: white;
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        width: 260px;
        transform: translateX(-100%);
        z-index: 1200;
        overflow-y: auto;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .close-sidebar {
        display: block;
    }
    .hamburger-wrapper {
        display: flex;
    }
    .top-bar {
        padding: 6px 12px;
    }
    .top-bar-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .user-email {
        text-align: center;
        margin-bottom: 0;
    }
    .top-bar-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    .top-bar-buttons button {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
    .hamburger-wrapper {
        margin-right: 0;
        align-self: center;
    }
}

.hidden {
    display: none !important;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

input, button, textarea, select {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
}

button {
    background: #007bff;
    color: white;
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

button:hover {
    background: #0056b3;
}

button:disabled {
    background: #aaa;
    cursor: not-allowed;
}

.switch-link {
    text-align: center;
    margin-top: 15px;
}

.error-msg {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    text-align: center;
}

.btn-submit {
    background: #27ae60;
}
.btn-submit:hover {
    background: #219a52;
}

.btn-report, .btn-pdf, .btn-roteiros {
    background-color: #6c757d;
}
.btn-report:hover, .btn-pdf:hover, .btn-roteiros:hover {
    background-color: #5a6268;
}
.btn-pdf {
    background-color: #dc3545;
}
.btn-pdf:hover {
    background-color: #c82333;
}
.btn-roteiros {
    background-color: #17a2b8;
}
.btn-roteiros:hover {
    background-color: #138496;
}

.save-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    z-index: 1001;
}
.save-status.saving { background: #f39c12; }
.save-status.success { background: #27ae60; }
.save-status.error { background: #e74c3c; }

.item-block {
    border-left: 4px solid #3498db;
    padding: 16px;
    margin-bottom: 20px;
    background: #fefefe;
    border-radius: 8px;
    border: 1px solid #eee;
}
.item-header {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 8px;
}
.item-req {
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 12px;
    font-style: italic;
}
.item-responses {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 15px 0;
}
.response-option {
    display: inline-flex;
    align-items: center;
    background: #e9ecef;
    padding: 8px 16px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}
.response-option:hover { background: #dee2e6; }
.response-option input {
    width: auto;
    margin-right: 6px;
    transform: scale(1.1);
}
.obs-field {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
}
.global-na-btn {
    background: #f39c12;
    color: white;
    margin-bottom: 20px;
    width: auto;
    padding: 8px 12px;
    white-space: normal;
    line-height: 1.3;
    font-size: 0.9rem;
}
.global-na-btn:hover { background: #e67e22; }
.summary-box {
    background: #e8f4f8;
    border: 2px solid #3498db;
    border-radius: 12px;
    padding: 20px;
    margin-top: 30px;
}
.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.stat-card {
    background: white;
    padding: 12px;
    text-align: center;
    border-radius: 8px;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.stat-card span {
    display: block;
    font-size: 28px;
    color: #3498db;
}
.btn-primary {
    background: #3498db;
}
.btn-primary:hover { background: #2980b9; }
.btn-secondary {
    background: #6c757d;
}
.btn-secondary:hover { background: #5a6268; }

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}
.admin-tabs button {
    width: auto;
    background: #f0f0f0;
    color: #333;
    padding: 8px 16px;
    margin: 0;
}
.admin-tabs button.active {
    background: #007bff;
    color: white;
}
#admin-templates-panel { margin-top: 20px; }
#template-file-input { margin: 10px 0; }
#admin-roteiros-list {
    margin-top: 15px;
    max-height: 400px;
    overflow-y: auto;
}
.roteiro-item {
    border: 1px solid #ddd;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 6px;
}
.roteiro-item .actions { margin-top: 8px; }
.roteiro-item button {
    margin-right: 8px;
    width: auto;
    padding: 4px 12px;
}
.roteiro-item .roteiro-select {
    width: auto;
    margin-right: 10px;
}
#assign-inspector-modal .modal-content { max-width: 400px; }

.attachment-button {
    background-color: #6c757d;
    color: white;
    padding: 5px 10px;
    font-size: 0.8rem;
    margin-top: 8px;
    width: auto;
}
.attachment-list {
    margin-top: 8px;
    padding: 5px;
    background: #f9f9f9;
    border-radius: 5px;
    font-size: 0.8rem;
}
.attachment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px;
    border-bottom: 1px solid #eee;
}
.attachment-item button {
    width: auto;
    margin: 0 2px;
    padding: 2px 6px;
    font-size: 0.7rem;
}
.anexos-panel {
    transition: all 0.2s;
}
.anexos-panel table { font-size: 0.8rem; }
.anexos-panel button {
    width: auto;
    padding: 2px 6px;
    margin: 0 2px;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 90%;
    width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}
.close, .close-assign, .close-report, .close-import {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close:hover, .close-assign:hover, .close-report:hover, .close-import:hover { color: red; }
#report-modal .modal-content {
    max-width: 900px;
    width: 90%;
}
#report-text {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    background: #fefefe;
    border: 1px solid #ccc;
    padding: 10px;
    max-height: 60vh;
    overflow-y: auto;
}
#copy-report-btn, #print-from-modal-btn {
    width: auto;
    margin-top: 10px;
    margin-right: 10px;
}
#logs-list {
    font-family: monospace;
    font-size: 12px;
}
.log-entry {
    border-bottom: 1px solid #eee;
    padding: 8px;
}
.log-entry pre {
    margin: 0;
    white-space: pre-wrap;
}
/* ========== NOVA CLASSE PARA TEXTAREA DO CAMPO OUTROS ========== */
.form-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    resize: vertical;
    min-height: 80px;
}