:root {
    --ink: #13251d;
    --muted: #607269;
    --green: #2f7355;
    --dark: #184b36;
    --mint: #e9f4ed;
    --line: #dce6df;
    --orange: #d98145;
    --paper: #fafbf8;
}

* { box-sizing: border-box; }
html { background: #eef1ee; }
body {
    margin: 0;
    background: #eef1ee;
    color: var(--ink);
    font: 18px/1.4 Arial, sans-serif;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
input, select {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 13px 14px;
    background: white;
    color: var(--ink);
    outline: none;
}
input:focus, select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px #2f73551a;
}
h2 {
    font: 700 34px/1.12 Georgia, serif;
    letter-spacing: -.4px;
    margin: 4px 0;
}
.primary {
    border: 0;
    background: var(--dark);
    color: white;
    border-radius: 12px;
    padding: 14px 20px;
    font-weight: 800;
}

/* Login */
.login {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(360px, 560px) 1fr;
}
.login-card {
    padding: clamp(32px, 8vw, 90px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--paper);
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}
.brand-logo {
    width: 54px;
    height: 54px;
    flex: 0 0 auto;
    object-fit: cover;
    border-radius: 17px;
    box-shadow: 0 8px 20px #183d2925;
}
.brand-logo.large {
    width: 70px;
    height: 70px;
    border-radius: 22px;
}
.brand small, .login-card > small, .heading > div > small, .settings > small, .faq-page > small, .modal-head small {
    color: var(--green);
    font-size: 13px;
    letter-spacing: 1.9px;
    font-weight: 800;
}
.brand h1 {
    font: 700 29px/1 Georgia, serif;
    margin: 4px 0 0;
}
.login-card .brand { margin-bottom: 75px; }
.login h2 {
    font-size: 42px;
    margin: 9px 0;
}
.login p {
    color: var(--muted);
    line-height: 1.55;
}
.login form {
    display: grid;
    gap: 18px;
    margin-top: 20px;
}
.login label {
    display: grid;
    gap: 8px;
    font-size: 15px;
    font-weight: 800;
}
.login input { padding: 15px; }
.login form button { margin-top: 4px; }
.login aside {
    background: linear-gradient(135deg, #123d2b, #2d7553);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8vw;
}
.login aside span { color: #bdd5c5; font-size: 20px; }
.login aside strong {
    font: 700 clamp(40px, 5vw, 72px)/1.08 Georgia, serif;
    margin-top: 12px;
}
.error {
    color: #a64338;
    background: #fae8e5;
    padding: 11px;
    border-radius: 9px;
}

/* Estrutura principal */
.app {
    min-height: 100vh;
    max-width: 1180px;
    margin: auto;
    background: var(--paper);
    padding-bottom: 110px;
    box-shadow: 0 0 70px #172a2112;
}
.app header {
    height: 92px;
    display: flex;
    align-items: center;
    padding: 0 42px;
    border-bottom: 1px solid var(--line);
    background: #fffffff2;
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 5;
}
.user {
    margin-left: auto;
    color: var(--muted);
    font-size: 15px;
}
.user a {
    margin-left: 16px;
    text-decoration: none;
    color: var(--dark);
    font-weight: 800;
    border: 1px solid var(--line);
    padding: 10px 14px;
    border-radius: 10px;
    background: white;
}
#content { padding: 44px; }
.welcome, .heading, .section-title {
    display: flex;
    justify-content: space-between;
    align-items: end;
}
.welcome p { margin: 0; color: var(--muted); font-size: 17px; }
.period {
    display: flex;
    gap: 10px;
    align-items: center;
}
.period span { color: var(--muted); font-size: 15px; font-weight: 700; }

/* Painel */
.hero {
    margin-top: 25px;
    background: linear-gradient(125deg, #173f2e, #347557);
    color: white;
    padding: 31px 32px;
    border-radius: 24px;
    box-shadow: 0 15px 35px #214d3530;
}
.hero-top {
    display: flex;
    justify-content: space-between;
    align-items: start;
}
.hero small {
    letter-spacing: 1.6px;
    color: #c9ddcf;
    font-weight: 800;
    font-size: 13px;
}
.hero strong {
    font: 700 46px Georgia, serif;
    display: block;
    margin-top: 8px;
}
.trend {
    padding: 9px 13px;
    border-radius: 20px;
    border: 1px solid #ffffff20;
    background: #ffffff16;
    font-size: 14px;
    font-weight: 800;
}
.trend.negative { background: #b54a4229; color: #ffd9d4; }
.hero-foot {
    border-top: 1px solid #ffffff2b;
    padding-top: 18px;
    margin-top: 26px;
    display: flex;
    gap: 52px;
}
.hero-foot div { display: grid; gap: 5px; }
.hero-foot b { font-size: 18px; }
.reserve-breakdown {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 9px;
    margin-top: 13px;
}
.reserve-breakdown span {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
    color: var(--muted);
    font-size: 14px;
}
.reserve-breakdown b { color: var(--ink); }
.section-title { margin: 34px 0 14px; }
.section-title h3 {
    font: 700 23px Georgia, serif;
    margin: 0;
}
.section-title span {
    color: var(--muted);
    font-size: 14px;
    text-transform: capitalize;
}
.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.card {
    display: grid;
    gap: 7px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: white;
    box-shadow: 0 7px 20px #18271d08;
}
.card span, .card small { color: var(--muted); font-size: 14px; }
.card strong { font-size: 24px; }
.productivity {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #eff4f0;
    border-radius: 18px;
    padding: 23px 12px;
}
.productivity div {
    text-align: center;
    border-right: 1px solid var(--line);
    display: grid;
    gap: 6px;
}
.productivity div:last-child { border: 0; }
.productivity b { font: 700 25px Georgia, serif; }
.productivity span { color: var(--muted); font-size: 15px; }
.performance {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.performance div {
    display: grid;
    gap: 8px;
    padding: 19px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: white;
}
.performance span { color: var(--muted); font-size: 15px; }
.performance strong { font-size: 21px; }

/* Histórico */
.heading { margin-bottom: 26px; }
.page-hint {
    color: var(--muted);
    font-size: 15px;
    margin: 8px 0 0;
}
.list { display: grid; gap: 11px; }
.row {
    display: grid;
    grid-template-columns: 50px 1fr auto 26px;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: white;
}
.row.clickable {
    cursor: pointer;
    transition: .18s ease;
}
.row.clickable:hover {
    border-color: #acc7b7;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px #18271d0b;
}
.date {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--mint);
    display: grid;
    place-content: center;
    text-align: center;
}
.date b { font-size: 20px; }
.date small {
    color: var(--green);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}
.info, .value { display: grid; gap: 4px; }
.info span, .value span { color: var(--muted); font-size: 14px; }
.value { text-align: right; }
.value b { color: var(--green); }
.row-chevron { color: #8ca095; font-size: 28px; }
.empty-state {
    color: var(--muted);
    text-align: center;
    padding: 50px 20px;
    border: 1px dashed var(--line);
    border-radius: 16px;
}

/* Ajustes e FAQ */
.settings, .faq-page {
    max-width: 760px;
    margin: auto;
}
.settings {
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: white;
}
.settings > p, .faq-intro {
    color: var(--muted);
    font-size: 16px;
    margin: 10px 0 28px;
}
.settings > label {
    display: block;
    border-top: 1px solid var(--line);
    padding: 20px 0;
}
.settings > label > span {
    display: block;
    margin-bottom: 9px;
    font-size: 16px;
    font-weight: 800;
}
.settings label small {
    display: block;
    color: var(--muted);
    font-size: 14px;
    font-weight: 400;
    margin-top: 8px;
}
.money, .percent { display: flex; }
.money i, .percent i {
    width: 48px;
    display: grid;
    place-items: center;
    background: #edf2ee;
    border: 1px solid var(--line);
    font-style: normal;
    font-weight: 700;
}
.money i {
    border-right: 0;
    border-radius: 10px 0 0 10px;
}
.money input {
    flex: 1;
    min-width: 0;
    border-radius: 0 10px 10px 0;
}
.percent input {
    flex: 1;
    min-width: 0;
    border-radius: 10px 0 0 10px;
}
.percent i {
    border-left: 0;
    border-radius: 0 10px 10px 0;
}
.formula-note {
    display: grid;
    gap: 5px;
    padding: 17px;
    border-radius: 12px;
    background: var(--mint);
    font-size: 15px;
}
.formula-note span { color: #557064; }
.settings > .primary { width: 100%; margin-top: 19px; }
.faq-item {
    margin-bottom: 11px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: white;
}
.faq-item summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    list-style: none;
    cursor: pointer;
    font-size: 17px;
    font-weight: 800;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary span {
    color: var(--green);
    font-size: 23px;
    transition: .2s;
}
.faq-item[open] summary span { transform: rotate(45deg); }
.faq-item > div {
    border-top: 1px solid var(--line);
    padding: 4px 20px 18px;
    color: #53645b;
    line-height: 1.65;
    font-size: 16px;
}

/* Navegação e modais */
nav {
    position: fixed;
    z-index: 6;
    left: 50%;
    bottom: 15px;
    transform: translateX(-50%);
    display: flex;
    gap: 3px;
    padding: 7px;
    border-radius: 18px;
    background: #172a21f3;
    box-shadow: 0 12px 30px #0003;
}
nav button {
    display: flex;
    align-items: center;
    gap: 7px;
    border: 0;
    border-radius: 12px;
    background: none;
    color: #b1beb7;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 800;
}
nav button i { font-style: normal; font-size: 19px; line-height: 1; }
nav button.active { background: white; color: var(--dark); }
.fab {
    position: fixed;
    z-index: 7;
    right: max(calc((100vw - 1100px) / 2), 25px);
    bottom: 27px;
    width: 51px;
    height: 51px;
    border: 0;
    border-radius: 15px;
    background: var(--orange);
    color: white;
    font-size: 30px;
    box-shadow: 0 8px 20px #a9502745;
}
.backdrop {
    position: fixed;
    z-index: 20;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 19px;
    background: #10221999;
    backdrop-filter: blur(5px);
}
.modal {
    width: min(720px, 100%);
    max-height: 94vh;
    overflow: auto;
    padding: 28px;
    border-radius: 23px;
    background: #fbfcfa;
    box-shadow: 0 25px 70px #0005;
}
.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 22px;
}
.modal-head button {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #e9efeb;
    font-size: 21px;
}
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.grid label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
}
.grid input, .grid select { width: 100%; }
.preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    padding: 16px;
    border-radius: 12px;
    background: var(--mint);
}
.preview span { color: var(--muted); font-size: 14px; }
.preview b { color: var(--dark); font-size: 20px; }
.delivery-form > .primary { width: 100%; }
.detail-modal { width: min(780px, 100%); }
.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.detail-grid div {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
}
.detail-grid span { color: var(--muted); font-size: 14px; }
.detail-grid b { font-size: 17px; }
.detail-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 21px;
}
.detail-actions button { min-width: 145px; }
.danger {
    border: 0;
    border-radius: 11px;
    padding: 13px;
    background: #a8463c;
    color: white;
    font-weight: 800;
}
.danger.ghost { background: #f9e7e4; color: #9e4036; }
.confirm {
    max-width: 420px;
    text-align: center;
}
.confirm-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #f9e7e4;
    color: #a53f35;
    font-size: 26px;
    font-weight: 900;
}
.confirm p { color: var(--muted); line-height: 1.55; }
.actions { display: flex; gap: 10px; margin-top: 22px; }
.actions button { flex: 1; }
.cancel {
    border: 0;
    border-radius: 11px;
    padding: 13px;
    background: #edf1ee;
    color: var(--ink);
    font-weight: 800;
}
#toast {
    position: fixed;
    z-index: 30;
    left: 50%;
    bottom: 102px;
    transform: translateX(-50%);
    display: none;
    padding: 13px 20px;
    border-radius: 12px;
    background: var(--dark);
    color: white;
    box-shadow: 0 12px 30px #0003;
    font-size: 15px;
}

@media (max-width: 720px) {
    body { font-size: 17px; }
    .login { grid-template-columns: 1fr; }
    .login aside { display: none; }
    .login-card { min-height: 100vh; padding: 28px 24px; }
    .login-card .brand { margin-bottom: 65px; }
    .login h2 { font-size: 35px; }
    .app { width: 100%; box-shadow: none; }
    .app header { height: 79px; padding: 0 16px; }
    .brand-logo { width: 46px; height: 46px; border-radius: 14px; }
    .brand h1 { font-size: 25px; }
    .brand small { font-size: 10px; letter-spacing: 1.5px; }
    .user > b, .user { font-size: 0; }
    .user a { margin-left: 8px; font-size: 14px; }
    #content { padding: 27px 17px; }
    h2 { font-size: 28px; }
    .welcome { align-items: start; }
    .welcome h2 { max-width: 220px; font-size: 27px; }
    .period span { display: none; }
    .period select { width: 140px; padding: 10px; font-size: 14px; }
    .hero { padding: 25px 22px; border-radius: 21px; }
    .hero strong { font-size: 36px; }
    .trend { font-size: 12px; padding: 7px 9px; }
    .hero-foot { justify-content: space-between; gap: 9px; }
    .hero-foot b { font-size: 15px; }
    .reserve-breakdown { grid-template-columns: 1fr 1fr; }
    .cards { grid-template-columns: 1fr; }
    .productivity { grid-template-columns: 1fr 1fr; gap: 21px 0; }
    .productivity div:nth-child(2) { border: 0; }
    .performance { grid-template-columns: 1fr; }
    .heading { align-items: end; gap: 10px; }
    .heading h2 { font-size: 28px; }
    .heading .primary { padding: 12px 14px; font-size: 14px; white-space: nowrap; }
    .row { grid-template-columns: 45px 1fr auto 18px; gap: 9px; padding: 12px; }
    .date { width: 45px; height: 45px; }
    .info span, .value span { font-size: 13px; }
    .settings { padding: 24px 18px; }
    nav {
        bottom: 10px;
        width: calc(100% - 24px);
        justify-content: space-around;
    }
    nav button {
        flex: 1;
        flex-direction: column;
        gap: 2px;
        padding: 8px 5px;
        font-size: 13px;
    }
    nav button i { font-size: 20px; }
    .fab { right: 18px; bottom: 94px; }
    .grid { grid-template-columns: 1fr 1fr; }
    .modal { padding: 23px 18px; }
    .detail-grid { grid-template-columns: 1fr 1fr; }
    .detail-actions button { min-width: 0; flex: 1; }
}

@media (max-width: 430px) {
    .hero strong { font-size: 31px; }
    .trend { max-width: 90px; text-align: center; }
    .grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .preview { align-items: start; flex-direction: column; }
}
