/* Pede7 - Link de Pedidos | painel administrativo */

:root,
html[data-theme="light"] {
    color-scheme: light;
    --brand: #ff5a1f;
    --brand-2: #ff3d5e;
    --ink: #14161f;
    --ink-soft: #5a6275;
    --line: #e6e9f0;
    --bg: #f7f8fc;
    --card: #ffffff;
    --sidebar: #12131a;
    --ok: #12a150;
    --danger: #e13c3c;
    --radius: 14px;
    --shadow: 0 8px 28px rgba(20, 22, 31, .06);
    --surface: #ffffff;
    --surface-2: #f3f5fa;
    --input-bg: #ffffff;
    --code-bg: #eef1f7;
    --label: #2a3142;
    --hover: #fbfcfe;
    --auth-card: #ffffff;
    --auth-bg:
        radial-gradient(90% 70% at 50% -15%, rgba(255, 122, 47, .18) 0%, transparent 55%),
        radial-gradient(70% 50% at 100% 10%, rgba(255, 61, 94, .08) 0%, transparent 45%),
        linear-gradient(180deg, #fff8f4 0%, #f7f8fc 42%, #eef1f7 100%);
    --auth-shadow: 0 24px 60px rgba(20, 22, 31, .10);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --ink: #e8eaef;
    --ink-soft: #9aa3b5;
    --line: #2a2f3c;
    --bg: #0e1016;
    --card: #171a22;
    --sidebar: #0a0b10;
    --shadow: 0 8px 28px rgba(0, 0, 0, .45);
    --surface: #171a22;
    --surface-2: #1c202b;
    --input-bg: #12151c;
    --code-bg: #222733;
    --label: #c5cad6;
    --hover: #1c212c;
    --auth-card: #171a22;
    --auth-bg: radial-gradient(120% 80% at 50% 0%, #17181f 0%, #07080c 60%);
    --auth-shadow: 0 30px 70px rgba(0, 0, 0, .45);
}

* , *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
code { background: var(--code-bg); padding: 1px 6px; border-radius: 6px; font-size: .85em; color: var(--ink); }

/* ---------------- theme toggle ---------------- */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1;
    flex: 0 0 auto;
    transition: transform .15s ease, border-color .15s ease, background .15s ease, color .15s ease;
}
.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
    color: var(--brand);
}
.theme-toggle .theme-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}
.theme-toggle .theme-icon svg {
    grid-area: 1 / 1;
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
}
/* Claro = mostra lua | Escuro = mostra sol */
.theme-toggle .theme-icon svg.theme-icon-sun { display: none; }
.theme-toggle .theme-icon svg.theme-icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle .theme-icon svg.theme-icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .theme-icon svg.theme-icon-moon { display: none; }
.theme-toggle.top,
.theme-toggle.float {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
    bottom: auto;
    z-index: 70;
    box-shadow: var(--shadow);
}
html[data-theme="dark"] .theme-toggle.top,
html[data-theme="dark"] .theme-toggle.float {
    background: #1c202b;
    border-color: #333948;
}
.theme-toggle-inline {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 9px;
    vertical-align: middle;
    margin-right: 4px;
}
.theme-toggle-inline .theme-icon,
.theme-toggle-inline .theme-icon svg {
    width: 16px;
    height: 16px;
}
/* ?cone do tema do LINK (independente do tema do painel) */
.theme-toggle.is-link-theme .theme-icon svg.theme-icon-sun { display: none; }
.theme-toggle.is-link-theme .theme-icon svg.theme-icon-moon { display: block; }
.theme-toggle.is-link-theme[data-page-theme="dark"] .theme-icon svg.theme-icon-sun { display: block; }
.theme-toggle.is-link-theme[data-page-theme="dark"] .theme-icon svg.theme-icon-moon { display: none; }
.page-theme-form { display: inline-flex; margin: 0; }
.open-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: var(--surface);
    cursor: pointer;
    transition: transform .15s ease, border-color .15s ease, background .15s ease, color .15s ease;
}
.open-toggle:hover { transform: translateY(-1px); }
.open-toggle.is-open {
    color: #0f7a3e;
    border-color: color-mix(in srgb, #12a150 40%, var(--line));
    background: color-mix(in srgb, #12a150 12%, var(--surface));
}
.open-toggle.is-closed {
    color: #b32626;
    border-color: color-mix(in srgb, #e13c3c 40%, var(--line));
    background: color-mix(in srgb, #e13c3c 12%, var(--surface));
}
.open-toggle-icon {
    display: grid;
    place-items: center;
    width: 16px;
    height: 16px;
}
.open-toggle-icon svg { display: block; width: 16px; height: 16px; }
.page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}
.page-actions form { display: inline; margin: 0; }
.page-actions .page-theme-form { display: inline-flex; }

/* ---------------- login ---------------- */
.auth-body {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--auth-bg);
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--auth-card);
    color: var(--ink);
    border-radius: 20px;
    padding: 32px 28px;
    box-shadow: var(--auth-shadow);
    border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}
.auth-logo a {
    display: block;
    line-height: 0;
    text-decoration: none;
}
.auth-logo a:hover { opacity: .9; }
.auth-logo img {
    width: auto;
    height: auto;
    max-width: min(220px, 100%);
    max-height: 72px;
    display: block;
    border-radius: 12px;
    background: #fff;
    padding: 8px 12px;
    box-sizing: border-box;
}
.auth-logo i {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    display: grid; place-items: center;
    font-style: normal; font-size: .85rem; font-weight: 800;
}
.auth-card h1 { font-size: 1.3rem; margin-bottom: 6px; }
.auth-sub { color: var(--ink-soft); font-size: .88rem; margin: 0 0 20px; }
.password-field {
    position: relative;
    margin-top: 6px;
}
.password-field input {
    margin-top: 0 !important;
    padding-right: 46px !important;
    width: 100%;
}
.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: var(--ink-soft);
    display: grid;
    place-items: center;
    cursor: pointer;
    border-radius: 8px;
    padding: 0;
}
.password-toggle:hover {
    color: var(--brand);
    background: var(--hover);
}
.password-toggle svg {
    display: block;
    grid-area: 1 / 1;
}
.password-toggle .icon-eye-off { display: none; }
.password-toggle.is-visible .icon-eye { display: none; }
.password-toggle.is-visible .icon-eye-off { display: block; }
.auth-hint { font-size: .78rem; color: var(--ink-soft); text-align: center; margin-top: 14px; }
.auth-create {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: 1rem;
    color: var(--ink-soft);
}
.auth-create a {
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
}
.auth-create a:hover { text-decoration: underline; }
.auth-rights {
    margin-top: 18px;
    text-align: center;
    font-size: .72rem;
    color: var(--ink-soft);
    line-height: 1.45;
}
.auth-rights a {
    color: inherit;
    text-decoration: none;
}
.auth-rights a:hover { text-decoration: underline; }

/* ---------------- captcha ---------------- */
.captcha-box {
    margin: 14px 0 4px;
    padding: 14px;
    border-radius: 14px;
    background: #f3f6fb;
    border: 1px solid #dbe3ef;
}
html[data-theme="dark"] .captcha-box {
    background: #1a1f2a;
    border-color: var(--line);
}
.captcha-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.captcha-head strong {
    font-size: .92rem;
    color: var(--ink);
}
.captcha-shield {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #6d5efc;
    background: color-mix(in srgb, #6d5efc 14%, transparent);
}
.captcha-help {
    margin: 0 0 12px;
    font-size: .82rem;
    color: var(--ink-soft);
}
.captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.captcha-code.captcha-image {
    display: block;
    width: 180px;
    height: 56px;
    padding: 0;
    object-fit: contain;
    background: #f7f8fc;
    letter-spacing: 0;
}
.captcha-code {
    flex: 1 1 140px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: .28em;
    color: #1e3a5f;
    background:
        repeating-linear-gradient(
            -45deg,
            rgba(255, 255, 255, .35) 0 8px,
            rgba(180, 205, 235, .25) 8px 16px
        ),
        #d7e8f8;
    border: 1px solid #b7cfe6;
    user-select: none;
    font-family: "Courier New", ui-monospace, monospace;
}
html[data-theme="dark"] .captcha-code {
    color: #e8f1ff;
    background:
        repeating-linear-gradient(
            -45deg,
            rgba(255, 255, 255, .04) 0 8px,
            rgba(80, 120, 180, .18) 8px 16px
        ),
        #243044;
    border-color: #3a4a63;
}
.captcha-refresh {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--ink-soft);
    display: grid;
    place-items: center;
    cursor: pointer;
    flex: 0 0 auto;
    transition: color .15s ease, border-color .15s ease;
}
.captcha-refresh:hover {
    color: var(--brand);
    border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
}
.captcha-refresh:disabled { opacity: .5; cursor: wait; }
.captcha-input {
    width: 100%;
    margin-top: 0 !important;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 600;
    text-align: center;
}
.captcha-input::placeholder {
    letter-spacing: .04em;
    font-weight: 500;
    text-transform: uppercase;
}

@media (max-width: 420px) {
    .captcha-code { letter-spacing: .18em; font-size: 1.2rem; }
}

/* ---------------- layout ---------------- */
.layout { display: flex; min-height: 100dvh; }

.sidebar {
    width: 248px;
    flex: 0 0 248px;
    background: var(--sidebar);
    color: #c7ccdb;
    padding: 20px 14px;
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow-y: auto;
}
.sidebar .brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 4px 18px;
}
.sidebar .brand img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 56px;
    display: block;
    border-radius: 10px;
    background: #fff;
    padding: 6px 8px;
    box-sizing: border-box;
}
.sidebar .brand .brand-link {
    display: block;
    line-height: 0;
    text-decoration: none;
}
.sidebar .brand .brand-link:hover {
    opacity: .92;
}
.sidebar .brand i {
    width: 32px; height: 32px; border-radius: 9px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    display: grid; place-items: center; font-style: normal; font-size: .8rem;
}
.sidebar nav { display: flex; flex-direction: column; gap: 3px; }
.sidebar nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #aeb5c7;
    text-decoration: none;
    font-size: .9rem;
    transition: background .15s ease, color .15s ease;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar nav a.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 600; }
.sidebar nav a svg { width: 18px; height: 18px; fill: currentColor; }
.sidebar .side-foot {
    margin-top: 22px; padding: 14px 12px; border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: .76rem; color: #78809a; line-height: 1.45;
}
.sidebar .side-foot a {
    color: #9aa3b8;
    text-decoration: none;
}
.sidebar .side-foot a:hover { color: #fff; }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 16px 26px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 1.12rem; }
.topbar .sub { font-size: .8rem; color: var(--ink-soft); margin-top: 2px; }
.topbar .user { display: flex; align-items: center; gap: 12px; font-size: .84rem; color: var(--ink-soft); }
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem;
}
.burger { display: none; background: none; border: 0; font-size: 1.4rem; cursor: pointer; }

.content { padding: 24px 26px 60px; }

.pay-reminder {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 12px 26px;
    border-bottom: 1px solid #f0c48a;
    background: linear-gradient(90deg, #fff4e5, #ffe8cc);
    color: #7a3e00;
}
.pay-reminder.is-wait {
    background: linear-gradient(90deg, #eef3ff, #e4ebff);
    border-bottom-color: #c5d2f5;
    color: #2d4c9c;
}
.pay-reminder-copy {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    flex: 1;
}
.pay-reminder-copy svg {
    flex: 0 0 auto;
    margin-top: 1px;
    opacity: .9;
}
.pay-reminder-copy strong { display: block; font-size: .92rem; }
.pay-reminder-copy span { display: block; font-size: .82rem; line-height: 1.35; margin-top: 2px; opacity: .94; }
.pay-reminder-btn { white-space: nowrap; }

/* ---------------- componentes ---------------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}
.card > header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card > header h2 { font-size: 1rem; }
.card > header p { margin: 3px 0 0; font-size: .8rem; color: var(--ink-soft); }
.card .body { padding: 18px; }

.grid { display: grid; gap: 14px; margin-bottom: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid > .card { margin-bottom: 0; height: 100%; }

/* Relat?rios: filtros + a??es na mesma linha */
.analytics-filters {
    display: grid;
    gap: 12px;
    align-items: end;
    margin: 0;
}
.analytics-filters.is-client {
    grid-template-columns: minmax(0, 1.4fr) minmax(140px, .7fr) auto;
}
.analytics-filters.is-admin {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(140px, .7fr) auto;
}
.analytics-filters > label {
    margin: 0;
    min-width: 0;
}
.analytics-filters-actions {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
}
.analytics-filters-actions .btn {
    white-space: nowrap;
}

/* SEO settings (SERP preview) */
.seo-edit-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, .75fr);
    gap: 14px;
    align-items: start;
    margin-bottom: 18px;
}
.seo-edit-main { min-width: 0; }
.seo-fields .seo-span-2 { grid-column: 1 / -1; }
.seo-preview-panel { position: sticky; top: 1rem; margin-bottom: 0; }
.seo-serp {
    font-family: Arial, Helvetica, sans-serif;
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 12px;
    padding: 1rem 1.1rem;
}
html.dark .seo-serp,
html[data-theme="dark"] .seo-serp {
    background: #fff;
}
.seo-serp__url {
    color: #202124;
    font-size: .82rem;
    margin-bottom: .2rem;
    word-break: break-all;
}
.seo-serp__title {
    display: block;
    color: #1a0dab;
    font-size: 1.15rem;
    line-height: 1.3;
    text-decoration: none;
    margin-bottom: .25rem;
}
.seo-serp__title:hover { text-decoration: underline; }
.seo-serp__desc {
    margin: 0;
    color: #4d5156;
    font-size: .9rem;
    line-height: 1.45;
}
.seo-tips {
    margin: 1rem 0 0;
    padding-left: 1.1rem;
    color: var(--ink-soft);
    font-size: .86rem;
    display: grid;
    gap: .35rem;
}
@media (max-width: 992px) {
    .seo-edit-layout { grid-template-columns: 1fr; }
    .seo-preview-panel { position: static; }
}

.smtp-settings-title {
    margin: 0 0 8px;
    font-size: 1rem;
    scroll-margin-top: 88px;
}
input.is-invalid,
select.is-invalid,
textarea.is-invalid {
    border-color: #d94a4a;
    box-shadow: 0 0 0 3px rgba(217, 74, 74, .12);
}
.hint.field-error { color: #b32626; font-weight: 600; }

.mail-test-row { margin-top: 12px; }
.mail-test-field { display: block; margin-bottom: 0; }
.mail-test-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    flex-wrap: wrap;
}
.mail-test-controls input[type=email] {
    flex: 1;
    min-width: 200px;
    margin-top: 0;
}
.mail-test-controls .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Dashboard insights */
.dash-empty { margin: 0; color: var(--ink-soft); font-size: .86rem; }
.dash-empty-cell { color: var(--ink-soft); }
.nowrap { white-space: nowrap; }
.table-wrap { overflow-x: auto; }

/* Pagina??o (logs e listas) */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-top: 1px solid var(--line);
}
.pagination-meta {
    margin: 0;
    font-size: .84rem;
    color: var(--ink-soft);
}
.pagination-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.pagination-gap {
    color: var(--ink-soft);
    padding: 0 2px;
    font-size: .9rem;
}
.btn.is-disabled,
.btn[aria-disabled="true"] {
    opacity: .45;
    pointer-events: none;
    cursor: default;
}
.logs-per-page {
    margin: 0;
}
.logs-per-page label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: .82rem;
    font-weight: 600;
    color: var(--ink-soft);
}
.logs-per-page select {
    width: auto;
    margin: 0;
    min-width: 72px;
    padding: 7px 10px;
    font-size: .82rem;
}
.table-compact { font-size: .82rem; }
.table-compact th, .table-compact td { padding: 10px 12px; }

.dash-rank-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.dash-rank-row:last-child { margin-bottom: 0; }
.dash-rank-icon {
    width: 34px; height: 34px; border-radius: 9px;
    display: grid; place-items: center; overflow: hidden; flex-shrink: 0;
}
.dash-rank-meta { flex: 1; min-width: 0; }
.dash-rank-meta strong {
    display: block; font-size: .86rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-rank-meta small { color: var(--ink-soft); font-size: .75rem; }
.dash-rank-bar {
    width: 72px; height: 8px; border-radius: 999px;
    background: #eef0f6; overflow: hidden; flex-shrink: 0;
}
html.dark .dash-rank-bar { background: #2a3140; }
.dash-rank-bar > span { display: block; height: 100%; border-radius: inherit; }
.dash-rank-value {
    font-size: .85rem; width: 42px; text-align: right; flex-shrink: 0;
}
.dash-source-label {
    width: 88px; flex-shrink: 0; text-transform: capitalize; font-size: .86rem;
}

.dash-donut {
    display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
}
.dash-donut canvas {
    width: 140px !important; height: 140px !important; flex-shrink: 0;
}
.dash-legend { flex: 1; min-width: 140px; }
.dash-legend-row {
    display: flex; align-items: flex-start; gap: 8px;
    margin-bottom: 10px; font-size: .84rem;
}
.dash-legend-row:last-child { margin-bottom: 0; }
.dash-swatch {
    width: 10px; height: 10px; border-radius: 3px;
    margin-top: 4px; flex-shrink: 0;
}
.dash-legend-meta { min-width: 0; flex: 1; line-height: 1.25; }
.dash-legend-meta strong { display: block; }
.dash-legend-meta small { color: var(--ink-soft); }
.dash-legend-value { margin-left: auto; flex-shrink: 0; }

.dash-insights .dash-rank-bar { width: 56px; }

@media (max-width: 1100px) {
    .dash-insights.grid.cols-3 { grid-template-columns: 1fr 1fr; }
    .dash-insights .card:first-child { grid-column: 1 / -1; }
}

label { display: block; font-size: .82rem; font-weight: 600; color: var(--label); margin-bottom: 12px; }
label .hint { display: block; font-weight: 400; color: var(--ink-soft); font-size: .75rem; margin-top: 3px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
label.check input { width: auto; margin: 0; }

input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=tel], select, textarea {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    font-size: .88rem;
    background: var(--input-bg);
    color: var(--ink);
    transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(255, 90, 31, .14);
}
textarea { resize: vertical; min-height: 80px; }
input[type=color] {
    width: 100%; height: 42px; margin-top: 6px; padding: 3px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--input-bg); cursor: pointer;
}
input[type=range] { width: 100%; margin-top: 10px; accent-color: var(--brand); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    font: inherit; font-size: .87rem; font-weight: 600;
    cursor: pointer; text-decoration: none;
    transition: transform .15s ease, filter .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.danger { background: #fff; border-color: #f3c9c9; color: var(--danger); }
.btn.block { width: 100%; margin-top: 8px; }
.btn.sm { padding: 7px 12px; font-size: .8rem; }
.btn svg { width: 16px; height: 16px; fill: currentColor; }

.alert { padding: 11px 14px; border-radius: 10px; font-size: .85rem; margin-bottom: 12px; }
.alert.ok { background: #e8f8ef; color: #0d7a3e; border: 1px solid #bfe9d2; }
.alert.error { background: #fdecec; color: #b32626; border: 1px solid #f6c9c9; }
.alert.info { background: #eef3ff; color: #2d4c9c; border: 1px solid #ccd9f7; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 600; }
.badge.on { background: #e8f8ef; color: #0d7a3e; }
.badge.off { background: #f1f2f6; color: #6a7183; }
.badge.warn { background: #fff4e0; color: #9a6200; }
.badge.info { background: #eef3ff; color: #2d4c9c; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; font-size: .86rem; border-bottom: 1px solid var(--line); }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
tbody tr:hover { background: var(--hover); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px 18px; box-shadow: var(--shadow); min-width: 0;
}
.stat span { font-size: .76rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }
.stat strong { display: block; font-size: clamp(1.25rem, 2.4vw, 1.7rem); margin-top: 6px; word-break: break-word; }
.stat small { font-size: .76rem; color: var(--ink-soft); }

/* ---------------- toggle ---------------- */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span {
    position: absolute; inset: 0; cursor: pointer;
    background: #ccd1de; border-radius: 999px; transition: background .2s ease;
}
.switch span::before {
    content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%; transition: transform .2s ease;
}
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(20px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px rgba(255, 90, 31, .25); }

/* ---------------- editor de itens ---------------- */
.items { display: flex; flex-direction: column; gap: 10px; }
.item {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
    padding: 12px;
    display: grid;
    grid-template-columns: 40px 38px 1fr auto;
    gap: 12px;
    align-items: center;
    transition: box-shadow .15s ease, opacity .15s ease, border-color .15s ease;
}
.item.dragging { opacity: .55; box-shadow: 0 12px 30px rgba(0, 0, 0, .14); z-index: 5; position: relative; }
.item.dragging-source {
    display: none !important;
}
.item.drag-target {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(255, 90, 31, .18);
}
.item.drag-over { border-color: var(--brand); }
.item-placeholder {
    border: 2px dashed var(--brand);
    border-radius: 12px;
    background: rgba(255, 90, 31, .08);
    box-sizing: border-box;
    pointer-events: none;
}
.item-ghost {
    position: fixed;
    z-index: 9999;
    margin: 0;
    pointer-events: none;
    opacity: .96;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .22);
    transform: scale(1.02);
    border-color: var(--brand);
    background: var(--card);
}
.item.inactive { background: var(--surface-2); }
.item.plan-locked {
    border-color: #ecd7a2;
    background: #fffaf0;
}
.item.plan-locked .ic-box { opacity: .55; filter: grayscale(.4); }
.item.removed { display: none; }
.item .handle {
    cursor: grab; color: #8b93a7; display: grid; place-items: center; user-select: none;
    touch-action: none; font-size: 1.7rem; line-height: 1; letter-spacing: -2px;
    width: 40px; height: 48px; border-radius: 8px;
}
.item .handle:hover { color: var(--brand); background: var(--hover); }
.item.dragging .handle,
.item.dragging-source .handle,
.item-ghost .handle { cursor: grabbing; }
body.is-dragging-item { cursor: grabbing !important; user-select: none; }
body.is-dragging-item * { cursor: grabbing !important; }
.item .ic-box {
    width: 38px; height: 38px; border-radius: 10px;
    display: grid; place-items: center; color: #fff;
}
.item .ic-box svg { width: 20px; height: 20px; fill: currentColor; }
.item .ic-box img.channel-logo {
    width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block;
}
.item .ic-box:has(img.channel-logo) {
    padding: 0; background: transparent !important; overflow: hidden;
}
.item .fields { min-width: 0; display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.item .fields .name { font-weight: 600; font-size: .88rem; }
.item .fields input { margin-top: 0; }
.item .tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item .adv { grid-column: 1 / -1; border-top: 1px dashed var(--line); padding-top: 10px; display: none; }
.item.open .adv { display: block; }
.item .item-adv-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
}
.item .item-adv-grid > label {
    margin: 0;
    font-size: .78rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.item .item-adv-grid select,
.item .item-adv-grid input[type="color"],
.item .item-adv-actions .btn.sm {
    box-sizing: border-box !important;
    width: 100% !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    margin-top: 4px !important;
    padding: 0 10px !important;
    border: 1px solid var(--line) !important;
    border-radius: 10px !important;
    font-size: .8rem !important;
    line-height: 1 !important;
}
.item .item-adv-grid input[type="color"] {
    padding: 4px !important;
    cursor: pointer;
    background: var(--input-bg) !important;
}
.item .item-adv-grid input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}
.item .item-adv-grid input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}
.item .item-adv-grid input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 6px;
}
.item .item-adv-actions {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-width: 0;
}
.item .item-adv-actions .hint {
    font-size: .78rem;
    color: var(--ink-soft);
    line-height: 1.2;
    margin: 0;
}
.item .item-adv-actions .btn.sm {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transform: none !important;
}
.item .link-btn { background: none; border: 0; color: var(--ink-soft); cursor: pointer; font-size: .78rem; padding: 4px; }
.item .link-btn:hover { color: var(--brand); }

/* ---------------- preview ---------------- */
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.preview-col { position: sticky; top: 90px; }
.phone {
    width: 100%;
    max-width: 330px;
    margin: 0 auto;
    aspect-ratio: 9 / 19;
    background: #111;
    border-radius: 34px;
    padding: 10px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
}
.phone iframe {
    width: 100%; height: 100%;
    border: 0; border-radius: 26px; background: #000; display: block;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .35) transparent;
}
.preview-actions { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

.url-box {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
    padding: 9px 12px; font-size: .82rem; word-break: break-all;
}
.url-box strong { font-weight: 600; }

.upload-box { border: 1px dashed color-mix(in srgb, var(--line) 80%, var(--ink-soft)); border-radius: 12px; padding: 12px; text-align: center; background: var(--surface-2); }
.upload-box img { max-width: 100%; max-height: 140px; min-height: 64px; object-fit: contain; border-radius: 10px; display: block; margin: 0 auto 10px; background: var(--code-bg); }
.upload-box .row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.upload-box input[type=file] { display: none; }

.style-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 6px; }
.style-picker label {
    margin: 0; text-align: center; padding: 10px 6px; border: 1px solid var(--line);
    border-radius: 10px; cursor: pointer; font-size: .78rem; background: var(--card);
}
.style-picker input { display: none; }
.style-picker label:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--card)); color: var(--brand); font-weight: 700; }

.sticky-save {
    position: sticky; bottom: 0; z-index: 15;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--line);
    padding: 12px 18px;
    display: flex; gap: 10px; justify-content: flex-end; align-items: center;
    margin: 0 -26px -60px;
}
.sticky-save .status { margin-right: auto; font-size: .95rem; font-weight: 600; color: var(--danger); }

.qr-wrap { text-align: center; }
.qr-wrap canvas, .qr-wrap img { background: #fff; border-radius: 12px; border: 1px solid var(--line); padding: 10px; }

.toast {
    position: fixed; right: 20px; bottom: 20px; z-index: 60;
    background: var(--ink); color: #fff;
    padding: 12px 18px; border-radius: 10px; font-size: .85rem;
    opacity: 0; transform: translateY(12px); pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: none; }
.toast.err { background: var(--danger); }

/* ---------------- dialogs (confirm / alert) ---------------- */
.app-dialog {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, visibility .18s ease;
}
.app-dialog.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.app-dialog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 18, 26, .38);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.app-dialog-panel {
    position: relative;
    width: min(400px, calc(100vw - 32px));
    margin: auto;
    padding: 22px 22px 18px;
    border-radius: 18px;
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: 0 24px 60px rgba(16, 18, 26, .18);
    transform: translateY(10px) scale(.97);
    transition: transform .2s cubic-bezier(.2, .8, .2, 1);
}
.app-dialog.is-open .app-dialog-panel {
    transform: none;
}
.app-dialog-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    background: color-mix(in srgb, var(--brand) 12%, var(--card));
    color: var(--brand);
}
.app-dialog.is-danger .app-dialog-icon {
    background: color-mix(in srgb, var(--danger) 12%, var(--card));
    color: var(--danger);
}
.app-dialog-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.app-dialog-title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--ink);
    line-height: 1.3;
}
.app-dialog-msg {
    margin: 0;
    font-size: .9rem;
    line-height: 1.5;
    color: var(--ink-soft);
}
.app-dialog-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 20px;
}
.app-dialog-actions .btn {
    min-width: 96px;
    transform: none !important;
}
.app-dialog-actions .btn.danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}
.app-dialog-actions .btn.danger:hover {
    filter: brightness(1.05);
}

@media (max-width: 520px) {
    .app-dialog {
        place-items: end center;
        padding: 12px;
    }
    .app-dialog-panel {
        width: 100%;
        border-radius: 18px 18px 14px 14px;
        padding: 20px 16px 14px;
        transform: translateY(16px);
    }
    .app-dialog.is-open .app-dialog-panel {
        transform: none;
    }
    .app-dialog-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .app-dialog-actions .btn {
        min-width: 0;
        width: 100%;
        padding: 12px 14px;
    }
}

/* ---------------- loading global ---------------- */
.admin-loader {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    background: rgba(16, 18, 26, .28);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, visibility .18s ease;
}
.admin-loader.is-on {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.admin-loader-panel {
    min-width: min(280px, calc(100vw - 40px));
    padding: 18px 20px 16px;
    border-radius: 14px;
    background: var(--card);
    box-shadow: var(--shadow);
    text-align: center;
}
.admin-loader-bar {
    height: 4px;
    border-radius: 999px;
    background: var(--code-bg);
    overflow: hidden;
}
.admin-loader-bar > span {
    display: block;
    width: 40%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
    animation: admin-loader-slide 1s ease-in-out infinite;
}
.admin-loader-text {
    margin: 12px 0 0;
    font-size: .82rem;
    color: var(--ink-soft);
}
@keyframes admin-loader-slide {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}

.empty-state { text-align: center; padding: 40px 20px; color: var(--ink-soft); }
.empty-state h3 { color: var(--ink); margin-bottom: 8px; }

.card.is-editing {
    border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent), var(--shadow);
}
.card table tr.is-active-row {
    background: color-mix(in srgb, var(--brand) 8%, #fff);
}
.card table tr.is-active-row td { border-color: color-mix(in srgb, var(--brand) 20%, var(--line)); }

/* ---------------- planos ---------------- */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    align-items: stretch;
}
.plan-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px 18px 16px;
    box-shadow: var(--shadow);
    min-width: 0;
}
.plan-card.featured {
    border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
    box-shadow: 0 10px 30px rgba(255, 90, 31, .12);
}
.plan-card.is-current {
    border-color: color-mix(in srgb, var(--ok) 50%, var(--line));
    box-shadow: 0 10px 28px rgba(18, 161, 80, .12);
}
.plan-card.inactive { opacity: .62; background: var(--surface-2); }

.plan-pay-card > header {
    align-items: flex-start;
}
.gateway-mp-title {
    margin: 18px 0 0;
    font-size: .95rem;
    font-weight: 700;
}
.gateway-mp-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}
.gateway-mp-method {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--hover);
    cursor: pointer;
}
.gateway-mp-method input { margin-top: 3px; }
.gateway-mp-method strong { display: block; font-size: .9rem; }
.gateway-mp-method small { display: block; margin-top: 2px; color: var(--ink-soft); font-size: .78rem; line-height: 1.35; }
    margin-top: 4px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-2);
}
.plan-pay-method-title {
    margin: 0 0 12px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--ink-soft);
}
.plan-pay-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.plan-pay-option { margin: 0; }
.plan-pay-option-btn {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    text-align: left;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    color: inherit;
    cursor: pointer;
    min-height: 84px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.plan-pay-option.is-selected .plan-pay-option-btn:disabled {
    opacity: 1;
    cursor: default;
    color: inherit;
}
.plan-pay-option-mercadopago.is-selected .plan-pay-option-btn {
    border-color: #009ee3;
    box-shadow: 0 0 0 1px rgba(0, 158, 227, .35);
}
.plan-pay-option-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 8px;
    border-radius: 12px;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .02em;
}
.plan-pay-option-ico.pix {
    background: #e8f8ef;
    color: #0d7a3e;
}
.plan-pay-option-ico.mp {
    background: #009ee3;
    color: #fff;
}
.plan-pay-option-radio {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--line);
    flex: 0 0 auto;
}
.plan-pay-option.is-selected .plan-pay-option-radio {
    border-color: var(--brand);
    box-shadow: inset 0 0 0 4px var(--brand);
}
.plan-pay-option-mercadopago.is-selected .plan-pay-option-radio {
    border-color: #009ee3;
    box-shadow: inset 0 0 0 4px #009ee3;
}
.plan-pay-option-btn strong { display: block; font-size: .95rem; }
.plan-pay-option-btn small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: .8rem; line-height: 1.35; }
.plan-pay-detail { display: grid; gap: 14px; }
.plan-pay-pix-panel {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid color-mix(in srgb, #12a150 30%, var(--line));
    border-radius: 16px;
    background: linear-gradient(180deg, color-mix(in srgb, #12a150 8%, var(--card)), var(--card));
}
.plan-pay-pix-hero {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
}
.plan-pay-pix-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #12a150, #0d8a42);
    color: #fff;
    font-weight: 800;
    font-size: .85rem;
}
.plan-pay-pix-hero strong { display: block; font-size: 1.05rem; }
.plan-pay-pix-hero p {
    margin: 2px 0 0;
    color: var(--ink-soft);
    font-size: .84rem;
}
.plan-pay-pix-amount {
    justify-self: end;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
}
.plan-pay-pix-amount span { font-size: .75rem; }
.plan-pay-pix-amount strong { font-size: 1.45rem; color: #0d8a42; }
.plan-pay-pix-methods {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.plan-pay-pix-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, #12a150 14%, var(--card));
    color: #0d7a3e;
    font-size: .75rem;
    font-weight: 700;
}
.plan-pay-pix-layout {
    display: grid;
    grid-template-columns: minmax(180px, 220px) 1fr;
    gap: 16px;
    align-items: start;
}
.plan-pay-qr {
    text-align: center;
    padding: 14px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    display: grid;
    gap: 8px;
    justify-items: center;
}
.plan-pay-qr canvas {
    display: block;
    margin: 0 auto;
    width: 100%;
    max-width: 200px;
    height: auto;
    border-radius: 8px;
}
.plan-pay-qr .hint { margin: 0; font-size: .78rem; }
.plan-pay-pix-info { display: grid; gap: 12px; min-width: 0; }
.plan-pay-pix-titular {
    display: grid;
    gap: 2px;
}
.plan-pay-pix-titular strong { font-size: .95rem; }
.plan-pay-pix-btn {
    background: #12a150 !important;
    border-color: #12a150 !important;
    box-shadow: 0 8px 20px rgba(18, 161, 80, .22);
}
.plan-pay-pix-btn:hover { filter: brightness(1.05); }
.plan-pay-amount-inline {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.plan-pay-amount-inline span { color: var(--ink-soft); font-size: .85rem; }
.plan-pay-amount-inline strong { font-size: 1.35rem; }
.plan-pay-copia { display: grid; gap: 8px; }
.plan-pay-brcode {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .72rem;
    line-height: 1.4;
    word-break: break-all;
    resize: vertical;
    min-height: 68px;
}
.plan-pay-mp {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid color-mix(in srgb, #009ee3 28%, var(--line));
    border-radius: 16px;
    background:
        linear-gradient(180deg, color-mix(in srgb, #009ee3 8%, var(--card)), var(--card));
}
.plan-pay-mp-hero {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
}
.plan-pay-mp-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #009ee3;
    color: #fff;
    font-weight: 800;
    font-size: .85rem;
}
.plan-pay-mp-hero strong { display: block; font-size: 1.05rem; }
.plan-pay-mp-hero p {
    margin: 2px 0 0;
    color: var(--ink-soft);
    font-size: .84rem;
}
.plan-pay-mp-amount {
    justify-self: end;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
}
.plan-pay-mp-amount span { font-size: .75rem; }
.plan-pay-mp-amount strong { font-size: 1.45rem; color: #009ee3; }
.plan-pay-mp-methods {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.plan-pay-mp-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, #009ee3 12%, var(--card));
    color: #0077ad;
    font-size: .75rem;
    font-weight: 700;
}
.plan-pay-steps {
    margin: 0;
    padding-left: 18px;
    color: var(--ink-soft);
    font-size: .88rem;
    line-height: 1.55;
    display: grid;
    gap: 4px;
}
.plan-pay-mp-cta {
    display: grid;
    gap: 8px;
}
.plan-pay-mp-btn {
    width: 100%;
    background: #009ee3 !important;
    border-color: #009ee3 !important;
    box-shadow: 0 8px 20px rgba(0, 158, 227, .25);
}
.plan-pay-mp-btn:hover {
    filter: brightness(1.05);
}
.plan-pay-pix {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
}
@media (max-width: 720px) {
    .plan-pay-pix-layout { grid-template-columns: 1fr; }
    .plan-pay-qr { max-width: 260px; margin: 0 auto; }
    .plan-pay-mp-hero,
    .plan-pay-pix-hero {
        grid-template-columns: auto 1fr;
    }
    .plan-pay-mp-amount,
    .plan-pay-pix-amount {
        grid-column: 1 / -1;
        align-items: flex-start;
    }
}
.plan-pay-pix > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.plan-pay-key {
    font-size: 1rem;
    word-break: break-all;
}
.plan-pay-pix small { color: var(--ink-soft); }
.plan-pay-instructions {
    margin: 0;
    color: var(--ink-soft);
    font-size: .9rem;
    line-height: 1.5;
}
.plan-pay-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.plan-pay-mark {
    display: grid;
    gap: 10px;
}
.plan-pay-cancel { margin: 0; }
@media (max-width: 640px) {
    .plan-pay-pix { flex-direction: column; align-items: stretch; }
    .plan-pay-options { grid-template-columns: 1fr; }
}

.plan-badge {
    position: absolute;
    top: 12px; right: 12px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 999px;
}
.plan-badge-current {
    background: linear-gradient(135deg, #12a150, #0d8a42);
}
.plan-head { display: flex; align-items: center; gap: 8px; padding-right: 90px; }
.plan-head h3 { font-size: 1.05rem; }
.plan-price { display: flex; align-items: baseline; gap: 4px; }
.plan-price strong { font-size: 1.7rem; letter-spacing: -.02em; }
.plan-price span { color: var(--ink-soft); font-size: .85rem; }
.plan-year { font-size: .78rem; color: var(--ink-soft); margin-top: -6px; }
.plan-desc { margin: 0; font-size: .84rem; color: var(--ink-soft); line-height: 1.45; }
.plan-limits {
    list-style: none; margin: 4px 0 0; padding: 0;
    display: grid; gap: 6px;
}
.plan-limits li {
    display: flex; justify-content: space-between; gap: 10px;
    font-size: .8rem; padding: 6px 0; border-bottom: 1px dashed var(--line);
}
.plan-limits li span { color: var(--ink-soft); }
.plan-features {
    list-style: none; margin: 4px 0 0; padding: 0;
    display: grid; gap: 6px; flex: 1;
}
.plan-features li {
    position: relative;
    padding-left: 18px;
    font-size: .8rem;
    line-height: 1.35;
}
.plan-features li::before {
    content: "?";
    position: absolute; left: 0; top: 0;
    color: var(--ok); font-weight: 700;
}
.plan-extras { display: flex; flex-wrap: wrap; gap: 6px; min-height: 22px; }
.plan-extras span {
    font-size: .7rem; font-weight: 600;
    background: #fff4ef; color: var(--brand);
    border-radius: 999px; padding: 3px 8px;
}
.plan-actions {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
    margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line);
}
.plan-actions small { color: var(--ink-soft); font-size: .75rem; }
.plan-actions > div { display: flex; flex-wrap: wrap; gap: 6px; }
.plan-actions-choose {
    justify-content: stretch;
}
.plan-actions-choose form { width: 100%; margin: 0; }
.plan-actions-choose .btn {
    width: 100%;
    justify-content: center;
}
.plan-actions-choose .btn[aria-disabled="true"] {
    pointer-events: none;
    opacity: .7;
}

/* ---------------- suporte (clientes do painel) ---------------- */
.support-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
    flex: 0 0 auto;
    transition: transform .15s ease, border-color .15s ease, color .15s ease, background .15s ease;
}
.support-icon-btn:hover {
    transform: translateY(-1px);
    color: var(--brand);
    border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
}
.support-icon-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}
.sidebar nav a.nav-support {
    color: #8de0b0;
}
.sidebar nav a.nav-support:hover {
    color: #fff;
}
.sidebar nav .nav-version {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #aeb5c7;
    font-size: .9rem;
    line-height: inherit;
    user-select: none;
    pointer-events: none;
    cursor: default;
}
.sidebar nav .nav-version svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
}
.support-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: var(--radius);
    border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--line));
    background: color-mix(in srgb, var(--brand) 8%, var(--card));
    box-shadow: var(--shadow);
}
.support-bar-muted {
    border-color: var(--line);
    background: var(--surface-2);
}
.support-bar-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.support-bar-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
}
.support-bar-icon svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}
.support-bar-main strong {
    display: block;
    font-size: .98rem;
}
.support-bar-main p {
    margin: 3px 0 0;
    font-size: .84rem;
    color: var(--ink-soft);
    line-height: 1.4;
}
.support-bar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.support-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.support-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.quota-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}
.quota-item {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    color: inherit;
    text-decoration: none;
    display: block;
    transition: border-color .15s ease, box-shadow .15s ease;
}
a.quota-item:hover {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(255, 90, 31, .12);
}
.quota-item span {
    display: block;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ink-soft);
}
.quota-item strong {
    display: block;
    margin-top: 4px;
    font-size: 1.2rem;
}
.quota-item strong small { font-size: .85rem; color: var(--ink-soft); font-weight: 600; }
.quota-item.full {
    background: color-mix(in srgb, var(--brand) 12%, var(--card));
    border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
}
.quota-item.full strong { color: var(--brand); }

.btn:disabled,
.btn[disabled] {
    opacity: .45;
    cursor: not-allowed;
    transform: none !important;
}

input[type=date] {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    font-size: .88rem;
    background: var(--input-bg);
    color: var(--ink);
}

/* ---------------- responsivo ---------------- */
@media (max-width: 1200px) {
    .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .item .item-adv-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 8px;
    }
}

@media (max-width: 1100px) {
    .editor-grid { grid-template-columns: 1fr; }
    .preview-col { position: static; order: -1; }
    .preview-col .phone { max-width: 300px; }
    .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .analytics-filters.is-admin {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .analytics-filters.is-admin .analytics-filters-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 820px) {
    .sidebar {
        position: fixed; left: 0; top: 0; z-index: 40;
        transform: translateX(-100%); transition: transform .22s ease;
        box-shadow: none;
    }
    .sidebar.open {
        transform: none;
        box-shadow: 12px 0 40px rgba(0, 0, 0, .35);
    }
    .burger { display: block; }
    .grid.cols-2,
    .grid.cols-3,
    .grid.cols-4 { grid-template-columns: 1fr; }
    .analytics-filters.is-client,
    .analytics-filters.is-admin {
        grid-template-columns: 1fr;
    }
    .analytics-filters-actions {
        flex-wrap: wrap;
    }
    .analytics-filters-actions .btn {
        flex: 1;
    }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat { padding: 14px; }
    .stat strong { font-size: 1.4rem; }
    .item { grid-template-columns: 36px 34px 1fr; }
    .item .tools { grid-column: 1 / -1; justify-content: flex-start; }
    .item .fields { grid-template-columns: 1fr; }
    .item .item-adv-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .item .item-adv-actions { grid-column: 1 / -1; }
    .item .ic-box { width: 34px; height: 34px; }
    .item .handle { width: 36px; height: 44px; font-size: 1.55rem; }
    .content { padding: 14px 12px 70px; }
    .pay-reminder { padding: 12px 14px; }
    .topbar { padding: 12px 14px; gap: 10px; }
    .topbar h1 { font-size: 1.02rem; }
    .topbar .sub { display: none; }
    .topbar .user {
        gap: 8px;
        flex: 0 0 auto;
    }
    .topbar .user span.user-name { display: none; }
    .topbar .user .theme-toggle {
        display: inline-flex !important;
        width: 40px;
        height: 40px;
        color: var(--ink);
        background: var(--surface);
        border: 1px solid var(--line);
    }
    .topbar .user .theme-toggle .theme-icon {
        display: grid !important;
    }
    .topbar .user .support-icon-btn {
        display: inline-flex !important;
        width: 40px;
        height: 40px;
    }
    .support-bar {
        padding: 14px;
        gap: 12px;
    }
    .support-bar-actions {
        width: 100%;
    }
    .support-bar-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
    }
    .sticky-save {
        margin: 0 -12px -70px;
        flex-wrap: wrap;
        padding: 10px 12px;
        justify-content: stretch;
    }
    .sticky-save .status { width: 100%; margin: 0 0 4px; }
    .sticky-save .btn { flex: 1 1 auto; }
    .style-picker { grid-template-columns: repeat(2, 1fr); }
    .card { margin-bottom: 12px; border-radius: 12px; }
    .card > header {
        padding: 14px;
        flex-direction: column;
        align-items: stretch;
    }
    .card > header > div:last-child,
    .card > header form {
        width: 100%;
    }
    .card > header .btn,
    .card > header a.btn {
        width: 100%;
        justify-content: center;
    }
    .card .body { padding: 14px; }
    .card .body > .grid { gap: 10px; }

    /* tabelas viram lista de cards no mobile */
    .card > div[style*="overflow"],
    .table-wrap {
        overflow: visible !important;
    }
    table.responsive,
    .card table {
        display: block;
        width: 100%;
        border: 0;
    }
    .card table thead { display: none; }
    .card table tbody { display: flex; flex-direction: column; gap: 10px; }
    .card table tr {
        display: block;
        background: var(--card);
        border: 1px solid var(--line);
        border-radius: 12px;
        padding: 12px 14px;
        box-shadow: 0 2px 10px rgba(16, 18, 26, .04);
    }
    .card table tr:hover { background: var(--card); }
    .card table td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        padding: 6px 0;
        border: 0;
        font-size: .84rem;
        text-align: left !important;
        white-space: normal;
    }
    .card table td::before {
        content: attr(data-label);
        flex: 0 0 38%;
        max-width: 120px;
        font-size: .72rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .03em;
        color: var(--ink-soft);
    }
    .card table td:last-child {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 8px;
        padding-top: 10px;
        margin-top: 6px;
        border-top: 1px dashed var(--line);
    }
    .card table td:last-child::before { display: none; }
    .card table td:last-child .btn,
    .card table td:last-child form {
        display: inline-flex;
        align-items: center;
    }
    .card table td:last-child form { margin: 0; }
    .card table td:last-child .theme-toggle,
    .card table td:last-child .open-toggle {
        display: inline-flex !important;
        flex: 0 0 auto;
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        color: var(--ink);
    }
    .card table td:last-child .theme-toggle .theme-icon svg.theme-icon-moon {
        display: block;
    }
    html[data-theme="dark"] .card table td:last-child .theme-toggle .theme-icon svg.theme-icon-sun {
        display: block;
    }
    html[data-theme="dark"] .card table td:last-child .theme-toggle .theme-icon svg.theme-icon-moon {
        display: none;
    }
    .card table td:last-child .theme-toggle.is-link-theme[data-page-theme="dark"] .theme-icon svg.theme-icon-sun {
        display: block;
    }
    .card table td:last-child .theme-toggle.is-link-theme[data-page-theme="dark"] .theme-icon svg.theme-icon-moon {
        display: none;
    }
    .card table td:last-child .theme-toggle.is-link-theme:not([data-page-theme="dark"]) .theme-icon svg.theme-icon-sun {
        display: none;
    }
    .card table td:last-child .theme-toggle.is-link-theme:not([data-page-theme="dark"]) .theme-icon svg.theme-icon-moon {
        display: block;
    }
    .card table td[colspan] {
        display: block;
        text-align: center !important;
        color: var(--ink-soft);
        padding: 8px 0;
    }
    .card table td[colspan]::before { display: none; }
    .url-box { flex-wrap: wrap; }
    .url-box .btn { width: 100%; }
}

@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat strong { font-size: 1.25rem; }
    .auth-card { padding: 24px 18px; border-radius: 16px; }
    .phone { max-width: 260px; border-radius: 28px; }
}

/* ---------------- dark mode surfaces ---------------- */
html[data-theme="dark"] .btn.danger { background: var(--card); border-color: #5a3030; }
html[data-theme="dark"] .alert.ok { background: #143524; color: #8de0b0; border-color: #1f5a38; }
html[data-theme="dark"] .alert.error { background: #3a1818; color: #f0a0a0; border-color: #6a3030; }
html[data-theme="dark"] input.is-invalid,
html[data-theme="dark"] select.is-invalid,
html[data-theme="dark"] textarea.is-invalid {
    border-color: #e07070;
    box-shadow: 0 0 0 3px rgba(224, 112, 112, .18);
}
html[data-theme="dark"] .hint.field-error { color: #f0a0a0; }
html[data-theme="dark"] .alert.info { background: #182238; color: #a8c0ff; border-color: #2a4068; }
html[data-theme="dark"] .pay-reminder.is-due {
    background: linear-gradient(90deg, #3a2a14, #332414);
    border-bottom-color: #6a4e24;
    color: #f0c56a;
}
html[data-theme="dark"] .pay-reminder.is-wait {
    background: linear-gradient(90deg, #182238, #1a2744);
    border-bottom-color: #2a4068;
    color: #a8c0ff;
}
html[data-theme="dark"] .badge.on { background: #143524; color: #8de0b0; }
html[data-theme="dark"] .badge.off { background: #252a36; color: #9aa3b5; }
html[data-theme="dark"] .badge.warn { background: #3a2e14; color: #f0c56a; }
html[data-theme="dark"] .badge.info { background: #1a2744; color: #9db7f0; }
html[data-theme="dark"] tbody tr:hover { background: var(--hover); }
html[data-theme="dark"] .item,
html[data-theme="dark"] .upload-box,
html[data-theme="dark"] .style-picker label,
html[data-theme="dark"] .plan-card,
html[data-theme="dark"] .url-box,
html[data-theme="dark"] .admin-loader-panel {
    background: var(--card);
    color: var(--ink);
}
html[data-theme="dark"] .item.inactive,
html[data-theme="dark"] .item.plan-locked { background: #2a2418; }
html[data-theme="dark"] .item.plan-locked { border-color: #6b5420; }
html[data-theme="dark"] .plan-pay-option-ico.pix { background: #143524; color: #8de0b0; }
html[data-theme="dark"] .plan-pay-mp-chip { color: #7fd4ff; }
html[data-theme="dark"] .plan-pay-pix-chip { color: #8de0b0; }
html[data-theme="dark"] .plan-pay-mp {
    background: linear-gradient(180deg, rgba(0, 158, 227, .12), var(--card));
}
html[data-theme="dark"] .plan-pay-pix-panel {
    background: linear-gradient(180deg, rgba(18, 161, 80, .12), var(--card));
}
html[data-theme="dark"] .upload-box { border-color: #3a4152; background: #14171f; }
html[data-theme="dark"] .upload-box img { background: #222733; }
html[data-theme="dark"] .sticky-save { background: rgba(14, 16, 22, .92); border-color: var(--line); }
html[data-theme="dark"] .style-picker label:has(input:checked) { background: #2a1a14; }
html[data-theme="dark"] .item .handle:hover { background: #222733; }
html[data-theme="dark"] .card table tr,
html[data-theme="dark"] .card table tr:hover { background: var(--card); }
html[data-theme="dark"] .stat { background: var(--surface-2); }
html[data-theme="dark"] .burger { color: var(--ink); }
html[data-theme="dark"] .admin-loader { background: rgba(0, 0, 0, .55); }
html[data-theme="dark"] .admin-loader-bar { background: #2a2f3c; }
html[data-theme="dark"] .phone-frame { background: #0a0b10; }
html[data-theme="dark"] select option { background: #171a22; color: #e8eaef; }

/* Local7Zap */
.l7z-kicker {
    margin: 0 0 4px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #128c7e;
}
.l7z-hero-inner {
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
.l7z-status-box {
    min-width: 180px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--surface-2, #f3f4f8);
    display: grid;
    gap: 4px;
}
.l7z-status-box strong { font-size: .95rem; }
.l7z-status-box small { color: var(--ink-soft); font-size: .8rem; }
.l7z-connect-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.l7z-qr-panel {
    margin-top: 16px;
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}
.l7z-qr-panel canvas {
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
}
.l7z-pair-code {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: .12em;
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.l7z-dash-body {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
html[data-theme="dark"] .l7z-status-box { background: var(--surface-2); }
html[data-theme="dark"] .l7z-qr-panel canvas { border-color: #3a4152; }


/* ---------------- atualiza??es do sistema ---------------- */
.updates-pending-box {
    margin: 0 0 1rem;
    padding: .9rem 1rem;
    border: 1px solid #f0b429;
    border-radius: 10px;
    background: rgba(240, 180, 41, .08);
}
.upload-progress {
    margin-top: 14px;
}
.upload-progress__track {
    height: 8px;
    border-radius: 999px;
    background: var(--surface-2, #eef0f5);
    overflow: hidden;
}
.upload-progress__fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
    transition: width .15s ease;
}
.upload-progress--processing .upload-progress__fill {
    width: 100% !important;
    background-size: 40px 40px;
    animation: upload-progress-stripes .8s linear infinite;
    background-image: linear-gradient(
        135deg,
        rgba(255,255,255,.25) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255,255,255,.25) 50%,
        rgba(255,255,255,.25) 75%,
        transparent 75%,
        transparent
    );
}
.upload-progress--error .upload-progress__fill {
    background: #d64545;
}
.upload-progress__text {
    margin-top: 8px;
    font-size: .82rem;
    color: var(--ink-soft);
}
@keyframes upload-progress-stripes {
    from { background-position: 0 0; }
    to { background-position: 40px 0; }
}
.updates-upload-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
