* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', Roboto, system-ui, sans-serif;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

body {
    background: linear-gradient(145deg, #EB8302 0%, #c46a00 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #EB8302 0%, #c46a00 100%);
    color: white;
    padding: 32px;
    text-align: center;
}

.header h1 {
    font-size: clamp(32px, 6vw, 48px);
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff, #ffd89b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    font-size: clamp(14px, 4vw, 18px);
    opacity: 0.9;
    color: #ffe0d6;
}

.tabs {
    display: flex;
    background: #fff5f2;
    padding: 0 24px;
    gap: 8px;
    overflow-x: auto;
    border-bottom: 1px solid #ffded6;
}

.tab {
    padding: 20px 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: #d1583c;
    font-size: clamp(13px, 3.8vw, 15px);
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
}

.tab:hover {
    color: #EB8302;
}

.tab.active {
    color: #EB8302;
    border-bottom-color: #EB8302;
}

.tab-content {
    display: none;
    padding: 32px;
    background: white;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    color: #0f172a;
    font-size: clamp(24px, 5.5vw, 32px);
    font-weight: 700;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 12px;
}

h2::before {
    content: '';
    width: 6px;
    height: 36px;
    background: linear-gradient(to bottom, #EB8302, #f5a623);
    border-radius: 4px;
}

h3 {
    color: #334155;
    font-size: clamp(18px, 4.5vw, 22px);
    font-weight: 600;
    margin: 28px 0 20px;
}

.grid-2, .grid-3 {
    display: grid;
    gap: 24px;
}

.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }

@media (min-width: 640px) {
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    border: 1px solid #fee2da;
    transition: all 0.3s;
    box-shadow: 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card:hover {
    border-color: #fdba9a;
    transform: translateY(-2px);
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #475569;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input, select, textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #fee2da;
    border-radius: 16px;
    font-size: 14px;
    background: #fffaf8;
    transition: all 0.3s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #EB8302;
    background: white;
    box-shadow: 0 0 0 4px rgba(235, 131, 2, 0.1);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (min-width: 480px) {
    .radio-group {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

.radio-option {
    background: #fffaf8;
    border: 1px solid #fee2da;
    border-radius: 40px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    color: #d1583c;
}

.radio-option.selected {
    border-color: #EB8302;
    background: #fff0eb;
    color: #c46a00;
}

.radio-option input {
    width: auto;
    margin: 0;
}

.btn {
    padding: 16px 32px;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(145deg, #EB8302, #c46a00);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(145deg, #c46a00, #a35900);
    transform: translateY(-2px);
}

.btn-secondary {
    background: #fff0eb;
    color: #d1583c;
    border: 1px solid #fee2da;
}

.btn-success {
    background: linear-gradient(145deg, #10b981, #059669);
    color: white;
}

.btn-danger {
    background: linear-gradient(145deg, #ef4444, #dc2626);
    color: white;
}

.btn-warning {
    background: linear-gradient(145deg, #f59e0b, #d97706);
    color: white;
}

.perfil-row {
    background: white;
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 16px;
    border: 1px solid #fee2da;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 480px) {
    .perfil-row {
        grid-template-columns: 2fr 1fr 1fr 45px;
        align-items: center;
        padding: 14px;
    }
}

.custo-previsto {
    font-weight: 700;
    color: #EB8302;
    text-align: right;
    background: #fff0eb;
    padding: 8px 12px;
    border-radius: 12px;
}

.remove-btn {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 19px;
    cursor: pointer;
    font-size: 16px;
    width: 38px;
    height: 38px;
}

.remove-btn:hover {
    background: #dc2626;
    color: white;
}

.price-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin: 32px 0;
}

@media (min-width: 640px) {
    .price-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.price-box {
    background: linear-gradient(145deg, #fffaf8, #fff5f2);
    border-radius: 32px;
    padding: 32px 20px;
    text-align: center;
    border: 1px solid #fee2da;
    transition: all 0.3s;
}

.price-box:hover {
    transform: translateY(-5px);
}

.price-box h4 {
    color: #d1583c;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.price-box .price {
    font-size: clamp(36px, 7vw, 48px);
    font-weight: 800;
    color: #0f172a;
}

.alert {
    padding: 16px 20px;
    border-radius: 16px;
    margin-bottom: 15px;
    font-weight: 500;
    border-left: 4px solid transparent;
}

.alert-critical {
    background: #fef2f2;
    color: #b91c1c;
    border-left-color: #dc2626;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-left-color: #f59e0b;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border-left-color: #10b981;
}

.alert-info {
    background: #fef3f2;
    color: #c46a00;
    border-left-color: #EB8302;
}

.table-responsive {
    overflow-x: auto;
    border-radius: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #fee2da;
}

th {
    background: #fff5f2;
    color: #d1583c;
    padding: 16px 14px;
    font-weight: 600;
    font-size: 13px;
    text-align: left;
    border-bottom: 2px solid #fee2da;
}

td {
    padding: 14px 12px;
    border-bottom: 1px solid #fee2da;
    font-size: 13px;
    color: #475569;
}

tr:hover td {
    background: #fffaf8;
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fed7aa; color: #9a3412; }
.badge-danger { background: #fee2e2; color: #b91c1c; }

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 40px;
    padding: 32px;
    max-width: 550px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #fee2da;
}

.modal-close {
    background: #fff0eb;
    border: none;
    font-size: 28px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 20px;
    color: #d1583c;
}

.historico-item {
    background: white;
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 16px;
    border: 1px solid #fee2da;
    cursor: pointer;
    transition: all 0.3s;
}

.historico-item:hover {
    border-color: #fdba9a;
    transform: translateX(6px);
}

.historico-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.historico-titulo {
    font-weight: 700;
    font-size: 16px;
    color: #0f172a;
}

.historico-acoes {
    display: flex;
    gap: 8px;
}

.historico-acoes button {
    width: 38px;
    height: 38px;
    border-radius: 19px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    background: #fff0eb;
    color: #d1583c;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

@media (min-width: 480px) {
    .button-group {
        flex-direction: row;
        justify-content: flex-end;
    }
}

.info-text {
    color: #64748b;
    font-size: 13px;
    margin-top: 6px;
}

.mt-4 { margin-top: 24px; }

.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: white;
    padding: 16px 28px;
    border-radius: 50px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    animation: slideInRight 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid #EB8302;
}

.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: #ef4444; }
.toast.warning { border-left-color: #f59e0b; }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(235, 131, 2, 0.2);
    border-radius: 50%;
    border-top-color: #EB8302;
    animation: spin 1s ease-in-out infinite;
}

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

/* TELA DE LOGIN */
.tela-login {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #EB8302 0%, #c46a00 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 10000;
}

.login-container {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 48px;
    padding: 48px 40px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h1 {
    font-size: 64px;
    background: linear-gradient(135deg, #EB8302, #f5a623);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    color: #d1583c;
    margin-top: 8px;
}

.btn-login {
    background: linear-gradient(145deg, #EB8302, #c46a00);
    color: white;
    border: none;
    padding: 18px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 17px;
    cursor: pointer;
    width: 100%;
}

.btn-login:hover {
    background: linear-gradient(145deg, #c46a00, #a35900);
    transform: translateY(-2px);
}

.login-error {
    background: #fef2f2;
    color: #b91c1c;
    padding: 16px;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 20px;
}

/* DASHBOARD */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 24px;
}

@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.chart-card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    border: 1px solid #fee2da;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: linear-gradient(145deg, #fffaf8, #fff5f2);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid #fee2da;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: #EB8302;
}

.chart-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.chart-btn {
    background: #fff0eb;
    border: 1px solid #fee2da;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13px;
    cursor: pointer;
    color: #d1583c;
}

.chart-btn.active {
    background: #EB8302;
    color: white;
    border-color: #EB8302;
}

.paginacao {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 2px solid #fee2da;
}

.paginacao-controles {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 16px;
}

.paginacao-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid #fee2da;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    color: #d1583c;
}

.paginacao-btn.active {
    background: #EB8302;
    color: white;
    border-color: #EB8302;
}

.itens-por-pagina {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #fffaf8;
    border-radius: 16px;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #fff0eb;
    border-radius: 4px;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #EB8302;
}
