:root {
    --primary: #0f766e;
    --primary-dark: #0b5e58;
    --primary-soft: #e6f6f3;
    --ink: #17332f;
    --muted: #667b77;
    --surface: #ffffff;
    --surface-soft: #f4f7f6;
    --line: #dce7e4;
    --danger: #b42318;
    --danger-soft: #fff0ee;
    --success: #087443;
    --success-soft: #eaf8f0;
    --warning: #9a6700;
    --shadow: 0 16px 42px rgba(15, 66, 60, .08);
    --radius: 20px;
    --bottom-nav-height: 76px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--surface-soft);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.45;
}
button, input, select, textarea { font: inherit; }
a { color: var(--primary); }
code { padding: 2px 6px; border-radius: 6px; background: #edf2f1; font-size: .9em; }

.guest-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(15, 118, 110, .17), transparent 34%),
        linear-gradient(180deg, #f8fbfa, #eef5f3);
}
.guest-shell { width: min(100%, 920px); margin: 0 auto; padding: 24px 16px 40px; }
.brand-panel { display: flex; align-items: center; gap: 12px; margin: 4px auto 24px; width: min(100%, 680px); }
.brand-panel strong, .brand-panel span { display: block; }
.brand-panel strong { font-size: 1.08rem; }
.brand-panel span { color: var(--muted); font-size: .86rem; }
.brand-mark {
    display: grid; place-items: center; flex: 0 0 auto; width: 48px; height: 48px;
    color: #fff; background: linear-gradient(145deg, #15998f, #0b5e58); border-radius: 16px;
    font-weight: 800; font-size: 1.45rem; box-shadow: 0 10px 24px rgba(15,118,110,.25);
}
.brand-mark.small { width: 40px; height: 40px; border-radius: 13px; font-size: 1.15rem; }
.auth-card {
    width: min(100%, 520px); margin: 0 auto; background: var(--surface); border: 1px solid var(--line);
    border-radius: 28px; padding: 24px; box-shadow: var(--shadow);
}
.setup-card { width: min(100%, 820px); }
.version-label { margin: 18px 0 0; text-align: center; color: var(--muted); font-size: .78rem; }

.section-heading { margin-bottom: 24px; }
.section-heading.centered { text-align: center; }
.section-heading h1, .page-heading h1, .welcome-panel h1 { margin: 4px 0 8px; line-height: 1.12; letter-spacing: -.035em; }
.section-heading h1 { font-size: clamp(1.75rem, 6vw, 2.35rem); }
.section-heading p, .page-heading p, .welcome-panel p, .panel-heading p { margin: 0; color: var(--muted); }
.eyebrow { display: block; color: var(--primary); font-size: .75rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }

.form-stack { display: grid; gap: 18px; }
.form-section { margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 18px; }
.form-section legend { padding: 0 8px; font-weight: 800; }
.legend-help { margin: -2px 0 14px; color: var(--muted); font-size: .9rem; }
.field-grid { display: grid; gap: 14px; }
.field { display: grid; gap: 7px; }
.field > span { font-size: .9rem; font-weight: 750; }
.field small { color: var(--muted); }
.field-error { color: var(--danger) !important; font-weight: 650; }
input, select, textarea {
    width: 100%; min-height: 48px; padding: 11px 13px; color: var(--ink); background: #fff;
    border: 1px solid #cddbd8; border-radius: 12px; outline: none; transition: border-color .18s, box-shadow .18s;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(15,118,110,.12); }
.password-input { position: relative; }
.password-input input { padding-right: 78px; }
.password-toggle { position: absolute; inset: 5px 5px 5px auto; border: 0; background: var(--primary-soft); color: var(--primary-dark); border-radius: 9px; padding: 0 10px; font-size: .78rem; font-weight: 800; cursor: pointer; }

.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px;
    border: 1px solid transparent; border-radius: 12px; text-decoration: none; font-weight: 800; cursor: pointer;
    transition: transform .12s, filter .12s, background .12s;
}
.button:active { transform: translateY(1px); }
.button.primary { color: #fff; background: var(--primary); }
.button.primary:hover { background: var(--primary-dark); }
.button.secondary { color: var(--primary-dark); background: var(--primary-soft); border-color: #c7e9e3; }
.button.ghost { color: var(--ink); background: transparent; border-color: var(--line); }
.button.danger-soft { color: var(--danger); background: var(--danger-soft); border-color: #ffd8d3; }
.button.full { width: 100%; }
.button.large { min-height: 52px; }
.button.small { min-height: 36px; padding: 7px 11px; font-size: .82rem; }
.auth-help { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; font-size: .9rem; }
.auth-help span, .auth-help a { display: block; }
.auth-help span { color: var(--muted); }
.auth-help a { margin-top: 4px; font-weight: 800; }

.alert { margin-bottom: 18px; padding: 13px 15px; border-radius: 13px; border: 1px solid; font-size: .92rem; }
.alert.success { color: var(--success); background: var(--success-soft); border-color: #c9ecd8; }
.alert.danger { color: var(--danger); background: var(--danger-soft); border-color: #ffd4ce; }
.alert.warning { color: var(--warning); background: #fff7df; border-color: #f1d58c; }
.update-file-feedback { margin: 10px 0 0; }

.segment-grid { display: grid; gap: 10px; }
.segment-option { position: relative; cursor: pointer; }
.segment-option input { position: absolute; opacity: 0; pointer-events: none; }
.segment-option > span { display: grid; gap: 3px; min-height: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; transition: .16s; }
.segment-option strong { font-size: .93rem; }
.segment-option small { color: var(--muted); line-height: 1.35; }
.segment-option input:checked + span { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.segment-option input:focus-visible + span { outline: 3px solid rgba(15,118,110,.2); }

.app-shell { min-height: 100vh; }
.desktop-sidebar { display: none; }
.main-column { min-width: 0; }
.mobile-header {
    position: sticky; z-index: 30; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px;
    min-height: 70px; padding: max(12px, env(safe-area-inset-top)) 16px 12px; background: rgba(255,255,255,.94);
    border-bottom: 1px solid var(--line); backdrop-filter: blur(12px);
}
.mobile-header small, .mobile-header strong { display: block; }
.mobile-header small { color: var(--muted); font-size: .75rem; }
.mobile-header strong { font-size: 1.15rem; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 50%; background: var(--primary-soft); color: var(--primary-dark); font-weight: 850; }
.avatar.large { width: 48px; height: 48px; }
.content-area { width: min(100%, 1180px); margin: 0 auto; padding: 18px 14px calc(var(--bottom-nav-height) + 26px + env(safe-area-inset-bottom)); }
.bottom-nav {
    position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr);
    min-height: var(--bottom-nav-height); padding: 7px 4px max(7px, env(safe-area-inset-bottom)); background: rgba(255,255,255,.97);
    border-top: 1px solid var(--line); box-shadow: 0 -10px 30px rgba(17,55,50,.08); backdrop-filter: blur(14px);
}
.bottom-nav a, .bottom-nav > span, .bottom-nav form, .bottom-nav button { min-width: 0; }
.bottom-nav a, .bottom-nav > span, .bottom-nav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%; min-height: 52px;
    padding: 3px; border: 0; background: transparent; color: var(--muted); text-decoration: none;
}
.bottom-nav span > span, .bottom-nav a > span, .bottom-nav button > span { font-size: 1.2rem; line-height: 1; }
.bottom-nav small { font-size: .67rem; font-weight: 750; white-space: nowrap; }
.bottom-nav a.active { color: var(--primary); }
.bottom-nav .disabled { opacity: .48; }

.welcome-panel, .panel, .metric-card { background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 28px rgba(15,66,60,.045); }
.welcome-panel { display: grid; gap: 18px; padding: 22px; border-radius: var(--radius); }
.welcome-panel h1 { font-size: clamp(1.65rem, 7vw, 2.5rem); }
.status-pill { display: inline-flex; align-items: center; width: fit-content; padding: 5px 9px; border-radius: 999px; font-size: .72rem; font-weight: 800; }
.status-pill.active, .success-dot { color: var(--success); background: var(--success-soft); }
.status-pill.inactive { color: var(--danger); background: var(--danger-soft); }
.success-dot::before { content: ''; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: currentColor; }
.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
.metric-card { padding: 15px; border-radius: 16px; }
.metric-card span, .metric-card strong, .metric-card small { display: block; }
.metric-card span { color: var(--muted); font-size: .78rem; }
.metric-card strong { margin: 4px 0 2px; font-size: 1.75rem; line-height: 1; }
.metric-card small { color: var(--primary); font-size: .68rem; font-weight: 750; }
.dashboard-grid { display: grid; gap: 12px; }
.panel { padding: 18px; border-radius: var(--radius); }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.panel-heading h2 { margin: 2px 0 4px; font-size: 1.15rem; }
.roadmap { display: grid; gap: 5px; }
.roadmap-item { display: grid; grid-template-columns: 32px 1fr; gap: 11px; padding: 10px 0; }
.roadmap-item > span { display: grid; place-items: center; align-self: start; width: 30px; height: 30px; border-radius: 50%; background: #edf2f1; color: var(--muted); font-weight: 850; }
.roadmap-item strong, .roadmap-item small { display: block; }
.roadmap-item small { color: var(--muted); margin-top: 2px; }
.roadmap-item.done > span { color: #fff; background: var(--success); }
.roadmap-item.next > span { color: #fff; background: var(--primary); box-shadow: 0 0 0 5px var(--primary-soft); }
.summary-list { margin: 0 0 16px; }
.summary-list > div { display: flex; justify-content: space-between; gap: 15px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.summary-list dt { color: var(--muted); }
.summary-list dd { margin: 0; font-weight: 800; text-align: right; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0 18px; }
.tag { padding: 6px 9px; border-radius: 999px; color: var(--primary-dark); background: var(--primary-soft); font-size: .75rem; font-weight: 750; }
.muted { color: var(--muted); }

.page-heading { display: grid; gap: 14px; margin: 3px 0 16px; }
.page-heading h1 { font-size: 1.8rem; }
.action-heading .button { width: fit-content; }
.divider { height: 1px; margin: 4px 0; background: var(--line); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.user-list { display: grid; gap: 10px; }
.user-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.user-card:last-child { border-bottom: 0; }
.user-details { min-width: 0; }
.user-details > span, .user-details > small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-details > span { color: var(--muted); font-size: .88rem; }
.user-details > small { margin-top: 4px; color: var(--muted); font-size: .75rem; }
.user-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.user-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card form { grid-column: 2; }
.role-explanation { display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: var(--surface-soft); }
.role-explanation div { display: grid; }
.role-explanation strong { font-size: .84rem; }
.role-explanation span { color: var(--muted); font-size: .77rem; }
.empty-state { padding: 32px 12px; text-align: center; }
.empty-state p { color: var(--muted); }

@media (min-width: 640px) {
    .guest-shell { padding-top: 40px; }
    .auth-card { padding: 34px; }
    .field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .span-two { grid-column: span 2; }
    .segment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .welcome-panel { grid-template-columns: 1fr auto; align-items: center; }
    .metric-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
    .page-heading.action-heading { grid-template-columns: 1fr auto; align-items: end; }
    .user-card { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
    .user-card form { grid-column: 3; }
}

@media (min-width: 960px) {
    .app-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); }
    .desktop-sidebar {
        position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 20px;
        background: #102f2b; color: #fff;
    }
    .sidebar-brand { display: flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; }
    .sidebar-brand strong, .sidebar-brand small { display: block; }
    .sidebar-brand small { color: #a9c4c0; }
    .sidebar-nav { display: grid; gap: 5px; margin: 30px 0 auto; }
    .nav-link { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 11px; color: #cce0dd; text-decoration: none; font-weight: 700; }
    .nav-link span { width: 20px; text-align: center; }
    .nav-link small { margin-left: auto; font-size: .58rem; opacity: .7; }
    .nav-link.active { color: #fff; background: rgba(255,255,255,.12); }
    .nav-link.disabled { opacity: .48; }
    .sidebar-user { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.12); }
    .sidebar-user strong, .sidebar-user small { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .sidebar-user small { color: #a9c4c0; }
    .desktop-sidebar .button.ghost { color: #fff; border-color: rgba(255,255,255,.18); }
    .mobile-header, .bottom-nav { display: none; }
    .content-area { padding: 32px; }
    .dashboard-grid { grid-template-columns: minmax(0, 1.5fr) minmax(300px, .75fr); }
    .welcome-panel, .panel { padding: 24px; }
}
.mobile-only { display: block; }
.logout-panel { margin-top: 12px; }
@media (min-width: 960px) { .mobile-only { display: none !important; } }

/* Atualizador do sistema */
.updater-grid { display: grid; gap: 12px; margin-bottom: 12px; }
.version-comparison {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
    margin-bottom: 18px; padding: 14px; border-radius: 16px; background: var(--surface-soft);
}
.version-comparison > div:not(.version-arrow) { min-width: 0; }
.version-comparison span, .version-comparison strong { display: block; }
.version-comparison span { color: var(--muted); font-size: .75rem; }
.version-comparison strong { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; font-size: 1rem; }
.version-arrow { color: var(--primary); font-size: 1.4rem; font-weight: 850; }
.upload-field input[type="file"] { padding: 9px; background: var(--surface-soft); }
.upload-field input[type="file"]::file-selector-button {
    margin-right: 10px; padding: 9px 12px; border: 0; border-radius: 9px;
    color: #fff; background: var(--primary); font-weight: 800; cursor: pointer;
}
.confirmation-box {
    display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 10px;
    padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); cursor: pointer;
}
.confirmation-box input { width: 20px; min-height: 20px; margin: 2px 0 0; accent-color: var(--primary); }
.confirmation-box span { color: var(--muted); font-size: .86rem; }
.update-safety { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.update-safety > strong { display: block; margin-bottom: 10px; }
.safety-grid { display: grid; gap: 8px; }
.safety-grid span { color: var(--muted); font-size: .82rem; }
.requirement-ok { color: var(--success); }
.requirement-error { color: var(--danger); }
.updater-note { margin: 18px 0 0; }
.update-release-notes { margin-bottom: 12px; border-color: #c9ecd8; }
.clean-list { margin: 0; padding-left: 20px; }
.clean-list li + li { margin-top: 7px; }
.update-history-panel { margin-top: 12px; }
.update-history-list { display: grid; gap: 10px; }
.update-history-item { padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-soft); }
.update-history-main { min-width: 0; }
.update-history-main > span, .update-history-main > small { display: block; }
.update-history-main > span { margin-top: 4px; color: var(--muted); }
.update-history-main > small { margin-top: 5px; color: var(--muted); font-size: .73rem; }
.update-version-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.update-history-item > code { display: block; margin-top: 10px; overflow-wrap: anywhere; }
.update-error-detail { margin: 10px 0 0; }
.dashboard-update-button { margin-top: 9px; }

@media (min-width: 640px) {
    .safety-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 960px) {
    .updater-grid { grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); }
}

/* Clientes, endereços e contatos — v0.2.0 */
.status-pill.prospect { color: var(--warning); background: #fff7df; }
.metric-link { color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.metric-link:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(15,66,60,.09); }
.optional-label { margin-left: 5px; color: var(--muted); font-size: .72rem; font-weight: 650; }
.small-text { font-size: .82rem; }

.client-metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.client-metric-grid article { padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 28px rgba(15,66,60,.035); }
.client-metric-grid span, .client-metric-grid strong { display: block; }
.client-metric-grid span { color: var(--muted); font-size: .74rem; }
.client-metric-grid strong { margin-top: 3px; font-size: 1.55rem; line-height: 1; }
.client-filter-panel { margin-bottom: 12px; }
.client-filter-form { display: grid; gap: 12px; }
.filter-actions { display: flex; align-items: end; gap: 8px; }
.filter-actions .button { flex: 1; }
.client-list-panel { padding-top: 14px; }
.client-list { display: grid; }
.client-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; min-width: 0; padding: 14px 0; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.client-card:first-child { padding-top: 2px; }
.client-card:last-child { padding-bottom: 2px; border-bottom: 0; }
.client-card:active { opacity: .78; }
.client-avatar { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 auto; color: var(--primary-dark); background: var(--primary-soft); border-radius: 15px; font-weight: 900; font-size: 1.15rem; }
.client-avatar.company { color: #31568d; background: #eaf1ff; }
.client-avatar.profile { width: 64px; height: 64px; border-radius: 20px; font-size: 1.5rem; }
.client-card-main { min-width: 0; }
.client-card-main > span, .client-card-main > small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-card-main > span { color: var(--muted); font-size: .84rem; }
.client-card-main > small { margin-top: 3px; color: var(--muted); font-size: .73rem; }
.client-card-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.client-card-title strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-card-title .status-pill { flex: 0 0 auto; }
.client-card-arrow { color: #92aaa6; font-size: 1.8rem; line-height: 1; }
.pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.pagination > :last-child { justify-self: end; }
.pagination strong { color: var(--muted); font-size: .75rem; text-align: center; }

.client-type-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 16px; }
.client-type-switch label { position: relative; cursor: pointer; }
.client-type-switch input { position: absolute; opacity: 0; pointer-events: none; }
.client-type-switch span { display: grid; gap: 2px; min-height: 72px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.client-type-switch strong { font-size: .9rem; }
.client-type-switch small { color: var(--muted); font-size: .72rem; }
.client-type-switch input:checked + span { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.client-type-switch input:focus-visible + span { outline: 3px solid rgba(15,118,110,.18); }
[hidden] { display: none !important; }
.inline-input-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.inline-input-action .button { min-height: 48px; }
.form-check-row { margin-top: 16px; }
.form-check-row span strong, .form-check-row span small { display: block; }
.form-check-row span small { margin-top: 2px; color: var(--muted); }
.sticky-form-actions { position: sticky; z-index: 15; bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom)); margin: 0 -14px -18px; padding: 12px 14px; background: rgba(244,247,246,.96); border-top: 1px solid var(--line); backdrop-filter: blur(12px); }
.sticky-form-actions .button { flex: 1; }

.client-profile-header { display: grid; gap: 15px; margin-bottom: 12px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(15,66,60,.045); }
.back-link { width: fit-content; color: var(--muted); text-decoration: none; font-size: .82rem; font-weight: 750; }
.client-profile-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.client-profile-main > div:last-child { min-width: 0; }
.client-profile-main h1 { margin: 2px 0 3px; overflow-wrap: anywhere; font-size: clamp(1.45rem, 7vw, 2.2rem); line-height: 1.08; letter-spacing: -.035em; }
.client-profile-main p { margin: 0 0 7px; color: var(--muted); }
.client-profile-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.client-profile-actions .button:only-child { grid-column: 1 / -1; }
.client-detail-grid { display: grid; gap: 12px; }
.client-detail-main, .client-detail-side { display: grid; align-content: start; gap: 12px; }
.detail-list { margin: 0; }
.detail-list > div { display: grid; grid-template-columns: minmax(95px, .55fr) minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.detail-list > div:first-child { padding-top: 0; }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); }
.detail-list dd { min-width: 0; margin: 0; font-weight: 750; text-align: right; overflow-wrap: anywhere; }
.client-notes { margin-top: 16px; padding: 14px; border-radius: 14px; background: var(--surface-soft); }
.client-notes strong { display: block; margin-bottom: 5px; }
.client-notes p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.entity-section .panel-heading { align-items: center; }
.entity-section .panel-heading > div { min-width: 0; }
.entity-card-list { display: grid; gap: 10px; }
.entity-card { padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-soft); }
.entity-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.entity-card-heading > div { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; min-width: 0; }
.entity-card-heading strong { overflow-wrap: anywhere; }
.entity-card-heading > a { flex: 0 0 auto; font-size: .8rem; font-weight: 800; }
.entity-card address { margin-top: 8px; color: var(--muted); font-style: normal; font-size: .86rem; }
.contact-card > span, .contact-card > small { display: block; }
.contact-card > span { margin-top: 7px; }
.contact-card > small { margin-top: 3px; color: var(--muted); overflow-wrap: anywhere; }
.entity-card-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.entity-card-actions form { margin: 0; }
.text-button { min-height: 30px; padding: 0; color: var(--primary); background: transparent; border: 0; font-size: .78rem; font-weight: 800; cursor: pointer; }
.text-button.danger { color: var(--danger); }
.empty-state.compact { padding: 18px 8px; }
.side-title { margin: 3px 0 14px; font-size: 1.1rem; }
.related-counter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.related-counter-grid > div { padding: 13px; text-align: center; background: var(--surface-soft); border-radius: 13px; }
.related-counter-grid strong, .related-counter-grid span { display: block; }
.related-counter-grid strong { font-size: 1.55rem; }
.related-counter-grid span { color: var(--muted); font-size: .72rem; }
.compact-form { gap: 12px; }

@media (min-width: 640px) {
    .client-metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .client-filter-form { grid-template-columns: minmax(240px, 1fr) 170px 170px auto; align-items: end; }
    .filter-actions .button { flex: 0 0 auto; }
    .client-profile-header { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
    .client-profile-header .back-link { grid-column: 1 / -1; }
    .client-profile-actions { display: flex; }
    .client-profile-actions .button:only-child { grid-column: auto; }
    .sticky-form-actions { position: static; margin: 0; padding: 4px 0 0; background: transparent; border-top: 0; backdrop-filter: none; }
    .sticky-form-actions .button { flex: 0 0 auto; }
}

@media (min-width: 960px) {
    .client-detail-grid { grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); }
    .client-profile-header { padding: 24px; }
    .client-list-panel { padding-top: 20px; }
    .client-card { padding: 16px 4px; border-radius: 12px; transition: background .15s, padding .15s; }
    .client-card:hover { padding-left: 10px; padding-right: 10px; background: var(--surface-soft); }
}


/* Catálogo único — v0.3.0 */
.button.danger-outline { color: var(--danger); background: transparent; border-color: #efb9b2; }
.button.danger-outline:hover { background: var(--danger-soft); }
.heading-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tag.neutral { color: var(--muted); background: #edf2f1; }
.unit-badge { display: inline-flex; align-items: center; min-height: 30px; padding: 5px 9px; color: var(--primary-dark); background: var(--primary-soft); border-radius: 999px; font-size: .75rem; font-weight: 800; }

.catalog-filter-form { display: grid; gap: 12px; }
.catalog-list { display: grid; }
.catalog-card {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
    padding: 14px 0; color: inherit; border-bottom: 1px solid var(--line); text-decoration: none;
}
.catalog-card:last-child { border-bottom: 0; }
.catalog-type-icon {
    display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 auto;
    border-radius: 14px; color: var(--primary-dark); background: var(--primary-soft); font-size: 1rem; font-weight: 900;
}
.catalog-type-icon.material { color: #7b5200; background: #fff5d9; }
.catalog-type-icon.product { color: #2451a6; background: #edf3ff; }
.catalog-type-icon.service { color: #0b6b63; background: #e6f6f3; }
.catalog-type-icon.fee { color: #7c3d8d; background: #f8edfb; }
.catalog-type-icon.rental { color: #8a4511; background: #fff0e5; }
.catalog-type-icon.package { color: #3d5470; background: #edf2f7; }
.catalog-type-icon.large { width: 58px; height: 58px; border-radius: 18px; font-size: 1.25rem; }
.catalog-card-main { min-width: 0; }
.catalog-card-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.catalog-card-title strong { min-width: 0; overflow-wrap: anywhere; }
.catalog-card-main > small { display: block; margin-top: 3px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalog-card-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.catalog-card-footer > strong { color: var(--primary-dark); }
.catalog-card-footer > strong small { color: var(--muted); font-size: .72rem; }
.stock-chip { display: inline-flex; padding: 5px 8px; color: var(--success); background: var(--success-soft); border-radius: 999px; font-size: .72rem; font-weight: 800; }
.stock-chip.low { color: var(--danger); background: var(--danger-soft); }

.catalog-type-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.catalog-type-switch label { position: relative; cursor: pointer; }
.catalog-type-switch input { position: absolute; opacity: 0; pointer-events: none; }
.catalog-type-switch span {
    display: grid; min-height: 100%; padding: 13px; border: 1px solid var(--line);
    border-radius: 14px; background: #fff; transition: .16s;
}
.catalog-type-switch strong { font-size: .88rem; }
.catalog-type-switch small { margin-top: 2px; color: var(--muted); font-size: .7rem; line-height: 1.3; }
.catalog-type-switch input:checked + span { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.catalog-type-switch input:focus-visible + span { outline: 3px solid rgba(15,118,110,.2); }

.money-input { position: relative; }
.money-input > span {
    position: absolute; z-index: 2; left: 13px; top: 50%; transform: translateY(-50%);
    color: var(--muted); font-size: .83rem; font-weight: 800;
}
.money-input input { padding-left: 43px; }
.price-preview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.price-preview > div { min-width: 0; padding: 12px; background: var(--surface-soft); border-radius: 13px; }
.price-preview span, .price-preview strong { display: block; }
.price-preview span { color: var(--muted); font-size: .68rem; }
.price-preview strong { margin-top: 3px; overflow-wrap: anywhere; font-size: .95rem; }
.compact-confirmation { margin-top: 12px; }
.compact-confirmation strong { color: var(--ink); }
.stock-minimum-field { margin-top: 14px; max-width: 320px; }
[data-stock-section].disabled { opacity: .62; }
[data-stock-section].disabled [data-stock-toggle-wrapper] { pointer-events: none; }

.catalog-profile-header { margin-bottom: 12px; }
.catalog-detail-grid { display: grid; gap: 12px; }
.catalog-detail-main, .catalog-detail-side { display: grid; align-content: start; gap: 12px; }
.catalog-price-hero { padding: 18px; border-radius: 17px; background: linear-gradient(145deg, var(--primary-soft), #f8fbfa); }
.catalog-price-hero span, .catalog-price-hero strong, .catalog-price-hero small { display: block; }
.catalog-price-hero span { color: var(--muted); font-size: .78rem; }
.catalog-price-hero strong { margin: 4px 0; color: var(--primary-dark); font-size: clamp(1.8rem, 9vw, 2.7rem); line-height: 1; }
.catalog-price-hero small { color: var(--muted); }
.detail-price-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.catalog-summary-list { margin-top: 10px; margin-bottom: 0; }
.catalog-description { color: var(--ink); overflow-wrap: anywhere; white-space: normal; }
.stock-summary { padding: 16px; border: 1px solid #c9ecd8; border-radius: 16px; background: var(--success-soft); }
.stock-summary.low { border-color: #ffd4ce; background: var(--danger-soft); }
.stock-summary span, .stock-summary strong, .stock-summary small { display: block; }
.stock-summary span { color: var(--muted); font-size: .75rem; }
.stock-summary strong { margin: 3px 0; font-size: 1.55rem; }
.stock-summary small { color: var(--muted); }
.stock-location-list { display: grid; gap: 8px; margin-top: 12px; }
.stock-location-list > div { padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.stock-location-list span, .stock-location-list strong, .stock-location-list small { display: block; }
.stock-location-list span { color: var(--muted); font-size: .73rem; }
.stock-location-list small { color: var(--muted); }

.category-page-grid { display: grid; gap: 12px; }
.category-form-panel { align-self: start; }
.category-list { display: grid; gap: 9px; }
.category-card {
    display: grid; gap: 11px; padding: 13px; border: 1px solid var(--line);
    border-radius: 14px; background: var(--surface-soft);
}
.category-card.inactive { opacity: .72; }
.category-title-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.category-card small { display: block; margin-top: 4px; color: var(--muted); }
.category-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding-top: 9px; border-top: 1px solid var(--line); }
.category-actions form { margin: 0; }

@media (min-width: 640px) {
    .catalog-filter-form { grid-template-columns: minmax(240px, 1.3fr) 150px 180px 140px auto; align-items: end; }
    .catalog-type-switch { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .price-field-grid { max-width: 720px; }
    .category-card { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
    .category-actions { padding-top: 0; border-top: 0; }
}

@media (min-width: 960px) {
    .catalog-detail-grid { grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); }
    .category-page-grid { grid-template-columns: minmax(280px, .55fr) minmax(0, 1.45fr); }
    .catalog-card { padding: 16px 4px; border-radius: 12px; transition: background .15s, padding .15s; }
    .catalog-card:hover { padding-left: 10px; padding-right: 10px; background: var(--surface-soft); }
}

/* Orçamentos e propostas — v0.4.0 */
.quote-metric-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:12px 0; }
.quote-filter-form { display:grid; gap:12px; }
.quote-list { display:grid; }
.quote-card { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; padding:15px 0; color:inherit; text-decoration:none; border-bottom:1px solid var(--line); }
.quote-card:last-child { border-bottom:0; }
.quote-card-main { min-width:0; }
.quote-card-title { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.quote-card-title strong { overflow-wrap:anywhere; }
.quote-card-main > small { display:block; margin-top:4px; color:var(--muted); }
.quote-card-footer { display:flex; flex-wrap:wrap; gap:8px 14px; margin-top:10px; color:var(--muted); font-size:.78rem; }
.quote-card-total { align-self:center; text-align:right; color:var(--primary-dark); font-size:1rem; }
.quote-form { padding-bottom:8px; }
.quote-item-list { display:grid; gap:12px; }
.quote-item-row { padding:14px; border:1px solid var(--line); border-radius:16px; background:var(--surface-soft); }
.quote-item-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px; }
.quote-item-total { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:12px; padding-top:11px; border-top:1px solid var(--line); }
.quote-item-total span { color:var(--muted); font-size:.8rem; }
.quote-summary { display:grid; gap:8px; padding:15px; border-radius:16px; background:var(--primary-soft); }
.quote-summary > div { display:flex; justify-content:space-between; gap:12px; }
.quote-summary .grand-total { margin-top:4px; padding-top:10px; border-top:1px solid #bfe3dd; font-size:1.15rem; }
.quote-detail-grid { display:grid; gap:12px; }
.quote-detail-main,.quote-detail-side { display:grid; align-content:start; gap:12px; }
.quote-detail-items { display:grid; }
.quote-detail-item { display:grid; grid-template-columns:30px minmax(0,1fr); gap:10px; padding:14px 0; border-bottom:1px solid var(--line); }
.quote-detail-item:last-child { border-bottom:0; }
.quote-detail-item-number { display:grid; place-items:center; width:30px; height:30px; border-radius:50%; background:var(--primary-soft); color:var(--primary-dark); font-weight:850; }
.quote-detail-item-main { min-width:0; }
.quote-detail-item-title { display:flex; flex-wrap:wrap; align-items:flex-start; justify-content:space-between; gap:8px; }
.quote-detail-item-main p { margin:5px 0; color:var(--muted); }
.quote-detail-item-main small { color:var(--muted); }
.quote-detail-item-total { grid-column:2; color:var(--primary-dark); }
.quote-text-grid { display:grid; gap:18px; }
.quote-text-grid p { margin:6px 0 0; }
.quote-total-card { background:linear-gradient(145deg,var(--primary-soft),#fff); }
.quote-total-hero { display:block; margin:6px 0 14px; color:var(--primary-dark); font-size:clamp(2rem,10vw,3rem); line-height:1; }
.quote-total-list { margin:0; }
.quote-actions-panel { display:grid; gap:10px; }
.quote-actions-panel form { margin:0; }
.quote-timeline { display:grid; gap:14px; }
.quote-timeline > div { display:grid; grid-template-columns:14px minmax(0,1fr); gap:10px; }
.timeline-dot { width:12px; height:12px; margin-top:5px; border-radius:50%; background:#9aa9a6; }
.timeline-dot.approved { background:var(--success); }.timeline-dot.rejected,.timeline-dot.cancelled { background:var(--danger); }.timeline-dot.sent,.timeline-dot.viewed { background:var(--primary); }.timeline-dot.expired { background:var(--warning); }
.quote-timeline small,.quote-timeline p { display:block; margin:2px 0 0; color:var(--muted); }
.public-link-panel { border-color:#bfe3dd; background:var(--primary-soft); }
.copy-link-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; margin:12px 0; }
.decision-panel.approved { border-color:#c9ecd8; background:var(--success-soft); }.decision-panel.rejected { border-color:#ffd4ce; background:var(--danger-soft); }
.success-button { color:#fff; background:var(--success); }
.public-shell { width:min(100%,920px); margin:0 auto; padding:18px 12px 38px; }
.public-quote-header { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; }
.public-quote-card { background:#fff; border:1px solid var(--line); border-radius:22px; box-shadow:var(--shadow); overflow:hidden; }
.public-quote-content { padding:18px; }
.public-decision-panel { margin-top:14px; padding:18px; border:1px solid var(--line); border-radius:18px; background:#fff; }
.print-body { background:#fff; color:#111; }
.print-shell { width:min(100%,900px); margin:0 auto; padding:28px; }
.print-actions { margin-bottom:16px; text-align:right; }
@media (min-width:640px){.quote-metric-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.quote-filter-form{grid-template-columns:minmax(220px,1.2fr) 160px 220px auto;align-items:end}.quote-item-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.quote-detail-item{grid-template-columns:34px minmax(0,1fr) auto}.quote-detail-item-total{grid-column:auto;align-self:center}.quote-text-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (min-width:960px){.quote-detail-grid{grid-template-columns:minmax(0,1.45fr) minmax(300px,.55fr)}.quote-card{padding:17px 5px;border-radius:12px;transition:.15s}.quote-card:hover{padding-left:11px;padding-right:11px;background:var(--surface-soft)}}
@media print{.print-actions{display:none}.print-shell{padding:0}.public-quote-card{border:0;box-shadow:none}}

/* Ordens de serviço — v0.5.0 */
.linked-work-order-panel { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:14px; margin-bottom:12px; border-color:#bfe3dd; background:var(--primary-soft); }
.linked-work-order-panel.ready { border-color:#c9ecd8; background:var(--success-soft); }
.linked-work-order-panel h2,.linked-work-order-panel p { margin:3px 0 0; }
.linked-work-order-panel form { margin:0; }
.work-order-metrics article { padding:15px; border:1px solid var(--line); border-radius:16px; background:var(--surface); }
.work-order-metrics article span,.work-order-metrics article small { display:block; color:var(--muted); }
.work-order-metrics article strong { display:block; margin:4px 0; font-size:1.45rem; }
.work-order-filter-form { grid-template-columns:1fr; }
.work-order-card { grid-template-columns:auto minmax(0,1fr) auto; align-items:center; }
.quote-card-code { display:none; }
.work-order-code-badge { background:#0f766e; }
.work-order-status.draft { background:#eef2f1; color:#4f6662; }
.work-order-status.scheduled { background:#e9f2ff; color:#245a96; }
.work-order-status.assigned { background:#e8f5f3; color:#0f766e; }
.work-order-status.in_progress { background:#fff4d6; color:#855b00; }
.work-order-status.paused { background:#f4ecff; color:#653c93; }
.work-order-status.completed { background:var(--success-soft); color:#17643d; }
.work-order-status.cancelled { background:var(--danger-soft); color:#a1382d; }
.assignment-grid { display:grid; gap:9px; margin-top:12px; }
.assignment-option { display:flex; align-items:center; gap:10px; padding:12px; border:1px solid var(--line); border-radius:14px; background:var(--surface-soft); cursor:pointer; }
.assignment-option input { width:19px; height:19px; accent-color:var(--primary); }
.assignment-option span,.assignment-option strong,.assignment-option small { display:block; }
.assignment-option small { margin-top:2px; color:var(--muted); }
.work-order-item-editor { position:relative; }
.work-order-line-total { justify-content:center; padding:12px; border:1px dashed #b9d8d3; border-radius:13px; background:var(--primary-soft); }
.work-order-line-total span,.work-order-line-total strong { display:block; }
.work-order-line-total strong { margin-top:5px; font-size:1.05rem; }
.work-order-total-box { display:flex; justify-content:space-between; gap:12px; margin-top:14px; padding:16px; border-radius:16px; color:#fff; background:var(--primary-dark); }
.work-order-action-bar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; }
.work-order-action-bar strong,.work-order-action-bar span { display:block; }
.work-order-action-buttons { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.work-order-action-buttons form { margin:0; }
.work-order-detail-grid { display:grid; gap:12px; }
.work-order-detail-main,.work-order-detail-side { display:grid; align-content:start; gap:12px; }
.work-order-detail-item { align-items:center; }
.work-order-used-field { display:grid; grid-template-columns:minmax(72px,100px) auto; align-items:center; gap:5px; }
.work-order-used-field span { grid-column:1/-1; color:var(--muted); font-size:.72rem; }
.work-order-used-field input { min-width:0; }
.work-order-used-field small { color:var(--muted); }
.work-order-cost-summary { display:flex; justify-content:space-between; gap:12px; margin-top:14px; padding-top:14px; border-top:1px solid var(--line); font-size:1.05rem; }
.panel-footer-actions { display:flex; justify-content:flex-end; margin-top:12px; }
.work-order-note-form { display:grid; gap:10px; padding:14px; border:1px solid var(--line); border-radius:15px; background:var(--surface-soft); }
.work-order-notes-list { display:grid; gap:10px; margin-top:14px; }
.work-order-notes-list article { padding:13px; border:1px solid var(--line); border-radius:14px; }
.work-order-notes-list article > div { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.work-order-notes-list p { margin:8px 0; }
.work-order-notes-list small { color:var(--muted); }
.work-order-team-list,.work-order-time-list { display:grid; gap:9px; margin-top:10px; }
.team-mini-card { display:flex; align-items:center; gap:9px; }
.team-mini-card > span { display:grid; place-items:center; width:34px; height:34px; border-radius:50%; color:#fff; background:var(--primary); font-weight:800; }
.team-mini-card strong,.team-mini-card small { display:block; }
.team-mini-card small { color:var(--muted); }
.work-order-time-list > div { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:2px 8px; padding:10px; border-radius:12px; background:var(--surface-soft); }
.work-order-time-list strong,.work-order-time-list small { display:block; }
.work-order-time-list small { color:var(--muted); }
.work-order-time-list span { grid-row:1/3; grid-column:2; align-self:center; font-weight:800; }
.signature-canvas-wrap { overflow:hidden; border:2px dashed #9fc8c2; border-radius:14px; background:#fff; touch-action:none; }
.signature-canvas-wrap canvas { display:block; width:100%; height:auto; min-height:150px; touch-action:none; }
.signature-actions { display:flex; justify-content:space-between; gap:8px; margin-top:10px; }
.saved-signature { display:grid; gap:4px; margin:10px 0; padding:10px; border:1px solid var(--line); border-radius:13px; }
.saved-signature img { width:100%; max-height:130px; object-fit:contain; border-bottom:1px solid var(--line); }
.saved-signature small { color:var(--muted); }
.work-order-print-summary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:18px 0; }
.work-order-print-summary > div { padding:10px; border:1px solid #d9e3e1; border-radius:10px; }
.work-order-print-summary span,.work-order-print-summary strong { display:block; }
.work-order-print-summary span { color:#62706e; font-size:.72rem; }
.work-order-print-signatures { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:28px; margin-top:42px; }
.printed-signature { text-align:center; }
.printed-signature img { width:100%; height:90px; object-fit:contain; }
.printed-signature > span { display:block; height:90px; border-bottom:1px solid #222; }
.printed-signature img + span { height:0; }
.printed-signature strong,.printed-signature small { display:block; margin-top:5px; }
.printed-signature small { color:#687370; }

@media (min-width:640px) {
    .work-order-filter-form { grid-template-columns:minmax(220px,1.3fr) 160px 150px 200px auto; align-items:end; }
    .assignment-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .quote-card-code { display:grid; place-items:center; width:46px; height:46px; border-radius:13px; color:var(--primary-dark); background:var(--primary-soft); font-size:.65rem; }
    .quote-card-code span,.quote-card-code strong { display:block; }
    .work-order-note-form { grid-template-columns:minmax(0,1fr) 180px auto; align-items:end; }
}
@media (min-width:960px) {
    .work-order-detail-grid { grid-template-columns:minmax(0,1.45fr) minmax(300px,.55fr); }
    .assignment-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media print {
    .work-order-print-summary,.work-order-print-signatures { break-inside:avoid; }
}

/* Fase 6 — Estoque operacional */
.bottom-nav { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.bottom-nav small { font-size: .62rem; }
.heading-actions { display:flex; flex-wrap:wrap; gap:8px; }
.inventory-metric-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:12px 0; }
.inventory-metric-grid article { padding:15px; background:var(--surface); border:1px solid var(--line); border-radius:16px; box-shadow:0 8px 28px rgba(15,66,60,.035); }
.inventory-metric-grid span,.inventory-metric-grid strong { display:block; }
.inventory-metric-grid span { color:var(--muted); font-size:.75rem; }
.inventory-metric-grid strong { margin-top:4px; font-size:1.45rem; line-height:1.1; }
.inventory-metric-grid .warning-card,.metric-card.metric-warning { border-color:#f1d58c; background:#fffaf0; }
.inventory-metric-grid .danger-card { border-color:#f4c1bb; background:var(--danger-soft); }
.inventory-filter-panel { margin-bottom:12px; }
.inventory-filter-form { display:grid; gap:12px; }
.inventory-layout,.inventory-detail-layout,.inventory-location-layout { display:grid; gap:12px; }
.inventory-item-list { display:grid; gap:9px; }
.inventory-item-card { display:grid; gap:12px; padding:14px; color:inherit; text-decoration:none; border:1px solid var(--line); border-radius:15px; background:#fff; }
.inventory-item-card:hover { border-color:#acd8d1; box-shadow:0 8px 22px rgba(15,66,60,.06); }
.inventory-item-card.low { border-left:5px solid #d69e2e; }
.inventory-item-card.out { border-left:5px solid var(--danger); }
.inventory-item-main { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.inventory-item-main strong,.inventory-item-main small { display:block; }
.inventory-item-main small { margin-top:3px; color:var(--muted); }
.stock-state { display:inline-flex; align-items:center; justify-content:center; padding:5px 9px; border-radius:999px; font-size:.7rem; font-weight:850; white-space:nowrap; }
.stock-state.ok { color:var(--success); background:var(--success-soft); }
.stock-state.warning { color:var(--warning); background:#fff4d6; }
.stock-state.danger { color:var(--danger); background:var(--danger-soft); }
.inventory-item-numbers { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; }
.inventory-item-numbers div { padding:9px; border-radius:11px; background:var(--surface-soft); }
.inventory-item-numbers span,.inventory-item-numbers strong { display:block; }
.inventory-item-numbers span { color:var(--muted); font-size:.67rem; }
.inventory-item-numbers strong { margin-top:2px; font-size:.82rem; overflow-wrap:anywhere; }
.stock-movement-list { display:grid; gap:0; }
.stock-movement-list article { display:grid; grid-template-columns:34px minmax(0,1fr) auto; align-items:start; gap:10px; padding:13px 0; border-bottom:1px solid var(--line); }
.stock-movement-list article:last-child { border-bottom:0; }
.stock-movement-list strong,.stock-movement-list small { display:block; }
.stock-movement-list small { margin-top:2px; color:var(--muted); font-size:.72rem; }
.stock-movement-list p { margin:5px 0 0; font-size:.82rem; }
.stock-movement-list b { align-self:center; font-size:.82rem; white-space:nowrap; }
.movement-icon { display:grid; place-items:center; width:32px; height:32px; border-radius:50%; font-weight:900; }
.movement-icon.positive { color:var(--success); background:var(--success-soft); }
.movement-icon.negative { color:var(--danger); background:var(--danger-soft); }
.stock-movement-list.compact article { grid-template-columns:30px minmax(0,1fr) auto; }
.stock-movement-list.compact .movement-icon { width:28px; height:28px; }
.inventory-movement-panel { max-width:860px; }
.inventory-item-hero { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:12px; }
.inventory-item-hero strong,.inventory-item-hero small { display:block; }
.inventory-item-hero strong { margin:3px 0; font-size:clamp(1.7rem,7vw,2.5rem); }
.inventory-location-balance-list { display:grid; gap:8px; }
.inventory-location-balance-list article { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:12px; align-items:center; padding:13px; border:1px solid var(--line); border-radius:13px; }
.inventory-location-balance-list article.inactive { opacity:.62; }
.inventory-location-balance-list strong,.inventory-location-balance-list small,.inventory-location-balance-list span,.inventory-location-balance-list b { display:block; }
.inventory-location-balance-list small,.inventory-location-balance-list span { color:var(--muted); font-size:.72rem; }
.inventory-location-balance-list b { margin-top:2px; font-size:.86rem; }
.stock-location-list { display:grid; gap:12px; }
.stock-location-list > article { padding:14px; border:1px solid var(--line); border-radius:15px; }
.stock-location-list > article.inactive { opacity:.7; background:var(--surface-soft); }
.location-edit-form { display:grid; gap:11px; }
.location-title { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.location-title strong,.location-title small { display:block; }
.location-title small { color:var(--muted); }
.location-stats { display:flex; justify-content:space-between; gap:12px; padding:10px; border-radius:11px; background:var(--surface-soft); font-size:.76rem; }
.location-stats span { color:var(--muted); }
.location-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; padding-top:10px; border-top:1px solid var(--line); }
.stock-sync-notice { display:grid; gap:2px; margin-bottom:12px; padding:12px 14px; border:1px solid #bfe1db; border-radius:13px; background:var(--primary-soft); }
.stock-sync-notice span { color:var(--muted); font-size:.82rem; }
.work-order-material-fields { display:grid; gap:9px; min-width:min(100%,260px); }
.compact-field { min-width:190px; }
.compact-field select { min-height:42px; }
.stock-current-location { color:var(--primary-dark)!important; }
.work-order-detail-item.stock-controlled { border-left:4px solid var(--primary); }

@media (min-width:640px) {
    .inventory-metric-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
    .inventory-filter-form { grid-template-columns:minmax(220px,1.4fr) minmax(170px,.8fr) minmax(160px,.7fr) auto; align-items:end; }
    .inventory-location-layout { grid-template-columns:minmax(280px,.75fr) minmax(0,1.4fr); align-items:start; }
}
@media (min-width:900px) {
    .inventory-layout { grid-template-columns:minmax(0,1.5fr) minmax(300px,.7fr); align-items:start; }
    .inventory-detail-layout { grid-template-columns:minmax(300px,.7fr) minmax(0,1.3fr); align-items:start; }
}

/* Fase 7 — Financeiro unificado */
.bottom-nav { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.bottom-nav small { font-size: .58rem; }
.finance-metric-grid,.finance-detail-metrics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:12px 0; }
.finance-metric-grid article,.finance-detail-metrics article { padding:15px; background:var(--surface); border:1px solid var(--line); border-radius:16px; box-shadow:0 8px 28px rgba(15,66,60,.035); }
.finance-metric-grid span,.finance-metric-grid strong,.finance-metric-grid small,.finance-detail-metrics span,.finance-detail-metrics strong { display:block; }
.finance-metric-grid span,.finance-detail-metrics span { color:var(--muted); font-size:.75rem; }
.finance-metric-grid strong,.finance-detail-metrics strong { margin-top:4px; font-size:1.35rem; line-height:1.1; }
.finance-metric-grid small { margin-top:5px; color:var(--muted); }
.finance-metric-grid .danger-card,.finance-detail-metrics .danger-card { border-color:#f4c1bb; background:var(--danger-soft); }
.finance-filter-form { display:grid; gap:10px; }
.finance-layout,.finance-detail-layout,.finance-settings-layout { display:grid; gap:12px; }
.finance-entry-list,.finance-account-list,.finance-account-admin-list,.finance-category-list,.installment-list,.payment-history-list { display:grid; gap:10px; }
.finance-entry-card { display:grid; grid-template-columns:34px minmax(0,1fr); gap:10px; padding:14px; color:inherit; text-decoration:none; background:#fff; border:1px solid var(--line); border-radius:16px; transition:.15s ease; }
.finance-entry-card:hover { border-color:#9ac7c1; transform:translateY(-1px); }
.finance-entry-card.overdue { border-color:#efb8b1; background:#fffafa; }
.finance-entry-card.cancelled { opacity:.62; }
.finance-direction { display:grid; place-items:center; width:34px; height:34px; border-radius:12px; font-weight:900; background:#e7f6f3; color:var(--primary); }
.finance-entry-card.expense .finance-direction { background:#fff0ed; color:#a13d31; }
.finance-entry-main { display:flex; justify-content:space-between; gap:10px; align-items:flex-start; }
.finance-entry-main strong,.finance-entry-main small { display:block; }
.finance-entry-main small { margin-top:3px; color:var(--muted); }
.finance-status { display:inline-flex; align-items:center; justify-content:center; white-space:nowrap; padding:5px 8px; border-radius:999px; font-size:.68rem; font-weight:800; background:#edf3f2; color:#46615e; }
.finance-status.paid { background:#e5f7ed; color:#1d6a43; }
.finance-status.partial { background:#fff6dc; color:#8a6410; }
.finance-status.overdue { background:#fdebea; color:#a13d31; }
.finance-status.cancelled { background:#ececec; color:#666; }
.finance-entry-meta,.finance-entry-values { grid-column:2; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.finance-entry-meta span,.finance-entry-values span { display:block; padding:8px 9px; border-radius:10px; background:#f6f8f7; color:var(--muted); font-size:.69rem; }
.finance-entry-meta b,.finance-entry-values strong { display:block; margin-top:2px; color:var(--text); font-size:.78rem; }
.finance-account-panel { align-self:start; }
.finance-account-list article,.finance-account-admin-list article,.finance-category-list article,.payment-history-list article { display:flex; align-items:center; gap:10px; padding:12px; border:1px solid var(--line); border-radius:14px; background:#fff; }
.finance-account-list article > div,.finance-account-admin-list article > div,.finance-category-list article > div,.payment-history-list article > div { flex:1; min-width:0; }
.finance-account-list strong,.finance-account-list small,.finance-account-admin-list strong,.finance-account-admin-list small,.finance-category-list strong,.finance-category-list small,.payment-history-list strong,.payment-history-list small { display:block; }
.finance-account-list small,.finance-account-admin-list small,.finance-category-list small,.payment-history-list small { margin-top:3px; color:var(--muted); }
.finance-account-list article.inactive,.finance-account-admin-list article.inactive,.finance-category-list article.inactive,.payment-history-list article.cancelled { opacity:.58; }
.finance-detail-main,.finance-detail-side,.settings-stack { display:grid; gap:12px; align-content:start; }
.installment-card { padding:14px; border:1px solid var(--line); border-radius:16px; background:#fff; }
.installment-card.overdue { border-color:#efb8b1; background:#fffafa; }
.installment-card.cancelled { opacity:.6; }
.installment-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.installment-heading strong,.installment-heading small { display:block; }
.installment-heading small { margin-top:3px; color:var(--muted); }
.installment-values { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-top:12px; }
.installment-values span { padding:8px; border-radius:10px; background:#f6f8f7; color:var(--muted); font-size:.7rem; }
.installment-values b { display:block; margin-top:2px; color:var(--text); }
.payment-details { margin-top:12px; border-top:1px dashed var(--line); padding-top:10px; }
.payment-details summary { cursor:pointer; color:var(--primary); font-weight:800; }
.payment-form { display:grid; gap:10px; margin-top:12px; }
.payment-icon,.category-type { display:grid; place-items:center; flex:0 0 auto; width:34px; height:34px; border-radius:12px; font-weight:900; background:#e7f6f3; color:var(--primary); }
.category-type.expense { background:#fff0ed; color:#a13d31; }
.category-type.both { background:#fff6dc; color:#8a6410; }
.payment-history-list p { margin:5px 0 0; color:var(--muted); font-size:.8rem; }
.finance-settings-layout aside.panel,.settings-stack .panel { align-self:start; }
@media (min-width:640px){
  .finance-metric-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .finance-detail-metrics { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .finance-filter-form { grid-template-columns:minmax(220px,1.3fr) 150px 150px 160px auto; align-items:end; }
  .finance-entry-meta { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .finance-entry-values { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (min-width:900px){
  .finance-layout { grid-template-columns:minmax(0,1.65fr) minmax(280px,.75fr); }
  .finance-detail-layout { grid-template-columns:minmax(0,1.55fr) minmax(280px,.65fr); }
  .finance-settings-layout { grid-template-columns:minmax(0,1.35fr) minmax(300px,.65fr); }
}

/* Fase 8 — Agenda operacional */
.status-pill.scheduled { color: #365f8d; background: #edf5ff; }
.status-pill.confirmed { color: var(--success); background: var(--success-soft); }
.status-pill.in_progress { color: var(--warning); background: #fff6dd; }
.status-pill.completed { color: #315d4e; background: #e8f3ef; }
.status-pill.cancelled, .status-pill.no_show { color: var(--danger); background: var(--danger-soft); }
.calendar-metrics { margin-bottom: 12px; }
.calendar-toolbar-panel { padding: 14px 18px; }
.calendar-toolbar { display: grid; gap: 14px; align-items: end; }
.calendar-month-navigation { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.calendar-month-navigation h2 { margin: 2px 0 0; font-size: 1.25rem; text-align: center; }
.calendar-filter { min-width: 0; }
.calendar-filter .field { min-width: 220px; }
.calendar-panel { padding: 0; overflow-x: auto; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(118px, 1fr)); min-width: 826px; }
.calendar-weekdays { position: sticky; top: 0; z-index: 4; background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.calendar-weekdays span { padding: 10px; color: var(--muted); font-size: .74rem; font-weight: 800; text-align: center; text-transform: uppercase; }
.calendar-day { min-height: 132px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.outside { background: #fafcfc; opacity: .66; }
.calendar-day.today { background: #f0fbf8; box-shadow: inset 0 0 0 2px rgba(15,118,110,.28); }
.calendar-day > header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.calendar-day > header > span { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; font-size: .78rem; font-weight: 850; }
.calendar-day.today > header > span { color: #fff; background: var(--primary); }
.calendar-day > header > a { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; color: var(--primary); background: var(--primary-soft); text-decoration: none; font-weight: 900; }
.calendar-day-events { display: grid; gap: 4px; }
.calendar-event { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px; padding: 5px 6px; border-left: 3px solid var(--primary); border-radius: 7px; background: #edf8f6; color: var(--ink); text-decoration: none; font-size: .67rem; line-height: 1.25; }
.calendar-event strong { white-space: nowrap; }
.calendar-event span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event.status-confirmed { border-left-color: var(--success); background: var(--success-soft); }
.calendar-event.status-in_progress { border-left-color: var(--warning); background: #fff6dd; }
.calendar-event.status-completed { border-left-color: #52796f; background: #eef5f2; opacity: .78; }
.calendar-event.status-cancelled, .calendar-event.status-no_show { border-left-color: var(--danger); background: var(--danger-soft); text-decoration: line-through; opacity: .72; }
.calendar-event.block { border-left-color: #7557a4; background: #f4effa; color: #583d80; }
.calendar-more { display: block; padding: 3px 5px; color: var(--muted); font-size: .65rem; }
.upcoming-panel { margin-top: 12px; }
.agenda-list { display: grid; gap: 8px; }
.agenda-list-item { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px; color: var(--ink); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; }
.agenda-list-item:hover { background: var(--surface-soft); }
.agenda-date { display: grid; place-items: center; align-content: center; min-height: 48px; border-radius: 12px; background: var(--primary-soft); }
.agenda-date strong { font-size: 1.15rem; line-height: 1; }
.agenda-date span { margin-top: 3px; color: var(--primary-dark); font-size: .6rem; font-weight: 850; }
.agenda-main { min-width: 0; }
.agenda-main strong, .agenda-main small, .agenda-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-main small, .agenda-main span { color: var(--muted); font-size: .76rem; }
.team-select-grid { display: grid; gap: 8px; }
.team-select-card { position: relative; cursor: pointer; }
.team-select-card input { position: absolute; opacity: 0; pointer-events: none; }
.team-select-card > span { display: grid; gap: 2px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.team-select-card small { color: var(--muted); }
.team-select-card input:checked + span { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.calendar-detail-grid { margin-bottom: 12px; }
.detail-actions { margin-top: 16px; }
.people-list { display: grid; gap: 9px; }
.person-row { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; }
.person-row strong, .person-row small { display: block; }
.person-row small { color: var(--muted); }
.status-action-form { display: grid; gap: 10px; }
.timeline-list { display: grid; gap: 13px; }
.timeline-item { display: grid; grid-template-columns: 14px 1fr; gap: 10px; }
.timeline-item > span { width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.timeline-item strong, .timeline-item small { display: block; }
.timeline-item small { color: var(--muted); }
.timeline-item p { margin: 4px 0 0; }
.calendar-settings-grid { align-items: start; }
.settings-list { display: grid; gap: 9px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.settings-row > div { min-width: 0; }
.settings-row strong, .settings-row span, .settings-row small { display: block; }
.settings-row span, .settings-row small { color: var(--muted); font-size: .78rem; }

@media (max-width: 620px) {
    .agenda-list-item { grid-template-columns: 44px minmax(0, 1fr); }
    .agenda-list-item > .status-pill { grid-column: 2; justify-self: start; }
    .settings-row { align-items: flex-start; flex-direction: column; }
    .settings-row form, .settings-row button { width: 100%; }
    .status-action-form { grid-template-columns: 1fr; }
}

@media (min-width: 760px) {
    .calendar-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
    .calendar-month-navigation { justify-content: flex-start; }
    .calendar-month-navigation h2 { min-width: 220px; }
    .team-select-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .status-action-form { grid-template-columns: 190px minmax(0, 1fr) auto; align-items: end; }
    .calendar-settings-grid { grid-template-columns: minmax(300px, .75fr) minmax(0, 1.25fr); }
}

@media (max-width: 999px) {
    .bottom-nav { display: flex; overflow-x: auto; overscroll-behavior-inline: contain; }
    .bottom-nav > a, .bottom-nav > span, .bottom-nav > form { flex: 0 0 72px; }
}

/* Fase 9 — Relatórios e indicadores */
.report-heading { align-items:flex-start; }
.report-filter-panel { position:sticky; top:0; z-index:4; margin-bottom:12px; }
.report-filter-form { display:grid; gap:10px; }
.report-section-nav { display:flex; gap:8px; overflow-x:auto; padding:2px 0 12px; scrollbar-width:thin; }
.report-section-nav a { flex:0 0 auto; padding:8px 12px; border:1px solid var(--line); border-radius:999px; background:var(--surface); color:var(--text); text-decoration:none; font-size:.76rem; font-weight:800; }
.report-section-nav a:hover { border-color:#8bbdb6; color:var(--primary); }
.report-section { display:grid; gap:12px; margin:10px 0 28px; scroll-margin-top:110px; }
.report-section-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; }
.report-section-heading h2 { margin:2px 0 0; }
.report-metric-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.report-metric-grid article { min-width:0; padding:14px; border:1px solid var(--line); border-radius:16px; background:var(--surface); box-shadow:0 8px 28px rgba(15,66,60,.035); }
.report-metric-grid span,.report-metric-grid strong,.report-metric-grid small { display:block; }
.report-metric-grid span { color:var(--muted); font-size:.72rem; }
.report-metric-grid strong { margin-top:5px; font-size:clamp(1.05rem,4.5vw,1.45rem); line-height:1.1; overflow-wrap:anywhere; }
.report-metric-grid small { margin-top:5px; color:var(--muted); font-size:.7rem; }
.report-metric-grid .danger-card { border-color:#efb8b1; background:var(--danger-soft); }
.report-metric-grid .success-card { border-color:#b7ddca; background:#effaf4; }
.report-two-columns { display:grid; gap:12px; }
.report-card { min-width:0; }
.report-card h3 { margin:2px 0 0; }
.report-bar-list,.report-ranking-list,.productivity-list { display:grid; gap:9px; }
.report-bar-list article { display:grid; gap:7px; padding:10px 0; border-bottom:1px solid var(--line); }
.report-bar-list article:last-child { border-bottom:0; }
.report-bar-list article > div:first-child { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.report-bar-list strong,.report-bar-list span { display:block; }
.report-bar-list span { color:var(--muted); font-size:.72rem; text-align:right; }
.report-bar-track { height:8px; overflow:hidden; border-radius:999px; background:#edf2f1; }
.report-bar-track i { display:block; min-width:2px; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--primary),#48a99e); }
.report-ranking-list article { display:grid; grid-template-columns:30px minmax(0,1fr) auto; gap:10px; align-items:center; padding:10px; border:1px solid var(--line); border-radius:13px; background:#fff; }
.report-ranking-list article > span { display:grid; place-items:center; width:30px; height:30px; border-radius:10px; background:var(--primary-soft); color:var(--primary-dark); font-weight:900; }
.report-ranking-list strong,.report-ranking-list small { display:block; }
.report-ranking-list small { margin-top:2px; color:var(--muted); font-size:.7rem; }
.report-ranking-list b { white-space:nowrap; font-size:.8rem; }
.report-ranking-list.warning-list article > span { background:var(--danger-soft); color:var(--danger); }
.finance-ranking article > span { font-size:1rem; }
.report-table-wrap { overflow-x:auto; }
.report-table { width:100%; border-collapse:collapse; min-width:600px; }
.report-table th,.report-table td { padding:10px 9px; border-bottom:1px solid var(--line); text-align:left; font-size:.76rem; }
.report-table th { color:var(--muted); font-size:.68rem; text-transform:uppercase; letter-spacing:.04em; }
.report-table td:last-child,.report-table th:last-child { text-align:right; }
.report-chip-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.report-chip-grid article { padding:12px; border:1px solid var(--line); border-radius:13px; background:#fff; }
.report-chip-grid span,.report-chip-grid strong,.report-chip-grid small { display:block; }
.report-chip-grid span,.report-chip-grid small { color:var(--muted); font-size:.7rem; }
.report-chip-grid strong { margin:4px 0; font-size:1.2rem; }
.productivity-list article { display:grid; gap:10px; padding:13px; border:1px solid var(--line); border-radius:15px; background:#fff; }
.productivity-person { display:flex; align-items:center; gap:10px; }
.productivity-person > span { display:grid; place-items:center; flex:0 0 auto; width:38px; height:38px; border-radius:50%; background:var(--primary-soft); color:var(--primary-dark); font-weight:900; }
.productivity-person strong,.productivity-person small { display:block; }
.productivity-person small { color:var(--muted); }
.productivity-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; }
.productivity-stats span { padding:8px; border-radius:10px; background:var(--surface-soft); color:var(--muted); font-size:.65rem; }
.productivity-stats b { display:block; margin-bottom:2px; color:var(--text); font-size:.76rem; }
.empty-state.compact { padding:24px 10px; }
@media (min-width:640px) {
    .report-filter-form { grid-template-columns:180px 180px auto; align-items:end; }
    .report-metric-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .report-chip-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
@media (min-width:900px) {
    .report-two-columns { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .report-metric-grid { grid-template-columns:repeat(5,minmax(0,1fr)); }
    .report-filter-panel { position:static; }
    .report-section { scroll-margin-top:20px; }
}

/* OS 0.9.2 — checklist e evidências */
.work-order-checklist-form,.attachment-upload-form{display:grid;gap:12px}.checklist-list,.checklist-new-grid{display:grid;gap:8px}.checklist-row{display:grid;grid-template-columns:minmax(220px,1fr) auto auto;gap:12px;align-items:center;padding:10px;border:1px solid var(--line);border-radius:12px}.checklist-row input[type=text]{width:100%}.checklist-row label{display:flex;align-items:center;gap:6px;white-space:nowrap}.checklist-readonly{display:grid;gap:8px}.checklist-readonly>div{display:flex;gap:10px;align-items:center;padding:10px;border:1px solid var(--line);border-radius:12px}.checklist-readonly>div.done{opacity:.7}.checklist-readonly small{margin-left:auto}.attachment-upload-form{grid-template-columns:1.2fr .7fr 1fr auto;align-items:end}.attachment-gallery{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:10px;margin-top:14px}.attachment-card{display:flex;gap:12px;align-items:center;padding:12px;border:1px solid var(--line);border-radius:14px;text-decoration:none;color:inherit}.attachment-card>span{font-size:26px}.attachment-card div{display:grid;gap:3px}.attachment-card small{color:var(--muted)}@media(max-width:800px){.checklist-row,.attachment-upload-form{grid-template-columns:1fr}.checklist-row label{white-space:normal}}

/* 0.9.3 — Central de alertas e prioridades */
.nav-link-with-badge { position: relative; padding-right: 3.25rem; }
.nav-badge {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    min-width: 1.45rem;
    height: 1.45rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dc2626;
    color: #fff;
    font-size: 0.7rem;
    line-height: 1;
}
.mobile-header-actions { display: flex; align-items: center; gap: 0.7rem; }
.mobile-alert-link {
    position: relative;
    width: 2.55rem;
    height: 2.55rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 118, 110, 0.1);
    color: #0f766e;
    font-weight: 900;
    text-decoration: none;
}
.mobile-alert-link.active { background: #0f766e; color: #fff; }
.mobile-alert-link strong {
    position: absolute;
    top: -0.2rem;
    right: -0.2rem;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dc2626;
    color: #fff;
    font-size: 0.62rem;
    border: 2px solid #fff;
}
.bottom-alert-link > span { position: relative; }
.bottom-alert-link b {
    position: absolute;
    top: -0.45rem;
    right: -0.65rem;
    min-width: 1.05rem;
    height: 1.05rem;
    padding: 0 0.18rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dc2626;
    color: #fff;
    font-size: 0.55rem;
    border: 1px solid #fff;
}
.metric-danger { border-color: rgba(220, 38, 38, 0.35) !important; background: linear-gradient(180deg, #fff 0%, #fff7f7 100%); }
.notification-page-heading { align-items: center; }
.notification-metrics { margin-bottom: 1rem; }
.notification-filters { margin: 0 0 1rem; }
.notification-list { display: grid; gap: 0.85rem; }
.notification-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid #d9e4e2;
    border-left-width: 5px;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}
.notification-card.severity-danger { border-left-color: #dc2626; }
.notification-card.severity-warning { border-left-color: #d97706; }
.notification-card.severity-info { border-left-color: #0f766e; }
.notification-card.severity-success { border-left-color: #15803d; }
.notification-card.is-unread { box-shadow: 0 12px 28px rgba(15, 118, 110, 0.09); }
.notification-card.is-archived { opacity: 0.72; background: #f8fafc; }
.notification-icon {
    width: 2.65rem;
    height: 2.65rem;
    border-radius: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    background: #eef7f6;
    color: #0f766e;
}
.severity-danger .notification-icon { background: #fef2f2; color: #dc2626; }
.severity-warning .notification-icon { background: #fff7ed; color: #d97706; }
.severity-success .notification-icon { background: #f0fdf4; color: #15803d; }
.notification-body { min-width: 0; }
.notification-body h2 { margin: 0.3rem 0 0.35rem; font-size: 1.05rem; }
.notification-body p { margin: 0 0 0.45rem; color: #475569; }
.notification-body small { color: #64748b; }
.notification-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; color: #64748b; font-size: 0.75rem; }
.notification-meta strong { color: #0f766e; }
.status-pill.danger { background: #fef2f2; color: #b91c1c; }
.status-pill.warning { background: #fff7ed; color: #b45309; }
.status-pill.info { background: #eff6ff; color: #1d4ed8; }
.status-pill.success { background: #f0fdf4; color: #15803d; }
.notification-actions { display: flex; flex-direction: column; align-items: stretch; gap: 0.45rem; min-width: 9.2rem; }
.notification-actions form { margin: 0; }
.notification-actions .button { width: 100%; }
.dashboard-priority-panel { margin-bottom: 1rem; }
.dashboard-alert-list { display: grid; gap: 0.55rem; }
.dashboard-alert-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid #dbe7e5;
    border-radius: 0.85rem;
    color: inherit;
    text-decoration: none;
    background: #fff;
}
.dashboard-alert-item:hover { border-color: #0f766e; transform: translateY(-1px); }
.dashboard-alert-item strong, .dashboard-alert-item small { display: block; }
.dashboard-alert-item small { color: #64748b; margin-top: 0.15rem; }
.dashboard-alert-symbol {
    width: 2rem;
    height: 2rem;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef7f6;
    color: #0f766e;
    font-weight: 900;
}
.dashboard-alert-item.severity-danger .dashboard-alert-symbol { background: #fef2f2; color: #dc2626; }
.dashboard-alert-item.severity-warning .dashboard-alert-symbol { background: #fff7ed; color: #d97706; }
.dashboard-all-clear { display: flex; gap: 0.85rem; align-items: center; padding: 1rem; border-radius: 0.9rem; background: #f0fdf4; color: #166534; }
.dashboard-all-clear > span { font-size: 1.5rem; font-weight: 900; }
.dashboard-all-clear strong, .dashboard-all-clear small { display: block; }
.dashboard-all-clear small { margin-top: 0.15rem; color: #3f6212; }

@media (max-width: 760px) {
    .notification-page-heading { align-items: stretch; }
    .notification-card { grid-template-columns: auto minmax(0, 1fr); }
    .notification-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; min-width: 0; }
    .notification-actions form, .notification-actions .button { width: auto; flex: 1 1 9rem; }
    .dashboard-alert-item { grid-template-columns: auto minmax(0, 1fr); }
    .dashboard-alert-item > span:last-child { display: none; }
}

/* Comunicações 0.9.4 */
.communication-layout{align-items:start}.communication-compose{margin-top:1rem;padding-top:1rem;border-top:1px solid var(--border)}.contact-summary{display:flex;justify-content:space-between;gap:1rem;padding:.9rem 1rem;border-radius:14px;background:var(--surface-soft)}.contact-summary span{color:var(--muted)}.communication-template-list{margin-top:1rem}.communication-template-list article{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.8rem 0;border-top:1px solid var(--border)}.communication-template-list small{display:block;color:var(--muted)}.message-cell{min-width:240px;max-width:420px}.inline-form{display:flex;gap:.5rem;align-items:center}.inline-form select{min-width:120px}.form-hint code{font-size:.82rem}@media(max-width:760px){.contact-summary,.inline-form{align-items:stretch;flex-direction:column}.message-cell{min-width:190px}}


/* Assinatura única e histórico auditável — 0.9.5 */
.signature-valid-badge { display:inline-flex; align-items:center; gap:7px; width:max-content; margin:8px 0; padding:7px 11px; border-radius:999px; background:#e5f8ef; color:#12613f; font-weight:800; font-size:.82rem; }
.active-signature { border-color:#92d1b5; box-shadow:0 0 0 2px rgba(34,139,94,.08); }
.signature-help { margin-top:8px; }
.signature-replace-card, .signature-history-card { margin-top:14px; border:1px solid var(--line); border-radius:14px; background:var(--surface-soft, #f7faf9); overflow:hidden; }
.signature-replace-card > summary, .signature-history-card > summary { cursor:pointer; padding:12px 14px; font-weight:800; color:var(--ink); }
.signature-replace-card[open] > summary, .signature-history-card[open] > summary { border-bottom:1px solid var(--line); }
.signature-replace-card > p, .signature-replace-card > form, .signature-history-list { margin:12px 14px; }
.historical-signature { background:#fff; opacity:.88; }
.historical-signature p { margin:5px 0 0; font-size:.82rem; color:var(--muted); }
.signature-actions .button.danger { background:#b83b3b; color:#fff; border-color:#b83b3b; }
@media (max-width: 640px) { .signature-actions { display:grid; grid-template-columns:1fr; } .signature-actions .button { width:100%; } }

/* Dashboard gerencial e homologação — 0.9.6 */
.dashboard-management-panel{margin-bottom:1rem}.management-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:.75rem}.management-card{display:flex;flex-direction:column;gap:.28rem;padding:1rem;border:1px solid var(--border);border-radius:1rem;background:var(--surface);text-decoration:none;color:inherit}.management-card:hover{border-color:var(--primary);transform:translateY(-1px)}.management-card>span{font-size:.78rem;color:var(--muted);font-weight:700}.management-card>strong{font-size:1.35rem;color:var(--ink)}.management-card>small{font-size:.75rem;color:var(--muted)}.management-card.danger{border-color:#fecaca;background:#fff7f7}.readiness-card{background:linear-gradient(180deg,#fff,#f2fbf9)}.homologation-heading{align-items:center}.homologation-summary{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:1.25rem;align-items:center;margin-bottom:1rem}.readiness-ring{--readiness:0%;width:112px;height:112px;border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;background:conic-gradient(var(--primary) var(--readiness),#e6efed 0);position:relative}.readiness-ring:after{content:"";position:absolute;inset:10px;border-radius:50%;background:#fff}.readiness-ring strong,.readiness-ring span{position:relative;z-index:1}.readiness-ring strong{font-size:1.45rem}.readiness-ring span{font-size:.72rem;color:var(--muted)}.homologation-summary-copy h2{margin:.15rem 0}.homologation-summary-copy p{margin:.2rem 0;color:var(--muted)}.readiness-progress{height:9px;border-radius:999px;background:#e6efed;overflow:hidden;margin-top:.75rem}.readiness-progress span{display:block;height:100%;border-radius:inherit;background:var(--primary)}.homologation-mini-metrics{display:flex;gap:.6rem}.homologation-mini-metrics article{min-width:84px;padding:.75rem;border-radius:.85rem;background:var(--surface-soft);text-align:center}.homologation-mini-metrics strong,.homologation-mini-metrics span{display:block}.homologation-mini-metrics span{font-size:.7rem;color:var(--muted)}.homologation-mini-metrics .danger{background:#fff1f2;color:#b91c1c}.homologation-groups{display:grid;gap:1rem}.homologation-list{display:grid;gap:.7rem}.homologation-item{display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,420px);gap:1rem;padding:1rem;border:1px solid var(--border);border-left-width:5px;border-radius:1rem;background:#fff}.homologation-item.status-approved{border-left-color:#16a34a}.homologation-item.status-blocked{border-left-color:#dc2626}.homologation-item.status-in_progress{border-left-color:#2563eb}.homologation-item.status-pending{border-left-color:#d97706}.homologation-item.status-not_applicable{border-left-color:#94a3b8}.homologation-title-row{display:flex;align-items:center;justify-content:space-between;gap:.75rem}.homologation-item-main p{margin:.35rem 0;color:var(--muted)}.homologation-item-main small{color:var(--muted)}.homologation-form{display:grid;grid-template-columns:150px minmax(0,1fr) auto;gap:.6rem;align-items:end}.homologation-form label{margin:0}.homologation-note textarea{min-height:70px}.homologation-evidence{padding:.75rem;border-radius:.75rem;background:var(--surface-soft)}.homologation-evidence p{margin:.25rem 0 0}.status-pill.neutral{background:#f1f5f9;color:#475569}@media(max-width:1100px){.management-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.homologation-item{grid-template-columns:1fr}.homologation-form{grid-template-columns:150px minmax(0,1fr) auto}}@media(max-width:760px){.management-grid{grid-template-columns:1fr 1fr}.homologation-summary{grid-template-columns:1fr;text-align:center}.readiness-ring{margin:auto}.homologation-mini-metrics{justify-content:center;flex-wrap:wrap}.homologation-form{grid-template-columns:1fr}.homologation-heading{align-items:stretch}}@media(max-width:480px){.management-grid{grid-template-columns:1fr}}

/* 0.9.7 — gerenciamento de equipe e conta */
.user-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; grid-column: 2; }
.user-actions form { grid-column: auto; }
.security-note { color: var(--warning) !important; font-weight: 800; }
.account-management-grid { display: grid; gap: 14px; }
.security-panel { align-content: start; }
.check-row { display: flex; align-items: flex-start; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); cursor: pointer; }
.check-row input { width: 20px; min-height: 20px; margin: 2px 0 0; flex: 0 0 auto; }
.check-row span, .check-row strong, .check-row small { display: block; }
.check-row small { margin-top: 3px; color: var(--muted); }
.form-help { margin: 0; color: var(--muted); font-size: .86rem; }
.compact-summary { margin-top: 4px; }
.forced-password-shell { min-height: calc(100vh - 150px); display: grid; place-items: center; padding: 18px 0; }
.forced-password-card { width: min(100%, 560px); padding: clamp(20px, 5vw, 34px); }
.forced-password-card h1 { margin: 5px 0 10px; font-size: clamp(1.7rem, 6vw, 2.25rem); }
.forced-password-card > p { margin: 0 0 20px; color: var(--muted); }
.security-footer { display: block; margin-top: 14px; color: var(--muted); text-align: center; }
.avatar-link { text-decoration: none; }
.sidebar-user-link { color: #fff; text-decoration: none; border-radius: 12px; padding: 12px 8px 0; }
.sidebar-user-link.active { background: rgba(255,255,255,.09); }
@media (min-width: 640px) {
    .user-actions { grid-column: 3; justify-content: flex-end; }
    .account-management-grid { grid-template-columns: minmax(0, 1.35fr) minmax(300px, .85fr); align-items: start; }
}

/* v0.9.9 — Dashboard por perfil e operação mobile */
.technician-orders-panel{margin-bottom:1rem}.technician-order-list{display:grid;gap:.75rem}.technician-order-group{margin:.45rem 0 0;padding:.45rem .7rem;border-radius:.7rem;background:var(--surface-soft);font-size:.86rem}.technician-order-group.in_progress{background:#ecfdf5;color:#047857}.technician-order-group.late{background:#fff1f2;color:#be123c}.technician-order-group.today{background:#eff6ff;color:#1d4ed8}.technician-order-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:1rem;align-items:center;padding:1rem;border:1px solid var(--border);border-left:5px solid #94a3b8;border-radius:1rem;background:#fff}.technician-order-card.in_progress{border-left-color:#059669}.technician-order-card.late{border-left-color:#dc2626}.technician-order-card.today{border-left-color:#2563eb}.technician-order-code-row{display:flex;align-items:center;gap:.7rem;flex-wrap:wrap}.technician-order-main h3{margin:.35rem 0}.technician-order-main p{margin:.2rem 0;color:var(--muted)}.technician-order-actions{display:flex;gap:.55rem;align-items:center;flex-wrap:wrap}.technician-order-actions form{margin:0}.technician-empty{text-align:center;padding:1.5rem}.technician-empty p{margin:.35rem 0 0;color:var(--muted)}
@media(max-width:760px){.technician-order-card{grid-template-columns:1fr}.technician-order-actions{display:grid;grid-template-columns:1fr 1fr}.technician-order-actions .button,.technician-order-actions form,.technician-order-actions button{width:100%}.technician-welcome{align-items:flex-start}.technician-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:420px){.technician-metrics{grid-template-columns:1fr}.technician-order-actions{grid-template-columns:1fr}}

/* v0.9.10 — PWA, conectividade e candidato à versão 1.0 */
.pwa-install-control[hidden] { display: none !important; }
.pwa-install-control { margin-top: 10px; }
.guest-install-control { width: min(100%, 420px); margin: 4px auto 10px; }

.app-runtime-notice {
    position: fixed;
    z-index: 1200;
    left: 14px;
    right: 14px;
    bottom: calc(var(--bottom-nav-height) + 14px + env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 720px;
    margin: 0 auto;
    padding: 13px 15px;
    border: 1px solid rgba(15,118,110,.22);
    border-radius: 16px;
    background: #fff;
    color: #17332f;
    box-shadow: 0 18px 45px rgba(15,58,53,.18);
    font-size: .92rem;
    font-weight: 700;
}
.app-runtime-notice button {
    flex: 0 0 auto;
    border: 0;
    border-radius: 11px;
    background: #0f766e;
    color: #fff;
    padding: 9px 12px;
    font: inherit;
    cursor: pointer;
}
.connectivity-offline { background: #fff7e8; border-color: #efbd62; color: #70470b; }
.connectivity-offline::before { content: "!"; display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; background: #f3b33d; color: #4f3100; }
.pwa-update-notice { background: #eaf8f5; }
.pwa-installed-notice { justify-content: center; background: #e9f8ef; border-color: #9bd5ad; }
.pwa-ios-notice { background: #eef6ff; border-color: #a9ccee; }
.is-offline form button[type="submit"]:not([data-offline-allowed]) { }
.pwa-standalone body { overscroll-behavior-y: contain; }

@media (min-width: 900px) {
    .app-runtime-notice { left: calc(260px + 24px); bottom: 24px; }
}

@media (max-width: 520px) {
    .app-runtime-notice { align-items: stretch; flex-direction: column; }
    .app-runtime-notice button { width: 100%; }
}

/* v1.0.0 — central de acesso universal e instalação assistida */
.auth-help-stack { display: grid; gap: 8px; }
.auth-help-stack > div { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px; }

.install-center { width: min(100%, 980px); display: grid; gap: 18px; }
.install-center-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; padding: clamp(18px, 4vw, 28px); border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(135deg, #effaf8, #ffffff); box-shadow: 0 18px 50px rgba(15, 66, 60, .08); }
.install-center-hero img { width: 96px; height: 96px; border-radius: 24px; box-shadow: 0 12px 28px rgba(15, 118, 110, .2); }
.install-center-hero h1 { margin: 4px 0 8px; font-size: clamp(1.65rem, 5vw, 2.45rem); line-height: 1.08; }
.install-center-hero p { margin: 0; color: var(--muted); max-width: 680px; }

.install-detected-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 13px; align-items: center; padding: 16px 18px; border: 1px solid #9bd5c9; border-radius: 18px; background: #ecfbf7; }
.install-detected-card strong, .install-detected-card p { display: block; }
.install-detected-card p { margin: 3px 0 0; color: var(--muted); }
.install-detected-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: #0f766e; color: #fff; font-size: 1.35rem; font-weight: 900; }

.install-primary-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.install-action-feedback { min-height: 22px; margin: -8px 0 0; color: #0f766e; text-align: center; font-weight: 800; }

.install-platform-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.install-platform-card { position: relative; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: #fff; transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.install-platform-card.active { border-color: #0f766e; transform: translateY(-2px); box-shadow: 0 14px 34px rgba(15, 66, 60, .1); }
.install-platform-card.active::after { content: "Este aparelho"; position: absolute; top: 12px; right: 12px; padding: 5px 8px; border-radius: 999px; background: #dff7f1; color: #0f766e; font-size: .7rem; font-weight: 900; text-transform: uppercase; letter-spacing: .03em; }
.install-platform-symbol { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--surface-soft); color: #0f766e; font-size: 1.2rem; font-weight: 900; }
.install-platform-card h2 { margin: 13px 0 7px; font-size: 1.08rem; }
.install-platform-card p { margin: 0; color: var(--muted); font-size: .92rem; }

.install-link-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.install-link-card h2 { margin: 4px 0 7px; }
.install-link-card p { margin: 0 0 12px; color: var(--muted); }
.install-link-card code { display: block; max-width: 100%; padding: 10px 12px; overflow-wrap: anywhere; border-radius: 12px; background: var(--surface-soft); color: #17332f; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.install-link-actions { display: grid; gap: 9px; min-width: 170px; }
.install-reassurance { padding: 16px 18px; border-left: 5px solid #0f766e; border-radius: 14px; background: #f7faf9; }
.install-reassurance p { margin: 4px 0 0; color: var(--muted); }

.pwa-install-dialog { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 18px; background: rgba(8, 31, 28, .62); backdrop-filter: blur(5px); }
.pwa-install-dialog-panel { position: relative; width: min(100%, 560px); max-height: min(88vh, 760px); overflow: auto; padding: clamp(22px, 5vw, 32px); border-radius: 24px; background: #fff; box-shadow: 0 28px 90px rgba(0, 0, 0, .28); }
.pwa-install-dialog-panel h2 { margin: 6px 38px 8px 0; font-size: clamp(1.45rem, 5vw, 2rem); }
.pwa-install-dialog-intro { margin: 0 0 18px; color: var(--muted); }
.pwa-install-dialog-close { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--surface-soft); color: #17332f; font-size: 1.7rem; cursor: pointer; }
.pwa-install-steps { display: grid; gap: 12px; margin: 0 0 16px; padding: 0; list-style: none; }
.pwa-install-steps li { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 11px; align-items: start; }
.pwa-install-steps li > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #0f766e; color: #fff; font-weight: 900; }
.pwa-install-steps p { margin: 5px 0 0; }
.pwa-install-dialog-note { padding: 12px 14px; border-radius: 13px; background: #fff7e8; color: #70470b; font-size: .9rem; }
.dialog-open { overflow: hidden; }

@media (min-width: 760px) {
    .guest-shell:has(.install-center) { width: min(100% - 40px, 1040px); }
}

@media (max-width: 760px) {
    .install-center-hero { grid-template-columns: 1fr; text-align: center; }
    .install-center-hero img { margin: 0 auto; }
    .install-primary-actions, .install-platform-grid, .install-link-card { grid-template-columns: 1fr; }
    .install-link-actions { grid-template-columns: 1fr 1fr; min-width: 0; }
}

@media (max-width: 440px) {
    .install-link-actions { grid-template-columns: 1fr; }
    .install-platform-card.active::after { position: static; display: inline-block; margin-top: 12px; }
}


/* v1.0.1 — correções mobile de ordens, checklist, conta e evidências */
.mobile-user-menu { position: relative; }
.mobile-user-menu > summary { list-style: none; cursor: pointer; }
.mobile-user-menu > summary::-webkit-details-marker { display: none; }
.mobile-user-popover {
    position: absolute; top: calc(100% + 10px); right: 0; z-index: 80; width: min(270px, calc(100vw - 28px));
    padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: #fff;
    box-shadow: 0 18px 45px rgba(15,66,60,.18);
}
.mobile-user-popover a,.mobile-user-popover button {
    width: 100%; display: grid; gap: 2px; padding: 12px 13px; border: 0; border-radius: 11px;
    color: var(--ink); background: transparent; text-align: left; text-decoration: none; cursor: pointer;
}
.mobile-user-popover a:hover { background: var(--surface-soft); }
.mobile-user-popover a span { font-weight: 800; }
.mobile-user-popover a small { color: var(--muted); overflow-wrap: anywhere; }
.mobile-user-popover form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--line); }
.mobile-user-popover button { color: var(--danger); font-weight: 850; }
.mobile-user-popover button:hover { background: var(--danger-soft); }

.evidence-file-field small { line-height: 1.35; }
.evidence-file-field input[type="file"] { min-width: 0; overflow: hidden; }

@media (max-width: 800px) {
    .panel-heading { align-items: flex-start; gap: 10px; }
    .panel-heading > strong { flex: 0 0 auto; font-size: .95rem; white-space: nowrap; }
    .checklist-row { grid-template-columns: minmax(0,1fr); gap: 10px; padding: 12px; overflow: hidden; }
    .checklist-row label,.checklist-option { width: 100%; min-width: 0; justify-content: flex-start; white-space: normal; }
    .checklist-row label input[type="checkbox"],.checklist-option input[type="checkbox"] { width: 22px; min-width: 22px; min-height: 22px; margin: 0; flex: 0 0 22px; }
    .checklist-option span { min-width: 0; overflow-wrap: anywhere; }
    .attachment-upload-form { grid-template-columns: minmax(0,1fr); }

    .work-order-card {
        grid-template-columns: minmax(0,1fr) auto;
        align-items: start;
        gap: 12px;
        padding: 15px 0;
        overflow: hidden;
    }
    .work-order-card .quote-card-main { min-width: 0; }
    .work-order-card .quote-card-title { display: grid; grid-template-columns: minmax(0,1fr); gap: 7px; }
    .work-order-card .quote-card-title .status-pill { justify-self: start; max-width: 100%; }
    .work-order-card .quote-card-main > span,.work-order-card .quote-card-main > small { overflow-wrap: anywhere; }
    .work-order-card .quote-card-total {
        min-width: 82px; max-width: 100px; display: grid; grid-template-columns: minmax(0,1fr) 14px;
        align-items: center; gap: 5px; text-align: right;
    }
    .work-order-card .quote-card-total strong { min-width: 0; font-size: .94rem; line-height: 1.2; overflow-wrap: anywhere; }
    .work-order-card .quote-card-total span { font-size: 1.45rem; }
}

@media (max-width: 390px) {
    .content-area { padding-left: 10px; padding-right: 10px; }
    .panel { padding-left: 14px; padding-right: 14px; }
    .work-order-card { grid-template-columns: minmax(0,1fr) 76px; gap: 9px; }
    .work-order-card .quote-card-total { min-width: 0; max-width: 76px; }
    .work-order-card .quote-card-total strong { font-size: .86rem; }
}


/* v1.0.2 — câmera direta e seleção de galeria/arquivos */
.evidence-source-actions {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 2px;
}
.evidence-source-button {
    width: 100%; min-width: 0; justify-content: center; white-space: normal; text-align: center; line-height: 1.25;
}
.evidence-file-input {
    position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important;
    margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important;
    white-space: nowrap !important; border: 0 !important; opacity: 0; pointer-events: none;
}
@media (max-width: 620px) {
    .evidence-source-actions { grid-template-columns: minmax(0,1fr); }
    .evidence-source-button { min-height: 48px; }
}


/* Operação offline v1.1.0 */
.offline-sync-bar{position:sticky;top:0;z-index:35;display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 16px;padding:12px 14px;border:1px solid #f59e0b;background:#fffbeb;border-radius:14px;box-shadow:0 8px 24px rgba(120,53,15,.08)}
.offline-sync-bar[hidden]{display:none!important}.offline-sync-bar div{display:grid;gap:2px}.offline-sync-bar strong{color:#92400e}.offline-sync-bar small{color:#78350f;line-height:1.35}
@media(max-width:640px){.offline-sync-bar{align-items:stretch;flex-direction:column}.offline-sync-bar .button{width:100%}}

/* Visualizador de fotos v1.1.2 */
html.image-viewer-open,
body.image-viewer-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}
.image-viewer-modal {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none !important;
    max-height: none !important;
    z-index: 2147483000;
    background: #050807;
    color: #fff;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    isolation: isolate;
}
.image-viewer-modal[hidden] { display: none !important; }
.image-viewer-toolbar {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 64px;
    padding: max(10px, env(safe-area-inset-top)) 12px 10px;
    background: rgba(0, 0, 0, .92);
    border-bottom: 1px solid rgba(255, 255, 255, .16);
}
.image-viewer-toolbar button {
    min-width: 48px;
    min-height: 48px;
    border: 1px solid rgba(255, 255, 255, .36);
    border-radius: 14px;
    background: #151918;
    color: #fff;
    cursor: pointer;
}
.image-viewer-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 14px;
    font-size: 1rem;
}
.image-viewer-back > span { font-size: 1.45rem; line-height: 1; }
.image-viewer-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    font-size: .98rem;
}
.image-viewer-close {
    width: 48px;
    padding: 0;
    font-size: 2rem;
    line-height: 1;
}
.image-viewer-stage {
    position: relative;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 8px;
    touch-action: pan-x pan-y pinch-zoom;
    overscroll-behavior: contain;
}
.image-viewer-stage img {
    display: block;
    width: auto;
    height: auto;
    max-width: calc(100vw - 16px);
    max-height: 100%;
    object-fit: contain;
    transform-origin: center;
    transition: transform .15s ease;
    user-select: none;
    -webkit-user-drag: none;
}
.image-viewer-actions {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 64px;
    padding: 10px 12px max(10px, env(safe-area-inset-bottom));
    background: rgba(0, 0, 0, .92);
    border-top: 1px solid rgba(255, 255, 255, .16);
}
.image-viewer-actions button {
    min-width: 46px;
    min-height: 46px;
    border: 1px solid rgba(255, 255, 255, .34);
    border-radius: 999px;
    background: #171717;
    color: #fff;
    font-size: 1.35rem;
    cursor: pointer;
}
.image-viewer-actions span {
    min-width: 54px;
    text-align: center;
    font-weight: 800;
}
.image-viewer-actions .image-viewer-bottom-close {
    width: auto;
    padding: 0 18px;
    border-radius: 14px;
    background: #fff;
    color: #111;
    font-size: .95rem;
    font-weight: 800;
}
@media (max-width: 480px) {
    .image-viewer-toolbar { gap: 7px; padding-left: 8px; padding-right: 8px; }
    .image-viewer-back { padding: 0 11px; }
    .image-viewer-back strong { display: none; }
    .image-viewer-title { font-size: .9rem; }
    .image-viewer-actions { gap: 8px; }
}



/* Operação offline confiável v1.1.3 */
.offline-download-group {
    display: grid;
    gap: 5px;
    min-width: min(100%, 250px);
}
.offline-download-group small {
    color: var(--muted, #60736f);
    font-size: .78rem;
    line-height: 1.35;
}
.offline-download-group small[data-state="success"] { color: #087443; font-weight: 700; }
.offline-download-group small[data-state="working"] { color: #8a5a00; font-weight: 700; }
.offline-download-group small[data-state="error"] { color: #b42318; font-weight: 700; }
.offline-sync-bar {
    position: sticky;
    top: 0;
    z-index: 45;
}
.offline-sync-bar > div { min-width: 0; }
.offline-sync-bar small { display: block; line-height: 1.35; }
@media (max-width: 760px) {
    .offline-download-group { width: 100%; }
    .offline-download-group .button { width: 100%; }
}

/* Orçamento comercial profissional — v1.1.5 */
.print-body {
    min-height: 100vh;
    color: #18342f;
    background: #e9efed;
}
.print-shell {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 28px 18px 44px;
}
.print-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: min(100%, 210mm);
    margin: 0 auto 18px;
    padding: 14px 16px;
    border: 1px solid #d6e1de;
    border-radius: 15px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 10px 32px rgba(24,52,47,.08);
}
.print-toolbar-copy,
.print-toolbar-copy strong,
.print-toolbar-copy small { display: block; }
.print-toolbar-copy strong { color: #173f39; font-size: .94rem; }
.print-toolbar-copy small { margin-top: 2px; color: #667b77; font-size: .78rem; }
.print-toolbar-actions { display: flex; flex: 0 0 auto; gap: 8px; }

.quote-proposal-document {
    --quote-accent: #0f766e;
    --quote-accent-dark: #0b5e58;
    --quote-accent-soft: #eaf5f2;
    --quote-ink: #19342f;
    --quote-muted: #637873;
    --quote-line: #d7e2df;
    width: min(100%, 210mm);
    min-height: 278mm;
    margin: 0 auto;
    padding: 14mm 13mm 11mm;
    overflow: hidden;
    color: var(--quote-ink);
    background: #fff;
    border: 1px solid #dbe4e2;
    box-shadow: 0 24px 70px rgba(24,52,47,.14);
    font-size: 13px;
    line-height: 1.42;
}
.quote-proposal-document * { box-sizing: border-box; }
.quote-proposal-document h1,
.quote-proposal-document h2,
.quote-proposal-document p,
.quote-proposal-document dl,
.quote-proposal-document dd { margin: 0; }
.quote-section-label {
    display: block;
    margin-bottom: 4px;
    color: var(--quote-accent);
    font-size: 9.5px;
    font-weight: 850;
    letter-spacing: .105em;
    line-height: 1.2;
    text-transform: uppercase;
}

.quote-proposal-document .quote-document-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--quote-accent);
}
.quote-proposal-document .quote-document-company {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 12px;
}
.quote-brand-symbol {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    color: #fff;
    background: var(--quote-accent);
    border-radius: 11px;
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
}
.quote-company-copy { min-width: 0; }
.quote-company-copy > * { display: block; }
.quote-company-kicker {
    margin-bottom: 1px;
    color: var(--quote-muted);
    font-size: 9.5px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.quote-company-copy strong {
    max-width: 112mm;
    color: var(--quote-ink);
    font-size: 18px;
    line-height: 1.18;
    overflow-wrap: anywhere;
}
.quote-company-copy small {
    margin-top: 3px;
    color: var(--quote-muted);
    font-size: 10px;
    line-height: 1.35;
}
.quote-proposal-document .quote-document-code {
    display: grid;
    justify-items: end;
    flex: 0 0 auto;
    text-align: right;
}
.quote-proposal-document .quote-document-code > span {
    color: var(--quote-muted);
    font-size: 9.5px;
    font-weight: 850;
    letter-spacing: .12em;
}
.quote-proposal-document .quote-document-code > strong {
    margin: 2px 0 5px;
    color: var(--quote-accent-dark);
    font-size: 18px;
    letter-spacing: .015em;
    line-height: 1.15;
}
.quote-document-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 4px 8px;
    border: 1px solid #d5dfdd;
    border-radius: 999px;
    color: #526964;
    background: #f3f6f5;
    font-size: 9px;
    font-weight: 800;
}
.quote-document-status.sent,
.quote-document-status.viewed { color: #0b5e58; border-color: #bfe0db; background: #e9f5f2; }
.quote-document-status.approved { color: #17643d; border-color: #c4e6d2; background: #eaf7ef; }
.quote-document-status.rejected,
.quote-document-status.cancelled { color: #9e3328; border-color: #f0c9c5; background: #fff0ee; }
.quote-document-status.expired { color: #855b00; border-color: #ecd79d; background: #fff7df; }

.quote-document-intro {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 24px;
    padding: 20px 0 15px;
}
.quote-client-block h1 {
    color: var(--quote-ink);
    font-size: 21px;
    line-height: 1.18;
    letter-spacing: -.02em;
}
.quote-client-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 14px;
    margin-top: 7px;
    color: var(--quote-muted);
    font-size: 10.5px;
}
.quote-client-meta span { overflow-wrap: anywhere; }
.quote-document-metadata {
    display: grid;
    grid-template-columns: repeat(3, auto);
    align-content: start;
    gap: 0;
    border: 1px solid var(--quote-line);
    border-radius: 10px;
    overflow: hidden;
}
.quote-document-metadata div {
    min-width: 73px;
    padding: 9px 11px;
    border-left: 1px solid var(--quote-line);
}
.quote-document-metadata div:first-child { border-left: 0; }
.quote-document-metadata dt {
    color: var(--quote-muted);
    font-size: 8.5px;
    font-weight: 750;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.quote-document-metadata dd {
    margin-top: 2px;
    color: var(--quote-ink);
    font-size: 10.5px;
    font-weight: 800;
    white-space: nowrap;
}
.quote-document-object,
.quote-proposal-document .quote-document-address {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-left: 3px solid var(--quote-accent);
    background: #f6f9f8;
}
.quote-document-object strong,
.quote-proposal-document .quote-document-address strong {
    display: block;
    color: var(--quote-ink);
    font-size: 11.5px;
    font-weight: 750;
    line-height: 1.4;
}

.quote-proposal-document .quote-document-items { margin-top: 18px; }
.quote-table-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 8px;
}
.quote-table-heading h2 { color: var(--quote-ink); font-size: 15px; line-height: 1.2; }
.quote-table-heading > small { color: var(--quote-muted); font-size: 9px; white-space: nowrap; }
.quote-document-table-wrap {
    overflow: hidden;
    border: 1px solid var(--quote-line);
    border-radius: 10px;
}
.quote-proposal-document .quote-document-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 10.2px;
}
.quote-proposal-document .quote-document-table th {
    padding: 8px 7px;
    color: #fff;
    background: var(--quote-accent-dark);
    border: 0;
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: .04em;
    text-align: left;
    text-transform: uppercase;
}
.quote-proposal-document .quote-document-table th:nth-child(n+3) { text-align: right; }
.quote-proposal-document .quote-document-table td {
    padding: 10px 7px;
    vertical-align: top;
    border-top: 1px solid var(--quote-line);
    color: var(--quote-ink);
}
.quote-proposal-document .quote-document-table tbody tr:first-child td { border-top: 0; }
.quote-proposal-document .quote-document-table tbody tr:nth-child(even) { background: #f8faf9; }
.quote-col-number { width: 7%; }
.quote-col-description { width: 43%; }
.quote-col-quantity { width: 12%; }
.quote-col-unit-price { width: 14%; }
.quote-col-discount { width: 11%; }
.quote-col-total { width: 13%; }
.quote-item-number span {
    display: grid;
    place-items: center;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    color: var(--quote-accent-dark);
    background: var(--quote-accent-soft);
    font-size: 9px;
    font-weight: 850;
}
.quote-item-description strong,
.quote-item-description small { display: block; }
.quote-item-description strong { font-size: 10.5px; line-height: 1.35; }
.quote-item-description small { margin-top: 3px; color: var(--quote-muted); font-size: 9px; line-height: 1.38; }
.quote-item-numeric,
.quote-proposal-document .quote-item-total { text-align: right; white-space: nowrap; }
.quote-proposal-document .quote-item-total strong { color: var(--quote-accent-dark); font-size: 10.5px; }

.quote-document-closing {
    display: grid;
    grid-template-columns: minmax(0,1fr) 72mm;
    align-items: start;
    gap: 20px;
    margin-top: 16px;
}
.quote-document-closing.without-notes { grid-template-columns: 1fr; }
.quote-document-closing.without-notes .quote-document-totals { justify-self: end; width: 72mm; }
.quote-proposal-document .quote-document-notes {
    display: grid;
    gap: 11px;
    min-width: 0;
}
.quote-proposal-document .quote-document-notes > div {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--quote-line);
}
.quote-proposal-document .quote-document-notes > div:last-child { border-bottom: 0; }
.quote-proposal-document .quote-document-notes p {
    color: #415b56;
    font-size: 9.5px;
    line-height: 1.48;
    overflow-wrap: anywhere;
}
.quote-proposal-document .quote-document-totals {
    overflow: hidden;
    border: 1px solid var(--quote-line);
    border-radius: 10px;
    background: #fff;
}
.quote-proposal-document .quote-document-totals > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 11px;
    border-top: 1px solid var(--quote-line);
    font-size: 10px;
}
.quote-proposal-document .quote-document-totals > div:first-child { border-top: 0; }
.quote-proposal-document .quote-document-totals span { color: var(--quote-muted); }
.quote-proposal-document .quote-document-totals strong { color: var(--quote-ink); white-space: nowrap; }
.quote-proposal-document .quote-total-adjustment { background: #fbfcfc; }
.quote-proposal-document .quote-grand-total {
    padding: 12px 11px !important;
    color: #fff;
    background: var(--quote-accent-dark);
    border-top: 0 !important;
}
.quote-proposal-document .quote-grand-total span,
.quote-proposal-document .quote-grand-total strong { color: #fff; }
.quote-proposal-document .quote-grand-total span {
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.quote-proposal-document .quote-grand-total strong { font-size: 16px; }

.quote-document-acceptance {
    display: grid;
    grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
    gap: 18px;
    margin-top: 23px;
    padding-top: 14px;
    border-top: 1px solid var(--quote-line);
    break-inside: avoid;
}
.quote-document-acceptance p { color: var(--quote-muted); font-size: 9px; line-height: 1.45; }
.quote-acceptance-fields {
    display: grid;
    grid-template-columns: 1.35fr .55fr 1fr;
    gap: 10px;
    align-items: end;
}
.quote-acceptance-fields span {
    min-height: 27px;
    padding-top: 16px;
    border-bottom: 1px solid #91a5a0;
    color: var(--quote-muted);
    font-size: 8px;
}
.quote-proposal-document .quote-document-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    margin-top: 22px;
    padding-top: 10px;
    border-top: 1px solid var(--quote-line);
    color: var(--quote-muted);
    font-size: 8.5px;
    line-height: 1.4;
}
.quote-footer-company,
.quote-footer-document { display: grid; gap: 1px; }
.quote-footer-company { max-width: 72%; }
.quote-footer-document { flex: 0 0 auto; justify-items: end; text-align: right; }
.quote-footer-company strong,
.quote-footer-document strong { color: var(--quote-ink); font-size: 9px; }

.public-quote-body { background: #eef3f1; }
.public-quote-shell {
    width: min(100%, 1020px);
    margin: 0 auto;
    padding: 18px 12px 46px;
}
.public-quote-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: min(100%, 210mm);
    margin: 0 auto 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 8px 26px rgba(24,52,47,.07);
}
.public-quote-topbar > div { display: flex; align-items: center; min-width: 0; gap: 10px; }
.public-quote-topbar strong,
.public-quote-topbar small { display: block; }
.public-quote-topbar strong { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.public-quote-topbar small { color: var(--muted); font-size: .76rem; }
.public-decision-card {
    width: min(100%, 210mm);
    margin: 14px auto 0;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 35px rgba(24,52,47,.08);
}

@media screen and (max-width: 760px) {
    .print-shell { padding: 12px 8px 28px; }
    .print-toolbar { align-items: stretch; flex-direction: column; margin-bottom: 10px; }
    .print-toolbar-actions { display: grid; grid-template-columns: 1fr 1.45fr; }
    .print-toolbar-actions .button { width: 100%; }
    .quote-proposal-document {
        min-height: 0;
        padding: 22px 16px 18px;
        border-radius: 0;
        box-shadow: none;
        font-size: 13px;
    }
    .quote-proposal-document .quote-document-header { gap: 12px; }
    .quote-brand-symbol { width: 40px; height: 40px; border-radius: 9px; font-size: 19px; }
    .quote-company-copy strong { font-size: 15px; }
    .quote-company-copy small { display: none; }
    .quote-proposal-document .quote-document-code > strong { font-size: 14px; }
    .quote-document-intro { grid-template-columns: 1fr; gap: 13px; }
    .quote-document-metadata { grid-template-columns: repeat(3,1fr); }
    .quote-document-metadata div { min-width: 0; padding: 8px; }
    .quote-client-block h1 { font-size: 19px; }
    .quote-table-heading { align-items: flex-start; flex-direction: column; gap: 2px; }
    .quote-table-heading > small { white-space: normal; }
    .quote-document-table-wrap { overflow: visible; border: 0; border-radius: 0; }
    .quote-proposal-document .quote-document-table,
    .quote-proposal-document .quote-document-table tbody,
    .quote-proposal-document .quote-document-table tr,
    .quote-proposal-document .quote-document-table td { display: block; width: 100%; }
    .quote-proposal-document .quote-document-table colgroup,
    .quote-proposal-document .quote-document-table thead { display: none; }
    .quote-proposal-document .quote-document-table tr {
        display: grid;
        grid-template-columns: 32px minmax(0,1fr) minmax(98px,.55fr);
        gap: 0 8px;
        margin-bottom: 10px;
        padding: 11px;
        border: 1px solid var(--quote-line);
        border-radius: 10px;
        background: #fff !important;
    }
    .quote-proposal-document .quote-document-table td {
        padding: 5px 0;
        border: 0;
    }
    .quote-proposal-document .quote-item-number { grid-row: 1 / span 2; }
    .quote-proposal-document .quote-item-description { grid-column: 2 / 4; }
    .quote-proposal-document .quote-item-numeric,
    .quote-proposal-document .quote-item-total {
        grid-column: 2 / 4;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        border-top: 1px dashed var(--quote-line) !important;
        text-align: right;
    }
    .quote-proposal-document .quote-item-numeric::before,
    .quote-proposal-document .quote-item-total::before {
        content: attr(data-label);
        color: var(--quote-muted);
        font-size: 8.5px;
        font-weight: 750;
        letter-spacing: .04em;
        text-transform: uppercase;
    }
    .quote-document-closing,
    .quote-document-closing.without-notes { grid-template-columns: 1fr; }
    .quote-document-closing.without-notes .quote-document-totals,
    .quote-proposal-document .quote-document-totals { justify-self: stretch; width: 100%; }
    .quote-document-acceptance { grid-template-columns: 1fr; }
    .quote-acceptance-fields { grid-template-columns: 1fr; }
    .quote-proposal-document .quote-document-footer { align-items: flex-start; flex-direction: column; }
    .quote-footer-company { max-width: 100%; }
    .quote-footer-document { justify-items: start; text-align: left; }
    .public-quote-shell { padding-left: 0; padding-right: 0; }
    .public-quote-topbar,
    .public-decision-card { width: calc(100% - 20px); }
    .public-quote-topbar { margin-left: 10px; margin-right: 10px; }
    .public-decision-card { margin-left: 10px; margin-right: 10px; }
}

@media print {
    @page { size: A4 portrait; margin: 11mm; }
    html,
    body.print-body,
    body.public-quote-body { width: auto; min-height: 0; background: #fff !important; }
    .no-print,
    .print-toolbar,
    .public-quote-topbar,
    .public-decision-card { display: none !important; }
    .print-shell,
    .public-quote-shell {
        width: auto;
        max-width: none;
        margin: 0;
        padding: 0;
    }
    .quote-proposal-document {
        width: auto;
        min-height: 0;
        margin: 0;
        padding: 0;
        overflow: visible;
        border: 0;
        box-shadow: none;
        font-size: 9.5pt;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .quote-proposal-document .quote-document-header,
    .quote-document-intro,
    .quote-document-object,
    .quote-proposal-document .quote-document-address,
    .quote-document-closing,
    .quote-document-acceptance,
    .quote-proposal-document .quote-document-footer { break-inside: avoid; }
    .quote-proposal-document .quote-document-table { table-layout: fixed; }
    .quote-proposal-document .quote-document-table thead { display: table-header-group; }
    .quote-proposal-document .quote-document-table tr { break-inside: avoid; page-break-inside: avoid; }
    .quote-proposal-document .quote-document-table td { padding-top: 7px; padding-bottom: 7px; }
    .quote-proposal-document .quote-document-footer { margin-top: 14px; }
}
@media screen and (max-width: 760px) {
    .quote-proposal-document .quote-item-numeric > span,
    .quote-proposal-document .quote-item-total > strong {
        margin-left: auto;
        padding-left: 12px;
    }
}

/* Busca remota de clientes e itens do catálogo — v1.1.6 */
.remote-search { position: relative; }
.remote-search input[type="search"] { padding-right: 46px; }
.remote-search-clear { position:absolute; right:8px; top:50%; transform:translateY(-50%); width:34px; height:34px; border:0; background:transparent; font-size:24px; cursor:pointer; color:var(--muted, #64756f); }
.remote-search-results { position:absolute; z-index:80; top:calc(100% + 6px); left:0; right:0; max-height:320px; overflow:auto; border:1px solid var(--border, #d7e2de); border-radius:14px; background:#fff; box-shadow:0 16px 35px rgba(20,45,38,.16); }
.remote-search-option { display:flex; width:100%; flex-direction:column; gap:3px; padding:13px 15px; border:0; border-bottom:1px solid #edf2f0; background:#fff; text-align:left; cursor:pointer; }
.remote-search-option:last-child { border-bottom:0; }
.remote-search-option:hover, .remote-search-option:focus { background:#f1f8f6; outline:none; }
.remote-search-option strong { color:#173c35; font-size:15px; }
.remote-search-option small, .remote-search-empty { color:#687a74; font-size:13px; }
.remote-search-empty { padding:15px; }

.quote-document-decision{display:flex;justify-content:space-between;gap:24px;margin-top:22px;padding:18px;border:1px solid #cfe0dc;border-radius:14px;background:#f8fbfa;break-inside:avoid}.quote-document-decision strong{display:block;margin:4px 0 6px;color:#0b5f55}.quote-document-decision p{margin:3px 0}.quote-document-decision small{display:block;margin-top:6px}.quote-document-signature{min-width:230px;text-align:center}.quote-document-signature span{display:block;margin-bottom:6px;font-size:11px;color:#627873}.quote-document-signature img{display:block;max-width:230px;max-height:110px;margin:auto;border:1px solid #d5e1de;border-radius:8px;background:#fff}@media(max-width:700px){.quote-document-decision{flex-direction:column}.quote-document-signature{min-width:0;text-align:left}.quote-document-signature img{margin:0}}


/* v1.5.11 — checklist com gestão separada da execução */
.checklist-admin-note{display:grid;gap:3px;padding:12px 14px;border:1px solid #cfe5df;border-radius:12px;background:#f0faf7}
.checklist-admin-note small{color:var(--muted)}
.checklist-admin-actions{display:flex;gap:10px;align-items:center;justify-content:flex-end;flex-wrap:wrap}
.checklist-executor-list{display:grid;gap:10px}
.checklist-executor-item{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px;border:1px solid var(--line);border-radius:14px;background:#fff;cursor:pointer}
.checklist-executor-item.done{background:#f4faf7;opacity:.82}
.checklist-executor-copy{display:grid;gap:4px;min-width:0}
.checklist-executor-copy strong{overflow-wrap:anywhere}
.checklist-executor-copy small{display:inline-flex;width:max-content;padding:4px 8px;border-radius:999px;background:#fff3d6;color:#775500;font-weight:800}
.checklist-executor-check{display:flex;align-items:center;gap:8px;white-space:nowrap}
.checklist-executor-check input{width:24px;height:24px;accent-color:#0f8277}
@media(max-width:700px){
  .checklist-executor-item{align-items:flex-start;flex-direction:column}
  .checklist-executor-check{width:100%;justify-content:flex-start}
  .checklist-admin-actions{display:grid;grid-template-columns:1fr}
  .checklist-admin-actions .button{width:100%}
}


/* v1.5.12 — envio de foto/evidência */
.evidence-upload-status{display:grid;gap:7px;margin-top:8px;padding:10px 12px;border:1px solid #cfe3de;border-radius:12px;background:#f4faf8}
.evidence-upload-status-line{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:.82rem}
.evidence-upload-status-line strong{color:#0b7e72}
.evidence-upload-progress{height:8px;overflow:hidden;border-radius:999px;background:#dce9e6}
.evidence-upload-progress>span{display:block;width:0;height:100%;border-radius:inherit;background:#0f8277;transition:width .18s ease}


/* v1.5.14 — experiência desktop profissional
   Mobile permanece com a navegação inferior atual. */
@media screen and (min-width: 1000px) {
    html, body { min-width: 0; overflow-x: hidden; }
    body { padding-bottom: 0 !important; }

    .app-shell {
        display: block !important;
        min-height: 100vh;
    }

    .desktop-sidebar {
        position: fixed !important;
        inset: 0 auto 0 0;
        z-index: 80;
        display: flex !important;
        width: 260px;
        height: 100dvh;
        min-height: 100vh;
        padding: 20px;
        overflow: hidden;
        background: #102f2b;
    }

    .desktop-sidebar .sidebar-nav {
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        padding-right: 5px;
        scrollbar-width: thin;
        scrollbar-color: rgba(255,255,255,.22) transparent;
    }

    .desktop-sidebar .sidebar-nav::-webkit-scrollbar { width: 5px; }
    .desktop-sidebar .sidebar-nav::-webkit-scrollbar-thumb {
        border-radius: 999px;
        background: rgba(255,255,255,.22);
    }

    .main-column {
        width: auto !important;
        min-width: 0;
        margin-left: 260px;
    }

    /* Nunca mostrar navegação mobile no computador. */
    .mobile-header,
    .bottom-nav,
    .bottom-nav-primary {
        display: none !important;
    }

    .content-area {
        width: 100% !important;
        max-width: 1480px;
        margin: 0 auto;
        padding: 28px 32px 42px !important;
    }

    .sticky-form-actions {
        bottom: 0 !important;
        margin-left: 0;
        margin-right: 0;
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1.55fr) minmax(320px, .75fr);
        gap: 18px;
        align-items: start;
    }

    .metric-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 14px;
    }

    .welcome-panel,
    .panel {
        padding: 24px;
    }

    .page-heading {
        margin-top: 0;
    }

    .table-wrap {
        max-width: 100%;
        overflow-x: auto;
    }
}

@media screen and (min-width: 1280px) {
    .content-area {
        padding-left: 38px !important;
        padding-right: 38px !important;
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1.7fr) minmax(340px, .65fr);
    }
}

@media screen and (min-width: 1600px) {
    .content-area { max-width: 1560px; }
}


/* v1.5.15 — rolagem profissional do menu lateral no desktop */
@media screen and (min-width: 1000px) {
    .desktop-sidebar {
        display: flex !important;
        flex-direction: column !important;
        height: 100dvh !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .desktop-sidebar .sidebar-brand {
        flex: 0 0 auto;
    }

    .desktop-sidebar .sidebar-nav {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow-y: scroll !important;
        overflow-x: hidden !important;
        overscroll-behavior: contain;
        padding-right: 8px !important;
        margin-right: -4px;
        scrollbar-width: auto !important;
        scrollbar-color: rgba(196,230,224,.55) rgba(255,255,255,.07) !important;
    }

    .desktop-sidebar .sidebar-nav::-webkit-scrollbar {
        display: block !important;
        width: 9px !important;
    }

    .desktop-sidebar .sidebar-nav::-webkit-scrollbar-track {
        background: rgba(255,255,255,.07);
        border-radius: 999px;
    }

    .desktop-sidebar .sidebar-nav::-webkit-scrollbar-thumb {
        min-height: 42px;
        border: 2px solid transparent;
        border-radius: 999px;
        background: rgba(196,230,224,.55);
        background-clip: padding-box;
    }

    .desktop-sidebar .sidebar-nav::-webkit-scrollbar-thumb:hover {
        background: rgba(224,245,241,.82);
        background-clip: padding-box;
    }

    /* Identidade e ações do usuário continuam visíveis.
       Apenas a lista de módulos rola. */
    .desktop-sidebar .sidebar-user,
    .desktop-sidebar .pwa-install-control,
    .desktop-sidebar > form {
        flex: 0 0 auto !important;
    }

    .desktop-sidebar > form {
        margin-top: 8px;
    }
}

.activity-picker{border:0;padding:0;margin:0}.activity-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.activity-option{display:flex;gap:10px;align-items:flex-start;border:1px solid #d3e3df;border-radius:13px;padding:12px;background:#fff;cursor:pointer}.activity-option:has(input:checked){border-color:#0f8277;background:#edf9f7}.activity-option input{margin-top:4px;accent-color:#0f8277}.activity-option strong,.activity-option small{display:block}.activity-option small{color:#687d79;margin-top:3px;line-height:1.35}@media(max-width:680px){.activity-grid{grid-template-columns:1fr}}
