:root {
    --bg-deep: #f4fbf6;
    --bg-mid: #e8f6ec;
    --bg-soft: #def0e5;
    --surface: #ffffff;
    --surface-soft: rgba(255, 255, 255, 0.98);
    --line: #cfe5d7;
    --ink: #1f4a32;
    --ink-soft: #5b7f69;
    --brand: #2f8f57;
    --brand-hover: #237043;
    --brand-2: #1d6a46;
    --danger: #b42318;
    --warning: #5e7e2e;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background:
        radial-gradient(circle at 8% 8%, rgba(255, 255, 255, 0.9), transparent 32%),
        radial-gradient(circle at 88% 18%, rgba(153, 214, 174, 0.32), transparent 34%),
        linear-gradient(135deg, var(--bg-deep) 0%, var(--bg-mid) 56%, var(--bg-soft) 100%);
    color: var(--ink);
}

a {
    color: var(--brand);
}

.brand-header {
    position: sticky;
    top: 0;
    z-index: 1000;

    max-width: 1120px;
    margin: 0 auto;
    padding: 12px 16px 8px;

    display: flex;
    justify-content: center;

    /* opcional: dá um leve fundo para não misturar com o conteúdo ao rolar */
    background: linear-gradient(
        135deg,
        rgba(234, 247, 238, 0.92) 0%,
        rgba(224, 243, 231, 0.92) 56%,
        rgba(216, 239, 224, 0.92) 100%
    );
    backdrop-filter: blur(6px);
}

.brand-card {
    display: flex;
    align-items: center;
    gap: 16px;

    width: min(100%, 920px);
    padding: 12px 16px;

    border: 1px solid rgba(188, 222, 201, 0.8);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(4px);
    color: var(--ink);
}

.brand-logo {
    width: 150px;   /* desktop */
    height: auto;
    display: block;
}

.brand-col {
    min-width: 0;
}

.brand-col-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.brand-col-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    text-align: left;
}

.brand-main-title {
    margin: 0;
    font-size: clamp(22px, 3vw, 36px);
    font-weight: 800;
    text-align: left;
    color: #1f5f3f;
    letter-spacing: 0.01em;
    text-wrap: balance;
}

.brand-title {
    margin: 0;
    font-size: clamp(20px, 1.5vw, 30px);
    font-weight: 600;
    color: #3d7355;
    text-align: left;
}

.page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 16px 16px 48px;
}

.panel {
    background: var(--surface-soft);
    border: 1px solid rgba(207, 229, 215, 0.95);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 16px;
    box-shadow: 0 12px 28px rgba(43, 103, 68, 0.14);
}

.panel h1,
.panel h2,
.panel h3 {
    margin-top: 0;
    color: #20543a;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    color: var(--ink-soft);
}

.kpis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.kpi {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    background: #f7fcf8;
}

.kpi .label {
    color: var(--ink-soft);
    font-size: 13px;
}

.kpi .value {
    font-size: 24px;
    font-weight: 700;
    margin-top: 6px;
}

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

.btn,
button,
input[type="submit"] {
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

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

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

.btn-secondary {
    background: var(--brand-2);
    color: #fff;
}

.btn-outline {
    border-color: var(--line);
    background: #fff;
    color: #2d5d43;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.form-row {
    margin-bottom: 12px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
    color: #25533a;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    background: #fff;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #2f8f57;
    outline: 2px solid rgba(47, 143, 87, 0.2);
    outline-offset: 0;
}

input[type="checkbox"] {
    width: auto;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 9px 7px;
    text-align: left;
    vertical-align: top;
}

thead th {
    font-size: 12px;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

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

.alert {
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
}

.alert-success {
    background: #eaf8ef;
    border-color: #bee7cb;
    color: #14532d;
}

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

.alert-warning {
    background: #f3faee;
    border-color: #d1e7bf;
    color: var(--warning);
}

.admin-topbar {
    background: transparent;
    border-bottom: 0;
}

.admin-topbar .inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(199, 227, 210, 0.9);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 24px rgba(39, 95, 63, 0.12);
}

.admin-brand {
    font-weight: 700;
    color: #245a3e;
}

.admin-subtitle {
    color: #5a7a66;
    font-size: 12px;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-nav a {
    color: #2b5f42;
    text-decoration: none;
    border: 1px solid #cfe5d7;
    background: #f1f8f3;
    padding: 6px 9px;
    border-radius: 10px;
    font-size: 13px;
}

.admin-nav a.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    background: #eaf6ee;
}

.coupon-numbers {
    font-size: 12px;
    color: #2a5d42;
    line-height: 1.35;
    white-space: normal;
}

.auth-panel {
    max-width: 560px;
    margin: 0 auto;
}

.cadastro-panel {
    max-width: 980px;
    margin: 0 auto;
}

.terms-row {
    margin-top: 4px;
}

.terms-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
    font-weight: 500;
    line-height: 1.35;
}

.terms-label input[type="checkbox"] {
    margin: 0;
    transform: translateY(-1px);
}

.form-actions {
    width: 100%;
    align-items: center;
}

.form-actions .btn-submit {
    margin-left: auto;
}

.qr-box {
    margin-top: 12px;
    padding: 10px;
    border: 1px solid #cfe5d7;
    border-radius: 12px;
    background: #ffffff;
    text-align: center;
}

.qr-box-inline {
    max-width: 280px;
}

.qr-title {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: #25533a;
}

.qr-image {
    width: 35%;
    max-width: 84px;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

@media (max-width: 900px) {
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .brand-header {
        padding: 8px 12px 6px;
    }

    .brand-card {
        width: 100%;
        padding: 8px 12px;
        gap: 10px;
        border-radius: 12px;
    }

    .brand-logo {
        width: 48px;  /* logo menor no mobile */
    }

    .brand-main-title {
        font-size: clamp(16px, 5vw, 22px);
        line-height: 1.15;
    }

    .brand-title {
        font-size: 13px;
    }

    .page {
        padding-top: 12px;
        padding-bottom: 28px;
    }

    .panel {
        padding: 16px;
        border-radius: 12px;
    }

    .admin-topbar .inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
    }

    .admin-nav {
        width: 100%;
    }

    .actions {
        flex-direction: column;
        align-items: stretch;
    }

    .actions .btn {
        text-align: center;
    }

    .terms-label {
        align-items: flex-start;
    }

    .form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 8px;
    }

    .form-actions .btn-submit {
        margin-left: 0;
    }

    .qr-box-inline {
        max-width: 100%;
    }

    .qr-image {
        max-width: 70px;
    }
}
