:root {
    --navy: #0a0a0a;
    --blue: #facc15;
    --blue2: #eab308;
    --bg: #030303;

    --card: #fff;
    --text: #111;
    --muted: #2f2f30;
    --line: #e5e5e5;

    --green: #16a36a;
    --red: #dc3b4a;
    --yellow: #facc15;

    --shadow: 0 8px 24px rgba(0, 0, 0, 0.09);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: var(--bg);
    color: var(--blue2);
}

body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
    -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(250, 204, 21, 0.3);
    outline-offset: 1px;
}

/* =========================
   TOPBAR
========================= */

.topbar {
    background: var(--navy);
    color: #fff;
    padding: calc(14px + env(safe-area-inset-top)) 18px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 20;
}

.eyebrow {
    font-size: 10px;
    letter-spacing: 0.12em;
    opacity: 0.65;
    font-weight: 800;
}

.topbar h1 {
    font-size: 21px;
    margin: 3px 0 0;
}

/* =========================
   MAIN
========================= */

.main {
    max-width: 980px;
    margin: 0 auto;
    padding: 18px 16px 28px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 5px 0 15px;
}

h2 {
    font-size: 22px;
    margin: 0;
}

.sub {
    color: var(--card);
    font-size: 13px;
    margin: 5px 0 0;
}

.icon-btn {
    border: 0;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 12px;
    width: 42px;
    height: 42px;
}

/* =========================
   GRID / STATS
========================= */

.grid {
    display: grid;
    gap: 12px;
}

.stats {
    grid-template-columns: repeat(2, 1fr);
}

.stat {
    background: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.stat .label {
    font-size: 12px;
    color: var(--card);
}

.stat .value {
    font-size: 23px;
    font-weight: 850;
    margin-top: 7px;
}

.stat.green .value {
    color: var(--green);
}

/* =========================
   BUTTONS
========================= */

.primary {
    background: var(--yellow);
    color: #0a0a0a;
    border: 0;
    border-radius: 15px;
    min-height: 50px;
    padding: 0 18px;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(250, 204, 21, 0.24);
}

.secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 13px;
    min-height: 44px;
    padding: 0 15px;
    font-weight: 700;
}

.danger {
    color: var(--red);
    border-color: #f2c5ca;
}

.full {
    width: 100%;
}

/* =========================
   HERO / LIST / CARDS
========================= */

.hero-action {
    margin: 16px 0;
}

.list {
    display: grid;
    gap: 10px;
}

.card {
    background: var(--muted);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 15px;
}

.order-card {
    width: 100%;
    text-align: left;
}

.row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.order-name {
    font-weight: 800;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 12px;
}

.money {
    font-weight: 850;
}

/* =========================
   TAGS
========================= */

.tag {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    background: #edf2f7;
    color: #52606d;
}

.tag.paid {
    background: #e7f7ef;
    color: #087a4b;
}

.tag.due {
    background: #fff3df;
    color: #a25a00;
}

.order-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 8px;
}

.order-services {
    font-size: 12px;
    color: #5d6979;
    margin-top: 7px;
}

/* =========================
   BOTTOM NAV
========================= */

.bottom-nav {
    position: fixed;
    z-index: 30;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--navy);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 7px 5px calc(7px + env(safe-area-inset-bottom));
}

.nav-item {
    border: 0;
    background: none;
    color: var(--card);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 5px 2px;
}

.nav-item span {
    font-size: 21px;
    line-height: 20px;
    font-weight: 800;
}

.nav-item small {
    font-size: 10px;
    font-weight: 700;
}

.nav-item.active {
    color: var(--yellow);
}

/* =========================
   FORMS
========================= */

.form {
    display: grid;
    gap: 15px;
}

.field {
    display: grid;
    gap: 7px;
    position: relative;
}

.field label {
    font-size: 12px;
    font-weight: 800;
    color: #536074;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    min-height: 48px;
    border: 1px solid #dce3ec;
    border-radius: 13px;
    background: var(--muted);
    padding: 12px 13px;
    color: var(--text);
    font-size: 16px;
}

.field textarea {
    min-height: 92px;
    resize: vertical;
}

/* =========================
   SUGGESTIONS
========================= */

.suggestions {
    position: absolute;
    top: 77px;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 13px;
    box-shadow: var(--shadow);
    z-index: 10;
    overflow: hidden;
}

.suggestion {
    display: block;
    width: 100%;
    text-align: left;
    background: #fff;
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px;
}

.suggestion:last-child {
    border: 0;
}

.suggestion b {
    display: block;
}

/* =========================
   SERVICES
========================= */

.service-picker {
    display: grid;
    gap: 8px;
}

.service-option {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--text);
}

.service-option input {
    width: 20px;
    height: 20px;
    accent-color: var(--yellow);
}

.service-option .price {
    margin-left: auto;
    font-weight: 800;
}

/* =========================
   TOTAL
========================= */

.total-bar {
    position: sticky;
    bottom: calc(66px + env(safe-area-inset-bottom));
    z-index: 8;
    background: var(--navy);
    border: 1px solid var(--line);
    box-shadow: 0 -8px 25px rgba(10, 25, 50, 0.08);
    border-radius: 17px;
    padding: 13px;
    margin-top: 3px;
}

.total-bar strong {
    font-size: 23px;
}

/* =========================
   PAGAMENTOS
========================= */

.payment-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.periods {
    display: flex;
    gap: 7px;
    overflow: auto;
    padding-bottom: 2px;
}

.period-btn {
    white-space: nowrap;
}

.period-btn.active {
    background: var(--muted);
    color: var(--card);
    border-color: var(--muted);
}

/* =========================
   EMPTY STATE
========================= */

.empty {
    text-align: center;
    padding: 32px 18px;
    color: var(--muted);
}

.empty strong {
    display: block;
    color: var(--card);
    margin-bottom: 6px;
}

/* =========================
   SERVICE TABLE
========================= */

.table-like {
    display: grid;
    gap: 8px;
}

.service-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 9px;
    align-items: center;
}

.service-row .price {
    font-weight: 800;
}

/* =========================
   TOGGLE
========================= */

.toggle {
    width: 46px;
    height: 27px;
    border-radius: 20px;
    border: 0;
    background: var(--text);
    position: relative;
}

.toggle::after {
    content: "";
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: var(--card);
    position: absolute;
    top: 3px;
    left: 3px;
    transition: 0.15s;
}

.toggle.on {
    background: var(--green);
}

.toggle.on::after {
    left: 22px;
}

/* =========================
   MODAL
========================= */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(6, 16, 30, 0.55);
    z-index: 60;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal {
    background: var(--bg);
    width: 100%;
    max-width: 640px;
    border-radius: 22px 22px 0 0;
    max-height: 92vh;
    overflow: auto;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.modal-head h3 {
    margin: 0;
    font-size: 20px;
}

/* =========================
   ACTIONS / TOAST
========================= */

.actions {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
}

.actions > * {
    flex: 1;
    min-width: 130px;
}

.toast-root {
    position: fixed;
    z-index: 100;
    left: 16px;
    right: 16px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    display: grid;
    gap: 8px;
}

.toast {
    background: var(--navy);
    color: #fff;
    border-radius: 13px;
    padding: 13px 15px;
    box-shadow: var(--shadow);
    animation: in 0.2s ease;
}

.toast.error {
    background: #8d2430;
}

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

    to {
        transform: none;
        opacity: 1;
    }
}

/* =========================
   DETAILS
========================= */

.detail-grid {
    display: grid;
    gap: 10px;
}

.detail-line {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    border-bottom: 1px solid var(--line);
    padding: 9px 0;
}

.detail-line:last-child {
    border: 0;
}

/* =========================
   RESPONSIVE
========================= */

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

    .main {
        padding: 28px 24px;
    }

    .bottom-nav {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: min(720px, 100%);
        border: 1px solid var(--line);
        border-bottom: 0;
        border-radius: 20px 20px 0 0;
    }

    .modal-backdrop {
        align-items: center;
    }

    .modal {
        border-radius: 22px;
    }

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

    .service-picker {
        grid-template-columns: 1fr 1fr;
    }
}

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

    .stats .value {
        font-size: 20px;
    }
}