/* ===================================================================
   Portal Vendedor Quimatic — estilos base (mobile-first)
   Paleta: azul Quimatic #0b3c6f, acento #2e7ac6, neutros graduados.
   =================================================================== */

:root {
    --c-bg:          #f4f6f9;
    --c-surface:     #ffffff;
    --c-border:      #e1e6ec;
    --c-text:        #1b2634;
    --c-muted:       #6c7a8a;
    --c-primary:     #0b3c6f;
    --c-primary-ink: #ffffff;
    --c-accent:      #2e7ac6;
    --c-success:     #1e8a4c;
    --c-warn:        #b3630a;
    --c-danger:      #c1351a;
    --c-info:        #205e8a;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --shadow-sm: 0 1px 2px rgba(11,60,111,0.06);
    --shadow-md: 0 6px 16px rgba(11,60,111,0.10);

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;

    --font:
      -apple-system, BlinkMacSystemFont, "Segoe UI",
      Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--c-bg);
    color: var(--c-text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.4;
    -webkit-text-size-adjust: 100%;
}

a { color: var(--c-accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

/* ---------- Shell mobile-first ---------- */
.app-shell {
    min-height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    padding-bottom: 96px;
    background: var(--c-bg);
}

/* ---------- Auth pages ---------- */
.auth-page {
    padding: var(--space-6) var(--space-4) var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-height: 100vh;
}
.auth-brand { text-align: center; margin: var(--space-4) 0 var(--space-2); }
.auth-brand h1 { font-size: 1.4rem; margin: var(--space-3) 0 0; color: var(--c-primary); }
.auth-brand .subtitle { color: var(--c-muted); font-size: 0.9rem; margin: var(--space-1) 0 0; }
.auth-footer { text-align: center; color: var(--c-muted); margin-top: auto; }

.logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--c-primary);
    color: var(--c-primary-ink);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.02em;
}
.logo-badge--sm { width: 32px; height: 32px; font-size: 1rem; }

/* ---------- Card / Form ---------- */
.card {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.field { display: flex; flex-direction: column; gap: var(--space-1); }
.field > span { font-size: 0.85rem; color: var(--c-muted); font-weight: 600; }
.field input, .field select, .field textarea {
    font-family: inherit;
    font-size: 1rem;
    padding: 12px 14px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    background: var(--c-surface);
    color: var(--c-text);
    min-height: 48px;   /* alvo de toque */
}
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--c-accent);
    outline: 2px solid rgba(46,122,198,0.25);
    outline-offset: 0;
}
.field-error { color: var(--c-danger); font-size: 0.85rem; font-style: normal; }

.password-wrap { position: relative; display: flex; }
.password-wrap input { flex: 1; padding-right: 48px; }
.toggle-pwd {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    background: transparent; border: 0; font-size: 1.1rem;
    width: 40px; height: 40px; border-radius: 50%;
    cursor: pointer; color: var(--c-muted);
}
.toggle-pwd:hover { background: rgba(0,0,0,0.04); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font: inherit;
    font-weight: 600;
    padding: 14px 18px;
    min-height: 48px;
    border: 0;
    border-radius: var(--radius-md);
    cursor: pointer;
    background: #edf1f6;
    color: var(--c-text);
}
.btn:hover { filter: brightness(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary { background: var(--c-primary); color: var(--c-primary-ink); }
.btn--accent { background: var(--c-accent); color: #fff; }
.btn--danger { background: var(--c-danger); color: #fff; }

.form-footer { margin: 0; text-align: center; font-size: 0.9rem; }

/* ---------- Flash ---------- */
.flash-stack { display: flex; flex-direction: column; gap: var(--space-2); }
.flash {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    border-left: 4px solid transparent;
}
.flash--success { background: #e7f5ec; color: var(--c-success); border-color: var(--c-success); }
.flash--error   { background: #fbe9e6; color: var(--c-danger);  border-color: var(--c-danger); }
.flash--info    { background: #e6f0f7; color: var(--c-info);    border-color: var(--c-info); }
.flash--warning { background: #fff1d8; color: var(--c-warn);    border-color: var(--c-warn); }

/* ---------- App bar + menu ---------- */
.app-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--c-primary);
    color: var(--c-primary-ink);
    padding: var(--space-3) var(--space-4);
    box-shadow: var(--shadow-sm);
}
.app-bar__title { display: flex; align-items: center; gap: var(--space-2); }
.app-bar__title strong { font-weight: 600; }
.menu summary {
    list-style: none;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    position: relative;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary::before {
    content: '';
    width: 20px; height: 2px;
    background: currentColor;
    box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}
.menu[open] summary::before {
    background: transparent;
    box-shadow: none;
    width: 20px; height: 20px;
    border: 2px solid currentColor;
    border-radius: 50%;
}
.menu__list {
    position: absolute;
    top: 100%;
    right: var(--space-4);
    min-width: 220px;
    margin: var(--space-2) 0 0;
    padding: var(--space-2) 0;
    background: var(--c-surface);
    color: var(--c-text);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    list-style: none;
    z-index: 20;
}
.menu__list li { padding: var(--space-2) var(--space-4); }
.menu__list li a,
.menu__logout { color: var(--c-text); background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.menu__user { font-weight: 600; }
.menu__email { font-size: 0.85rem; color: var(--c-muted); }
.menu__sep { padding: 0; height: 1px; background: var(--c-border); margin: var(--space-1) 0; }
.menu__form { margin: 0; }

/* ---------- Container ---------- */
.container { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-4); }
.greet { font-size: 1.3rem; margin: 0; color: var(--c-primary); }

/* ---------- Summary cards ---------- */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
}
.summary-card {
    background: var(--c-surface);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.summary-card__label { font-size: 0.75rem; color: var(--c-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.summary-card__value { font-size: 1.6rem; font-weight: 700; color: var(--c-primary); }

/* ---------- Section + list ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.section-head h3 { margin: 0; font-size: 1rem; }
.muted { color: var(--c-muted); font-size: 0.85rem; }

.quote-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.quote-item {
    background: var(--c-surface);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.quote-item--link {
    text-decoration: none;
    color: inherit;
    transition: box-shadow .15s ease, transform .05s ease;
}
.quote-item--link:hover,
.quote-item--link:focus-visible {
    box-shadow: 0 2px 8px rgba(11, 60, 111, 0.15);
    outline: none;
}
.quote-item--link:active { transform: scale(0.995); }
.quote-item__main { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.quote-item__numero { color: var(--c-primary); }
.quote-item__cliente { color: var(--c-text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-item__meta { display: flex; align-items: center; justify-content: space-between; font-size: 0.85rem; color: var(--c-muted); }
.quote-item__total { color: var(--c-text); font-weight: 600; }
.quote-item__status { text-transform: capitalize; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; }
.status-emitida    { background: #e7f5ec; color: var(--c-success); }
.status-rascunho   { background: #e6f0f7; color: var(--c-info); }
.status-cancelada  { background: #fbe9e6; color: var(--c-danger); }

.badge { font-size: 0.7rem; padding: 2px 8px; border-radius: 999px; letter-spacing: 0.04em; font-weight: 700; }
.badge--qm   { background: #0b3c6f; color: #fff; }
.badge--deq  { background: #2e7ac6; color: #fff; }

/* ---------- Rascunhos em aberto ---------- */
.drafts-section {
    background: #fff8e7;
    border: 1px solid #ffd98a;
    border-radius: var(--radius);
    padding: var(--space-3);
    margin-bottom: var(--space-3);
}
.drafts-section__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--space-2);
}
.drafts-section__head h3 {
    margin: 0;
    font-size: 1rem;
    color: #7a5300;
}
.drafts-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.draft-item {
    background: #fff;
    border: 1px solid #f0e2bd;
    border-radius: var(--radius);
    padding: var(--space-2);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.draft-item__main {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    min-width: 0;
}
.draft-item__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.draft-item__cliente {
    color: var(--c-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.draft-item__meta {
    font-size: 0.82rem;
    color: var(--c-muted);
}
.draft-item__actions {
    display: flex;
    gap: var(--space-2);
    justify-content: flex-end;
}
.draft-item__form {
    margin: 0;
}
.draft-item__discard {
    color: #a33;
}
.draft-item__discard:hover {
    background: #fde2e2;
    border-color: #e8a3a3;
}

/* ---------- Bottom CTA ---------- */
.bottom-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    display: flex;
    justify-content: center;
    padding: var(--space-3);
    background: linear-gradient(to top, rgba(244,246,249,1) 60%, rgba(244,246,249,0));
    pointer-events: none;
}
.bottom-bar__cta {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 240px;
    padding: 16px 24px;
    background: var(--c-primary);
    color: #fff;
    border-radius: 999px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    text-decoration: none;
}
.bottom-bar__cta:hover { text-decoration: none; filter: brightness(1.05); }

/* ---------- Admin ---------- */
.back-link {
    color: var(--c-primary-ink);
    font-size: 1.3rem;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}
.back-link:hover { background: rgba(255,255,255,0.12); text-decoration: none; }

.summary-card__sub { font-size: 0.85rem; color: var(--c-muted); font-weight: 500; margin-left: 2px; }
.section-head__title { margin: var(--space-2) 0 0; font-size: 1rem; color: var(--c-text); }

.admin-menu {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.admin-menu__item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--c-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    color: var(--c-text);
    text-decoration: none;
    min-height: 64px;
}
.admin-menu__item:hover { text-decoration: none; box-shadow: var(--shadow-md); }
.admin-menu__icon { font-size: 1.6rem; }
.admin-menu__item strong { display: block; color: var(--c-primary); }
.admin-menu__item small { color: var(--c-muted); font-size: 0.85rem; }

/* ---------- Form helpers ---------- */
.search-form {
    display: flex;
    gap: var(--space-2);
}
.search-form .input { flex: 1; }
.input {
    font-family: inherit;
    font-size: 1rem;
    padding: 12px 14px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    background: var(--c-surface);
    color: var(--c-text);
    min-height: 48px;
}
.input:focus {
    border-color: var(--c-accent);
    outline: 2px solid rgba(46,122,198,0.25);
}
.btn--secondary { background: #edf1f6; color: var(--c-primary); }

/* ---------- Empty state ---------- */
.empty-state {
    text-align: center;
    padding: var(--space-5) var(--space-4);
    background: var(--c-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.empty-state p { margin: var(--space-2) 0; color: var(--c-muted); }

/* ---------- Product list ---------- */
.product-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.product-item {
    background: var(--c-surface);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}
.product-item__head { display: flex; align-items: center; gap: var(--space-2); }
.product-item__codigo { color: var(--c-primary); font-family: "SF Mono", Menlo, Consolas, monospace; }
.product-item__nome { color: var(--c-text); font-size: 0.95rem; }
.product-item__meta { display: flex; gap: var(--space-3); font-size: 0.8rem; color: var(--c-muted); }
.product-item__precos { display: flex; gap: var(--space-1); flex-wrap: wrap; margin-top: var(--space-1); }
.pill {
    background: #edf1f6;
    color: var(--c-primary);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
}

/* ---------- User list ---------- */
.user-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.user-item {
    background: var(--c-surface);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}
.user-item__main { display: flex; flex-direction: column; gap: 2px; }
.user-item__email { font-size: 0.85rem; color: var(--c-muted); }
.user-item__meta { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font-size: 0.8rem; }
.user-item__login { color: var(--c-muted); }

.badge--admin         { background: var(--c-primary); color: #fff; }
.badge--representante { background: var(--c-accent);  color: #fff; }
.badge--muted         { background: #d8dee7;          color: var(--c-muted); }

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-top: var(--space-3);
    font-size: 0.9rem;
}
.pagination a {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: var(--c-surface);
    color: var(--c-primary);
    box-shadow: var(--shadow-sm);
}

/* ---------- Cards genericos (importar/preview) ---------- */
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    margin-bottom: var(--space-5);
    box-shadow: var(--shadow-sm);
}
.card__title {
    margin: 0 0 var(--space-3) 0;
    font-size: 1.05rem;
    color: var(--c-primary);
}
.card--info {
    background: #eff6fb;
    border-color: #c9dde8;
}
.card--danger {
    background: #fdecec;
    border-color: #e8c9c9;
    color: #7a1a0f;
}
.card--danger .card__title { color: #7a1a0f; }

.steps {
    padding-left: 1.25rem;
    margin: 0 0 var(--space-3) 0;
}
.steps li { margin-bottom: 4px; }

/* ---------- Form fields (upload) ---------- */
.form--import .field { display: block; margin-bottom: var(--space-4); }
.field__label {
    display: block;
    font-size: 0.9rem;
    color: var(--c-muted);
    margin-bottom: 6px;
}
.input--file {
    width: 100%;
    padding: 10px;
    border: 1px dashed var(--c-border);
    border-radius: var(--radius-sm);
    background: #fafbfc;
}
.form__actions {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-top: var(--space-4);
}
.btn--ghost {
    background: transparent;
    color: var(--c-muted);
    border: 1px solid var(--c-border);
}
.btn--block {
    width: 100%;
    display: block;
    text-align: center;
}
.form--confirm { margin-top: var(--space-5); }
.form--cancel { margin-top: var(--space-2); }

/* ---------- Diff list (preview) ---------- */
.disclosure {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-3);
}
.disclosure > summary {
    cursor: pointer;
    padding: var(--space-2) 0;
    color: var(--c-primary);
}
.diff-list {
    list-style: none;
    padding: 0;
    margin: var(--space-3) 0 0 0;
}
.diff-item {
    padding: var(--space-3);
    border-top: 1px solid var(--c-border);
}
.diff-item:first-child { border-top: 0; }
.diff-item__head {
    display: flex;
    gap: var(--space-2);
    align-items: baseline;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.diff-item__head code {
    font-weight: 600;
    color: var(--c-primary);
}
.diff-item__nome {
    font-size: 0.95rem;
    color: var(--c-text);
}
.diff-item__precos {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.diff-item--add      { background: #f2faf5; }
.diff-item--change   { background: #fff9ee; }
.diff-item--remove   { background: #fdf3f3; opacity: 0.88; }

.pill--new {
    background: #1e8a4c;
    color: #fff;
}
.pill--change {
    background: #b3630a;
    color: #fff;
}
.pill s {
    opacity: 0.7;
    font-weight: 400;
}

.issue-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.issue-list li {
    padding: 6px 0;
    border-top: 1px solid #e8c9c9;
    font-size: 0.9rem;
}
.issue-list li:first-child { border-top: 0; }

.text-danger { color: var(--c-danger); }

/* =========================================================
   Wizard de cotação (4 telas)
   ========================================================= */

/* Stepper */
.stepper {
    display: flex;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-4) 0;
    justify-content: space-between;
}
.stepper__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--c-muted);
    font-size: 0.78rem;
    position: relative;
}
.stepper__num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--c-border);
    color: var(--c-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}
.stepper__item.is-done .stepper__num {
    background: var(--c-success);
    color: #fff;
}
.stepper__item.is-active .stepper__num {
    background: var(--c-primary);
    color: #fff;
}
.stepper__item.is-active .stepper__label {
    color: var(--c-primary);
    font-weight: 600;
}

/* Form wizard */
.form-wizard { margin-top: var(--space-3); }
.form-wizard .field {
    border: 0;
    padding: 0;
    margin: 0 0 var(--space-4) 0;
}
.form-wizard .field legend {
    font-weight: 600;
    padding: 0;
    margin-bottom: var(--space-2);
    color: var(--c-primary);
    font-size: 0.95rem;
}
.form-wizard__actions {
    display: flex;
    gap: var(--space-2);
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-5);
}
.form-wizard__actions .btn { flex: 1; }

.form-cancel {
    margin-top: var(--space-3);
    text-align: center;
}

/* Radio cards (empresa) */
.radio-group { display: grid; gap: var(--space-2); }
.radio-group--inline {
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: var(--space-2);
}
.radio-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-3);
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius-md);
    background: var(--c-surface);
    cursor: pointer;
    transition: border-color .12s, background .12s;
}
.radio-card input[type="radio"] { margin-right: 8px; }
.radio-card:has(input:checked) {
    border-color: var(--c-primary);
    background: #f0f6fd;
}
.radio-card__title { font-weight: 600; color: var(--c-primary); }
.radio-card__sub   { color: var(--c-muted); font-size: 0.85rem; }

/* Radio pills (tabela) */
.radio-pill {
    padding: var(--space-2) var(--space-3);
    border: 1.5px solid var(--c-border);
    border-radius: 999px;
    background: var(--c-surface);
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    color: var(--c-muted);
}
.radio-pill input { display: none; }
.radio-pill:has(input:checked) {
    border-color: var(--c-primary);
    background: var(--c-primary);
    color: #fff;
}
.field__hint { font-size: 0.8rem; margin-top: var(--space-2); }

/* Checkbox card */
.checkbox-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-3);
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius-md);
    background: var(--c-surface);
    cursor: pointer;
}
.checkbox-card input { transform: scale(1.2); margin-right: 8px; }
.checkbox-card:has(input:checked) {
    border-color: var(--c-primary);
    background: #f0f6fd;
}
.checkbox-card__title { font-weight: 600; color: var(--c-primary); }
.checkbox-card__sub   { color: var(--c-muted); font-size: 0.85rem; margin-top: 4px; }

/* Inputs agrupados */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: var(--space-3);
}
.input-group > span { font-size: 0.85rem; color: var(--c-muted); }
.req { color: var(--c-danger); }

.input-inline {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.75rem;
    color: var(--c-muted);
}
.input--small { padding: 6px 8px !important; font-size: 0.9rem; max-width: 80px; }
.btn--small { padding: 6px 12px !important; font-size: 0.85rem; }

/* Clientes recentes */
.recent-clients {
    margin-bottom: var(--space-3);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
}
.recent-clients summary { cursor: pointer; color: var(--c-accent); font-weight: 600; }
.recent-clients__list {
    list-style: none;
    padding: var(--space-2) 0 0 0;
    margin: 0;
}
.recent-clients__list li { padding: 6px 0; border-top: 1px solid var(--c-border); }
.recent-clients__list li:first-child { border-top: 0; }
.link-btn {
    background: none;
    border: 0;
    padding: 0;
    color: var(--c-accent);
    text-align: left;
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
}

/* Preview de defaults (step3) */
.defaults-preview {
    margin-top: var(--space-3);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
}
.defaults-preview summary { cursor: pointer; color: var(--c-accent); font-weight: 600; }

/* Adicionar produto (step2) — form embutido na linha */
.product-list--addable .product-item { padding-bottom: var(--space-3); }
.add-form {
    display: flex;
    gap: var(--space-2);
    align-items: flex-end;
    margin-top: var(--space-2);
}
.add-form .btn { align-self: stretch; }

/* Carrinho (step2) */
.section-title {
    font-size: 0.9rem;
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: var(--space-4) 0 var(--space-2) 0;
}
.cart-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-3) 0;
    display: grid;
    gap: var(--space-2);
}
.cart-item {
    padding: var(--space-3);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    position: relative;
}
.cart-item__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.cart-item__qtd {
    color: var(--c-accent);
    font-weight: 600;
}
.cart-item__nome { font-size: 0.9rem; }
.cart-item__meta {
    display: flex;
    gap: var(--space-3);
    color: var(--c-muted);
    font-size: 0.8rem;
    margin-top: 4px;
}
.cart-item__rm { margin-top: var(--space-2); text-align: right; }

/* Revisão (step4) */
.review-items {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-3) 0;
    display: grid;
    gap: var(--space-2);
}
.review-item {
    padding: var(--space-2) 0;
    border-top: 1px solid var(--c-border);
}
.review-item:first-child { border-top: 0; }
.review-item__head {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
}
.review-item__name { font-size: 0.9rem; }
.review-item__meta {
    color: var(--c-muted);
    font-size: 0.8rem;
}
.review-obs {
    background: var(--c-bg);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    margin: var(--space-2) 0 0 0;
    white-space: pre-wrap;
}

.totals {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px var(--space-3);
    margin: var(--space-3) 0 0 0;
    padding-top: var(--space-3);
    border-top: 1px solid var(--c-border);
}
.totals dt, .totals dd { margin: 0; }
.totals dd { text-align: right; }
.totals__final { font-weight: 700; font-size: 1.1rem; color: var(--c-primary); }

/* Cards genéricos (usado em step4 e sucesso) */
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    box-shadow: var(--shadow-sm);
}
.card__title {
    margin: 0 0 var(--space-3) 0;
    font-size: 1rem;
    color: var(--c-primary);
}
.card--success {
    border-color: #bfe0cc;
    background: #edf7f0;
}

/* Listas de definição limpas */
.dl-clean {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px var(--space-3);
    margin: 0;
}
.dl-clean dt {
    color: var(--c-muted);
    font-size: 0.8rem;
    font-weight: normal;
}
.dl-clean dd { margin: 0; word-break: break-word; }

.big-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--c-primary);
    margin: var(--space-2) 0;
    letter-spacing: 0.5px;
}

.notice {
    background: #fff7eb;
    border: 1px solid #f0d6a0;
    padding: var(--space-3);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
    font-size: 0.9rem;
}

/* Botão danger-link (usado em Cancelar) */
.btn--danger-link {
    background: none;
    border: 0;
    color: var(--c-danger);
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
    padding: var(--space-2);
}

.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;
}

/* ---------- Desktop ajustes ---------- */
@media (min-width: 720px) {
    .app-shell { max-width: 560px; }
}

/* ===================================================================
   Entrega 2 — Filtros + Paginação (dashboard)
   =================================================================== */

/* Filtros colapsáveis */
.filters {
    margin: 12px 0 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}
.filters__summary {
    list-style: none;
    cursor: pointer;
    padding: 10px 14px;
    font-weight: 600;
    color: #0b3c6f;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    user-select: none;
}
.filters__summary::-webkit-details-marker { display: none; }
.filters__summary::after {
    content: '▾';
    font-size: 0.9rem;
    opacity: 0.6;
    transition: transform 0.15s ease;
}
.filters[open] .filters__summary::after { transform: rotate(180deg); }
.filters__badge {
    display: inline-block;
    font-size: 0.72rem;
    background: #2e7ac6;
    color: #fff;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 500;
    margin-left: auto;
    margin-right: 6px;
}
.filters__body {
    padding: 4px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid #eef2f7;
}
.filters__row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.filters__label {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.filters__search {
    display: flex;
    gap: 8px;
    margin-top: 2px;
}
.filters__input {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
}
.filters__input:focus {
    outline: none;
    border-color: #2e7ac6;
    box-shadow: 0 0 0 3px rgba(46, 122, 198, 0.15);
}
.filters__footer {
    display: flex;
    justify-content: flex-end;
}
.filters__clear {
    font-size: 0.85rem;
    color: #64748b;
    text-decoration: underline;
}
.filters__clear:hover { color: #0b3c6f; }

/* Chips */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.chip {
    display: inline-block;
    padding: 6px 12px;
    font-size: 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #f8fafc;
    color: #334155;
    text-decoration: none;
    transition: background 0.1s ease, border-color 0.1s ease, color 0.1s ease;
}
.chip:hover { background: #e2e8f0; }
.chip--active {
    background: #0b3c6f;
    border-color: #0b3c6f;
    color: #fff;
    font-weight: 500;
}
.chip--active:hover { background: #0b3c6f; }

/* Summary cards clicáveis */
.summary-card--link {
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s ease, transform 0.05s ease;
}
.summary-card--link:hover,
.summary-card--link:focus-visible {
    box-shadow: 0 2px 8px rgba(11, 60, 111, 0.15);
    outline: none;
}
.summary-card--link:active { transform: scale(0.99); }
.summary-card--active {
    background: #e0ecf9;
    border: 1px solid #2e7ac6;
}

/* Paginação */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 16px 0 20px;
    padding: 10px 0;
}
.pagination__btn {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #0b3c6f;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}
.pagination__btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}
.pagination__btn--disabled {
    color: #cbd5e1;
    background: #f8fafc;
    cursor: default;
}
.pagination__btn--disabled:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}
.pagination__status {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
    text-align: center;
    flex: 1;
}

/* Botão pequeno */
.btn--sm {
    padding: 9px 14px;
    font-size: 0.88rem;
}

/* Radio pill travado (usuário sem permissão de alterar a tabela) */
.radio-pill--locked {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border: 1.5px dashed var(--c-border);
    border-radius: 999px;
    background: var(--c-surface);
    color: var(--c-primary);
    font-weight: 600;
    cursor: not-allowed;
    user-select: none;
}
.radio-pill--locked .radio-pill__lock {
    font-size: 0.85em;
    opacity: 0.7;
}

/* ==============================================================
   Entrega 7 — UX pack
   ============================================================== */

/* Nome do vendedor na listagem de cotações (só admin vê) */
.quote-item__vendedor {
    display: inline-block;
    margin-top: 2px;
    padding: 1px 8px;
    background: var(--c-bg);
    border-radius: 999px;
    font-size: 0.75rem;
    color: var(--c-muted);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}
.quote-item__vendedor::before {
    content: "\1F464  ";
    font-size: 0.9em;
    opacity: 0.7;
}

/* Rodapé sticky do wizard (evita que Continuar fique fora da tela no mobile) */
.form-wizard__actions--sticky {
    position: sticky;
    bottom: 0;
    z-index: 10;
    margin-top: var(--space-4);
    padding: var(--space-3) 0;
    padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(
        to bottom,
        rgba(244, 246, 249, 0) 0%,
        var(--c-bg) 24%,
        var(--c-bg) 100%
    );
    box-shadow: 0 -1px 0 var(--c-border);
}
.container:has(.form-wizard__actions--sticky) {
    padding-bottom: var(--space-6, 32px);
}

/* =====================================================================
 * Entrega 8 — Desconto padrão + Condições customizadas
 * =================================================================== */

/* Bloco de inputs editáveis quando o usuário desmarca "condições padrão" */
.cond-custom {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-3);
    padding: var(--space-3);
    border: 1px dashed var(--c-border);
    border-radius: var(--radius-2);
    background: color-mix(in oklab, var(--c-bg) 94%, white);
}
.cond-custom[hidden] { display: none; }

.cond-custom .input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cond-custom .input-group > span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--c-muted);
}
.cond-custom textarea.input {
    min-height: 2.2em;
    resize: vertical;
}

/* Preview fechado quando marcado: menor visual load */
.defaults-preview {
    margin-top: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-2);
    background: var(--c-surface);
}
.defaults-preview[hidden] { display: none; }
.defaults-preview > summary {
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--c-muted);
    padding: 4px 0;
}
.defaults-preview > summary:focus { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.defaults-preview .dl-clean { margin-top: var(--space-2); }

/* ============================================================
   Restritos & Permissoes (adicionados em entrega-ncm-restrito)
   ============================================================ */

.badge--restrito {
    background: #f7e3ce;
    color: #8a4b12;
    border: 1px solid #e5c89a;
}

.summary-card__extra {
    display: block;
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--color-muted, #6b6f76);
}

.user-item__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.product-list--check {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-item--check {
    background: #fff;
    border: 1px solid #e1e3e7;
    border-radius: 8px;
    padding: 10px 12px;
}

.product-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.product-check__input {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.product-check__body {
    flex: 1;
    min-width: 0;
}

.product-check__codigo {
    font-weight: 600;
    font-size: 0.95rem;
}

.product-check__nome {
    font-size: 0.88rem;
    color: #3b3f46;
    word-break: break-word;
}

.product-check__meta {
    margin-top: 3px;
    font-size: 0.78rem;
    color: var(--color-muted, #6b6f76);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.perm-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 10px 0;
    padding: 8px 10px;
    background: #f5f5f7;
    border-radius: 6px;
}

.perm-toolbar__stats {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--color-muted, #6b6f76);
}

.form--permissoes .form__actions--sticky {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 10px 0;
    border-top: 1px solid #e1e3e7;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    z-index: 5;
}

.pill--new    { background: #e7f6ea; color: #1b6a28; }
.pill--change { background: #fff3da; color: #7a5211; }

.btn--small {
    font-size: 0.82rem;
    padding: 5px 10px;
}
