/* ════════════════════════════════════════════════════════════════════════
 * myDelivery Afiliados — CSS único compartilhado por todas as telas
 * ════════════════════════════════════════════════════════════════════════
 *
 * Design system:
 *  - Dark mode profissional (paleta laranja MyDelivery + neutros frios)
 *  - Sem emoji, sem SVG aleatório — apenas ícones CSS puro construídos
 *    semânticamente com pseudo-elementos
 *  - Layout: sidebar fixa esquerda + main scrollável
 *  - Responsivo: sidebar colapsa em drawer no mobile
 * ──────────────────────────────────────────────────────────────────────── */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
    margin: 0; padding: 0; min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0a0c10;
    color: #e5e7eb;
    -webkit-font-smoothing: antialiased;
}

:root {
    --bg: #0a0c10;
    --surface-1: #11141b;
    --surface-2: #161a23;
    --surface-3: #1c2030;
    --border: rgba(255,255,255,.06);
    --border-strong: rgba(255,255,255,.12);
    --text: #f1f5f9;
    --text-2: #cbd0d9;
    --text-3: #8a8f9a;
    --text-4: #6e7480;
    --brand: #ff5500;
    --brand-light: #ff8a3b;
    --brand-bg: rgba(255, 85, 0, .14);
    --success: #22c55e;
    --success-bg: rgba(34,197,94,.12);
    --warn: #f59e0b;
    --warn-bg: rgba(245,158,11,.12);
    --err: #f43f5e;
    --err-bg: rgba(244,63,94,.12);
    --info: #38bdf8;
    --info-bg: rgba(56,189,248,.12);
}

/* ══════════ Layout principal ══════════ */
.app {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}
@media (max-width: 900px) { .app { grid-template-columns: 1fr; } }

/* ══════════ Sidebar ══════════ */
.sidebar {
    background: var(--surface-1);
    border-right: 1px solid var(--border);
    padding: 24px 14px;
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    overflow-y: auto;
}
@media (max-width: 900px) {
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0;
        width: 260px; z-index: 100;
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: 0 10px 40px rgba(0,0,0,.4);
    }
    .sidebar.is-open { transform: translateX(0); }
    body.has-mobile-menu::after {
        content: ''; position: fixed; inset: 0;
        background: rgba(0,0,0,.55); z-index: 99;
        opacity: 0; pointer-events: none; transition: opacity .2s;
    }
    body.has-mobile-menu.menu-open::after { opacity: 1; pointer-events: auto; }
}

.sidebar__brand {
    display: flex; align-items: center; gap: 12px;
    padding: 0 8px 22px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 18px;
}
.sidebar__logo {
    width: 42px; height: 42px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--brand-light), var(--brand));
    display: grid; place-items: center;
    box-shadow: 0 8px 20px rgba(255,85,0,.32), inset 0 1px 0 rgba(255,255,255,.18);
    position: relative;
}
/* Ícone CSS puro do logo: triângulo de motoboy estilizado (quadrado rotacionado) */
.sidebar__logo::before {
    content: '';
    width: 18px; height: 18px;
    background: #fff;
    clip-path: polygon(0 30%, 35% 30%, 60% 0, 60% 30%, 100% 30%, 100% 100%, 0 100%);
}
.sidebar__brand-text { line-height: 1.15; }
.sidebar__brand-text b { display: block; font-size: 15px; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.sidebar__brand-text span { font-size: 10.5px; font-weight: 700; color: var(--brand-light); letter-spacing: .14em; text-transform: uppercase; }

.sidebar__group-label {
    font-size: 10px; font-weight: 800; text-transform: uppercase;
    letter-spacing: .14em; color: var(--text-4);
    padding: 14px 12px 8px;
}
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-2);
    text-decoration: none;
    font-size: 13.5px; font-weight: 500;
    transition: background .15s, color .15s;
    margin-bottom: 2px;
    cursor: pointer; border: none; background: transparent;
    width: 100%; text-align: left; font-family: inherit;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
    background: var(--brand-bg); color: var(--brand-light);
    font-weight: 700;
}
/* Ícone CSS puro nos itens da sidebar — bolinha que muda de forma por classe */
.nav-icon {
    width: 18px; height: 18px;
    display: inline-grid; place-items: center;
    flex-shrink: 0;
    position: relative;
}
/* dashboard: 4 quadradinhos */
.nav-icon.i-dashboard::before, .nav-icon.i-dashboard::after {
    content: ''; position: absolute; background: currentColor;
    border-radius: 2px;
}
.nav-icon.i-dashboard::before {
    width: 7px; height: 7px; top: 2px; left: 2px;
    box-shadow: 9px 0 0 currentColor, 0 9px 0 currentColor, 9px 9px 0 currentColor;
}
.nav-icon.i-dashboard::after { display: none; }
/* link: 2 arcos sobrepostos formando elo */
.nav-icon.i-link::before, .nav-icon.i-link::after {
    content: ''; position: absolute;
    width: 9px; height: 6px;
    border: 1.5px solid currentColor;
    border-radius: 5px;
    background: transparent;
}
.nav-icon.i-link::before { left: 1px; top: 6px; }
.nav-icon.i-link::after { right: 1px; top: 6px; }
/* money: cifrão simples */
.nav-icon.i-money { font-style: normal; font-weight: 800; font-size: 14px; }
.nav-icon.i-money::before { content: '$'; line-height: 18px; }
/* pdf */
.nav-icon.i-pdf::before {
    content: ''; position: absolute;
    width: 12px; height: 14px;
    border: 1.5px solid currentColor;
    border-radius: 2px;
    top: 2px; left: 3px;
    background: transparent;
}
.nav-icon.i-pdf::after {
    content: 'PDF'; position: absolute;
    font-size: 6px; font-weight: 900; color: currentColor;
    top: 7px; left: 4.5px;
    letter-spacing: 0;
}
/* play / video */
.nav-icon.i-play::before {
    content: ''; position: absolute;
    width: 0; height: 0;
    border-left: 9px solid currentColor;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    top: 3px; left: 5px;
}
/* doc / termos */
.nav-icon.i-doc::before {
    content: ''; position: absolute;
    width: 12px; height: 14px;
    border: 1.5px solid currentColor;
    border-radius: 1.5px;
    top: 2px; left: 3px;
}
.nav-icon.i-doc::after {
    content: ''; position: absolute;
    width: 6px; height: 1px;
    background: currentColor;
    top: 6px; left: 6px;
    box-shadow: 0 3px 0 currentColor, 0 6px 0 currentColor;
}
/* user / dados */
.nav-icon.i-user::before {
    content: ''; position: absolute;
    width: 6px; height: 6px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    top: 1px; left: 5px;
}
.nav-icon.i-user::after {
    content: ''; position: absolute;
    width: 12px; height: 7px;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    border: 1.5px solid currentColor;
    border-bottom: none;
    bottom: 1px; left: 2px;
}
/* logout: seta saindo */
.nav-icon.i-logout::before {
    content: ''; position: absolute;
    width: 10px; height: 12px;
    border: 1.5px solid currentColor;
    border-right: none;
    border-radius: 2px 0 0 2px;
    top: 2px; left: 1px;
}
.nav-icon.i-logout::after {
    content: ''; position: absolute;
    width: 5px; height: 5px;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    transform: rotate(45deg);
    top: 5px; right: 1px;
}
/* admin: estrela 4 pontas */
.nav-icon.i-admin { font-style: normal; font-weight: 800; font-size: 14px; }
.nav-icon.i-admin::before {
    content: ''; position: absolute;
    width: 8px; height: 8px; top: 5px; left: 5px;
    background: currentColor;
    transform: rotate(45deg);
    box-shadow: 0 -3px 0 currentColor, 0 3px 0 currentColor, -3px 0 0 currentColor, 3px 0 0 currentColor;
}
/* chat: balão de fala com cauda */
.nav-icon.i-chat::before {
    content: ''; position: absolute;
    width: 14px; height: 10px;
    border: 1.5px solid currentColor;
    border-radius: 5px;
    top: 2px; left: 2px;
}
.nav-icon.i-chat::after {
    content: ''; position: absolute;
    width: 0; height: 0;
    border-top: 4px solid currentColor;
    border-left: 4px solid transparent;
    border-right: 3px solid transparent;
    bottom: 3px; left: 5px;
}
/* shield: escudo (usado em auditoria) */
.nav-icon.i-shield::before {
    content: ''; position: absolute;
    width: 12px; height: 14px;
    border: 1.5px solid currentColor;
    border-radius: 7px 7px 2px 2px / 4px 4px 2px 2px;
    top: 2px; left: 3px;
    border-bottom-color: transparent;
}
.nav-icon.i-shield::after {
    content: ''; position: absolute;
    width: 4px; height: 4px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    top: 6px; left: 7px;
}

.sidebar__footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.sidebar__user {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 10px;
    background: var(--surface-2);
}
.sidebar__user-avatar {
    width: 32px; height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--brand-light), var(--brand));
    color: #fff;
    display: grid; place-items: center;
    font-size: 12px; font-weight: 800;
    letter-spacing: -.01em;
}
.sidebar__user-name { font-size: 12.5px; font-weight: 700; color: var(--text); line-height: 1.2; }
.sidebar__user-email { font-size: 11px; color: var(--text-4); margin-top: 2px; word-break: break-all; }

/* ══════════ Main ══════════ */
.main {
    padding: 28px 32px 60px;
    min-width: 0; /* permite shrink no grid */
}
@media (max-width: 700px) { .main { padding: 18px 16px 60px; } }

.topbar {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 26px;
}
.mobile-menu-btn {
    width: 38px; height: 38px;
    border-radius: 9px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    display: none; place-items: center; cursor: pointer;
    position: relative;
}
.mobile-menu-btn::before, .mobile-menu-btn::after, .mobile-menu-btn span {
    content: ''; display: block;
    width: 16px; height: 2px;
    background: currentColor; border-radius: 1px;
    position: absolute; left: 11px;
}
.mobile-menu-btn::before { top: 12px; }
.mobile-menu-btn::after { bottom: 12px; }
.mobile-menu-btn span { top: 18px; }
@media (max-width: 900px) { .mobile-menu-btn { display: grid; } }

.page-title {
    font-size: 22px; font-weight: 800; letter-spacing: -.02em;
    color: var(--text);
    flex: 1;
}
.page-subtitle {
    font-size: 13px; color: var(--text-3);
    margin-top: 4px;
    line-height: 1.5;
}

/* ══════════ Cards / Painel ══════════ */
.card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px 24px;
    margin-bottom: 18px;
}
.card__head {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.card__title {
    font-size: 14px; font-weight: 800;
    color: var(--text);
    letter-spacing: -.01em;
}
.card__sub {
    font-size: 12px; color: var(--text-3); margin-top: 4px;
    line-height: 1.5;
}

/* ══════════ KPI cards (dashboard) ══════════ */
.kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}
@media (max-width: 520px) {
    .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
    .kpi { padding: 14px 14px; }
    .kpi__val { font-size: 22px; }
    .kpi__lb { font-size: 10px; }
}
@media (max-width: 380px) {
    .kpis { grid-template-columns: 1fr; }
}
.kpi {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
    position: relative; overflow: hidden;
    transition: transform .15s, border-color .15s;
}
.kpi:hover { border-color: var(--border-strong); }
.kpi::before {
    content: ''; position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--brand), var(--brand-light));
    opacity: .6;
}
.kpi__lb {
    font-size: 10.5px; color: var(--text-4);
    font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}
.kpi__val {
    font-size: 26px; color: var(--text);
    font-weight: 800; letter-spacing: -.02em;
    margin-top: 6px; line-height: 1.1;
}
.kpi__sub {
    font-size: 11.5px; color: var(--text-3);
    margin-top: 4px;
}
.kpi--brand .kpi__val { color: var(--brand-light); }
.kpi--success .kpi__val { color: var(--success); }
.kpi--warn .kpi__val { color: var(--warn); }

/* ══════════ Botões ══════════ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 18px;
    border-radius: 10px;
    border: none;
    font-family: inherit; font-size: 13.5px; font-weight: 700;
    cursor: pointer;
    transition: transform .1s, opacity .15s, background .15s, border-color .15s;
    letter-spacing: .01em;
    text-decoration: none;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn--primary {
    background: linear-gradient(135deg, var(--brand-light), var(--brand));
    color: #fff;
    box-shadow: 0 6px 18px rgba(255,85,0,.30), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn--ghost {
    background: var(--surface-2);
    color: var(--text-2);
    border: 1px solid var(--border);
}
.btn--ghost:hover { background: var(--surface-3); color: var(--text); }
.btn--danger {
    background: var(--err-bg);
    color: var(--err);
    border: 1px solid rgba(244,63,94,.3);
}
.btn--danger:hover { background: rgba(244,63,94,.18); }
.btn--success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(34,197,94,.3);
}
.btn--success:hover { background: rgba(34,197,94,.2); }
.btn--sm { padding: 7px 12px; font-size: 12px; border-radius: 8px; }

/* ══════════ Form ══════════ */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 11.5px; color: var(--text-3);
    font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
    margin-bottom: 7px;
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--text);
    font-family: inherit; font-size: 14px;
    transition: border-color .15s, background .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--brand);
    background: var(--surface-3);
}
.form-input::placeholder { color: var(--text-4); }
.form-textarea { resize: vertical; min-height: 80px; }

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 600px) { .form-grid-2 { grid-template-columns: 1fr; } }

/* ══════════ Tabela ══════════ */
.table-wrap {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}
/* Tabelas rolam horizontal em telas estreitas — evita quebrar layout */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll::-webkit-scrollbar { height: 8px; }
.table-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }
.table-scroll table { min-width: 640px; }
@media (max-width: 600px) {
    .table-scroll table { min-width: 520px; }
    thead th { padding: 10px 12px; font-size: 10.5px; }
    tbody td { padding: 12px; font-size: 12.5px; }
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
thead th {
    background: var(--surface-2);
    padding: 13px 16px;
    text-align: left;
    color: var(--text-3);
    font-size: 11px; font-weight: 800;
    text-transform: uppercase; letter-spacing: .08em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-2);
    vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,.015); }
.ta-right { text-align: right; }

/* ══════════ Badges de status ══════════ */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px; font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.badge::before {
    content: ''; width: 6px; height: 6px;
    border-radius: 50%; background: currentColor;
}
.badge--pendente { background: var(--warn-bg); color: var(--warn); }
.badge--ativo, .badge--aprovado { background: var(--success-bg); color: var(--success); }
.badge--cancelado, .badge--bloqueado { background: var(--err-bg); color: var(--err); }
.badge--trial { background: var(--info-bg); color: var(--info); }
.badge--neutro { background: rgba(255,255,255,.06); color: var(--text-3); }
.badge--paga { background: var(--success-bg); color: var(--success); }

/* ══════════ Toast ══════════ */
.toast-stack {
    position: fixed; top: 20px; right: 20px;
    z-index: 9999;
    display: flex; flex-direction: column; gap: 8px;
    max-width: 360px;
}
.toast {
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    border-left: 3px solid var(--brand);
    color: var(--text);
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 13.5px; font-weight: 600;
    box-shadow: 0 12px 32px rgba(0,0,0,.4);
    animation: toast-in .25s ease;
}
.toast--ok { border-left-color: var(--success); }
.toast--err { border-left-color: var(--err); }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ══════════ Empty state ══════════ */
.empty {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-3);
}
.empty__title { font-size: 15px; font-weight: 800; color: var(--text-2); margin-bottom: 8px; }
.empty__sub { font-size: 13px; line-height: 1.5; max-width: 360px; margin: 0 auto; }

/* ══════════ Auth (login / signup) ══════════ */
.auth-wrap {
    min-height: 100vh;
    display: grid; place-items: center;
    padding: 24px;
    background:
        radial-gradient(60% 50% at 100% 0%, rgba(255,85,0,.12) 0%, transparent 70%),
        radial-gradient(70% 60% at 0% 100%, rgba(56,189,248,.06) 0%, transparent 70%),
        var(--bg);
}
.auth-card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 34px 32px;
    width: 100%; max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.auth-brand {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 26px;
}
.auth-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.auth-sub { font-size: 13px; color: var(--text-3); margin-bottom: 26px; line-height: 1.5; }
.auth-link {
    color: var(--brand-light); text-decoration: none; font-weight: 700;
}
.auth-link:hover { text-decoration: underline; }
.auth-foot {
    margin-top: 22px; padding-top: 18px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 13px; color: var(--text-3);
}

/* ══════════ Link copy box ══════════ */
.link-row {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px 6px 6px 14px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.link-row__url {
    flex: 1 1 240px; min-width: 0;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 12px;
    color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    padding: 6px 0;
}
@media (max-width: 480px) {
    .link-row { padding: 10px 12px; }
    .link-row__url {
        white-space: normal; word-break: break-all;
        font-size: 11.5px; line-height: 1.5;
        text-overflow: initial; overflow: visible;
    }
    .link-row .btn { width: 100%; margin-top: 4px; }
}
.link-row__lb {
    font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
    color: var(--text-4);
    margin-right: 8px;
    flex-shrink: 0;
}

/* ══════════ Spinner pequeno ══════════ */
.spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.15);
    border-top-color: var(--brand-light);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════ Skeleton ══════════ */
.skel {
    background: linear-gradient(90deg, rgba(255,255,255,.03) 0%, rgba(255,255,255,.06) 50%, rgba(255,255,255,.03) 100%);
    background-size: 200% 100%;
    animation: shine 1.4s ease-in-out infinite;
    border-radius: 6px;
}
@keyframes shine { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ══════════ Modal ══════════ */
.modal {
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(4, 6, 10, .74);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center;
    padding: 16px;
    overflow-y: auto;
}
.modal.is-open { display: flex; }
.modal__card {
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    padding: 22px 24px;
    max-width: 520px; width: 100%;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.03);
    margin: auto;
    color: var(--text);
}
.modal__title {
    font-size: 18px; font-weight: 800; margin: 0 0 14px;
    color: var(--text); letter-spacing: -.01em;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.modal__msg { font-size: 13.5px; color: var(--text-2); line-height: 1.6; margin-bottom: 18px; }
/* Corpo do modal — bloco onde vai o conteúdo dinâmico (linhas de detalhe, form, etc) */
.modal__body {
    font-size: 13.5px; color: var(--text-2); line-height: 1.7;
    margin-bottom: 18px;
    display: flex; flex-direction: column; gap: 6px;
}
.modal__body b, .modal__body strong { color: var(--text); font-weight: 700; }
.modal__body p { margin: 0; }
.modal__body .kv {
    display: grid; grid-template-columns: minmax(90px, 130px) 1fr;
    gap: 8px 14px; align-items: baseline;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(255,255,255,.04);
}
.modal__body .kv:last-child { border-bottom: 0; }
.modal__body .kv > b { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 700; }
.modal__body .kv > span { font-size: 13.5px; color: var(--text); word-break: break-word; }
.modal__actions {
    display: flex; gap: 8px; justify-content: flex-end;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    align-items: center;
}
.modal__actions .btn { min-height: 38px; }
/* Ações compactas (btn--sm) — permitem 5-6 botões numa linha só sem quebrar */
.modal__actions .btn--sm { padding: 8px 12px; font-size: 12.5px; min-height: 34px; }

/* Modal em telas pequenas: ocupa a tela toda com respiro */
@media (max-width: 560px) {
    .modal { padding: 12px; align-items: flex-start; }
    .modal__card {
        padding: 18px 16px;
        max-height: calc(100vh - 24px);
        border-radius: 14px;
    }
    .modal__title { font-size: 16px; margin-bottom: 12px; padding-bottom: 12px; }
    .modal__body .kv {
        grid-template-columns: 1fr;
        gap: 2px;
    }
    .modal__body .kv > b { font-size: 10.5px; }
    .modal__actions { gap: 8px; }
    .modal__actions .btn { flex: 1 1 auto; min-width: 0; }
}

/* ══════════ Responsividade global (tablet / notebook / celular) ══════════
 * Padrão de breakpoints usado no projeto:
 *  ≥1200px    notebook grande — layout completo
 *  900-1199   notebook padrão — sidebar 260px + main
 *  700-899    tablet portrait — sidebar vira drawer
 *  480-699    celular landscape — colunas colapsam
 *  <480       celular portrait — 1 coluna + espaçamentos reduzidos
 * ──────────────────────────────────────────────────────────────────────── */

/* Tablet & telas médias */
@media (max-width: 1024px) {
    .main { padding: 24px 24px 60px; }
    .page-title { font-size: 20px; }
}

/* Celular landscape */
@media (max-width: 700px) {
    .card { padding: 18px 16px; border-radius: 14px; }
    .card__title { font-size: 13.5px; }
    .card__head { gap: 8px; margin-bottom: 14px; }
    .page-title { font-size: 18px; }
    .page-subtitle { font-size: 12px; }
    .topbar { margin-bottom: 20px; }
}

/* Celular portrait */
@media (max-width: 480px) {
    .main { padding: 16px 12px 60px; }
    .card { padding: 16px 14px; margin-bottom: 14px; }
    .sidebar { width: 88vw; max-width: 300px; }
}

/* Botões: sempre com hit-area confortável no touch */
@media (hover: none) {
    .btn { min-height: 42px; }
}

/* Inputs / textareas: fonte 16px em iOS pra não dar zoom auto ao focar */
@media (max-width: 700px) {
    input, textarea, select {
        font-size: 16px !important;
    }
}

/* Utility pra scrollar horizontal contêineres largos (links de afiliado, etc) */
.hscroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.hscroll::-webkit-scrollbar { height: 6px; }
.hscroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 3px; }

/* Blocos de código / link do afiliado que geralmente estouram a largura */
.code-block, code, pre {
    word-break: break-all;
    overflow-wrap: anywhere;
    max-width: 100%;
}

/* ══════════ Diálogos programáticos (MYAF.confirm/alert/prompt) ══════════
 * Substituem alert/confirm/prompt nativos por modais bonitos.
 * ─────────────────────────────────────────────────────────────────────── */
.myaf-dlg {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(4, 6, 10, .74);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity .18s ease;
}
.myaf-dlg.is-open { opacity: 1; }
.myaf-dlg__card {
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    padding: 22px 24px;
    max-width: 440px; width: 100%;
    box-shadow: 0 24px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.03);
    color: var(--text);
    transform: translateY(-8px) scale(.98);
    transition: transform .18s cubic-bezier(.2,.9,.3,1.2);
}
.myaf-dlg.is-open .myaf-dlg__card { transform: translateY(0) scale(1); }
.myaf-dlg__title {
    font-size: 17px; font-weight: 800; letter-spacing: -.01em;
    color: var(--text); margin-bottom: 10px;
}
.myaf-dlg__msg {
    font-size: 14px; color: var(--text-2); line-height: 1.6;
    margin-bottom: 18px;
    white-space: pre-wrap;
}
.myaf-dlg__input {
    display: block; width: 100%;
    margin: 0 0 18px;
}
.myaf-dlg__actions {
    display: flex; gap: 10px; justify-content: flex-end;
    flex-wrap: wrap;
}
.myaf-dlg__actions .btn { min-height: 40px; }

@media (max-width: 500px) {
    .myaf-dlg { padding: 12px; align-items: flex-start; padding-top: 20vh; }
    .myaf-dlg__card { padding: 18px 16px; }
    .myaf-dlg__actions .btn { flex: 1 1 auto; }
}
