:root {
    --bg: #f6f7fb;
    --surface: #ffffff;
    --text: #16212f;
    --muted: #667085;
    --line: #dde3ea;
    --primary: #0f8b6f;
    --primary-dark: #0a6f59;
    --secondary: #2459d6;
    --soft-green: #e7f6f1;
    --soft-blue: #eaf0ff;
    --warning: #b7791f;
    --danger: #b42318;
    --shadow: 0 8px 24px rgba(22, 33, 47, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.45;
}

a {
    color: var(--primary-dark);
    text-decoration: none;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    font-size: 1.55rem;
    line-height: 1.15;
    margin-bottom: 0.4rem;
}

h2 {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
}

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

input,
select,
textarea {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    padding: 0.8rem 0.9rem;
}

textarea {
    resize: vertical;
}

label span,
legend {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.auth-body {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    background: #eef5f3;
}

.auth-shell,
.app-shell {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
}

.auth-shell {
    padding-top: 1.5rem;
}

.app-shell {
    padding: 5.25rem 1rem 6.25rem;
}

.brand-block,
.topbar-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-block {
    margin-bottom: 1rem;
}

.brand-block small,
.topbar-title small {
    display: block;
    color: var(--muted);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
}

.brand-mark.small {
    width: 40px;
    height: 40px;
    font-size: 0.85rem;
}

.topbar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 10;
    background: rgba(246, 247, 251, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
}

.topbar-inner {
    max-width: 760px;
    min-height: 68px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
}

.panel,
.metric-card,
.list-item,
.agenda-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.panel {
    padding: 1rem;
    box-shadow: var(--shadow);
}

.panel.slim {
    box-shadow: none;
}

.stack {
    display: grid;
    gap: 0.85rem;
}

.two-cols {
    display: grid;
    grid-template-columns: 1fr 96px;
    gap: 0.75rem;
}

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

.alert {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    font-weight: 700;
}

.alert-success {
    border-color: #a7e3d0;
    background: var(--soft-green);
    color: #075f4b;
}

.alert-error {
    border-color: #fecaca;
    background: #fff1f1;
    color: var(--danger);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    cursor: pointer;
    font-weight: 800;
    text-align: center;
}

.btn.primary {
    background: var(--primary);
    color: #fff;
}

.btn.primary:active {
    background: var(--primary-dark);
}

.btn.secondary {
    background: var(--soft-blue);
    color: var(--secondary);
    border-color: #c9d8ff;
}

.btn.ghost {
    background: #fff;
    color: var(--text);
    border-color: var(--line);
}

.btn.compact {
    width: auto;
    min-height: 44px;
    padding-inline: 1rem;
}

.auth-links {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    font-weight: 700;
}

.welcome {
    margin-bottom: 1rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.metric-card {
    padding: 1rem;
}

.metric-card span {
    display: block;
    color: var(--muted);
    font-weight: 700;
}

.metric-card strong {
    display: block;
    margin-top: 0.35rem;
    font-size: 1.55rem;
}

.metric-card.accent {
    border-color: #a7e3d0;
    background: var(--soft-green);
}

.quick-actions {
    display: grid;
    gap: 0.75rem;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem 0 0.75rem;
}

.section-head h1,
.section-head h2,
.section-head p {
    margin-bottom: 0;
}

.filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.choice-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.choice-group legend {
    grid-column: 1 / -1;
}

.choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choice span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-weight: 800;
}

.choice input:checked + span {
    border-color: var(--primary);
    background: var(--soft-green);
    color: var(--primary-dark);
}

.money-input {
    min-height: 60px;
    font-size: 1.45rem;
    font-weight: 800;
}

.list,
.agenda-list,
.mini-list {
    display: grid;
    gap: 0.75rem;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem;
}

.list-item strong,
.list-item span,
.list-item small {
    display: block;
}

.list-item span,
.list-item small,
.agenda-main small {
    color: var(--muted);
}

.small-link,
.link-danger {
    border: 0;
    background: transparent;
    color: var(--primary-dark);
    cursor: pointer;
    font-weight: 800;
    padding: 0.2rem 0;
}

.link-danger {
    color: var(--danger);
}

.row-actions {
    display: grid;
    justify-items: end;
    gap: 0.35rem;
    flex-shrink: 0;
}

.row-actions form {
    margin: 0;
}

.empty {
    margin: 0;
    padding: 1rem;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    text-align: center;
}

.date-divider {
    margin: 0.75rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.agenda-item {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 0.75rem;
    padding: 0.9rem;
}

.agenda-time {
    color: var(--secondary);
    font-weight: 800;
}

.agenda-main p {
    margin: 0.35rem 0;
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 8px;
    padding: 0.2rem 0.55rem;
    background: var(--soft-blue);
    color: var(--secondary);
    font-size: 0.82rem;
    font-weight: 800;
}

.badge.soft {
    background: #f2f4f7;
    color: var(--muted);
}

.status-cancelado {
    opacity: 0.72;
}

.mini-list > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
}

.mini-list > div:last-child {
    border-bottom: 0;
}

.danger-panel {
    margin-top: 1rem;
    box-shadow: none;
}

.bottom-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(22, 33, 47, 0.08);
}

.bottom-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.bottom-nav a.active {
    color: var(--primary-dark);
    background: var(--soft-green);
}

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

    .filters {
        grid-template-columns: 1fr 1fr auto;
        align-items: end;
    }

    .filters .btn {
        width: auto;
        min-width: 120px;
    }

    .quick-actions {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 420px) {
    .two-cols {
        grid-template-columns: 1fr;
    }

    .agenda-item {
        grid-template-columns: 48px 1fr;
    }

    .agenda-item .row-actions {
        grid-column: 1 / -1;
        display: flex;
        justify-content: flex-end;
    }

    .auth-links {
        display: grid;
    }
}
