:root {
    --primary: #FF5A1F;
    --primary-dark: #e04510;
    --primary-soft: #fff1ea;
    --dark: #111827;
    --muted: #4b5563;
    --bg: #eceff3;
    --white: #fff;
    --border: #d1d5db;
    --error: #dc2626;
    --ok: #059669;
    --topbar: #0f172a;
    --topbar-text: #e5e7eb;
    --shadow: 0 10px 30px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, Tahoma, Arial, 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
    background:
        radial-gradient(900px 320px at 0% -10%, rgba(255, 90, 31, .12), transparent 55%),
        var(--bg);
    color: var(--dark);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; font-weight: 600; }
.container { max-width: 1120px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.topbar {
    background: linear-gradient(120deg, #0b1220 0%, #1e293b 55%, #0f172a 100%);
    border-bottom: 3px solid var(--primary);
    position: sticky; top: 0; z-index: 10;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .25);
}
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: .85rem 1rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.brand {
    font-weight: 800;
    color: #fff !important;
    letter-spacing: -.01em;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    white-space: nowrap;
}
.brand i { color: var(--primary); }
.nav { display: flex; gap: .4rem; flex: 1; flex-wrap: wrap; }
.nav a {
    color: var(--topbar-text);
    padding: .42rem .7rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: .92rem;
}
.nav a.active, .nav a:hover {
    color: #fff;
    background: rgba(255, 90, 31, .92);
}
.product-hub {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 1rem 0 1.5rem;
}
.product-hub-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.2rem;
    border-radius: 16px;
    color: #fff !important;
    text-decoration: none !important;
    min-height: 132px;
    box-shadow: var(--shadow);
    transition: transform .15s ease, filter .15s ease;
}
.product-hub-card:hover { transform: translateY(-3px); filter: brightness(1.05); }
.product-hub-chegou {
    background: linear-gradient(135deg, #0369a1 0%, #0ea5e9 70%, #38bdf8 130%);
}
.product-hub-tto {
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 65%, #f97316 160%);
}
.product-hub-icon {
    width: 56px; height: 56px; border-radius: 14px;
    display: grid; place-items: center;
    background: rgba(255,255,255,.18);
    font-size: 1.45rem;
    flex-shrink: 0;
}
.product-hub-logo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(0,0,0,.18);
    background: #fff;
}
.narota-page-title {
    display: flex;
    align-items: center;
    gap: .65rem;
}
.narota-page-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 6px 14px rgba(15, 23, 42, .15);
}
.product-tabs a img {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    object-fit: cover;
    vertical-align: middle;
    margin-right: .15rem;
}
.product-hub-body { display: grid; gap: .2rem; flex: 1; min-width: 0; }
.product-hub-body strong { font-size: 1.25rem; line-height: 1.15; }
.product-hub-body small { opacity: .92; font-weight: 600; }
.product-hub-body em { font-style: normal; font-size: .85rem; opacity: .85; font-weight: 700; }
.product-hub-go {
    width: 40px; height: 40px; border-radius: 999px;
    display: grid; place-items: center;
    background: rgba(255,255,255,.2);
    flex-shrink: 0;
}
.product-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    background: #fff;
    border: 2px solid #cbd5e1;
    border-radius: 14px;
    padding: .4rem;
    margin: 0 0 1.25rem;
    box-shadow: var(--shadow);
}
.product-tabs a {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .75rem 1.15rem;
    border-radius: 10px;
    color: #334155 !important;
    font-weight: 800;
    background: #f8fafc;
    border: 1px solid transparent;
}
.product-tabs a:hover { background: var(--primary-soft); color: var(--primary-dark) !important; }
.product-tabs a.active {
    background: var(--primary);
    color: #fff !important;
    box-shadow: 0 8px 18px rgba(255, 90, 31, .35);
}
.product-tabs a.active:hover { background: var(--primary-dark); color: #fff !important; }
.product-tabs-home {
    margin-left: auto !important;
    width: 44px;
    justify-content: center;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
@media (max-width: 720px) {
    .product-hub { grid-template-columns: 1fr; }
    .product-tabs-home { margin-left: 0 !important; }
}
.user { display: flex; align-items: center; gap: .75rem; color: #cbd5e1; font-size: .95rem; }
.user .btn-outline {
    background: transparent;
    border-color: rgba(255,255,255,.35);
    color: #fff;
}
.user .btn-outline:hover { background: rgba(255,255,255,.1); }
h1 { margin: 0 0 .35rem; font-size: 1.85rem; letter-spacing: -.02em; }
.lead { color: var(--muted); margin: 0 0 1.5rem; }
.form-section { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 1.25rem; margin-bottom: 1rem; min-width: 0; overflow-wrap: anywhere; box-shadow: var(--shadow); }
.form-section h2 { margin: 0 0 1rem; font-size: 1.1rem; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.form-grid .span-full { grid-column: 1 / -1; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
label { display: block; font-size: .9rem; margin-bottom: .35rem; color: var(--muted); font-weight: 600; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { width: 100%; padding: .7rem .8rem; border: 1.5px solid var(--border); border-radius: 10px; font: inherit; background: #fff; }
input[type="checkbox"], input[type="radio"] { width: auto; padding: 0; border: 0; border-radius: 0; flex-shrink: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid #ffc4ad; border-color: var(--primary); }
input[type="checkbox"]:focus, input[type="radio"]:focus { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .7rem 1.05rem; border-radius: 10px; border: 1px solid transparent; cursor: pointer; font: inherit; font-weight: 700; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 18px rgba(255, 90, 31, .28); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-pagar { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-pagar:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-adiantamento { background: #059669; color: #fff; border-color: #059669; }
.btn-adiantamento:hover { background: #047857; border-color: #047857; }
.btn-pay-compact { min-width: 6.5rem; justify-content: center; font-weight: 600; letter-spacing: .01em; }
.td-pay { white-space: nowrap; width: 1%; }
.muted-dash { color: var(--muted); }
.pay-toggle-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.debito-migracao-box { background: #fffbeb; border-color: #fde68a; margin-bottom: 1rem; }
.debito-migracao-box h3 { margin: 0 0 .5rem; font-size: 1rem; }
.contrato-servicos-resumo { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: .75rem 1rem; margin-bottom: 1rem; font-size: .88rem; }
.pay-panel { margin-bottom: 1rem; }
.pay-resumo { margin: .75rem 0 0; text-align: center; font-size: .95rem; }
.btn-sm-text { font-size: .9rem; }
.btn-outline { background: #fff; border-color: var(--border); color: var(--dark); }
.btn-sm { padding: .4rem .75rem; font-size: .85rem; }
.btn-block { width: 100%; justify-content: center; }
.form-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
.alert { padding: .85rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-weight: 600; }
.alert-error { background: #fef2f2; color: var(--error); border: 1px solid #fecaca; }
.alert-success { background: #ecfdf5; color: var(--ok); border: 1px solid #a7f3d0; }
.alert-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.nav-badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--error); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.notif-list { display: flex; flex-direction: column; gap: 12px; }
.notif-item { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; background: #fff; }
.notif-item.nao-lida { border-left: 4px solid var(--primary); background: #fffaf5; }
.notif-item.lida { opacity: .85; }
.notif-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.notif-head small { color: var(--muted); white-space: nowrap; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state i { font-size: 2rem; margin-bottom: 12px; display: block; }
.push-enable-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.mb { margin-bottom: 1rem; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.auth-card { width: min(420px, 100%); background: #fff; padding: 2rem; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.08); }
.auth-card h1 { margin-bottom: .25rem; }
.subtitle { color: var(--muted); margin-bottom: 1.25rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.card, .action-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 1rem; box-shadow: var(--shadow); }
.card { display: flex; gap: 1rem; align-items: center; min-width: 0; }
.card-body { min-width: 0; flex: 1; }
.card-icon { font-size: 1.6rem; color: var(--primary); }
.actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.action-card { transition: .15s; color: inherit; }
.action-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.action-card i { font-size: 1.4rem; color: var(--primary); }
.field-row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-start; }
.field-row.option-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(148px, max-content));
    gap: .75rem;
}
.field-row.choice-list { flex-direction: column; align-items: stretch; }
.radio-card, .checkbox {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    background: #fafafa;
    border: 1px solid var(--border);
    padding: .65rem .85rem;
    border-radius: 8px;
    cursor: pointer;
    line-height: 1.35;
    flex: 0 0 auto;
    max-width: 100%;
}
.field-row.option-row .radio-card,
.field-row:not(.choice-list) > .checkbox { white-space: nowrap; }
.choice-list .checkbox {
    width: 100%;
    white-space: normal;
    align-items: flex-start;
}
.radio-card:has(input:checked),
.checkbox:has(input:checked) {
    border-color: #ffd8c7;
    background: #fff4ef;
}
.toggle-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: .75rem; }
.toggle-switch-block { max-width: 100%; }
.hidden { display: none !important; }
.mt { margin-top: .75rem; }
.hint { color: var(--muted); font-size: .9rem; line-height: 1.5; overflow-wrap: anywhere; word-break: break-word; }
.table-wrap { overflow: auto; background: #fff; border: 1px solid var(--border); border-radius: 14px; -webkit-overflow-scrolling: touch; box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table th, .table td { padding: .85rem 1rem; border-bottom: 1px solid var(--border); text-align: left; overflow-wrap: anywhere; word-break: break-word; }
.table th { background: #f1f5f9; font-size: .85rem; color: #334155; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.empty { text-align: center; color: var(--muted); }
.badge { display: inline-block; padding: .25rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.badge-ok { background: #ecfdf5; color: var(--ok); }
.nav-traccar { color: var(--muted); }
.nav-traccar:hover { color: var(--primary); }
.login-tabs { display: flex; gap: .5rem; margin-bottom: 1rem; }
.login-tab { flex: 1; text-align: center; padding: .55rem .75rem; border-radius: 8px; border: 1px solid var(--border); color: var(--muted); background: #fafafa; }
.login-tab.active, .login-tab:hover { color: var(--primary); border-color: #ffd8c7; background: #fff4ef; }
.auth-card-wide { width: min(460px, 100%); }
.auth-footer-links { text-align: center; margin-top: 1rem; }
.finance-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.finance-cards .card { padding: .75rem 1rem; }
.finance-cards h3 { margin: 0; font-size: 1.35rem; }
.extrato-wa-bar {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}
.extrato-wa-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; }
.extrato-wa-fields { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.extrato-wa-desconto { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; color: var(--muted); }
.extrato-wa-desconto select { min-width: 110px; padding: .45rem .6rem; border: 1px solid var(--border); border-radius: 8px; }
.extrato-wa-check { font-size: .85rem; margin: 0; align-self: center; }

.extrato-wa-totais { display: flex; flex-direction: column; gap: .15rem; font-size: .9rem; min-width: 140px; }
.th-check, .td-check { width: 2.5rem; text-align: center; }
.td-check input { width: 1.1rem; height: 1.1rem; cursor: pointer; }
.badge-off { background: #fef2f2; color: var(--error); }
.badge-pend { background: #fff7ed; color: #c2410c; }
.badge-info { background: #eff6ff; color: #1d4ed8; }
.section-divider { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.section-title { font-size: 1.15rem; margin: 0 0 1rem; color: var(--dark); }
.convite-box .convite-list { margin-top: 1.25rem; }
.convite-box .convite-list ul { list-style: none; padding: 0; margin: 0; }
.convite-box .convite-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .5rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.convite-link-row { margin-top: .75rem; }
.convite-send-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; align-items: flex-end; }
.convite-send-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.convite-send-input { width: min(240px, 100%); padding: .55rem .65rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.section-head-inline { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .75rem; }
.section-head-inline h3 { margin: 0; }
.filter-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.filter-tab { padding: .45rem .85rem; border-radius: 999px; border: 1px solid var(--border); background: #fafafa; color: var(--muted); font-size: .9rem; }
.filter-tab.active, .filter-tab:hover { color: var(--primary); border-color: #ffd8c7; background: #fff4ef; }
.table-actions { white-space: nowrap; }
.table-actions .inline-form { display: inline; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: 1rem 0; }
.public-page { background: var(--bg); }
.public-container { max-width: 720px; padding-top: 2rem; padding-bottom: 3rem; }
.public-wrap { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; }
.public-header { text-align: center; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.public-brand { font-size: 1.25rem; font-weight: 700; color: var(--primary); }
.public-header p { margin: .35rem 0 0; color: var(--muted); }
.whatsapp-box { margin-top: 1.25rem; padding: 1rem; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 10px; }
.whatsapp-box p { margin: 0 0 .75rem; color: #065f46; }
.whatsapp-box.wa-opened {
    padding: .65rem 1rem;
    background: #f3f4f6;
    border-color: #d1d5db;
}
.whatsapp-box.wa-opened .wa-intro,
.whatsapp-box.wa-opened .wa-preview,
.whatsapp-box.wa-opened .wa-hint,
.whatsapp-box.wa-opened .wa-actions,
.whatsapp-box.wa-opened .wa-status {
    display: none !important;
}
.whatsapp-box .wa-opened-note {
    margin: 0;
    color: #6b7280;
    font-size: .9rem;
    font-weight: 600;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem .75rem;
    align-items: center;
}
.whatsapp-box .btn-wa-reopen {
    font-weight: 600;
}
.config-contato-form { max-width: 560px; }
.config-contato-field { margin-bottom: 1.25rem; }
.config-contato-preview { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.config-contato-preview h3 { font-size: 1rem; margin: 0 0 .75rem; color: var(--text); }
.wa-preview {
    margin: 0 0 .85rem;
    padding: .85rem 1rem;
    background: #fff;
    border: 1px solid #d1fae5;
    border-radius: 8px;
    font-family: 'Segoe UI', Tahoma, Arial, 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
    font-size: .95rem;
    line-height: 1.55;
    color: #111827;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 280px;
    overflow: auto;
}
.wa-hint { font-size: .88rem; color: #047857; }
.wa-hint-desktop { display: none; }
.wa-hint-mobile { display: none; }
.wa-mode-desktop .wa-hint-desktop { display: block; }
.wa-mode-mobile .wa-hint-mobile { display: block; }
.wa-mode-mobile .wa-copy-btn { display: none; }
.wa-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.wa-status { margin: .75rem 0 0; font-size: .9rem; font-weight: 600; }
.wa-status-ok { color: #047857; }
.wa-status-error { color: #b45309; }
.wa-box kbd, .whatsapp-box kbd {
    display: inline-block;
    padding: .1rem .35rem;
    border: 1px solid #a7f3d0;
    border-radius: 4px;
    background: #fff;
    font-size: .82rem;
}
.btn-whatsapp { background: #25D366; color: #fff; font-weight: 600; }
.btn-whatsapp:hover { background: #1da851; color: #fff; }
.btn-whatsapp-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    font-size: 1.35rem;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
}
.btn-whatsapp-icon:hover,
.btn-whatsapp-icon:focus {
    background: #1da851;
    color: #fff;
}
.btn-whatsapp-icon:disabled,
.btn-whatsapp-icon[disabled] {
    opacity: .45;
    cursor: not-allowed;
    box-shadow: none;
}
.btn-whatsapp-icon.btn-sm {
    width: 2.15rem;
    height: 2.15rem;
    font-size: 1.15rem;
    padding: 0;
}
.btn-whatsapp-icon i { margin: 0; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.pix-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.pix-card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: nowrap; }
.pix-card-head h2 { margin: 0; flex: 1; min-width: 0; }
.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    font-size: .85rem;
    color: var(--muted);
    user-select: none;
}
.toggle-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.toggle-ui {
    position: relative;
    width: 44px;
    height: 24px;
    background: #d1d5db;
    border-radius: 999px;
    transition: background .2s;
    flex-shrink: 0;
}
.toggle-ui::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.toggle-switch input:checked + .toggle-ui { background: var(--ok); }
.toggle-switch input:checked + .toggle-ui::after { transform: translateX(20px); }
.toggle-switch input:focus-visible + .toggle-ui { outline: 2px solid var(--primary); outline-offset: 2px; }
.toggle-text { font-weight: 600; min-width: 4.5rem; }
.toggle-text-on { display: none; color: var(--ok); }
.toggle-text-off { display: inline; color: var(--muted); }
.toggle-switch input:checked ~ .toggle-text-off { display: none; }
.toggle-switch input:checked ~ .toggle-text-on { display: inline; }
.pix-field { margin-top: 1rem; }
.copy-row { display: flex; gap: .5rem; align-items: flex-start; flex-wrap: wrap; }
.copy-row input { flex: 1; min-width: 180px; }
.copy-row textarea { flex: 1; min-width: 180px; resize: vertical; }
.btn-copy { white-space: nowrap; }
.btn-copy-ok { border-color: #6ee7b7; color: var(--ok); background: #ecfdf5; }
.pix-qr-preview { margin-top: .75rem; display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; }
.pix-qr-preview img, .pix-resumo-qr {
    max-width: 180px;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}
.pix-resumo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.pix-resumo-item { padding: .85rem; border: 1px solid var(--border); border-radius: 10px; background: #fafafa; }
.pix-resumo-item strong { display: block; margin-bottom: .65rem; }
.pix-banco-tag {
    margin: 0 0 .65rem;
    font-size: .88rem;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: .45rem .65rem;
}
.pix-card .pix-banco-tag { margin-top: .75rem; }
.profile-header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; align-items: flex-start; }
.back-link { display: inline-block; margin-bottom: .5rem; color: var(--muted); font-size: .9rem; }
.row-delete-form { display: inline-flex; margin-left: .35rem; vertical-align: middle; }

.inline-form { display: inline; }
.btn-danger { color: var(--error); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.detail-list { margin: 0; display: grid; grid-template-columns: 120px 1fr; gap: .45rem .75rem; font-size: .95rem; }
.detail-list dt { color: var(--muted); margin: 0; }
.detail-list dd { margin: 0; font-weight: 500; }
.table-clickable tbody tr { cursor: pointer; }
.table-clickable tbody tr:hover { background: #fff8f5; }
.row-link { color: inherit; text-decoration: none; }
.row-link:hover { color: var(--primary); }
.template-list { display: grid; gap: .75rem; margin-bottom: 1rem; }
@media (min-width: 720px) {
    .template-list { grid-template-columns: 1fr 1fr; }
}
.template-card { display: block; padding: .85rem 1rem; border: 2px solid var(--border); border-radius: 10px; cursor: pointer; background: #fafafa; }
.template-card:has(input:checked) { border-color: var(--primary); background: #fff4ef; }
.template-card input { margin-right: .5rem; }
.template-card strong { display: block; margin-bottom: .25rem; }
.template-card small { color: var(--muted); line-height: 1.5; word-break: break-word; white-space: pre-wrap; font-family: inherit; display: block; max-width: 100%; overflow-wrap: anywhere; }
.wa-preview, .whatsapp-box .wa-preview {
    white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere;
    max-width: 100%; font-size: .92rem; line-height: 1.45;
}
@media (max-width: 640px) {
    .topbar-inner { flex-direction: column; align-items: flex-start; gap: .65rem; }
    .nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: .2rem; gap: .5rem; }
    .nav a { white-space: nowrap; font-size: .9rem; }
    .user { width: 100%; justify-content: space-between; flex-wrap: wrap; }
    .container { padding: 1rem .75rem 2rem; }
    h1 { font-size: 1.35rem; }
    .lead { font-size: .95rem; }
    .detail-list { grid-template-columns: 1fr; gap: .15rem 0; }
    .detail-list dt { font-size: .82rem; margin-top: .55rem; padding-top: 0; }
    .detail-list dt:first-child { margin-top: 0; }
    .form-actions { flex-direction: column; align-items: stretch; }
    .form-actions .btn { width: 100%; justify-content: center; }
    .cards, .actions-grid, .finance-cards { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .table-stack { min-width: 0; }
    .table-wrap:has(.table-stack) {
        overflow: visible;
        background: transparent;
        border: 0;
        border-radius: 0;
    }
    .table-stack thead { display: none; }
    .table-stack tbody tr {
        display: block;
        margin-bottom: .85rem;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
    }
    .table-stack tbody td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: .75rem;
        padding: .65rem 1rem;
        border-bottom: 1px solid #f3f4f6;
        text-align: right;
    }
    .table-stack tbody td:last-child { border-bottom: 0; }
    .table-stack tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--muted);
        font-size: .72rem;
        text-transform: uppercase;
        letter-spacing: .02em;
        text-align: left;
        flex: 0 0 38%;
        max-width: 42%;
        line-height: 1.4;
        padding-top: .1rem;
    }
    .table-stack tbody td.empty {
        display: block;
        text-align: center;
    }
    .table-stack tbody td.empty::before { display: none; }
    .table-stack .table-actions {
        white-space: normal;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

.section-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: .5rem;
}
.section-head-row h2 { margin: 0; }

.veiculo-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: .75rem;
    background: #fafbfc;
}
.veiculo-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
}
.veiculo-resumo-item {
    border-bottom: 1px solid var(--border);
    padding-bottom: .75rem;
    margin-bottom: .75rem;
}
.veiculo-resumo-item:last-child {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}

.veiculos-resumo-box {
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid #ffd8c7;
    border-radius: 12px;
    background: #fff8f4;
}
.veiculos-resumo-title {
    margin: 0 0 .35rem;
    font-size: 1rem;
    color: var(--text);
}
.veiculos-resumo-hint { margin: 0 0 .75rem; }
.veiculos-resumo-lista {
    list-style: none;
    margin: 0 0 .75rem;
    padding: 0;
}
.veiculos-resumo-lista li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .55rem 0;
    border-bottom: 1px dashed var(--border);
    font-size: .95rem;
}
.veiculos-resumo-lista li:last-child { border-bottom: 0; }
.veiculos-resumo-lista .resumo-placa {
    font-weight: 700;
    letter-spacing: .03em;
    min-width: 5.5rem;
}
.veiculos-resumo-lista .resumo-servico {
    flex: 1;
    color: #4b5563;
}
.veiculos-resumo-lista .resumo-valor {
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}
.veiculos-resumo-vazio { margin: 0 0 .5rem; }
.veiculos-resumo-vazio.hidden { display: none; }
.veiculos-resumo-subtotal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: .75rem;
    border-top: 2px solid #ffd8c7;
    font-size: 1rem;
}
.veiculos-resumo-subtotal strong {
    font-size: 1.15rem;
    color: var(--primary);
}

.servico-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: .75rem;
    background: #fafbfc;
}
.servico-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
}
.subsection-title {
    margin: 0;
    font-size: 1rem;
}
.mt { margin-top: 1rem; }

/* Seletor de cor do veículo */
.cor-veiculo-wrap label { margin-bottom: .5rem; }
.cor-veiculo-field { display: flex; flex-direction: column; gap: .5rem; }
.cor-veiculo-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}
.cor-veiculo-swatch-btn {
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    background: none;
    cursor: pointer;
    line-height: 0;
}
.cor-veiculo-swatch-btn:hover { border-color: #ffd8c7; }
.cor-veiculo-swatch-btn.is-active { border-color: var(--primary); box-shadow: 0 0 0 2px #fff4ef; }
.cor-veiculo-swatch {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 6px;
}
.cor-veiculo-text-row {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.cor-veiculo-preview {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
}
.cor-veiculo-input { flex: 1; min-width: 0; }
.cor-veiculo-hint { margin: 0; font-size: .8rem; }
.cor-veiculo-display {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}
.cor-veiculo-display .cor-veiculo-swatch {
    width: 22px;
    height: 22px;
}

.traccar-device-wrap label { margin-bottom: .35rem; }
.traccar-device-hint { margin: .35rem 0 0; font-size: .8rem; }
.select-traccar-device { font-size: .95rem; }
