:root {
    --bg: #c9d7ce;
    --surface: #FFFFFF;
    --surface-2: #f2f6f3;
    --ink: #0c4c24;
    --muted: #5e896f;
    --brand: #0c4c24;
    --brand-600: #5e896f;
    --accent: #84a494;
    --accent-2: #84a48c;
    --line: rgba(12, 76, 36, .18);
    --radius: 14px;
    --shadow: 0 8px 24px rgba(12, 76, 36, .10);
    --danger: #d32f2f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial;
    color: var(--ink);
    background:
        radial-gradient(600px 400px at 10% -10%, rgba(132, 164, 148, .25), transparent 60%),
        radial-gradient(700px 500px at 90% -10%, rgba(132, 164, 140, .18), transparent 60%),
        var(--bg);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header */
.main-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
}

.logo {
    height: 60px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

.brand h1 {
    margin: 0;
    font-size: 24px;
    color: var(--ink);
}

.brand p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--surface);
    padding: 8px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.nav-tab {
    flex: 1;
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.nav-tab:hover {
    background: var(--surface-2);
}

.nav-tab.active {
    background: var(--brand);
    color: white;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.card h2 {
    margin: 0 0 24px;
    font-size: 20px;
    color: var(--ink);
}

.card h3 {
    margin: 24px 0 16px;
    font-size: 16px;
    color: var(--ink);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 8px;
    font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--ink);
    font-size: 14px;
    transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(132, 164, 148, 0.2);
    background: white;
}

/* Checkboxes */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--brand);
}

label {
    cursor: pointer;
    user-select: none;
}

/* Service Sections */
.supplier-options {
    margin-top: 24px;
}

.service-section {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.checkbox-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 0;
}

.service-details {
    margin-top: 16px;
    padding-left: 30px;
    display: none;
}

.checkbox-header input:checked~span {
    color: var(--brand);
}

.checkbox-header input:checked+span+.service-details,
.checkbox-header input:checked~.service-details {
    display: block;
}

/* CSS específico para restaurante - garantir que os detalhes apareçam */
#atendimentoRestauranteDetails,
#estruturaRestauranteDetails,
#mesasRestauranteDetails {
    display: none;
}

#atendimentoRestauranteDetails.show,
#estruturaRestauranteDetails.show,
#mesasRestauranteDetails.show {
    display: block;
}

/* Garantir que service-details sejam exibidos quando checkbox estiver marcado */
.service-details {
    display: none !important;
}

.service-details.show {
    display: block !important;
}

/* Forçar exibição quando checkbox estiver marcado */
.checkbox-header input:checked~.service-details {
    display: block !important;
}

/* Sub Options */
.sub-options {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.sub-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

/* Form Rows */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.form-row>div label {
    font-size: 12px;
    margin-bottom: 6px;
}

.form-row input {
    font-size: 14px;
    padding: 10px 14px;
}

/* Dynamic Items */
.ab-items,
.sala-items,
.transfer-items,
.passeio-items {
    margin-bottom: 16px;
}

.dynamic-item {
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
}

.dynamic-item .remove-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--danger);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.dynamic-item .remove-btn:hover {
    transform: scale(1.1);
}

/* Buttons */
button {
    padding: 12px 24px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--brand);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-primary {
    background: var(--brand);
    color: white;
    border-color: transparent;
}

.btn-primary:hover {
    background: var(--brand-600);
}

.btn-secondary {
    background: var(--accent);
    color: white;
    border-color: transparent;
}

.btn-add {
    background: transparent;
    border: 2px dashed var(--accent);
    color: var(--accent);
    padding: 10px 20px;
    font-size: 13px;
}

.btn-add:hover {
    background: var(--surface-2);
}

/* Form Actions */
.form-actions {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Result Box */
.result-box {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
}

.result-box h3 {
    margin: 0 0 12px;
    color: #2e7d32;
}

.link-box {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.link-box input {
    flex: 1;
    background: white;
}

.link-box button {
    padding: 12px 20px;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--accent);
    border-radius: 12px;
    padding: 48px;
    text-align: center;
    background: var(--surface-2);
    margin-bottom: 24px;
    transition: all 0.2s ease;
}

.upload-area:hover {
    border-color: var(--brand);
    background: white;
}

.upload-area p {
    margin: 0 0 16px;
    color: var(--muted);
}

/* Files List */
.files-list {
    margin: 24px 0;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 8px;
}

.file-item .file-name {
    font-size: 14px;
    color: var(--ink);
}

.file-item .file-info {
    font-size: 12px;
    color: var(--muted);
}

.file-item .remove-file {
    background: transparent;
    border: none;
    color: var(--danger);
    padding: 6px 12px;
    font-size: 12px;
}

/* Quotations List */
.quotation-item {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quotation-info h4 {
    margin: 0 0 8px;
    font-size: 16px;
    color: var(--ink);
}

.quotation-info p {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
}

.quotation-actions {
    display: flex;
    gap: 8px;
}

.quotation-actions button {
    padding: 8px 16px;
    font-size: 13px;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-tabs {
        flex-direction: column;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .sub-options {
        flex-direction: column;
    }

    .quotation-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .quotation-actions {
        margin-top: 12px;
        width: 100%;
    }

    .quotation-actions button {
        flex: 1;
    }
}

/* Total do Projeto Badge */
.total-projeto-badge {
    padding: 12px 16px;
    text-align: right;
    min-width: 160px;
}

.total-projeto-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.total-projeto-valor {
    font-size: 18px;
    font-weight: 700;
    color: #059669;
    letter-spacing: -0.3px;
}

/* Loader */
.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--surface-2);
    border-radius: 50%;
    border-top-color: var(--brand);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Utility classes */
.mt {
    margin-top: 24px;
}

.mt-sm {
    margin-top: 16px;
}

/* Pending notification badge */
.pending-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #ff9800;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Drag and Drop Upload Area Enhancement */
.upload-area.drag-over {
    border-color: var(--brand);
    background: rgba(132, 164, 148, 0.1);
    transform: scale(1.02);
}

/* Quick Actions */
.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.card-actions button {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-icon {
    padding: 8px 12px;
}

/* Search and Filter Bar */
.search-filter-bar {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-input-wrapper input {
    padding-left: 44px;
    margin-bottom: 0;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 18px;
}

.filter-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-toggle-btn:hover {
    background: var(--brand-600);
    transform: translateY(-1px);
}

.filter-toggle-btn .toggle-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.filter-toggle-btn.active .toggle-icon {
    transform: rotate(180deg);
}

.filter-group-collapsible {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-date-inputs {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.filter-date-inputs>div {
    flex: 1;
}

/* Filtros de Valor */
.filter-value-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filter-value-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: var(--surface-2);
    border-radius: 10px;
}

.filter-value-label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    font-weight: 500;
    font-size: 14px;
    color: var(--ink);
}

.service-icon {
    font-size: 20px;
}

.filter-value-inputs {
    display: flex;
    gap: 12px;
    flex: 1;
}

.filter-value-inputs>div {
    flex: 1;
}

.filter-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-group select {
    flex: 1;
    min-width: 200px;
}

/* Auto-save indicator */
.autosave-indicator {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: white;
    padding: 12px 20px;
    border-radius: 24px;
    box-shadow: var(--shadow);
    font-size: 13px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s;
}

.autosave-indicator.show {
    opacity: 1;
}

.autosave-indicator .save-icon {
    color: #4caf50;
    font-size: 16px;
}

/* Estilos para formulário de restaurante */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-item:hover {
    background: rgba(132, 164, 148, 0.05);
}

.checkbox-item input[type="checkbox"] {
    margin: 0;
}

.conditional-field {
    display: none;
    margin-top: 12px;
}

.conditional-field.show {
    display: block;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-item:hover {
    background: rgba(132, 164, 148, 0.05);
}

.radio-item input[type="radio"] {
    margin: 0;
}

/* Estilos para campos obrigatórios */
.req {
    color: var(--brand);
    font-weight: 600;
}

.req::after {
    content: " *";
    color: var(--danger);
}

/* Sistema de Notificações Toast */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    padding: 16px 20px;
    min-width: 320px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s;
    border-left: 4px solid var(--accent);
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin: 0 0 4px 0;
    color: var(--ink);
}

.toast-message {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
    line-height: 1.4;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 20px;
    padding: 0;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--ink);
}

/* Tipos de toast */
.toast.success {
    border-left-color: #10b981;
}

.toast.success .toast-icon {
    color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.error .toast-icon {
    color: #ef4444;
}

.toast.warning {
    border-left-color: #f59e0b;
}

.toast.warning .toast-icon {
    color: #f59e0b;
}

.toast.info {
    border-left-color: #3b82f6;
}

.toast.info .toast-icon {
    color: #3b82f6;
}

/* Responsivo */
@media (max-width: 480px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: auto;
        max-width: 100%;
    }
}

/* Modal de Edição */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-2);
}

.modal-header h2 {
    color: var(--ink);
    font-size: 1.5em;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 28px;
    color: var(--muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--ink);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--surface-2);
}

/* Responsive para formulário de restaurante */
@media (max-width: 768px) {
    .checkbox-group {
        flex-direction: column;
    }

    .radio-group {
        flex-direction: column;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
}