* {
    box-sizing: border-box;
}

:root {
    --bg: #f5f7fa;
    --surface: #ffffff;
    --surface-soft: #f9fafb;
    --text: #101828;
    --muted: #667085;
    --border: #e4e7ec;
    --primary: #3E4095;
    --primary-2: #3E76AB;
    --success: #067647;
    --success-bg: #ecfdf3;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --sidebar: #24265f;
    --brand-orange: #F1623B;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

body {
    min-height: 100vh;
}

button,
input {
    font: inherit;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at top left, #eaf1f8 0, transparent 34%),
        var(--bg);
}

.auth-card {
    width: min(420px, 100%);
    padding: 34px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(16, 24, 40, .11);
}

.auth-card-wide {
    width: min(500px, 100%);
}

.brand-mark,
.brand-mini {
    display: grid;
    place-items: center;
    background: var(--primary);
    color: white;
    font-weight: 800;
}

.brand-mark {
    width: 48px;
    height: 48px;
    margin-bottom: 20px;
    border-radius: 13px;
    font-size: 22px;
}

.brand-mini {
    width: 38px;
    height: 38px;
    border-radius: 10px;
}

.auth-heading h1 {
    margin: 0;
    font-size: 26px;
}

.auth-heading p {
    margin: 8px 0 24px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.form-stack {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 7px;
}

.field span {
    font-size: 13px;
    font-weight: 650;
}

.field small {
    color: var(--muted);
    font-size: 11px;
}

.field input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #d0d5dd;
    border-radius: 9px;
    outline: none;
    background: white;
}

.field input:focus {
    border-color: #7aa4cc;
    box-shadow: 0 0 0 3px rgba(47, 117, 181, .10);
}

.btn {
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 9px;
    font-weight: 700;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-2);
}

.alert {
    padding: 11px 13px;
    margin-bottom: 16px;
    border-radius: 9px;
    font-size: 13px;
}

.alert-error {
    color: var(--danger);
    background: var(--danger-bg);
    border: 1px solid #fecdca;
}

.auth-footer {
    margin-top: 22px;
    color: #98a2b3;
    text-align: center;
    font-size: 11px;
}

.app-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    background: var(--sidebar);
    color: white;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 7px 8px 22px;
}

.sidebar-brand strong,
.sidebar-brand span {
    display: block;
}

.sidebar-brand strong {
    font-size: 15px;
}

.sidebar-brand span {
    margin-top: 2px;
    color: #98a2b3;
    font-size: 10px;
}

.sidebar-nav {
    display: grid;
    gap: 5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 11px;
    border-radius: 8px;
    color: #d0d5dd;
    text-decoration: none;
    font-size: 13px;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255,255,255,.08);
    color: white;
}

.nav-item.disabled {
    opacity: .55;
    cursor: default;
}

.sidebar-bottom {
    margin-top: auto;
}

.main {
    min-width: 0;
}

.topbar {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 28px;
    background: white;
    border-bottom: 1px solid var(--border);
}

.topbar h1 {
    margin: 0;
    font-size: 20px;
}

.topbar p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-chip strong,
.user-chip span {
    display: block;
}

.user-chip strong {
    font-size: 12px;
}

.user-chip span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #eaf1f8;
    color: var(--primary);
    font-weight: 800;
}

.content {
    padding: 28px;
}

.welcome {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 25px;
    background: linear-gradient(135deg, #17365d, #234e7d);
    color: white;
    border-radius: 15px;
}

.welcome h2 {
    margin: 5px 0 8px;
    font-size: 22px;
}

.welcome p {
    max-width: 650px;
    margin: 0;
    color: #dbe7f3;
    font-size: 13px;
    line-height: 1.5;
}

.eyebrow {
    color: #bdd2e6;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.status-live {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.1);
    font-size: 11px;
    white-space: nowrap;
}

.pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #75e0a7;
    box-shadow: 0 0 0 4px rgba(117,224,167,.14);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.stat-card,
.panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.stat-card {
    padding: 18px;
}

.stat-card strong {
    display: block;
    margin: 8px 0 3px;
    font-size: 25px;
}

.stat-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.stat-card small {
    color: #98a2b3;
    font-size: 10px;
}

.panel {
    margin-top: 18px;
    padding: 20px;
}

.panel-header h3 {
    margin: 0;
    font-size: 15px;
}

.panel-header p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.foundation-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 10px;
    margin-top: 16px;
}

.foundation-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 9px;
}

.foundation-item > span {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
}

.foundation-item.ok > span {
    background: var(--success-bg);
    color: var(--success);
}

.foundation-item strong,
.foundation-item small {
    display: block;
}

.foundation-item strong {
    font-size: 12px;
}

.foundation-item small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 76px 1fr;
    }

    .sidebar-brand > div:last-child,
    .nav-item:not(.active) {
        font-size: 0;
    }

    .nav-item {
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 650px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        display: none;
    }

    .topbar,
    .welcome {
        align-items: flex-start;
        flex-direction: column;
    }

    .stats-grid,
    .foundation-grid {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 16px;
    }
}
/* ============================================================
   FASE 2 - CADASTROS
   Cole este bloco NO FINAL do public/assets/css/app.css atual.
   ============================================================ */

.alert-success {
    color: #067647;
    background: #ecfdf3;
    border: 1px solid #abefc6;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.page-heading h2 {
    margin: 5px 0 7px;
    font-size: 22px;
}

.page-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.eyebrow.dark {
    color: #475467;
}

.tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    padding: 5px;
    width: fit-content;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
}

.tab {
    padding: 8px 13px;
    border-radius: 7px;
    color: #475467;
    text-decoration: none;
    font-size: 12px;
    font-weight: 650;
}

.tab.active {
    background: var(--primary);
    color: white;
}

.panel-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 16px;
}

.panel-toolbar h3 {
    margin: 0;
    font-size: 15px;
}

.panel-toolbar p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 9px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.data-table th,
.data-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 12px;
}

.data-table th {
    background: var(--surface-soft);
    color: #667085;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.actions-cell {
    width: 80px;
    text-align: right !important;
}

.btn-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--primary-2);
    font-weight: 700;
    cursor: pointer;
}

.badge {
    display: inline-flex;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
}

.badge-success {
    color: #067647;
    background: #ecfdf3;
}

.badge-muted {
    color: #475467;
    background: #f2f4f7;
}

.empty-cell {
    padding: 28px !important;
    color: #98a2b3;
    text-align: center !important;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 24, 40, .48);
    backdrop-filter: blur(2px);
}

.modal-card {
    position: relative;
    z-index: 1;
    width: min(500px, 100%);
    padding: 24px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(16, 24, 40, .22);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: #f2f4f7;
    color: #475467;
    cursor: pointer;
}

.modal-heading h3 {
    margin: 0;
    font-size: 17px;
}

.modal-heading p {
    margin: 5px 0 18px;
    color: var(--muted);
    font-size: 11px;
}

.field select {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #d0d5dd;
    border-radius: 9px;
    outline: none;
    background: white;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.switch-line {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #344054;
    font-size: 12px;
}

@media (max-width: 650px) {
    .panel-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .tabs {
        width: 100%;
        overflow-x: auto;
    }
}


/* ============================================================
   FASE 2.2 - USUÁRIOS E ESCOPOS
   ============================================================ */

.users-heading {
    align-items: flex-end;
}

.users-layout {
    display: grid;
    grid-template-columns: minmax(350px, 430px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.user-form-panel,
.users-list-panel {
    margin-top: 0;
}

.scope-section {
    margin-top: 3px;
    padding-top: 17px;
    border-top: 1px solid var(--border);
}

.scope-title {
    margin-bottom: 10px;
}

.scope-title strong,
.scope-title span {
    display: block;
}

.scope-title strong {
    color: #344054;
    font-size: 12px;
}

.scope-title span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.check-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
}

.check-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.check-card {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    min-height: 45px;
    padding: 10px 11px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: white;
    cursor: pointer;
}

.check-card:hover {
    background: #f9fafb;
}

.check-card input {
    margin-top: 2px;
}

.check-card strong,
.check-card small {
    display: block;
}

.check-card strong {
    font-size: 11px;
}

.check-card small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.35;
}

.scope-all {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
    padding: 9px 11px;
    border-radius: 8px;
    background: #eff4fa;
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.scope-disabled {
    opacity: .42;
    pointer-events: none;
}

.table-user {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 170px;
}

.table-user strong,
.table-user small {
    display: block;
}

.table-user strong {
    font-size: 11px;
}

.table-user small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 9px;
}

.user-avatar.small {
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    font-size: 10px;
}

.users-table td {
    vertical-align: middle;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 15px;
    border: 1px solid #d0d5dd;
    background: white;
    color: #344054;
    text-decoration: none;
}

.btn-secondary:hover {
    background: #f9fafb;
}

@media (max-width: 1150px) {
    .users-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    .check-grid.compact {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   FASE 2.3 - AJUSTE VISUAL DE USUÁRIOS + TURMAS
   ============================================================ */

.users-layout {
    grid-template-columns: minmax(430px, 520px) minmax(650px, 1fr);
}

.user-form-panel {
    position: sticky;
    top: 18px;
}

.user-form-panel .panel-toolbar,
.users-list-panel .panel-toolbar {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.user-form-panel .form-stack {
    padding-top: 2px;
}

.user-form-panel .field > span,
.user-form-panel .scope-title strong {
    font-size: 12px;
    font-weight: 700;
}

.user-form-panel .field input {
    min-height: 40px;
}

.check-card {
    min-height: 52px;
    align-items: center;
}

.check-card input,
.scope-all input,
.switch-line input {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}

.users-table th,
.users-table td {
    padding-top: 12px;
    padding-bottom: 12px;
}

.badge-info {
    background: #eff4ff;
    color: #3538cd;
}

.muted-text {
    color: var(--muted);
    font-size: 11px;
}

.quantity-section {
    padding-top: 4px;
}

.unit-quantity-card {
    margin-top: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
}

.unit-quantity-title {
    margin-bottom: 11px;
}

.unit-quantity-title strong,
.unit-quantity-title span {
    display: block;
}

.unit-quantity-title strong {
    color: var(--primary);
    font-size: 12px;
}

.unit-quantity-title span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}

.quantity-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.qty-field input {
    min-width: 0;
}

@media (max-width: 1400px) {
    .users-layout {
        grid-template-columns: 1fr;
    }

    .user-form-panel {
        position: static;
    }
}

@media (max-width: 760px) {
    .quantity-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* FASE 2.4 - Materiais e produção */
.production-heading { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--border); }
.production-tabs { margin-bottom: 18px; }
.production-panel + .production-panel { margin-top: 16px; }


/* ============================================================
   FASE 2.4.1 - MATERIAIS POR SEGMENTO
   ============================================================ */

.panel-toolbar-actions {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.inline-filter {
    display: grid;
    gap: 5px;
}

.inline-filter span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.inline-filter select {
    min-width: 190px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: white;
    color: #344054;
    outline: none;
}

.segment-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-width: 520px;
}

.badge-warning {
    background: #fffaeb;
    color: #b54708;
}

@media (max-width: 760px) {
    .panel-toolbar-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .inline-filter select {
        width: 100%;
    }
}


/* Fase 2.4.2 */
.predef-finishing-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
@media(max-width:650px){.predef-finishing-grid{grid-template-columns:1fr;}}


/* ============================================================
   FASE 3.0 - NOVA O.S.
   ============================================================ */
.os-form{display:grid;gap:18px}.os-section{margin-top:0}.section-heading{display:flex;align-items:center;gap:12px;padding-bottom:15px;margin-bottom:16px;border-bottom:1px solid var(--border)}.section-heading>span{width:30px;height:30px;display:grid;place-items:center;border-radius:50%;background:#eaf1f8;color:var(--primary);font-size:12px;font-weight:800}.section-heading h3{margin:0;font-size:15px}.section-heading p{margin:3px 0 0;color:var(--muted);font-size:10px}.os-grid{display:grid;gap:12px}.os-grid.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.field textarea{width:100%;padding:11px 12px;border:1px solid #d0d5dd;border-radius:9px;resize:vertical;outline:none;font:inherit}.class-picker{display:flex;flex-wrap:wrap;gap:7px;min-height:45px;padding:9px;border:1px solid var(--border);border-radius:9px;background:var(--surface-soft)}.class-picker.empty-state{color:var(--muted);font-size:11px;align-items:center}.class-chip{cursor:pointer}.class-chip input{display:none}.class-chip span{display:block;padding:7px 11px;border:1px solid #d0d5dd;border-radius:999px;background:white;color:#475467;font-size:11px;font-weight:650}.class-chip input:checked+span{border-color:var(--primary);background:#eaf1f8;color:var(--primary)}.class-actions{display:flex;gap:13px;margin-top:7px}.finishings-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:14px}.preset-status{margin-top:13px;padding:9px 11px;border-radius:8px;background:#f9fafb;color:var(--muted);font-size:10px}.quantity-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:13px}.quantity-card{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center;padding:15px;border:1px solid var(--border);border-radius:10px;background:var(--surface-soft)}.quantity-card strong,.quantity-card small{display:block}.quantity-card strong{font-size:12px}.quantity-card small{margin-top:2px;color:var(--muted);font-size:9px}.quantity-value{font-size:26px;font-weight:800;color:var(--primary)}.quantity-card .manual-quantity{grid-column:1/-1}.hidden{display:none!important}.soft-disabled{opacity:.45;pointer-events:none}.os-submit-bar{position:sticky;bottom:12px;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:15px 18px;border:1px solid var(--border);border-radius:12px;background:rgba(255,255,255,.96);box-shadow:0 10px 35px rgba(16,24,40,.12);backdrop-filter:blur(8px);z-index:20}.os-submit-bar strong,.os-submit-bar span{display:block}.os-submit-bar strong{font-size:12px}.os-submit-bar span{margin-top:2px;color:var(--muted);font-size:10px}
@media(max-width:1000px){.os-grid.cols-3{grid-template-columns:repeat(2,minmax(0,1fr))}.finishings-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:650px){.os-grid.cols-3,.finishings-grid,.quantity-cards{grid-template-columns:1fr}.os-submit-bar{align-items:stretch;flex-direction:column}}


/* ============================================================
   FASE 3.0.2 - TURMAS POR UNIDADE NA NOVA O.S.
   ============================================================ */

.class-unit-group {
    width: 100%;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #f9fafb;
}

.class-unit-group:last-child {
    margin-bottom: 0;
}

.class-unit-title {
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.class-unit-options {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}


/* ============================================================
   FASE 3.1 - LISTAGEM DE ORDENS DE SERVIÇO
   ============================================================ */
.os-list-heading {
    display:flex;
    justify-content:space-between;
    align-items:flex-end;
    gap:18px;
}
.os-filter-bar {
    display:grid;
    grid-template-columns:minmax(260px,2fr) minmax(220px,1fr) auto;
    gap:14px;
    align-items:end;
    margin-bottom:16px;
}
.os-filter-actions {
    display:flex;
    align-items:center;
    gap:12px;
    padding-bottom:2px;
}
.os-table-panel { padding:0; overflow:hidden; }
.table-scroll { width:100%; overflow-x:auto; }
.os-table { width:100%; border-collapse:collapse; min-width:1050px; }
.os-table th {
    text-align:left;
    padding:12px 14px;
    font-size:10px;
    text-transform:uppercase;
    letter-spacing:.05em;
    background:#f8fafc;
    border-bottom:1px solid var(--border);
}
.os-table td {
    padding:13px 14px;
    vertical-align:top;
    border-bottom:1px solid var(--border);
}
.os-table tbody tr:last-child td { border-bottom:0; }
.os-table tbody tr:hover { background:#fafafa; }
.os-table td strong,
.os-table td small { display:block; }
.os-table td small { margin-top:4px; opacity:.72; line-height:1.4; }
.os-code { white-space:nowrap; }
.os-units { font-size:12px; line-height:1.45; }
.status-pill {
    display:inline-flex;
    align-items:center;
    min-height:26px;
    padding:4px 9px;
    border-radius:999px;
    background:#f1f5f9;
    font-size:11px;
    font-weight:700;
    white-space:nowrap;
}
.os-empty { padding:38px 20px; }
@media(max-width:850px){
    .os-list-heading { align-items:flex-start; flex-direction:column; }
    .os-filter-bar { grid-template-columns:1fr; }
}


/* ============================================================
   FASE 3.2 - DETALHE DA O.S.
   ============================================================ */

/* Corrige links que usam a aparência de botão. */
a.btn,
a.btn:link,
a.btn:visited,
a.btn:hover,
a.btn:active {
    text-decoration: none;
}

.os-list-heading > .btn.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    line-height: 1;
    white-space: nowrap;
}

.os-code-link {
    color: var(--primary);
    text-decoration: none;
}

.os-code-link:hover {
    text-decoration: underline;
}

.os-detail-toolbar {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.os-detail-title h2 {
    margin: 3px 0 2px;
}

.os-detail-title p {
    margin: 0;
    color: var(--muted);
}

.os-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.detail-data-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.detail-item {
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fafbfc;
}

.detail-item span,
.detail-notes > span,
.unit-class-list > span,
.unit-production-head span,
.unit-production-numbers span,
.flow-card span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.detail-item strong {
    font-size: 12px;
}

.detail-yes {
    color: #067647;
}

.detail-no {
    color: #667085;
}

.detail-notes {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
}

.detail-notes div {
    font-size: 12px;
    line-height: 1.55;
}

.os-production-panel {
    margin-bottom: 16px;
}

.unit-production-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 12px;
}

.unit-production-card {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fafbfc;
}

.unit-production-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.unit-production-head strong {
    display: block;
    font-size: 13px;
}

.unit-production-numbers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.unit-production-numbers > div,
.unit-class-list {
    padding: 9px 10px;
    border-radius: 8px;
    background: white;
    border: 1px solid var(--border);
}

.unit-production-numbers strong {
    font-size: 17px;
}

.unit-class-list {
    margin-top: 8px;
}

.os-flow-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.flow-card {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fafbfc;
}

.history-list {
    display: grid;
    gap: 0;
}

.history-item {
    position: relative;
    display: grid;
    grid-template-columns: 16px 1fr;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.history-item:last-child {
    border-bottom: 0;
}

.history-dot {
    width: 8px;
    height: 8px;
    margin-top: 4px;
    border-radius: 50%;
    background: var(--primary);
}

.history-item strong,
.history-item span {
    display: block;
}

.history-item span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}

@media(max-width:1000px) {
    .os-detail-grid {
        grid-template-columns: 1fr;
    }

    .os-flow-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media(max-width:600px) {
    .detail-data-grid,
    .os-flow-grid {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   FASE 3.3 - LINHA CLICÁVEL + FLUXO OPERACIONAL
   ============================================================ */

.os-clickable-row {
    cursor: pointer;
}

.os-clickable-row:focus {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.workflow-actions,
.unit-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.workflow-actions {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.unit-action-row {
    margin-top: 10px;
}

.btn-small {
    min-height: 32px;
    padding: 0 10px;
    font-size: 10px;
}


/* ============================================================
   FASE 3.4 - REGRAS OBRIGATÓRIAS DA NOVA O.S.
   ============================================================ */

.rule-locked-field {
    position: relative;
}

/*
 * Reserva espaço na linha do título para o badge não encostar
 * no nome do acabamento.
 */
.rule-locked-field > span:first-child {
    padding-right: 92px;
}

.rule-locked-field select[data-rule-locked="1"] {
    pointer-events: none;
    background: #f2f4f7;
    color: #475467;
    border-color: #d0d5dd;
    cursor: not-allowed;
}

/*
 * O aviso não participa mais do fluxo da grade.
 * Portanto todos os selects permanecem perfeitamente alinhados.
 */
.rule-locked-field::after {
    content: "Regra automática";
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;

    display: inline-flex;
    align-items: center;

    margin: 0;
    padding: 2px 5px;

    border-radius: 999px;
    background: #eef2f6;

    color: #667085;
    font-size: 7px;
    line-height: 1.2;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .025em;

    white-space: nowrap;
}


/* ============================================================
   FASE 3.4.1 - FILTRO INSTANTÂNEO
   ============================================================ */

.os-clickable-row[hidden] {
    display: none;
}

#osFiltroBusca {
    transition:
        border-color .15s ease,
        box-shadow .15s ease;
}

#osFiltroBusca:focus {
    border-color: var(--primary);
}


/* ============================================================
   FASE 3.4.2 - AJUSTE FINO DO FORMULÁRIO
   ============================================================ */

.finishings-grid .field {
    min-width: 0;
}

.finishings-grid .field select {
    width: 100%;
}

/*
 * Em telas menores, o badge continua dentro do cabeçalho do campo
 * sem criar uma nova linha.
 */
@media (max-width: 760px) {
    .rule-locked-field > span:first-child {
        padding-right: 84px;
    }

    .rule-locked-field::after {
        font-size: 6.5px;
        padding: 2px 4px;
    }
}


/* ============================================================
   FASE 3.5.1 - AJUDA DO CÁLCULO DE CÓPIAS
   ============================================================ */

.field-help {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.35;
}


/* ============================================================
   FASE 3.6 - REGRAS DO FLUXO DE PRODUÇÃO
   ============================================================ */

.workflow-hint {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 9px;
    border-radius: 8px;
    background: #f8fafc;
    color: #667085;
    font-size: 10px;
    line-height: 1.35;
    font-weight: 700;
}

.workflow-hint-closed {
    background: #f2f4f7;
    color: #475467;
}


/* FASE 3.8.1 - aviso de segurança do seletor de segmentos */
.scope-empty-warning {
    padding: 10px 12px;
    border: 1px solid #f2c94c;
    border-radius: 8px;
    background: #fffaf0;
    font-size: 12px;
    font-weight: 700;
}


/* ============================================================
   FASE 3.10 - EQUIPAMENTO UTILIZADO NA IMPRESSÃO
   ============================================================ */

.unit-print-directives {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #e4e7ec;
    border-radius: 10px;
    background: #f8fafc;
}

.unit-print-directives > span {
    font-size: 10px;
    font-weight: 700;
    color: #667085;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.unit-print-directives > strong {
    font-size: 13px;
    color: #101828;
}

.unit-print-directives > small {
    color: #667085;
    font-size: 10px;
}

.print-equipment-form {
    display: flex;
    align-items: end;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.print-equipment-select {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 230px;
    flex: 1;
}

.print-equipment-select > span {
    font-size: 10px;
    font-weight: 700;
    color: #667085;
}

.print-equipment-select select {
    width: 100%;
    min-height: 34px;
}


/* ============================================================
   FASE 3.10.2 - AJUSTE VISUAL DO SELECT DE EQUIPAMENTOS
   ============================================================ */

.unit-action-row .print-equipment-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
    width: 100%;
}

.unit-action-row .print-equipment-select {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    width: 100%;
}

.unit-action-row .print-equipment-select > span {
    font-size: 10px;
    line-height: 1.2;
    font-weight: 700;
    color: #667085;
}

.unit-action-row .print-equipment-select select {
    box-sizing: border-box;
    width: 100%;
    height: 38px;
    min-height: 38px;
    padding: 0 34px 0 11px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background-color: #fff;
    color: #101828;
    font-size: 12px;
    font-weight: 500;
    line-height: 38px;
    outline: none;
}

.unit-action-row .print-equipment-select select:focus {
    border-color: #98a2b3;
    box-shadow: 0 0 0 3px rgba(16, 24, 40, 0.06);
}

.unit-action-row .print-equipment-form .btn {
    height: 38px;
    min-height: 38px;
    white-space: nowrap;
    align-self: end;
}

@media (max-width: 900px) {
    .unit-action-row .print-equipment-form {
        grid-template-columns: 1fr;
    }

    .unit-action-row .print-equipment-form .btn {
        width: 100%;
    }
}


/* ============================================================
   FASE 3.11 - DUPLICAR O.S.
   ============================================================ */

.os-actions-column,
.os-actions-cell {
    width: 92px;
    text-align: right;
}

.os-actions-cell {
    white-space: nowrap;
}

.os-duplicate-form {
    display: inline-flex;
    margin: 0;
}

.os-duplicate-button {
    min-width: 72px;
}


/* ============================================================
   FASE 3.12 - O.S. MÚLTIPLA
   ============================================================ */

.os-multiple-section {
    position: relative;
}

.os-multiple-toggle {
    width: fit-content;
}

.os-multiple-quantity {
    margin-top: 14px;
    max-width: 420px;
}

.os-multiple-quantity.hidden {
    display: none;
}

.os-multiple-quantity .field {
    margin: 0;
}

.os-multiple-quantity input[type="number"] {
    max-width: 180px;
}


/* ============================================================
   FASE 3.13 - LAYOUTS SALVOS DA NOVA O.S.
   ============================================================ */

.os-layout-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -4px 0 14px;
    padding: 0 2px;
    min-width: 0;
}

.os-layout-strip-label {
    flex: 0 0 auto;
    color: #667085;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.os-layout-list {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
    padding: 3px 0 5px;
}

.os-layout-chip {
    flex: 0 0 auto;
    appearance: none;
    border: 1px solid #e4e7ec;
    border-radius: 999px;
    background: #fff;
    color: #475467;
    padding: 6px 10px;
    font: inherit;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition:
        border-color .15s ease,
        background-color .15s ease,
        color .15s ease;
}

.os-layout-chip:hover {
    border-color: #98a2b3;
    background: #f8fafc;
    color: #101828;
}

.os-layout-empty {
    color: #98a2b3;
    font-size: 10px;
    font-style: italic;
    white-space: nowrap;
}

.os-submit-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

#osSalvarLayout:disabled {
    cursor: not-allowed;
    opacity: .48;
}

@media (max-width: 720px) {
    .os-layout-strip {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .os-layout-list {
        width: 100%;
    }

    .os-submit-actions {
        width: 100%;
    }

    .os-submit-actions .btn {
        flex: 1;
    }
}


/* ============================================================
   FASE 3.13.1 - PREDEFINIÇÕES COMPARTILHADAS ENTRE SEGMENTOS
   ============================================================ */

.preset-shared-segments-field {
    padding: 10px 12px;
    border: 1px solid #e4e7ec;
    border-radius: 10px;
    background: #f8fafc;
}

.preset-segment-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 8px;
}

.preset-segment-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 12px;
    cursor: pointer;
}

.preset-segment-option input {
    margin: 0;
}

.preset-segment-option:has(input:disabled) {
    cursor: default;
    opacity: .72;
}


/* ============================================================
   FASE 3.13.2 - AJUSTE VISUAL DAS PREDEFINIÇÕES
   ============================================================ */

.modal-overlay {
    overflow-y: auto;
    padding: 24px 16px;
    align-items: flex-start;
}

.modal-card {
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal-card:has(form[data-preset-form]) {
    width: min(640px, calc(100vw - 32px));
}

.preset-segment-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    margin-top: 8px;
}

.preset-segment-option {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 26px;
    margin: 0;
    padding: 0;
    color: #344054;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
}

.preset-segment-option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin: 0;
    border: 1.5px solid #98a2b3;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    position: relative;
}

.preset-segment-option input[type="checkbox"]:checked {
    border-color: #175cd3;
    background: #175cd3;
}

.preset-segment-option input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: none;
}

.preset-segment-option input[type="checkbox"]:focus-visible {
    outline: 3px solid rgba(23, 92, 211, .18);
    outline-offset: 2px;
}

.preset-segment-option input[type="checkbox"]:disabled {
    border-color: #d0d5dd;
    background: #eaecf0;
    cursor: default;
}

.preset-segment-option input[type="checkbox"]:checked:disabled {
    border-color: #98a2b3;
    background: #98a2b3;
}

.preset-segment-option:has(input:disabled) {
    opacity: .72;
    cursor: default;
}

@media (max-width: 720px) {
    .modal-overlay {
        padding: 10px;
    }

    .modal-card,
    .modal-card:has(form[data-preset-form]) {
        width: 100%;
        max-height: calc(100vh - 20px);
    }

    .preset-segment-options {
        gap: 8px 14px;
    }
}


/* ============================================================
   FASE 3.14 - SÉRIES PERSONALIZADAS NA NOVA O.S.
   ============================================================ */

.custom-series-picker {
    margin-top: 9px;
    padding: 10px;
    border: 1px solid #e4e7ec;
    border-radius: 9px;
    background: #f8fafc;
}

.custom-series-picker.hidden {
    display: none;
}

.custom-series-options {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 7px;
}

.custom-series-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 6px 9px;
    border: 1px solid #d0d5dd;
    border-radius: 999px;
    background: #fff;
    color: #344054;
    font-size: 11px;
    font-weight: 650;
    cursor: pointer;
}

.custom-series-chip input {
    width: 14px;
    height: 14px;
    margin: 0;
}

.custom-series-class-group {
    padding: 10px 0;
    border-bottom: 1px solid #eaecf0;
}

.custom-series-class-group:last-child {
    border-bottom: 0;
}

.custom-series-class-title {
    margin-bottom: 8px;
    color: #101828;
    font-size: 12px;
    font-weight: 800;
}


/* ============================================================
   FASE 3.14.1 - AJUSTE DA LISTAGEM DE O.S.
   ============================================================ */

/*
 * A coluna Material recebe largura mínima suficiente para evitar
 * quebra excessiva dos nomes, principalmente "Atividade Complementar".
 */
.os-table .os-material-column,
.os-table .os-material-cell {
    min-width: 190px;
    width: 190px;
}

.os-table .os-material-cell > strong {
    white-space: nowrap;
    line-height: 1.3;
}

.os-table .os-material-cell > small {
    white-space: normal;
}

/*
 * A coluna Série agora apresenta somente as séries.
 * As turmas permanecem disponíveis no detalhe da O.S.
 */
.os-table .os-series-cell {
    min-width: 150px;
}

.os-table .os-series-cell > strong {
    line-height: 1.35;
}

/*
 * Com a retirada das turmas da listagem, a tabela pode ficar
 * um pouco mais compacta sem prejudicar as demais colunas.
 */
.os-table {
    min-width: 980px;
}

@media (max-width: 1100px) {
    .os-table .os-material-column,
    .os-table .os-material-cell {
        min-width: 175px;
        width: 175px;
    }
}


/* ============================================================
   FASE 3.14.2 - AÇÕES OPERACIONAIS DA GRÁFICA NA LISTAGEM
   ============================================================ */

.graphic-list-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 132px;
}

.graphic-unit-action {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
}

.graphic-unit-name {
    margin: 0 !important;
    color: #667085;
    font-size: 9px !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.graphic-action-form {
    margin: 0;
}

.graphic-workflow-button {
    width: 100%;
    min-width: 108px;
    justify-content: center;
}

.graphic-print-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 185px;
    margin: 0;
}

.graphic-print-form.hidden {
    display: none;
}

.graphic-equipment-select {
    width: 100%;
    min-width: 185px;
    height: 32px;
    padding: 4px 8px;
    border: 1px solid #d0d5dd;
    border-radius: 7px;
    background: #fff;
    font-size: 10px;
}

.graphic-print-confirm-actions {
    display: flex;
    gap: 5px;
}

.graphic-print-confirm-actions .btn {
    flex: 1;
}

.graphic-action-done,
.graphic-action-waiting {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 8px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
}

.graphic-action-done {
    color: #067647;
    background: #ecfdf3;
    border: 1px solid #abefc6;
}

.graphic-action-waiting {
    color: #475467;
    background: #f8fafc;
    border: 1px solid #eaecf0;
}

/*
 * Na visão da gráfica removemos duas colunas de status,
 * dando mais espaço para Material, Série, Unidades e Ações.
 */
.os-table:has(.graphic-list-actions) {
    min-width: 900px;
}

.os-table:has(.graphic-list-actions) .os-actions-column,
.os-table:has(.graphic-list-actions) .os-actions-cell {
    min-width: 145px;
}


/* ============================================================
   FASE 3.14.5 - LOGOMARCA OFICIAL MGRAF
   ============================================================ */

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 58px;
    padding: 5px 7px 20px;
}

.sidebar-brand-logo {
    display: block;
    width: 168px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    object-position: left center;
}

/*
 * A antiga letra "M" permanece disponível apenas para telas
 * legadas/autenticação que ainda utilizem brand-mini.
 */
@media (max-width: 850px) {
    .sidebar-brand-logo {
        width: 150px;
    }
}


/* ============================================================
   FASE 3.14.5.2 - LOGOS LOGIN E PÁGINAS INTERNAS
   ============================================================ */

/* Logomarca compacta nas páginas internas. */
.sidebar-brand {
    min-height: 52px;
    padding: 5px 7px 18px;
}

.sidebar-brand-logo {
    width: 145px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    object-position: left center;
}

/* Logomarca completa na página de login. */
.auth-logo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 0 20px;
}

.auth-logo {
    display: block;
    width: min(310px, 92%);
    height: auto;
    object-fit: contain;
}

.auth-card .auth-heading {
    text-align: center;
}

.auth-card .auth-heading p {
    margin-top: 0;
}


/* ============================================================
   FASE 3.14.5.3 - LOGO DO LOGIN 50% MENOR
   ============================================================ */

.auth-logo {
    width: min(155px, 46%);
}


/* FASE 3.14.6 - AUTORIZAÇÃO DIRETA NA LISTAGEM */
.os-authorize-list-form {
    margin: 0;
}

.os-authorize-list-button {
    min-width: 88px;
}

.os-authorize-list-button:disabled {
    opacity: .42;
    cursor: not-allowed;
    filter: grayscale(.15);
}

.os-authorized-list-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 7px;
    color: #067647;
    background: #ecfdf3;
    border: 1px solid #abefc6;
    font-size: 10px;
    font-weight: 700;
}

.os-actions-cell {
    gap: 6px;
}


/* ============================================================
   FASE 3.14.6.1 - PADRONIZAÇÃO DOS BOTÕES DA COLUNA AÇÕES
   ============================================================ */

.os-actions-cell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 150px;
}

.os-actions-cell form {
    margin: 0;
}

.os-actions-cell .btn,
.os-actions-cell .os-authorized-list-label {
    box-sizing: border-box;
    min-width: 72px;
    min-height: 30px;
    height: 30px;
    padding: 0 10px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.os-actions-cell .os-authorize-list-button {
    min-width: 86px;
}

.os-actions-cell .os-duplicate-button {
    min-width: 72px;
}

.os-actions-cell .os-authorized-list-label {
    min-width: 86px;
    color: #067647;
    background: #ecfdf3;
    border: 1px solid #abefc6;
}

.os-actions-cell .os-authorize-list-button:disabled {
    opacity: 1;
    color: #ffffff;
    background: #98a2b3;
    border-color: #98a2b3;
    cursor: not-allowed;
}

.os-actions-cell .os-authorize-list-form,
.os-actions-cell .os-duplicate-form {
    display: inline-flex;
    align-items: center;
}


/* ============================================================
   FASE 3.14.6.2 - AÇÕES SEMPRE LADO A LADO
   ============================================================ */

.os-actions-column {
    width: 180px;
    min-width: 180px;
}

.os-actions-cell {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    min-width: 180px;
    white-space: nowrap;
}

.os-actions-cell form,
.os-actions-cell .os-authorize-list-form,
.os-actions-cell .os-duplicate-form {
    display: inline-flex !important;
    flex: 0 0 auto;
    margin: 0 !important;
}

.os-actions-cell .btn,
.os-actions-cell .os-authorized-list-label {
    flex: 0 0 auto;
    margin: 0 !important;
}


/* ============================================================
   FASE 3.14.6.4 - UNIDADES DA GRÁFICA LADO A LADO EM AÇÕES
   ============================================================ */

.os-actions-cell .graphic-list-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    width: auto !important;
    min-width: max-content;
}

.os-actions-cell .graphic-unit-action {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    flex: 0 0 112px !important;
    width: 112px !important;
    min-width: 112px !important;
    margin: 0 !important;
    gap: 4px;
}

.os-actions-cell .graphic-unit-name {
    display: block;
    width: 100%;
    min-height: 13px;
    margin: 0;
    text-align: center;
    white-space: nowrap;
    font-size: 8px;
    line-height: 1.2;
}

.os-actions-cell .graphic-workflow-button,
.os-actions-cell .graphic-action-done,
.os-actions-cell .graphic-action-waiting {
    width: 100% !important;
    min-width: 0 !important;
}

.os-actions-cell .graphic-action-form {
    width: 100%;
}

.os-actions-cell .graphic-action-form .btn {
    width: 100%;
}

.os-table th.os-actions-column,
.os-table td.os-actions-cell {
    width: 250px;
    min-width: 250px;
}

.os-actions-cell .graphic-print-form {
    width: 230px;
    min-width: 230px;
}

.os-actions-cell .graphic-equipment-select {
    width: 100%;
    min-width: 0;
}

.os-actions-cell .graphic-print-confirm-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 5px;
    margin-top: 5px;
}


/* ============================================================
   FASE 3.14.6.5 - UMA COLUNA DE AÇÕES POR UNIDADE
   ============================================================ */

.os-table th.os-actions-unit-column,
.os-table td.os-actions-unit-cell {
    width: 145px !important;
    min-width: 145px !important;
    max-width: 145px;
}

.os-actions-unit-column {
    text-align: center !important;
}

.os-actions-unit-column small {
    display: block;
    margin-top: 3px;
    color: #667085;
    font-size: 8px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
}

.os-actions-unit-cell {
    display: table-cell !important;
    vertical-align: middle !important;
    text-align: center;
    white-space: normal;
}

.os-actions-unit-cell form {
    width: 100%;
    margin: 0;
}

.os-actions-unit-cell .graphic-workflow-button,
.os-actions-unit-cell .graphic-action-done,
.os-actions-unit-cell .graphic-action-waiting {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100%;
}

.os-actions-unit-cell .graphic-print-form {
    width: 100% !important;
    min-width: 0 !important;
}

.os-actions-unit-cell .graphic-equipment-select {
    width: 100%;
    min-width: 0;
    font-size: 9px;
}

.os-actions-unit-cell .graphic-print-confirm-actions {
    display: flex;
    flex-direction: row;
    gap: 4px;
}

.os-actions-unit-cell .graphic-print-confirm-actions .btn {
    min-width: 0;
    padding-left: 6px;
    padding-right: 6px;
    font-size: 9px;
}

/*
 * Neutraliza a antiga disposição horizontal das unidades dentro
 * de uma única célula. Agora cada unidade possui sua própria célula.
 */
.os-actions-unit-cell .graphic-list-actions,
.os-actions-unit-cell .graphic-unit-action {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
}


/* ============================================================
   FASE 3.14.6.6 - AÇÕES DA DIGITAÇÃO NA LISTAGEM
   ============================================================ */

.typing-action-form {
    display: inline-flex;
    margin: 0;
}

.typing-workflow-button {
    min-width: 86px;
}

.typing-action-done,
.typing-action-waiting {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.typing-action-done {
    color: #067647;
    background: #ecfdf3;
    border: 1px solid #abefc6;
}

.typing-action-waiting {
    color: #475467;
    background: #f8fafc;
    border: 1px solid #eaecf0;
}


/* Fase 3.14.9 - confirmação de autorização direta na Nova O.S. */
body.modal-open {
    overflow: hidden;
}

.os-direct-authorization-modal {
    width: min(430px, 100%);
    padding: 26px;
}

.os-direct-authorization-modal .modal-heading h3 {
    font-size: 18px;
}

.os-direct-authorization-modal .modal-heading p {
    margin: 8px 0 22px;
    font-size: 13px;
    line-height: 1.5;
}

.os-direct-authorization-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.os-direct-authorization-actions .btn {
    min-width: 92px;
}

/* FASE 3.14.9.1 - equipamento somente após clicar em Impresso */
.os-actions-unit-cell .graphic-print-form.hidden {
    display: none !important;
}

.os-actions-unit-cell [data-graphic-print-open][hidden] {
    display: none !important;
}


/* ============================================================
   FASE 4.0 - REIMPRESSÕES
   ============================================================ */

.reprint-filter-bar {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 220px auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 14px;
}

.reprint-filter-actions {
    display: flex;
    gap: 7px;
    align-items: center;
}

.reprint-table-panel {
    padding: 0;
    overflow: hidden;
}

.reprint-table {
    width: 100%;
    min-width: 1120px;
    border-collapse: collapse;
}

.reprint-table th,
.reprint-table td {
    padding: 12px 11px;
    border-bottom: 1px solid #eaecf0;
    vertical-align: middle;
    text-align: left;
}

.reprint-table th {
    color: #475467;
    background: #f8fafc;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.reprint-table td {
    font-size: 11px;
}

.reprint-table td small {
    display: block;
    margin-top: 3px;
    color: #667085;
    font-size: 9px;
}

.reprint-code {
    color: #18436f;
    font-size: 12px;
}

.reprint-material {
    display: block;
    margin-top: 3px;
}

.reprint-qty {
    font-weight: 800;
    white-space: nowrap;
}

.reprint-qty small {
    display: inline !important;
}

.reprint-reason {
    max-width: 320px;
    line-height: 1.35;
}

.reprint-status,
.reprint-action-done,
.reprint-action-warning {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.reprint-status-solicitada {
    color: #b54708;
    background: #fffaeb;
    border: 1px solid #fedf89;
}

.reprint-status-recebida {
    color: #175cd3;
    background: #eff8ff;
    border: 1px solid #b2ddff;
}

.reprint-status-concluida,
.reprint-action-done {
    color: #067647;
    background: #ecfdf3;
    border: 1px solid #abefc6;
}

.reprint-action-warning {
    color: #475467;
    background: #f8fafc;
    border: 1px solid #eaecf0;
}

.reprint-equipment-used {
    margin-top: 5px !important;
}

.reprint-actions-column,
.reprint-actions-cell {
    width: 190px;
    min-width: 190px;
}

.reprint-actions-cell form {
    margin: 0;
}

.reprint-action-form .btn,
.reprint-print-open {
    width: 100%;
}

.reprint-print-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.reprint-print-form.hidden {
    display: none;
}

.reprint-equipment-select {
    width: 100%;
    min-width: 0;
    height: 32px;
    padding: 4px 7px;
    border: 1px solid #d0d5dd;
    border-radius: 7px;
    background: #fff;
    font-size: 9px;
}

.reprint-print-actions,
.reprint-request-actions {
    display: flex;
    flex-direction: row;
    gap: 6px;
}

.reprint-print-actions .btn,
.reprint-request-actions .btn {
    flex: 1;
}

.reprint-open-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.reprint-open-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 270px;
    padding: 9px 11px;
    border: 1px solid #d0d5dd;
    border-radius: 9px;
    background: #f8fafc;
}

.reprint-open-card strong,
.reprint-open-card span {
    display: block;
}

.reprint-open-card span {
    margin-top: 2px;
    color: #667085;
    font-size: 9px;
}

.reprint-request-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(260px,1fr));
    gap: 10px;
}

.reprint-request-card {
    padding: 12px;
    border: 1px solid #eaecf0;
    border-radius: 10px;
    background: #fcfcfd;
}

.reprint-request-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.reprint-request-heading span {
    display: block;
    color: #667085;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.reprint-request-heading strong {
    display: block;
    margin-top: 2px;
}

.reprint-request-form {
    display: grid;
    gap: 9px;
    margin-top: 10px;
}

.reprint-request-form.hidden {
    display: none;
}

@media (max-width: 900px) {
    .reprint-filter-bar {
        grid-template-columns: 1fr;
    }
}


.reprint-status-impressa {
    color: #1849a9;
    background: #eff8ff;
    border: 1px solid #b2ddff;
}


/* ============================================================
   FASE 4.2.1 - LISTAGEM DE REIMPRESSÕES
   ============================================================ */

.reprint-filter-bar {
    grid-template-columns: minmax(280px, 1fr) 220px auto;
}

.reprint-filter-actions {
    align-self: end;
}

.reprint-clickable-row {
    cursor: pointer;
    transition: background-color .12s ease;
}

.reprint-clickable-row:hover {
    background: #f8fafc;
}

.reprint-clickable-row:focus {
    outline: 2px solid rgba(24, 67, 111, .20);
    outline-offset: -2px;
}

.reprint-clickable-row[hidden] {
    display: none !important;
}


/* ============================================================
   FASE 5.1 - DASHBOARD FUNCIONAL
   ============================================================ */

.dashboard-welcome {
    margin-bottom: 22px;
}

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.dashboard-stat-link {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: transform .16s ease, box-shadow .16s ease;
}

.dashboard-stat-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .10);
}

.dashboard-recent-panel {
    overflow: hidden;
}

.dashboard-recent-list {
    display: grid;
}

.dashboard-recent-item {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr) 210px;
    gap: 20px;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid #e9edf3;
    color: inherit;
    text-decoration: none;
    transition: background .15s ease;
}

.dashboard-recent-item:hover {
    background: #f8fafc;
}

.dashboard-recent-code,
.dashboard-recent-material,
.dashboard-recent-status {
    display: grid;
    gap: 4px;
}

.dashboard-recent-code span,
.dashboard-recent-material span,
.dashboard-recent-status small {
    color: #778196;
    font-size: 12px;
}

.dashboard-recent-status {
    justify-items: end;
    text-align: right;
}

.dashboard-recent-status > span {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef3f8;
    font-size: 12px;
    font-weight: 700;
}

.dashboard-empty {
    padding: 32px 20px;
    color: #778196;
    text-align: center;
}

@media (max-width: 1250px) {
    .dashboard-stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 850px) {
    .dashboard-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-recent-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .dashboard-recent-status {
        justify-items: start;
        text-align: left;
    }
}

@media (max-width: 560px) {
    .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   FASE 5.2 - CENTRAL DE NOTIFICAÇÕES
   ============================================================ */

.notification-center {
    position: relative;
    margin-left: auto;
    margin-right: 10px;
}

.notification-bell {
    position: relative;
    width: 40px;
    height: 40px;
    border: 1px solid #dfe5ec;
    border-radius: 12px;
    background: #fff;
    color: #1d2b3d;
    cursor: pointer;
    font: inherit;
    display: grid;
    place-items: center;
    transition: background .15s ease, border-color .15s ease;
}

.notification-bell:hover {
    background: #f7f9fc;
    border-color: #cfd7e2;
}

.notification-bell-icon {
    font-size: 21px;
    line-height: 1;
    transform: rotate(45deg);
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: #d83b3b;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 19px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
}

.notification-popover {
    position: absolute;
    z-index: 1000;
    top: calc(100% + 10px);
    right: 0;
    width: min(420px, calc(100vw - 30px));
    max-height: 560px;
    overflow: hidden;
    border: 1px solid #dfe5ec;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .18);
}

.notification-popover-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid #edf0f4;
}

.notification-popover-header > div {
    display: grid;
    gap: 3px;
}

.notification-popover-header strong {
    font-size: 15px;
}

.notification-popover-header span {
    color: #7b8595;
    font-size: 11px;
}

.notification-read-all {
    border: 0;
    background: transparent;
    color: #24598c;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 0;
}

.notification-list {
    max-height: 475px;
    overflow-y: auto;
}

.notification-item {
    position: relative;
    display: grid;
    grid-template-columns: 9px minmax(0, 1fr);
    gap: 11px;
    padding: 14px 18px;
    border-bottom: 1px solid #f0f2f5;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.notification-item:hover {
    background: #f8fafc;
}

.notification-item.is-read {
    opacity: .68;
}

.notification-dot {
    width: 8px;
    height: 8px;
    margin-top: 5px;
    border-radius: 50%;
    background: #2f75b5;
}

.notification-item.is-read .notification-dot {
    background: #c7ced8;
}

.notification-item-content {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.notification-item-title {
    font-size: 12px;
    font-weight: 800;
    color: #172235;
}

.notification-item-message {
    color: #586477;
    font-size: 11px;
    line-height: 1.45;
}

.notification-item-time {
    color: #9199a7;
    font-size: 10px;
}

.notification-empty {
    padding: 34px 18px;
    color: #7b8595;
    font-size: 12px;
    text-align: center;
}

@media (max-width: 700px) {
    .notification-center {
        margin-left: 0;
    }

    .notification-popover {
        position: fixed;
        top: 70px;
        right: 15px;
        left: 15px;
        width: auto;
    }
}


/* ============================================================
   FASE 5.4 - USUÁRIOS ATIVOS NO DASHBOARD ADMINISTRADOR
   ============================================================ */

.dashboard-active-users-panel {
    margin-bottom: 22px;
    overflow: hidden;
}

.dashboard-active-users-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    border-top: 1px solid #edf0f4;
}

.dashboard-active-user {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 11px;
    align-items: center;
    padding: 15px 18px;
    border-right: 1px solid #edf0f4;
    border-bottom: 1px solid #edf0f4;
}

.dashboard-active-user-avatar {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #eaf1f8;
    color: #204c78;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 800;
}

.dashboard-online-dot {
    position: absolute;
    right: -1px;
    bottom: 1px;
    width: 10px;
    height: 10px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #35b56a;
}

.dashboard-active-user-info {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.dashboard-active-user-info strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}

.dashboard-active-user-info span,
.dashboard-active-user-time small {
    color: #7c8798;
    font-size: 10px;
}

.dashboard-active-user-time {
    display: grid;
    gap: 2px;
    justify-items: end;
}

.dashboard-active-user-time > span {
    color: #29975a;
    font-size: 10px;
    font-weight: 800;
}

@media (max-width: 1150px) {
    .dashboard-active-users-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .dashboard-active-users-list {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   FASE 5.5 - BADGES DE NOVOS REGISTROS NO MENU
   ============================================================ */

.nav-item-label {
    min-width: 0;
}

.nav-notification-badge {
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #d92d20;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px rgba(15, 27, 45, .95);
}

.nav-notification-badge[hidden] {
    display: none !important;
}

@media (max-width: 980px) {
    .nav-item:not(.active) .nav-item-label,
    .nav-item.active .nav-item-label {
        font-size: 0;
    }

    .nav-notification-badge {
        position: absolute;
        margin-left: 22px;
        margin-top: -15px;
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        line-height: 16px;
        font-size: 9px;
    }

    .sidebar-nav .nav-item {
        position: relative;
    }
}


/* ============================================================
   FASE 5.6 - NOTIFICAÇÕES NATIVAS DO NAVEGADOR
   ============================================================ */

.notification-browser-permission {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-bottom: 1px solid #edf0f4;
    background: #f8fafc;
}

.notification-browser-permission[hidden] {
    display: none !important;
}

.notification-browser-enable {
    flex: 0 0 auto;
    border: 1px solid #cfd9e6;
    border-radius: 9px;
    background: #fff;
    color: #173b61;
    cursor: pointer;
    padding: 7px 10px;
    font: inherit;
    font-size: 10px;
    font-weight: 800;
}

.notification-browser-enable:hover {
    background: #eef4fa;
}

.notification-browser-status {
    color: #7b8595;
    font-size: 10px;
    line-height: 1.35;
}


/* ============================================================
   FASE 6.0 - ALERTAS OPERACIONAIS DE 48 HORAS
   ============================================================ */

.alert-center {
    position: relative;
    margin-left: auto;
    margin-right: 8px;
}

.alert-center + .notification-center {
    margin-left: 0;
}

.alert-center-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    border: 1px solid #e5d7b8;
    border-radius: 12px;
    background: #fffaf0;
    color: #b26b00;
    cursor: pointer;
    font: inherit;
    display: grid;
    place-items: center;
}

.alert-center-toggle:hover {
    background: #fff5df;
}

.alert-center-icon {
    font-size: 20px;
    line-height: 1;
    font-weight: 800;
}

.alert-center-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: #d92d20;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 19px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
}

.alert-center-badge[hidden] {
    display: none !important;
}

.alert-popover {
    position: absolute;
    z-index: 1001;
    top: calc(100% + 10px);
    right: 0;
    width: min(460px, calc(100vw - 30px));
    max-height: 580px;
    overflow: hidden;
    border: 1px solid #eadfc9;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .18);
}

.alert-popover-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid #edf0f4;
}

.alert-popover-header > div {
    display: grid;
    gap: 3px;
}

.alert-popover-header strong {
    font-size: 15px;
}

.alert-popover-header span {
    color: #7b8595;
    font-size: 11px;
}

.alert-rule {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    background: #fff3d6;
    color: #996000 !important;
    font-weight: 800;
    white-space: nowrap;
}

.alert-list {
    max-height: 490px;
    overflow-y: auto;
}

.alert-item {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 11px;
    padding: 14px 18px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    transition: background .15s ease;
}

.alert-item:hover {
    background: #fffaf2;
}

.alert-item-symbol {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: #fff0cc;
    color: #a86500;
    font-size: 14px;
    font-weight: 900;
}

.alert-item-autorizacao .alert-item-symbol {
    background: #fff0cc;
    color: #a86500;
}

.alert-item-digitacao .alert-item-symbol {
    background: #eaf2ff;
    color: #285d9b;
}

.alert-item-grafica .alert-item-symbol {
    background: #fce8e7;
    color: #b42318;
}

.alert-item-content {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.alert-item-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.alert-item-top strong {
    color: #172235;
    font-size: 12px;
}

.alert-item-top span {
    flex: 0 0 auto;
    color: #b42318;
    font-size: 10px;
    font-weight: 800;
}

.alert-item-code {
    color: #344054;
    font-size: 11px;
    font-weight: 700;
}

.alert-item-message {
    color: #667085;
    font-size: 10px;
    line-height: 1.4;
}

.alert-empty {
    padding: 34px 18px;
    color: #7b8595;
    font-size: 12px;
    text-align: center;
}

@media (max-width: 700px) {
    .alert-popover {
        position: fixed;
        top: 70px;
        right: 15px;
        left: 15px;
        width: auto;
    }
}


/* ============================================================
   FASE 6.1 - PRIORIDADES E RESUMO DE ALERTAS NO DASHBOARD
   ============================================================ */

.alert-item.alert-priority-atencao {
    border-left: 3px solid #d69200;
}

.alert-item.alert-priority-urgente {
    border-left: 3px solid #e05a19;
}

.alert-item.alert-priority-critico {
    border-left: 3px solid #c62828;
    background: #fffafa;
}

.alert-item.alert-priority-critico:hover {
    background: #fff4f4;
}

.alert-priority-atencao .alert-item-symbol {
    background: #fff0cc;
    color: #a86500;
}

.alert-priority-urgente .alert-item-symbol {
    background: #ffeadf;
    color: #c54a0a;
}

.alert-priority-critico .alert-item-symbol {
    background: #fde2e2;
    color: #b42318;
}

.alert-priority-atencao .alert-priority-label {
    color: #a86500;
}

.alert-priority-urgente .alert-priority-label {
    color: #c54a0a;
}

.alert-priority-critico .alert-priority-label {
    color: #b42318;
}

.dashboard-alerts-panel {
    margin-bottom: 18px;
    overflow: hidden;
}

.dashboard-alerts-header {
    align-items: center;
}

.dashboard-alert-total {
    display: flex;
    align-items: baseline;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #f8fafc;
}

.dashboard-alert-total strong {
    font-size: 22px;
    color: #172235;
}

.dashboard-alert-total span {
    color: #667085;
    font-size: 11px;
}

.dashboard-alert-priority-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 0 16px 14px;
}

.dashboard-alert-priority {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 3px 10px;
    padding: 12px 14px;
    border: 1px solid #edf0f4;
    border-radius: 12px;
    background: #fff;
}

.dashboard-alert-priority span {
    font-size: 11px;
    font-weight: 800;
}

.dashboard-alert-priority strong {
    grid-row: span 2;
    font-size: 24px;
}

.dashboard-alert-priority small {
    font-size: 10px;
    color: #7b8595;
}

.dashboard-alert-priority-attention {
    border-left: 4px solid #d69200;
}

.dashboard-alert-priority-attention span,
.dashboard-alert-priority-attention strong {
    color: #9a6500;
}

.dashboard-alert-priority-urgent {
    border-left: 4px solid #e05a19;
}

.dashboard-alert-priority-urgent span,
.dashboard-alert-priority-urgent strong {
    color: #bd480d;
}

.dashboard-alert-priority-critical {
    border-left: 4px solid #c62828;
}

.dashboard-alert-priority-critical span,
.dashboard-alert-priority-critical strong {
    color: #b42318;
}

.dashboard-alerts-list {
    border-top: 1px solid #edf0f4;
}

.dashboard-alert-row {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 12px 16px;
    border-bottom: 1px solid #edf0f4;
    color: inherit;
    text-decoration: none;
}

.dashboard-alert-row:hover {
    background: #fafbfc;
}

.dashboard-alert-marker {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    font-weight: 900;
}

.dashboard-alert-row-attention .dashboard-alert-marker {
    background: #fff0cc;
    color: #a86500;
}

.dashboard-alert-row-urgent .dashboard-alert-marker {
    background: #ffeadf;
    color: #c54a0a;
}

.dashboard-alert-row-critical .dashboard-alert-marker {
    background: #fde2e2;
    color: #b42318;
}

.dashboard-alert-main {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.dashboard-alert-main strong {
    font-size: 12px;
    color: #172235;
}

.dashboard-alert-main span {
    font-size: 10px;
    color: #667085;
}

.dashboard-alert-age {
    display: grid;
    justify-items: end;
    gap: 2px;
}

.dashboard-alert-age strong {
    font-size: 10px;
}

.dashboard-alert-age span {
    font-size: 11px;
    font-weight: 800;
    color: #344054;
}

.dashboard-alert-row-attention .dashboard-alert-age strong {
    color: #a86500;
}

.dashboard-alert-row-urgent .dashboard-alert-age strong {
    color: #c54a0a;
}

.dashboard-alert-row-critical .dashboard-alert-age strong {
    color: #b42318;
}

.dashboard-alerts-ok {
    margin: 0 16px 16px;
    padding: 14px;
    border-radius: 12px;
    background: #f0faf5;
    color: #18794e;
    font-size: 11px;
    font-weight: 700;
}

.dashboard-alerts-ok span {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    margin-right: 6px;
    border-radius: 999px;
    background: #dff5e9;
}

.dashboard-alerts-more {
    padding: 10px 16px 14px;
    color: #667085;
    font-size: 10px;
    text-align: center;
}

@media (max-width: 800px) {
    .dashboard-alert-priority-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-alert-row {
        grid-template-columns: 30px minmax(0, 1fr);
    }

    .dashboard-alert-age {
        grid-column: 2;
        justify-items: start;
        grid-auto-flow: column;
        justify-content: start;
        gap: 7px;
    }
}


/* ============================================================
   FASE 6.2 - MODAL DE EQUIPAMENTO DA GRÁFICA
   ============================================================ */

body.graphic-equipment-modal-open {
    overflow: hidden;
}

.graphic-print-form[hidden] {
    display: none !important;
}

.graphic-equipment-modal {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: grid;
    place-items: center;
    padding: 20px;
}

.graphic-equipment-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(2px);
}

.graphic-equipment-modal-card {
    position: relative;
    z-index: 1;
    width: min(430px, calc(100vw - 32px));
    overflow: hidden;
    border: 1px solid #dfe5ec;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .25);
}

.graphic-equipment-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #edf0f4;
}

.graphic-equipment-modal-header > div {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.graphic-equipment-modal-header h3 {
    margin: 0;
    color: #172235;
    font-size: 17px;
}

.graphic-equipment-modal-header p {
    margin: 0;
    color: #7b8595;
    font-size: 11px;
}

.graphic-equipment-modal-close {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 9px;
    background: #f3f5f8;
    color: #445064;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.graphic-equipment-modal-close:hover {
    background: #e9edf3;
}

.graphic-equipment-modal-body {
    padding: 18px 20px;
}

.graphic-equipment-modal-label {
    display: block;
    margin-bottom: 7px;
    color: #344054;
    font-size: 11px;
    font-weight: 800;
}

.graphic-equipment-modal .graphic-equipment-select {
    width: 100%;
    min-height: 42px;
    margin: 0;
    border: 1px solid #cfd7e2;
    border-radius: 10px;
    background: #fff;
    padding: 0 11px;
    color: #172235;
    font: inherit;
    font-size: 12px;
}

.graphic-equipment-modal .graphic-equipment-select:focus {
    outline: 2px solid rgba(36, 89, 140, .16);
    border-color: #547ca4;
}

.graphic-equipment-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding: 14px 20px 18px;
    border-top: 1px solid #edf0f4;
    background: #fafbfc;
}

@media (max-width: 560px) {
    .graphic-equipment-modal {
        padding: 14px;
        align-items: end;
    }

    .graphic-equipment-modal-card {
        width: 100%;
        border-radius: 16px 16px 10px 10px;
    }

    .graphic-equipment-modal-actions {
        flex-direction: column-reverse;
    }

    .graphic-equipment-modal-actions .btn {
        width: 100%;
    }
}


/* ============================================================
   FASE 6.3 - ÚLTIMO EQUIPAMENTO DO USUÁRIO
   ============================================================ */

.graphic-equipment-last-choice {
    display: block;
    margin-top: 7px;
    color: #7b8595;
    font-size: 10px;
    line-height: 1.35;
}


/* ============================================================
   FASE 6.4 - CORES OPERACIONAIS DOS BOTÕES DA GRÁFICA
   ============================================================ */

/*
 * Receber = amarelo/laranja
 * Impresso = azul
 * Entregue = verde
 *
 * As cores representam a próxima ação operacional e facilitam
 * identificar rapidamente em que ponto cada unidade está.
 */

.graphic-workflow-button {
    min-width: 88px;
    border: 1px solid transparent;
    font-weight: 800;
    transition:
        transform .12s ease,
        box-shadow .12s ease,
        background .12s ease;
}

.graphic-workflow-button:hover {
    transform: translateY(-1px);
}

.graphic-workflow-receive {
    background: #fff1c7;
    border-color: #efc65d;
    color: #875400;
}

.graphic-workflow-receive:hover {
    background: #ffe8a3;
    border-color: #e8b63d;
    color: #754900;
    box-shadow: 0 4px 12px rgba(196, 135, 14, .16);
}

.graphic-workflow-print {
    background: #e7f0ff;
    border-color: #a9c5ee;
    color: #245b95;
}

.graphic-workflow-print:hover {
    background: #d9e9ff;
    border-color: #8eb4e8;
    color: #174c82;
    box-shadow: 0 4px 12px rgba(36, 91, 149, .15);
}

.graphic-workflow-deliver {
    background: #e3f7ea;
    border-color: #9bd8ae;
    color: #187643;
}

.graphic-workflow-deliver:hover {
    background: #d3f2df;
    border-color: #79c792;
    color: #126637;
    box-shadow: 0 4px 12px rgba(24, 118, 67, .14);
}

/* Estados já finalizados / especiais */

.graphic-action-completed {
    background: #e4f8ec;
    border-color: #9fdfb5;
    color: #16804a;
}

.graphic-action-skip {
    background: #f2f4f7;
    border-color: #d6dbe3;
    color: #667085;
}

.graphic-action-neutral {
    background: #f5f6f8;
    border-color: #dfe3e8;
    color: #7a8494;
}

.graphic-action-authorization {
    background: #fff7df;
    border-color: #f0d27a;
    color: #8a6200;
}

.graphic-action-equipment-missing {
    background: #fdeaea;
    border-color: #edb9b9;
    color: #a32d2d;
}

/*
 * Mantém o mesmo padrão nas duas colunas de unidade.
 * A leitura visual fica:
 *   amarelo = receber
 *   azul    = imprimir
 *   verde   = entregar/concluído
 */


/* ============================================================
   FASE 6.5 - BOTÕES DA GRÁFICA MAIORES + ÍCONES
   ============================================================ */

.graphic-workflow-button {
    min-width: 94px;
    min-height: 32px;
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
}

.graphic-button-icon {
    display: inline-grid;
    place-items: center;
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    font-size: 12px;
    line-height: 1;
    font-weight: 900;
}

.graphic-action-done,
.graphic-action-waiting {
    font-size: 10.5px;
    line-height: 1.2;
    padding: 6px 9px;
}

/* Mantém as colunas compactas mesmo com a fonte maior. */
.os-actions-unit-cell {
    min-width: 104px;
}

@media (max-width: 1250px) {
    .graphic-workflow-button {
        min-width: 88px;
        padding-inline: 8px;
        font-size: 10.5px;
        gap: 5px;
    }

    .os-actions-unit-cell {
        min-width: 96px;
    }
}


/* ============================================================
   FASE 6.6 - CÓPIAS EXTRAS POR TIPO DE MATERIAL
   ============================================================ */

.material-extra-copies-help {
    display: block;
    margin-top: 2px;
    color: #7b8595;
    font-size: 9px;
}


/* ============================================================
   FASE 6.7 - AÇÕES COM VISUAL DE SISTEMA + LINHA TÉCNICA
   ============================================================ */

/*
 * Botões operacionais:
 * base clara/neutra + cor apenas como indicador da etapa.
 * Isso reduz o aspecto de "botão colorido" e aproxima o visual
 * de uma interface de gestão.
 */

.graphic-workflow-button {
    --action-accent: #526174;
    --action-soft: #f4f6f8;

    min-width: 102px;
    min-height: 34px;
    padding: 5px 9px 5px 6px;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    background: #fff;
    color: #293548;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .01em;
    gap: 7px;
}

.graphic-workflow-button:hover {
    background: var(--action-soft);
    border-color: color-mix(in srgb, var(--action-accent) 34%, #d7dde5);
    color: #182433;
    box-shadow: 0 2px 6px rgba(16, 24, 40, .09);
    transform: translateY(-1px);
}

.graphic-workflow-button .graphic-button-icon {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
    border-radius: 6px;
    background: var(--action-soft);
    color: var(--action-accent);
    font-size: 11px;
    border: 1px solid color-mix(in srgb, var(--action-accent) 18%, transparent);
}

.graphic-workflow-receive {
    --action-accent: #a66b00;
    --action-soft: #fff7e4;
}

.graphic-workflow-print {
    --action-accent: #245f9d;
    --action-soft: #eef5ff;
}

.graphic-workflow-deliver {
    --action-accent: #18794e;
    --action-soft: #edf9f2;
}

/* Estados finais seguem a mesma linguagem visual, sem formato de botão. */
.graphic-action-done,
.graphic-action-waiting {
    min-width: 102px;
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 750;
}

/* Linha técnica discreta sob o material. */

.os-technical-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    max-width: 440px;
}

.os-technical-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 18px;
    padding: 2px 6px;
    border: 1px solid #e2e7ed;
    border-radius: 5px;
    background: #f7f9fb;
    color: #5f6b7c;
    font-size: 8.5px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.os-technical-tag > span {
    color: #778397;
    font-size: 9px;
    line-height: 1;
}

.os-technical-tag-paper {
    background: #f6f8fb;
}

.os-technical-tag-color {
    border-color: #d9dcef;
    background: #f6f4fc;
    color: #625887;
}

.os-technical-tag-color > span {
    color: #7764a5;
}

.os-technical-tag-finish {
    background: #f5f8f7;
    color: #50675e;
}

.os-technical-tag-finish > span {
    color: #648074;
}

@media (max-width: 1350px) {
    .graphic-workflow-button,
    .graphic-action-done,
    .graphic-action-waiting {
        min-width: 94px;
    }

    .os-technical-tags {
        max-width: 330px;
    }

    .os-technical-tag {
        font-size: 8px;
        padding-inline: 5px;
    }
}


/* ============================================================
   FASE 6.8 - BOTÕES OPERACIONAIS + CORES NAS INFORMAÇÕES TÉCNICAS
   ============================================================ */

/*
 * Botões:
 * - formato sólido e compacto
 * - ícone sem "quadradinho" interno
 * - maior contraste e leitura imediata
 * - mesma geometria para todas as etapas
 */

.graphic-workflow-button {
    min-width: 104px;
    min-height: 32px;
    padding: 6px 12px;
    border: 0;
    border-radius: 6px;
    color: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .14);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .01em;
    gap: 6px;
}

.graphic-workflow-button .graphic-button-icon {
    width: auto;
    height: auto;
    flex: 0 0 auto;
    display: inline;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: currentColor;
    font-size: 12px;
    font-weight: 900;
}

.graphic-workflow-receive {
    background: #b77908;
    color: #fff;
}

.graphic-workflow-receive:hover {
    background: #9d6504;
    color: #fff;
    border: 0;
    box-shadow: 0 3px 8px rgba(157, 101, 4, .22);
}

.graphic-workflow-print {
    background: #245b91;
    color: #fff;
}

.graphic-workflow-print:hover {
    background: #194b7b;
    color: #fff;
    border: 0;
    box-shadow: 0 3px 8px rgba(25, 75, 123, .22);
}

.graphic-workflow-deliver {
    background: #237a4b;
    color: #fff;
}

.graphic-workflow-deliver:hover {
    background: #19643b;
    color: #fff;
    border: 0;
    box-shadow: 0 3px 8px rgba(25, 100, 59, .22);
}

/* Estados que não são ações ficam deliberadamente mais suaves. */
.graphic-action-done,
.graphic-action-waiting {
    min-width: 104px;
    min-height: 30px;
    border-radius: 6px;
    box-shadow: none;
    font-size: 10px;
    font-weight: 800;
}

/*
 * Informações técnicas:
 * cada família recebe uma cor própria, mantendo tons suaves
 * para não competir visualmente com os botões de ação.
 */

.os-technical-tag {
    border-radius: 5px;
    font-weight: 750;
}

/* Papel / tamanho / cor física */
.os-technical-tag-paper {
    background: #fff4db;
    border-color: #f0d18b;
    color: #7b5707;
}

.os-technical-tag-paper > span {
    color: #a06f00;
}

/* Impressão colorida */
.os-technical-tag-color {
    background: #f2eefe;
    border-color: #d7c9f5;
    color: #654aa0;
}

.os-technical-tag-color > span {
    color: #7a5db6;
}

/* Acabamentos */
.os-technical-tag-finish {
    background: #eaf7f0;
    border-color: #b9dfc9;
    color: #286747;
}

.os-technical-tag-finish > span {
    color: #347a57;
}

/* Mantém o conjunto discreto mesmo quando há várias características. */
.os-technical-tags {
    gap: 4px;
    margin-top: 6px;
}

@media (max-width: 1350px) {
    .graphic-workflow-button,
    .graphic-action-done,
    .graphic-action-waiting {
        min-width: 96px;
    }
}


/* ============================================================
   FASE 6.9 - CÁLCULO ADMINISTRATIVO DE PAPEL POR UNIDADE
   ============================================================ */

.admin-paper-total strong {
    color: #1f4f79;
}

.admin-paper-calculation {
    margin-top: 12px;
    padding: 12px 13px;
    border: 1px solid #dfe6ee;
    border-radius: 10px;
    background: #f8fafc;
}

.admin-paper-calculation-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.admin-paper-calculation-head > div {
    display: grid;
    gap: 2px;
}

.admin-paper-calculation-head span {
    color: #7a8696;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 800;
}

.admin-paper-calculation-head strong {
    color: #263548;
    font-size: 11px;
}

.admin-only-badge {
    padding: 4px 7px;
    border-radius: 999px;
    background: #eaf1f8;
    color: #315f86 !important;
    font-size: 8px !important;
    white-space: nowrap;
}

.admin-paper-formula {
    display: flex;
    align-items: stretch;
    gap: 7px;
    flex-wrap: wrap;
}

.admin-paper-formula > div {
    min-width: 72px;
    display: grid;
    gap: 2px;
    padding: 7px 9px;
    border: 1px solid #e1e6ec;
    border-radius: 8px;
    background: #fff;
}

.admin-paper-formula > div span {
    color: #7b8595;
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 800;
}

.admin-paper-formula > div strong {
    color: #263548;
    font-size: 14px;
}

.admin-paper-operator {
    align-self: center;
    color: #7b8595;
    font-size: 13px;
    font-weight: 900;
}

.admin-paper-result {
    border-color: #b9d4e9 !important;
    background: #eef6fc !important;
}

.admin-paper-result strong {
    color: #205a86 !important;
}

.admin-paper-explanation {
    margin-top: 9px;
    color: #6d7888;
    font-size: 9px;
    line-height: 1.45;
}

@media (max-width: 700px) {
    .admin-paper-formula {
        gap: 5px;
    }

    .admin-paper-formula > div {
        min-width: 64px;
    }
}


/* ============================================================
   FASE 7.1 - RELATÓRIOS E INDICADORES
   ============================================================ */

.report-page {
    display: grid;
    gap: 16px;
}

.report-heading {
    margin-bottom: 0;
}

.report-filter-panel {
    padding: 14px 16px;
}

.report-filter-grid {
    display: grid;
    grid-template-columns: 150px 150px minmax(170px, 1fr) minmax(170px, 1fr) minmax(210px, 1.25fr) auto;
    align-items: end;
    gap: 10px;
}

.report-filter-actions {
    display: flex;
    gap: 7px;
    padding-bottom: 1px;
}

.report-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.report-stat-card {
    min-height: 108px;
    display: grid;
    align-content: center;
    gap: 5px;
    padding: 15px 17px;
    border: 1px solid #e1e6ed;
    border-radius: 12px;
    background: #fff;
}

.report-stat-card > span {
    color: #697587;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.report-stat-card > strong {
    color: #172235;
    font-size: 25px;
    line-height: 1;
}

.report-stat-card > small {
    color: #8590a0;
    font-size: 9px;
}

.report-stat-highlight {
    border-left: 4px solid #2b648f;
    background: #f9fbfd;
}

.report-two-columns {
    display: grid;
    grid-template-columns: 1.25fr .75fr;
    gap: 16px;
}

.report-panel {
    overflow: hidden;
}

.report-table-wrap {
    overflow-x: auto;
}

.report-table th:not(:first-child),
.report-table td:not(:first-child) {
    text-align: right;
}

.report-table td {
    font-size: 10px;
}

.report-segment-list {
    display: grid;
    gap: 14px;
    padding: 4px 17px 18px;
}

.report-segment-row {
    display: grid;
    gap: 6px;
}

.report-segment-row > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.report-segment-row strong {
    color: #344054;
    font-size: 10px;
}

.report-segment-row span {
    color: #7b8595;
    font-size: 9px;
}

.report-segment-track {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf1f5;
}

.report-segment-track > span {
    display: block;
    height: 100%;
    min-width: 4px;
    border-radius: inherit;
    background: #557ca1;
}

@media (max-width: 1250px) {
    .report-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .report-filter-actions {
        grid-column: span 3;
        justify-content: flex-end;
    }
}

@media (max-width: 900px) {
    .report-stat-grid,
    .report-two-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-two-columns .report-panel {
        grid-column: span 2;
    }
}

@media (max-width: 650px) {
    .report-filter-grid,
    .report-stat-grid {
        grid-template-columns: 1fr;
    }

    .report-filter-actions,
    .report-two-columns .report-panel {
        grid-column: auto;
    }

    .report-filter-actions {
        justify-content: stretch;
    }

    .report-filter-actions .btn {
        flex: 1;
    }
}


/* ============================================================
   FASE 8.1 - ESTOQUE DE PAPEL
   ============================================================ */

.stock-page {
    display: grid;
    gap: 16px;
}

.stock-heading {
    margin-bottom: 0;
}

.stock-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.stock-stat-card {
    display: grid;
    gap: 5px;
    min-height: 100px;
    align-content: center;
    padding: 15px 17px;
    border: 1px solid #e1e6ed;
    border-radius: 12px;
    background: #fff;
}

.stock-stat-card > span {
    color: #697587;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.stock-stat-card > strong {
    color: #172235;
    font-size: 24px;
    line-height: 1;
}

.stock-stat-card > small {
    color: #8590a0;
    font-size: 9px;
}

.stock-stat-warning {
    border-left: 4px solid #c17b08;
    background: #fffaf0;
}

.stock-table-wrap {
    overflow-x: auto;
}

.stock-table td,
.stock-history-table td {
    font-size: 10px;
}

.stock-paper-type {
    display: block;
    margin-top: 2px;
    color: #7b8595;
    font-size: 9px;
}

.stock-balance strong {
    display: block;
    color: #22364b;
    font-size: 13px;
}

.stock-balance small {
    color: #8a94a3;
    font-size: 8px;
}

.stock-status {
    display: inline-flex;
    align-items: center;
    min-height: 21px;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 800;
}

.stock-status-ok {
    border: 1px solid #b9dfc9;
    background: #eaf7f0;
    color: #286747;
}

.stock-status-low {
    border: 1px solid #f0d18b;
    background: #fff4db;
    color: #8b5d00;
}

.stock-movement {
    display: inline-flex;
    min-width: 58px;
    justify-content: center;
    padding: 3px 7px;
    border-radius: 5px;
    font-size: 9px;
    font-weight: 800;
}

.stock-movement-in {
    background: #eaf7f0;
    color: #286747;
}

.stock-movement-out {
    background: #fdeeee;
    color: #9a3535;
}

.stock-modal-card {
    width: min(610px, calc(100vw - 30px));
}

.stock-modal-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.stock-modal-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stock-current-balance {
    padding: 9px 11px;
    border: 1px solid #dfe6ee;
    border-radius: 8px;
    background: #f7f9fb;
    color: #667085;
    font-size: 10px;
}

.stock-current-balance strong {
    color: #263548;
    font-size: 13px;
}

@media (max-width: 750px) {
    .stock-stat-grid,
    .stock-modal-grid,
    .stock-modal-grid.two {
        grid-template-columns: 1fr;
    }
}


/* FASE 8.2 - identificação da baixa automática por O.S. */
.stock-auto-label {
    display: block;
    margin-top: 3px;
    color: #7b8595;
    font-size: 7px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}


/* FASE 8.2.1 - ESTOQUE SEPARADO POR UNIDADE */
.stock-unit-section {
    display: grid;
    gap: 14px;
}

.stock-unit-section + .stock-unit-section {
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid #dfe5ec;
}

.stock-unit-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 2px 0;
}

.stock-unit-heading span {
    display: block;
    margin-bottom: 3px;
    color: #7b8595;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.stock-unit-heading h3 {
    margin: 0;
    color: #1f2e40;
    font-size: 16px;
}

.stock-unit-stat-grid {
    margin-top: -3px;
}


/* ============================================================
   FASE 8.2.2 - ABAS DAS UNIDADES
   ============================================================ */

.stock-unit-tabs {
    display: flex;
    align-items: stretch;
    gap: 8px;
    padding: 5px;
    border: 1px solid #dde4eb;
    border-radius: 11px;
    background: #edf1f5;
    overflow-x: auto;
}

.stock-unit-tab {
    position: relative;
    min-width: 190px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 10px;
    row-gap: 2px;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #536174;
    cursor: pointer;
    text-align: left;
    transition:
        background .15s ease,
        border-color .15s ease,
        box-shadow .15s ease;
}

.stock-unit-tab:hover {
    background: rgba(255, 255, 255, .62);
}

.stock-unit-tab.active {
    border-color: #d7dee7;
    background: #fff;
    box-shadow: 0 1px 3px rgba(24, 39, 58, .08);
    color: #172a41;
}

.stock-unit-tab > span {
    grid-column: 1;
    font-size: 10px;
    font-weight: 800;
}

.stock-unit-tab > small {
    grid-column: 1;
    color: #7d8998;
    font-size: 8px;
    font-weight: 700;
}

.stock-unit-tab > em {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    padding: 3px 6px;
    border-radius: 999px;
    background: #fff0d8;
    color: #8b5d00;
    font-size: 7px;
    font-style: normal;
    font-weight: 800;
}

.stock-unit-tab.active::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -6px;
    height: 2px;
    border-radius: 999px;
    background: #2a5f8d;
}

.stock-unit-section[hidden] {
    display: none !important;
}

.stock-unit-tabs + .stock-unit-section {
    margin-top: 1px;
}

@media (max-width: 700px) {
    .stock-unit-tab {
        min-width: 160px;
    }
}


/* ============================================================
   FASE 8.5 - CUSTO POR FOLHA
   ============================================================ */

.stock-modal-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stock-unit-cost strong {
    color: #2e526f;
    font-size: 10px;
    white-space: nowrap;
}

@media (max-width: 750px) {
    .stock-modal-grid.three {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   FASE 8.5.1 - EDIÇÃO DO ITEM DE ESTOQUE
   ============================================================ */

.stock-row-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.stock-edit-note {
    padding: 9px 11px;
    border: 1px solid #dfe6ee;
    border-radius: 8px;
    background: #f7f9fb;
    color: #697587;
    font-size: 9px;
    line-height: 1.45;
}

.stock-edit-note strong {
    color: #263548;
}


/* ============================================================
   FASE 9.1 - PROTOCOLO DE PRODUÇÃO / ENTREGA
   ============================================================ */

.protocol-body {
    margin: 0;
    min-height: 100vh;
    background: #e9edf2;
    color: #182230;
    font-family:
        Inter,
        Arial,
        Helvetica,
        sans-serif;
}

.production-protocol-modal {
    min-height: 100vh;
    padding: 18px;
}

.production-protocol-toolbar {
    width: min(1040px, calc(100vw - 36px));
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 10px 13px;
    border: 1px solid #d9e0e8;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(26, 39, 54, .08);
}

.production-protocol-toolbar > div:first-child {
    display: grid;
    gap: 2px;
}

.production-protocol-toolbar strong {
    font-size: 12px;
}

.production-protocol-toolbar span {
    color: #758194;
    font-size: 9px;
}

.production-protocol-toolbar-actions {
    display: flex;
    gap: 7px;
}

.production-protocol-sheet {
    box-sizing: border-box;
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 10mm 11mm;
    background: #fff;
    box-shadow: 0 6px 28px rgba(30, 42, 58, .14);
}

.protocol-print-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 7mm;
    border-bottom: 1.5px solid #24374e;
}

.protocol-brand {
    display: block;
    margin-bottom: 2mm;
    color: #295f8f;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .03em;
}

.protocol-print-header h1 {
    margin: 0 0 1.5mm;
    color: #172638;
    font-size: 18px;
}

.protocol-print-header p {
    margin: 0;
    color: #687587;
    font-size: 10px;
}

.protocol-os-code {
    min-width: 41mm;
    padding: 4mm;
    border: 1px solid #cbd4df;
    border-radius: 3mm;
    text-align: right;
}

.protocol-os-code span {
    display: block;
    margin-bottom: 1mm;
    color: #758194;
    font-size: 7px;
    font-weight: 800;
    text-transform: uppercase;
}

.protocol-os-code strong {
    font-size: 18px;
    letter-spacing: .03em;
}

.protocol-material-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2.2mm;
    margin-top: 5mm;
}

.protocol-material-summary > div {
    min-height: 12mm;
    box-sizing: border-box;
    display: grid;
    align-content: center;
    gap: 1mm;
    padding: 2.5mm 3mm;
    border: 1px solid #dbe1e8;
    border-radius: 2mm;
}

.protocol-material-summary span {
    color: #778294;
    font-size: 6.5px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.protocol-material-summary strong {
    color: #263649;
    font-size: 8.5px;
    line-height: 1.25;
}

.protocol-summary-main,
.protocol-summary-wide {
    grid-column: span 2;
}

.protocol-summary-full {
    grid-column: 1 / -1;
}

.protocol-summary-main strong {
    font-size: 11px;
}

.protocol-receiver {
    margin-top: 6mm;
    padding-top: 4mm;
    border-top: 1px solid #cbd4df;
}

.protocol-receiver h2,
.protocol-label-heading h2 {
    margin: 0;
    font-size: 11px;
}

.protocol-signature-grid {
    display: grid;
    grid-template-columns: 1fr 45mm;
    gap: 7mm;
    margin-top: 8mm;
}

.protocol-signature-field,
.protocol-date-field {
    min-height: 12mm;
    display: flex;
    align-items: flex-end;
    padding-bottom: 1.5mm;
    border-bottom: 1px solid #263649;
}

.protocol-signature-field span,
.protocol-date-field span {
    color: #697587;
    font-size: 7px;
    font-weight: 700;
}

.protocol-label-section {
    margin-top: 8mm;
    padding-top: 5mm;
    border-top: 1.5px solid #263649;
}

.protocol-label-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10mm;
    margin-bottom: 4mm;
}

.protocol-label-heading p {
    margin: 1mm 0 0;
    color: #758194;
    font-size: 7px;
}

.protocol-label-heading > span {
    color: #758194;
    font-size: 7px;
    font-weight: 800;
}

.protocol-label-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3mm;
}

.protocol-class-label {
    box-sizing: border-box;
    min-height: 36mm;
    display: grid;
    grid-template-rows: auto 1fr auto;
    align-items: center;
    padding: 3mm;
    border: 1.2px solid #27384c;
    border-radius: 2mm;
    text-align: center;
    break-inside: avoid;
    page-break-inside: avoid;
}

.protocol-label-series {
    font-size: 10px;
    font-weight: 800;
}

.protocol-label-class {
    align-self: center;
    font-size: 25px;
    font-weight: 900;
    line-height: 1;
}

.protocol-label-copies {
    font-size: 11px;
    font-weight: 800;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 0;
    }

    html,
    body.protocol-body {
        width: 210mm;
        margin: 0;
        padding: 0;
        background: #fff;
    }

    .no-print {
        display: none !important;
    }

    .production-protocol-modal {
        min-height: 0;
        padding: 0;
    }

    .production-protocol-sheet {
        width: 210mm;
        min-height: 297mm;
        margin: 0;
        padding: 9mm 10mm;
        box-shadow: none;
    }

    .protocol-class-label {
        min-height: 35mm;
    }
}

@media screen and (max-width: 900px) {
    .production-protocol-modal {
        overflow-x: auto;
    }
}


/* ============================================================
   FASE 9.1.1 - PROTOCOLO MAIS MODERNO + ETIQUETAS EM UMA LINHA
   ============================================================ */

/* Cabeçalho mais limpo e contemporâneo */
.protocol-print-header {
    align-items: center;
    padding-bottom: 5mm;
    border-bottom: 0;
    position: relative;
}

.protocol-print-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1.5px;
    background: linear-gradient(
        90deg,
        #2a5f8d 0%,
        #6f8eaa 45%,
        #dfe5eb 100%
    );
}

.protocol-brand {
    margin-bottom: 1.2mm;
    color: #2a5f8d;
    font-size: 9px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.protocol-print-header h1 {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.015em;
}

.protocol-print-header p {
    font-size: 8px;
}

.protocol-os-code {
    min-width: 38mm;
    padding: 3.2mm 4mm;
    border: 1px solid #d9e0e7;
    border-radius: 3mm;
    background: #f7f9fb;
    box-shadow: inset 0 0 0 1px #fff;
}

.protocol-os-code strong {
    color: #1e3852;
    font-size: 17px;
}

/* Bloco das informações essenciais */
.protocol-material-summary {
    gap: 2mm;
    margin-top: 4mm;
    padding: 3mm;
    border: 1px solid #e0e6ed;
    border-radius: 3mm;
    background: #f8fafc;
}

.protocol-material-summary > div {
    min-height: 11mm;
    padding: 2.2mm 2.7mm;
    border: 1px solid #e1e6ec;
    border-radius: 2.2mm;
    background: #fff;
}

.protocol-material-summary > div:hover {
    background: #fff;
}

.protocol-material-summary span {
    color: #7f8a99;
    font-size: 6px;
    letter-spacing: .06em;
}

.protocol-material-summary strong {
    color: #223449;
    font-size: 8px;
}

.protocol-summary-main {
    background:
        linear-gradient(
            135deg,
            #f8fbfe 0%,
            #ffffff 100%
        ) !important;
    border-color: #cfdcea !important;
}

.protocol-summary-main strong {
    color: #1f4f78;
    font-size: 10.5px;
}

.protocol-summary-wide strong,
.protocol-summary-full strong {
    font-weight: 750;
}

/* Recebimento mais organizado */
.protocol-receiver {
    margin-top: 5mm;
    padding: 4mm 3mm 0;
    border-top: 1px solid #d6dde5;
    border-radius: 2mm 2mm 0 0;
}

.protocol-receiver h2 {
    color: #26384d;
    font-size: 10px;
    font-weight: 800;
}

.protocol-signature-grid {
    margin-top: 6mm;
}

/* Separação */
.protocol-label-section {
    margin-top: 6mm;
    padding-top: 4mm;
    border-top: 1px solid #d3dbe4;
}

.protocol-label-heading {
    margin-bottom: 3mm;
}

.protocol-label-heading h2 {
    color: #26384d;
    font-size: 10px;
    font-weight: 800;
}

/*
 * ETIQUETAS:
 * ficam lado a lado em uma única linha.
 * Caso existam muitas, a largura é dividida igualmente.
 */
.protocol-label-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 2.2mm;
    width: 100%;
}

.protocol-class-label {
    flex: 1 1 0;
    min-width: 0;
    min-height: 34mm;
    padding: 2.5mm 2mm;
    border: 1.2px solid #2e4055;
    border-radius: 2.2mm;
    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #f9fbfc 100%
        );
}

.protocol-label-series {
    color: #526175;
    font-size: 8px;
    font-weight: 800;
}

.protocol-label-class {
    color: #172c42;
    font-size: 21px;
    font-weight: 900;
}

.protocol-label-copies {
    color: #2e4055;
    font-size: 9px;
    font-weight: 800;
}

/* Ajuste automático se houver muitas etiquetas */
.protocol-label-grid:has(.protocol-class-label:nth-child(6)) .protocol-label-series {
    font-size: 7px;
}

.protocol-label-grid:has(.protocol-class-label:nth-child(6)) .protocol-label-class {
    font-size: 18px;
}

.protocol-label-grid:has(.protocol-class-label:nth-child(6)) .protocol-label-copies {
    font-size: 8px;
}

@media print {
    .production-protocol-sheet {
        padding: 8mm 9mm;
    }

    .protocol-material-summary {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .protocol-label-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        width: 100%;
    }

    .protocol-class-label {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        min-height: 32mm;
    }
}


/* ============================================================
   FASE 9.1.2 - PROTOCOLO NO MODELO DE REFERÊNCIA
   ============================================================ */

.production-protocol-sheet {
    padding: 9mm 10mm 10mm;
    color: #18263a;
}

.protocol-print-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8mm;
    padding-bottom: 4.5mm;
}

.protocol-title-wrap {
    display: flex;
    align-items: center;
    gap: 3.2mm;
}

.protocol-logo-mark {
    width: 11mm;
    height: 11mm;
    display: grid;
    place-items: center;
    border-radius: 2.5mm;
    background: #245eab;
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    box-shadow: 0 1mm 2.5mm rgba(36, 94, 171, .16);
}

.protocol-brand {
    margin: 0 0 .7mm;
    color: #243a5a;
    font-size: 7px;
    font-weight: 900;
    letter-spacing: .06em;
}

.protocol-print-header h1 {
    margin: 0;
    color: #14243a;
    font-size: 15px;
    font-weight: 850;
    letter-spacing: -.02em;
}

.protocol-print-header p {
    margin: 1mm 0 0;
    color: #65758a;
    font-size: 7.5px;
}

.protocol-print-header::after {
    background: #d9e1ea;
    height: 1px;
}

.protocol-os-code {
    min-width: 36mm;
    padding: 3mm 4mm;
    border: 1px solid #d3dce7;
    border-radius: 3mm;
    background: #fff;
    box-shadow: 0 .6mm 2mm rgba(23, 40, 61, .04);
}

.protocol-os-code span {
    color: #6e7c8f;
    font-size: 6px;
}

.protocol-os-code strong {
    color: #172743;
    font-size: 16px;
    font-weight: 900;
}

/* Grade dos dados - 3 colunas como a referência */
.protocol-material-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2mm;
    margin-top: 4mm;
    padding: 3mm;
    border: 1px solid #dde5ed;
    border-radius: 3mm;
    background: #fbfcfd;
}

.protocol-material-summary > div,
.protocol-info-card {
    min-height: 12mm;
    display: grid;
    align-content: center;
    gap: 1mm;
    padding: 2.4mm 3mm;
    border: 1px solid #dfe6ee;
    border-radius: 2mm;
    background: #fff;
    box-shadow: 0 .35mm 1.2mm rgba(29, 46, 67, .025);
}

.protocol-info-card span {
    color: #6b798c;
    font-size: 5.8px;
    font-weight: 850;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.protocol-info-card strong {
    color: #1d2d42;
    font-size: 8.2px;
    font-weight: 720;
    line-height: 1.25;
}

.protocol-info-wide {
    grid-column: span 1;
}

.protocol-info-full {
    grid-column: 1 / -1;
}

/* Seções Produção / Recebimento */
.protocol-production,
.protocol-receiver {
    margin-top: 5mm;
    padding-top: 4mm;
    border-top: 1px solid #d6dee8;
}

.protocol-section-title {
    display: flex;
    align-items: center;
    gap: 2mm;
    margin-bottom: 3mm;
}

.protocol-section-title h2 {
    margin: 0;
    color: #22599e;
    font-size: 9.5px;
    font-weight: 850;
}

.protocol-section-icon {
    color: #2562ad;
    font-size: 8px;
}

.protocol-production-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1.8mm;
}

.protocol-production-grid > div {
    min-height: 14mm;
    display: grid;
    align-content: center;
    gap: 1mm;
    padding: 2mm 2.2mm;
    border: 1px solid #dce5ef;
    border-radius: 1.8mm;
    background: #f8fbfe;
    text-align: center;
}

.protocol-production-grid span {
    color: #2b5f9e;
    font-size: 5.2px;
    font-weight: 850;
    letter-spacing: .025em;
    text-transform: uppercase;
}

.protocol-production-grid strong {
    color: #1c2d42;
    font-size: 7px;
    font-weight: 720;
    line-height: 1.25;
}

.protocol-receiver {
    border-top: 0;
}

.protocol-signature-grid {
    grid-template-columns: 1fr 45mm;
    gap: 10mm;
    margin-top: 5mm;
}

.protocol-signature-field,
.protocol-date-field {
    min-height: 11mm;
    padding: 0 1mm 1.5mm;
    border-bottom: 1px solid #25374d;
}

.protocol-date-field {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.protocol-date-field strong {
    color: #33465c;
    font-size: 7px;
    font-weight: 500;
}

.protocol-cut-line {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3mm;
    margin: 6mm 0 4mm;
    color: #394b60;
    font-size: 7px;
    font-weight: 700;
}

.protocol-cut-line::before,
.protocol-cut-line::after {
    content: "";
    flex: 1;
    border-top: 1px dashed #818d9b;
}

.protocol-cut-line > span {
    font-size: 12px;
}

.protocol-cut-line > strong {
    white-space: nowrap;
    font-weight: 700;
}

/* Etiquetas: uma única linha, contorno pontilhado e grande destaque da turma */
.protocol-label-section {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.protocol-label-heading {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 2mm;
}

.protocol-label-heading > span {
    color: #6f7d8e;
    font-size: 5.8px;
    font-weight: 750;
}

.protocol-label-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 3mm;
    width: 100%;
}

.protocol-class-label {
    flex: 1 1 0;
    min-width: 0;
    min-height: 39mm;
    display: grid;
    grid-template-rows: auto 1fr auto;
    align-items: center;
    padding: 3.2mm 2mm;
    border: 1px dashed #4e5967;
    border-radius: 2.6mm;
    background: #fff;
    text-align: center;
}

.protocol-label-series {
    color: #252f3b;
    font-size: 9px;
    font-weight: 850;
}

.protocol-label-class {
    position: relative;
    align-self: center;
    color: #111820;
    font-size: 29px;
    font-weight: 950;
    line-height: 1;
}

.protocol-label-class::after {
    content: "";
    display: block;
    width: 12mm;
    margin: 2mm auto 0;
    border-bottom: 1px solid #1d2732;
}

.protocol-label-copies {
    color: #1f2935;
    font-size: 9px;
    font-weight: 850;
}

.protocol-label-grid:has(.protocol-class-label:nth-child(6)) .protocol-label-class {
    font-size: 23px;
}

.protocol-label-grid:has(.protocol-class-label:nth-child(7)) .protocol-label-series,
.protocol-label-grid:has(.protocol-class-label:nth-child(7)) .protocol-label-copies {
    font-size: 7px;
}

.protocol-label-grid:has(.protocol-class-label:nth-child(7)) .protocol-label-class {
    font-size: 20px;
}

@media print {
    .production-protocol-sheet {
        padding: 8mm 9mm;
    }

    .protocol-material-summary,
    .protocol-production,
    .protocol-receiver,
    .protocol-label-section {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .protocol-label-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
    }

    .protocol-class-label {
        min-height: 38mm;
        flex: 1 1 0 !important;
    }
}


/* ============================================================
   FASE 9.1.3 - ÍCONES VETORIAIS NO PROTOCOLO
   ============================================================ */

.protocol-info-card {
    grid-template-columns: 9mm minmax(0, 1fr);
    align-items: center;
    column-gap: 2.5mm;
}

.protocol-info-card > div {
    min-width: 0;
    display: grid;
    gap: 1mm;
}

.protocol-card-icon {
    width: 7mm;
    height: 7mm;
    display: grid;
    place-items: center;
    color: #2765b3;
}

.protocol-card-icon svg,
.protocol-section-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.protocol-info-card > div > span {
    color: #6b798c;
    font-size: 5.8px;
    font-weight: 850;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.protocol-info-card > div > strong {
    color: #1d2d42;
    font-size: 8.2px;
    font-weight: 720;
    line-height: 1.25;
}

.protocol-section-icon {
    width: 5mm;
    height: 5mm;
    display: inline-grid;
    place-items: center;
    color: #2562ad;
    flex: 0 0 auto;
}

@media print {
    .protocol-card-icon,
    .protocol-section-icon {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ============================================================
   FASE 9.1.4 - AJUSTE DO BOTAO VOLTAR DO PROTOCOLO
   ============================================================ */
.production-protocol-toolbar-actions .btn {
    min-height: 34px;
    padding: 7px 13px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    box-shadow: none;
}

.production-protocol-toolbar-actions .btn-primary {
    min-width: 72px;
    border: 1px solid #c9d6e5;
    background: #f7f9fc;
    color: #173b67;
    box-shadow: 0 1px 2px rgba(19, 48, 82, .05);
}

.production-protocol-toolbar-actions .btn-primary:hover {
    border-color: #9fb6cf;
    background: #edf3f9;
    color: #0f3159;
    transform: none;
    box-shadow: 0 1px 3px rgba(19, 48, 82, .08);
}

.production-protocol-toolbar-actions .btn-primary:focus-visible {
    outline: 2px solid rgba(37, 98, 173, .22);
    outline-offset: 2px;
}


/* ============================================================
   FASE 9.2 - ATALHO DE PROTOCOLO NA LISTA DE O.S.
   ============================================================ */

.os-actions-unit-cell {
    position: relative;
}

.graphic-protocol-button {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 25px;
    height: 25px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #d6e0ea;
    border-radius: 6px;
    background: #fff;
    color: #38678f;
    box-shadow: 0 1px 2px rgba(25, 43, 62, .06);
    text-decoration: none;
    transition:
        background .15s ease,
        border-color .15s ease,
        color .15s ease,
        box-shadow .15s ease,
        transform .15s ease;
    z-index: 2;
}

.graphic-protocol-button svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.graphic-protocol-button:hover {
    border-color: #aac1d5;
    background: #f3f8fc;
    color: #245a86;
    box-shadow: 0 2px 5px rgba(36, 90, 134, .12);
    transform: translateY(-1px);
}

.graphic-protocol-button:focus-visible {
    outline: 2px solid rgba(42, 95, 141, .25);
    outline-offset: 2px;
}

/* Evita que o atalho sobreponha o botão/status principal da unidade. */
.os-actions-unit-cell > .graphic-action-form,
.os-actions-unit-cell > .graphic-workflow-button,
.os-actions-unit-cell > .graphic-action-done,
.os-actions-unit-cell > .graphic-action-waiting,
.os-actions-unit-cell > .graphic-print-form {
    margin-right: 30px;
}


/* ============================================================
   FASE 9.2.1 - PROTOCOLO EM COLUNA ÚNICA
   ============================================================ */

.os-protocol-column {
    width: 38px;
    min-width: 38px;
    padding-left: 4px !important;
    padding-right: 4px !important;
}

.os-protocol-cell {
    position: relative;
    width: 38px;
    min-width: 38px;
    padding-left: 4px !important;
    padding-right: 4px !important;
    text-align: center;
    overflow: visible;
}

.os-protocol-icon-button,
.os-protocol-icon-disabled {
    width: 25px;
    height: 25px;
    margin: 0 auto;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid #d7e0e8;
    border-radius: 6px;
    background: #fff;
    color: #5c7c98;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(24, 39, 58, .04);
}

button.os-protocol-icon-button {
    cursor: pointer;
}

.os-protocol-icon-button svg,
.os-protocol-icon-disabled svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.os-protocol-icon-button:hover {
    border-color: #aebfce;
    background: #f7fafc;
    color: #355f82;
}

.os-protocol-icon-disabled {
    opacity: .28;
}

.os-protocol-picker {
    position: relative;
    display: inline-block;
}

.os-protocol-picker-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 50%;
    z-index: 40;
    min-width: 165px;
    padding: 6px;
    transform: translateX(-50%);
    border: 1px solid #dbe2ea;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(27, 44, 64, .14);
    text-align: left;
}

.os-protocol-picker-menu > span {
    display: block;
    padding: 4px 7px 6px;
    color: #7a8695;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.os-protocol-picker-menu a {
    display: block;
    padding: 7px 8px;
    border-radius: 5px;
    color: #293b50;
    font-size: 9px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.os-protocol-picker-menu a:hover {
    background: #f1f5f8;
    color: #245a86;
}

/* Anula o posicionamento usado na primeira versão do atalho. */
.os-actions-unit-cell > .graphic-action-form,
.os-actions-unit-cell > .graphic-workflow-button,
.os-actions-unit-cell > .graphic-action-done,
.os-actions-unit-cell > .graphic-action-waiting,
.os-actions-unit-cell > .graphic-print-form {
    margin-right: 0;
}


/* ============================================================
   FASE 9.2.3 - BOTÃO VOLTAR CONSISTENTE COM O MGRAF
   ============================================================ */

.production-protocol-toolbar-actions {
    align-items: center;
}

/*
 * O Voltar passa a seguir o mesmo padrão visual dos botões principais
 * do PrintFlow: azul institucional, altura compacta e bordas de sistema.
 */
.protocol-back-button {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #173f69;
    border-radius: 6px;
    background: #173f69;
    color: #fff;
    box-shadow: 0 1px 2px rgba(18, 48, 79, .16);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition:
        background .15s ease,
        border-color .15s ease,
        box-shadow .15s ease,
        transform .15s ease;
}

.protocol-back-button svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.protocol-back-button:hover {
    border-color: #0f3459;
    background: #0f3459;
    color: #fff;
    box-shadow: 0 3px 8px rgba(15, 52, 89, .18);
    transform: translateY(-1px);
}

.protocol-back-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(15, 52, 89, .14);
}

.protocol-back-button:focus-visible {
    outline: 2px solid rgba(38, 100, 167, .28);
    outline-offset: 2px;
}

/*
 * O botão de reimpressão permanece secundário, mas recebe a mesma
 * altura e geometria do botão Voltar para a barra ficar alinhada.
 */
.production-protocol-toolbar-actions .btn-secondary {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}


/* ============================================================
   FASE 9.3 - MINHA CONTA / PREFERÊNCIAS DO PROTOCOLO
   ============================================================ */

.account-page {
    display: grid;
    gap: 16px;
}

.account-heading {
    margin-bottom: 0;
}

.account-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr);
    gap: 16px;
    align-items: start;
}

.account-panel {
    overflow: hidden;
}

.account-form,
.account-password-form {
    padding: 0 16px 16px;
}

.account-protocol-note,
.account-security-note {
    padding: 10px 12px;
    border: 1px solid #dfe6ee;
    border-radius: 8px;
    background: #f7f9fb;
    color: #6c7888;
    font-size: 9px;
    line-height: 1.5;
}

.account-protocol-note strong {
    color: #2b4056;
}

.account-unit-preferences {
    display: grid;
    gap: 12px;
    margin-top: 13px;
}

.account-unit-preference {
    padding: 12px;
    border: 1px solid #e0e6ed;
    border-radius: 10px;
    background: #fff;
}

.account-unit-name {
    display: grid;
    gap: 2px;
    margin-bottom: 9px;
}

.account-unit-name span {
    color: #8290a0;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.account-unit-name strong {
    color: #22354a;
    font-size: 11px;
}

.account-protocol-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

.account-protocol-option {
    position: relative;
    cursor: pointer;
}

.account-protocol-option > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.account-protocol-option-ui {
    min-height: 74px;
    display: grid;
    align-content: center;
    gap: 4px;
    padding: 9px 10px;
    border: 1px solid #dce3eb;
    border-radius: 8px;
    background: #fafbfc;
    transition:
        border-color .15s ease,
        background .15s ease,
        box-shadow .15s ease;
}

.account-protocol-option-ui strong {
    color: #34475b;
    font-size: 9px;
}

.account-protocol-option-ui small {
    color: #7a8797;
    font-size: 8px;
    line-height: 1.4;
}

.account-protocol-option:hover .account-protocol-option-ui {
    border-color: #b9c9d8;
    background: #f7fafc;
}

.account-protocol-option > input:checked + .account-protocol-option-ui {
    border-color: #7ba4c8;
    background: #eef6fc;
    box-shadow: inset 3px 0 0 #2d6594;
}

.account-protocol-option > input:checked + .account-protocol-option-ui strong {
    color: #1f567f;
}

.account-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 13px;
}

.account-password-panel .field + .field {
    margin-top: 2px;
}

.account-security-note {
    margin-top: 2px;
}

@media (max-width: 1050px) {
    .account-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .account-protocol-options {
        grid-template-columns: 1fr;
    }

    .account-protocol-option-ui {
        min-height: 58px;
    }
}


/* ============================================================
   FASE 10.1 - CONFIGURAÇÃO DE E-MAIL AUTOMÁTICO
   ============================================================ */

.email-config-page {
    display: grid;
    gap: 16px;
}

.email-config-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr);
    gap: 16px;
    align-items: start;
}

.email-config-panel,
.email-test-panel {
    padding: 17px;
}

.email-config-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 13px;
    border-bottom: 1px solid #e4e9ef;
}

.email-config-section-head h3,
.email-test-panel h3 {
    margin: 0 0 4px;
    color: #263649;
    font-size: 13px;
}

.email-config-section-head p,
.email-test-panel p {
    margin: 0;
    color: #7b8796;
    font-size: 9px;
    line-height: 1.45;
}

.email-active-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 9px;
    border: 1px solid #d9e3eb;
    border-radius: 7px;
    background: #f8fafc;
    color: #3c4f64;
    font-size: 9px;
    font-weight: 800;
    white-space: nowrap;
}

.email-active-toggle input {
    width: 15px;
    height: 15px;
}

.email-config-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 3px;
}

.email-rule-box {
    margin-top: 5px;
    padding: 11px 12px;
    border: 1px solid #dbe5ee;
    border-radius: 8px;
    background: #f5f9fc;
}

.email-rule-box > strong {
    display: block;
    margin-bottom: 5px;
    color: #2b5f8c;
    font-size: 9px;
}

.email-rule-box p {
    color: #647487;
    font-size: 9px;
}

@media (max-width: 950px) {
    .email-config-layout {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   FASE 10.1.1 - DIAGNÓSTICO SMTP
   ============================================================ */

.email-config-actions {
    gap: 7px;
}

.email-side-stack {
    display: grid;
    gap: 16px;
}

.email-diagnostic-panel {
    padding: 15px;
}

.email-diagnostic-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    padding-bottom: 11px;
    border-bottom: 1px solid #e4e9ef;
}

.email-diagnostic-head h3 {
    margin: 0 0 3px;
    color: #263649;
    font-size: 12px;
}

.email-diagnostic-head p {
    margin: 0;
    color: #7b8796;
    font-size: 8px;
    line-height: 1.4;
}

.email-diagnostic-summary {
    display: inline-flex;
    padding: 5px 7px;
    border-radius: 999px;
    font-size: 7px;
    font-weight: 800;
    white-space: nowrap;
}

.email-diagnostic-summary.is-ok {
    border: 1px solid #b8dfc7;
    background: #ebf7f0;
    color: #286748;
}

.email-diagnostic-summary.is-error {
    border: 1px solid #efc1c1;
    background: #fdf0f0;
    color: #9b3b3b;
}

.email-diagnostic-steps {
    display: grid;
    gap: 7px;
    margin-top: 10px;
}

.email-diagnostic-step {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    padding: 8px;
    border: 1px solid #e1e7ed;
    border-radius: 7px;
    background: #fafbfd;
}

.email-diagnostic-status {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 900;
}

.email-diagnostic-step strong {
    display: block;
    margin-bottom: 2px;
    color: #33465b;
    font-size: 8px;
}

.email-diagnostic-step p {
    margin: 0;
    color: #6f7d8d;
    font-size: 7px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.email-diagnostic-step.status-ok .email-diagnostic-status {
    background: #e7f6ee;
    color: #23724a;
}

.email-diagnostic-step.status-erro .email-diagnostic-status {
    background: #fdeaea;
    color: #a23b3b;
}

.email-diagnostic-step.status-info .email-diagnostic-status {
    background: #edf3f8;
    color: #476781;
}


/* ============================================================
   FASE 11.2 - BOTÃO CÓPIA P/ REVISÃO
   ============================================================ */

.graphic-review-copy-button {
    min-width: 142px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 6px 10px;
    border: 1px solid #2e6e9e;
    border-radius: 6px;
    background: #2f6f9f;
    color: #fff;
    box-shadow: 0 1px 2px rgba(30, 75, 109, .14);
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.graphic-review-copy-button:hover {
    border-color: #255b83;
    background: #255f8b;
    color: #fff;
    transform: translateY(-1px);
}

.graphic-review-copy-button:active {
    transform: translateY(0);
}

.graphic-review-copy-icon {
    width: 14px;
    height: 14px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 14px;
}

.graphic-review-copy-icon svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* ============================================================
   FASE 11.2.1 - ÍCONES NOS BOTÕES / STATUS DA GRÁFICA
   ============================================================ */

.graphic-system-icon,
.graphic-status-icon {
    width: 14px;
    height: 14px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 14px;
}

.graphic-system-icon svg,
.graphic-status-icon svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.graphic-workflow-button,
.graphic-action-done,
.graphic-action-waiting {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.graphic-workflow-receive .graphic-system-icon {
    color: currentColor;
}

.graphic-workflow-print .graphic-system-icon {
    color: currentColor;
}

.graphic-workflow-deliver .graphic-system-icon {
    color: currentColor;
}

.graphic-action-completed .graphic-status-icon {
    color: #2e8b57;
}

.graphic-action-authorization .graphic-status-icon {
    color: #b47a10;
}


/* ============================================================
   FASE 11.2.2 - ÍCONES NOS DEMAIS NÍVEIS DE USUÁRIO
   ============================================================ */

.workflow-system-icon,
.workflow-status-icon {
    width: 14px;
    height: 14px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 14px;
}

.workflow-system-icon svg,
.workflow-status-icon svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.typing-workflow-button,
.os-authorize-list-button,
.os-duplicate-button,
.os-authorized-list-label,
.typing-action-done,
.os-new-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.typing-action-done .workflow-status-icon {
    color: #2e8b57;
}

.os-authorized-list-label .workflow-status-icon {
    color: #2e8b57;
}

.os-duplicate-button .workflow-system-icon {
    color: #526f89;
}

.os-new-button .workflow-system-icon {
    width: 15px;
    height: 15px;
    flex-basis: 15px;
}

.os-new-button .workflow-system-icon svg {
    width: 15px;
    height: 15px;
}


/* ============================================================
   FASE 11.2.3 - ANIMAÇÃO DE CARREGAMENTO / AUTORIZAR
   ============================================================ */

.os-authorize-list-button.is-loading {
    min-width: 105px;
    cursor: wait;
    opacity: .92;
}

.button-loading-spinner {
    width: 12px;
    height: 12px;
    display: inline-block;
    flex: 0 0 12px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mgraf-button-spin .7s linear infinite;
}

@keyframes mgraf-button-spin {
    to {
        transform: rotate(360deg);
    }
}


/* ============================================================
   FASE 11.2.4 - POPUP AUTORIZAÇÃO SEM CÓPIA DE REVISÃO
   ============================================================ */

.has-system-modal-open {
    overflow: hidden;
}

.review-authorization-modal[hidden] {
    display: none !important;
}

.review-authorization-modal {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: grid;
    place-items: center;
    padding: 18px;
}

.review-authorization-modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(18, 31, 46, .46);
    backdrop-filter: blur(1.5px);
    cursor: default;
}

.review-authorization-modal-card {
    position: relative;
    z-index: 1;
    width: min(430px, 100%);
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 13px;
    padding: 18px;
    border: 1px solid #dfe5eb;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 20px 55px rgba(21, 40, 61, .24);
}

.review-authorization-modal-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid #efd39c;
    border-radius: 9px;
    background: #fff8e9;
    color: #b97812;
}

.review-authorization-modal-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.review-authorization-modal-content h3 {
    margin: 1px 0 7px;
    color: #24374b;
    font-size: 13px;
    line-height: 1.25;
}

.review-authorization-modal-content > p {
    margin: 0;
    color: #5f7082;
    font-size: 9px;
    line-height: 1.55;
}

.review-authorization-warning {
    margin-top: 11px;
    padding: 9px 10px;
    border: 1px solid #f0d9aa;
    border-radius: 7px;
    background: #fffaf0;
    color: #76531e;
    font-size: 9px;
    font-weight: 600;
    line-height: 1.45;
}

.review-authorization-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 7px;
    margin-top: 15px;
}

.review-authorization-confirm-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}


/* ============================================================
   FASE 12.1 - CADASTRO DE UNIDADES
   ============================================================ */

.unit-register-table .table-secondary {
    display: block;
    margin-top: 3px;
    color: #8290a0;
    font-size: 8px;
    line-height: 1.35;
}

.unit-register-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.unit-remove-link {
    color: #a64b4b;
}

.unit-remove-link:hover {
    color: #843737;
}

.unit-register-note {
    margin: 11px 13px 0;
    padding: 9px 10px;
    border: 1px solid #dfe6ed;
    border-radius: 7px;
    background: #f8fafc;
    color: #718092;
    font-size: 8px;
    line-height: 1.45;
}

.unit-register-note strong {
    color: #42556a;
}

.unit-form-section {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid #e1e7ed;
    border-radius: 8px;
    background: #fafbfd;
}

.unit-address-grid {
    grid-template-columns: .65fr 2fr .55fr;
}

.unit-city-grid {
    grid-template-columns: 1fr 100px;
}

.unit-register-form textarea {
    resize: vertical;
    min-height: 68px;
}

.unit-remove-confirm {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
}

.unit-remove-confirm-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid #efcccc;
    border-radius: 9px;
    background: #fff3f3;
    color: #a74747;
}

.unit-remove-confirm-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.unit-remove-warning,
.unit-remove-confirm-actions {
    grid-column: 1 / -1;
}

.unit-remove-warning {
    padding: 10px;
    border: 1px solid #ecd8b5;
    border-radius: 7px;
    background: #fffaf1;
    color: #745824;
    font-size: 9px;
    line-height: 1.45;
}

.unit-remove-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 7px;
}

.btn-danger {
    border-color: #a94d4d;
    background: #a94d4d;
    color: #fff;
}

.btn-danger:hover {
    border-color: #8f3f3f;
    background: #8f3f3f;
    color: #fff;
}

@media (max-width: 850px) {
    .unit-address-grid,
    .unit-city-grid {
        grid-template-columns: 1fr;
    }

    .unit-register-actions {
        flex-wrap: wrap;
    }
}


/* FASE 12.2 - Logomarca das unidades */
.unit-logo-section{display:grid;gap:10px;padding:12px;border:1px solid #e1e7ed;border-radius:8px;background:#fafbfd}
.unit-logo-upload-row{display:grid;grid-template-columns:118px minmax(0,1fr);gap:12px;align-items:center}
.unit-logo-preview{width:118px;height:78px;display:grid;place-items:center;overflow:hidden;border:1px dashed #cdd7e1;border-radius:8px;background:#fff;color:#8a97a6;font-size:8px;text-align:center}
.unit-logo-preview img{width:100%;height:100%;display:block;object-fit:contain;padding:6px;box-sizing:border-box}
.unit-logo-file-field{margin:0}
.unit-logo-file-field input[type=file]{padding:7px;background:#fff}
.protocol-unit-logo{width:46px;height:46px;display:grid;place-items:center;flex:0 0 46px}
.protocol-unit-logo img{display:block;max-width:46px;max-height:46px;width:auto;height:auto;object-fit:contain}
@media(max-width:700px){.unit-logo-upload-row{grid-template-columns:1fr}}
@media print{.protocol-unit-logo{width:46px;height:46px;flex-basis:46px}.protocol-unit-logo img{max-width:46px;max-height:46px}}


/* FASE 12.3 - Ações da listagem de unidades */
.unit-list-action,
[data-edit-unit],
[data-remove-unit]{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    min-height:30px;
    padding:5px 9px;
    border:1px solid #d8e0e8;
    border-radius:6px;
    background:#fff;
    box-shadow:0 1px 2px rgba(15, 35, 55, .04);
    font-size:12px;
    font-weight:600;
    line-height:1;
    text-decoration:none;
    white-space:nowrap;
    transition:border-color .15s ease, background-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.unit-list-action-edit,
[data-edit-unit]{
    color:#1c4f7d;
}
.unit-list-action-edit:hover,
[data-edit-unit]:hover{
    color:#123f69;
    border-color:#b8ccdf;
    background:#f5f9fc;
    box-shadow:0 2px 5px rgba(25, 68, 105, .08);
}
.unit-list-action-remove,
[data-remove-unit]{
    color:#b33b3b;
    border-color:#ead6d6;
}
.unit-list-action-remove:hover,
[data-remove-unit]:hover{
    color:#9c2929;
    border-color:#dfbcbc;
    background:#fff7f7;
    box-shadow:0 2px 5px rgba(150, 45, 45, .07);
}
.unit-list-action:active,
[data-edit-unit]:active,
[data-remove-unit]:active{
    transform:translateY(1px);
    box-shadow:none;
}
.system-action-icon{
    width:14px;
    height:14px;
    flex:0 0 14px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.8;
    stroke-linecap:round;
    stroke-linejoin:round;
}


/* ============================================================
   FASE 12.3.1 - HOTFIX VISUAL DAS AÇÕES DE UNIDADES
   ============================================================ */

.unit-register-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    white-space: nowrap;
}

.unit-list-action {
    min-width: 76px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 9px;
    border: 1px solid #d8e1ea;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(24, 48, 72, .05);
    font: inherit;
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition:
        background .15s ease,
        border-color .15s ease,
        color .15s ease,
        box-shadow .15s ease,
        transform .15s ease;
}

.unit-list-action-edit {
    color: #245f91;
}

.unit-list-action-edit:hover {
    border-color: #b7cee1;
    background: #f3f8fc;
    color: #164c79;
    box-shadow: 0 2px 5px rgba(36, 95, 145, .10);
}

.unit-list-action-remove {
    border-color: #ebd0d0;
    color: #b04444;
}

.unit-list-action-remove:hover {
    border-color: #deb6b6;
    background: #fff5f5;
    color: #943333;
    box-shadow: 0 2px 5px rgba(176, 68, 68, .09);
}

.unit-list-action:active {
    transform: translateY(1px);
    box-shadow: none;
}

.unit-list-action-icon {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* ============================================================
   FASE 12.4 - AÇÕES PADRONIZADAS NOS DEMAIS CADASTROS
   ============================================================ */

.cadastro-list-action {
    min-width: 76px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 9px;
    border: 1px solid #d8e1ea;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(24, 48, 72, .05);
    color: #245f91;
    font: inherit;
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    transition:
        background .15s ease,
        border-color .15s ease,
        color .15s ease,
        box-shadow .15s ease,
        transform .15s ease;
}

.cadastro-list-action:hover {
    border-color: #b7cee1;
    background: #f3f8fc;
    color: #164c79;
    box-shadow: 0 2px 5px rgba(36, 95, 145, .10);
}

.cadastro-list-action:active {
    transform: translateY(1px);
    box-shadow: none;
}

.cadastro-list-action-icon {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.actions-cell {
    white-space: nowrap;
}


/* ============================================================
   FASE 12.5 - ALUNOS ESPECIAIS POR TIPO DE MATERIAL
   ============================================================ */

.material-special-students-section {
    display: grid;
    gap: 8px;
    padding: 11px 12px;
    border: 1px solid #e1e7ed;
    border-radius: 8px;
    background: #f9fbfd;
}

.material-special-students-section .switch-line {
    margin: 0;
}

.material-special-students-section .field-help {
    margin-top: 0;
    color: #7a8898;
}


/* FASE 12.6 - Quantidade personalizada */
.material-custom-quantity-section{display:grid;gap:8px;padding:11px 12px;border:1px solid #e1e7ed;border-radius:8px;background:#f9fbfd}
.material-custom-quantity-section .switch-line{margin:0}
.quantity-card-total{display:flex;align-items:center;justify-content:flex-end;gap:8px}
.quantity-edit-button{width:29px;height:29px;display:inline-grid;place-items:center;flex:0 0 29px;padding:0;border:1px solid #d5e0e9;border-radius:7px;background:#fff;color:#275f8d;cursor:pointer;box-shadow:0 1px 2px rgba(26,54,80,.05);transition:background .15s ease,border-color .15s ease,color .15s ease,box-shadow .15s ease}
.quantity-edit-button:hover{border-color:#b8cee0;background:#f3f8fc;color:#174b76;box-shadow:0 2px 5px rgba(39,95,141,.10)}
.quantity-edit-button svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.quantity-customized-badge{grid-column:1/-1;justify-self:end;margin-top:-2px;padding:3px 6px;border:1px solid #d6c79f;border-radius:999px;background:#fff9e8;color:#87671a;font-size:7px;font-weight:700;line-height:1}
.os-custom-quantity-modal{width:min(410px,calc(100vw - 32px))}
.custom-quantity-warning{margin-top:9px;padding:9px 10px;border:1px solid #ecd8aa;border-radius:7px;background:#fffaf0;color:#74551c;font-size:9px;line-height:1.45}
.os-custom-quantity-actions{display:flex;justify-content:flex-end;gap:7px;margin-top:14px}


/* ============================================================
   FASE 12.6.3 - LOADING NO BOTÃO CRIAR O.S.
   ============================================================ */

#osSubmitButton.is-loading {
    min-width: 112px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: wait;
    opacity: .94;
}

#osSubmitButton.is-loading .button-loading-spinner {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
}


/* ============================================================
   FASE 12.7 - SOLICITADO POR NA NOVA O.S.
   ============================================================ */

.os-requester-field input {
    background: #fffdf8;
    border-color: #ddd3b7;
}

.os-requester-field input:focus {
    border-color: #bda66f;
    box-shadow: 0 0 0 2px rgba(189, 166, 111, .12);
}

.os-requester-field .field-help {
    color: #7c7054;
}


/* ============================================================
   FASE 12.7.4 - LOADING NO BOTÃO CONCLUIR DA DIGITAÇÃO
   ============================================================ */
.typing-workflow-button.is-loading {
    min-width: 92px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: wait;
    opacity: .94;
}

.typing-workflow-button.is-loading .button-loading-spinner {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
}


/* ============================================================
   FASE 13.2 - CUSTOS DOS EQUIPAMENTOS
   ============================================================ */
.equipment-cost-section{
    display:grid;
    gap:10px;
    padding:12px;
    border:1px solid #dfe7ef;
    border-radius:8px;
    background:#f9fbfd;
}
.equipment-cost-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
}
.money-input-wrap{
    display:flex;
    align-items:center;
    border:1px solid #d7e0e8;
    border-radius:7px;
    background:#fff;
    overflow:hidden;
}
.money-input-wrap>span{
    padding:0 9px;
    color:#6e7d8c;
    font-size:9px;
    font-weight:700;
    border-right:1px solid #e4e9ee;
}
.money-input-wrap input{
    min-width:0;
    width:100%;
    border:0!important;
    box-shadow:none!important;
    border-radius:0!important;
}
.equipment-cost-summary{
    display:grid;
    gap:3px;
    font-size:8px;
    line-height:1.3;
    white-space:nowrap;
}
.equipment-cost-summary span{
    display:flex;
    gap:5px;
    align-items:center;
}
.equipment-cost-summary strong{
    min-width:42px;
    color:#4c6073;
}
@media(max-width:700px){
    .equipment-cost-grid{grid-template-columns:1fr}
}


/* ============================================================
   FASE 13.2.1 - HOTFIX FORMULARIO CUSTOS EQUIPAMENTOS
   ============================================================ */
.equipment-cost-section{display:grid;gap:10px;padding:12px;border:1px solid #dfe7ef;border-radius:8px;background:#f8fbfd}
.equipment-cost-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.equipment-cost-section .scope-title{display:grid;gap:3px}
.equipment-cost-section .scope-title span{color:#718096;font-size:8px;font-weight:400}
@media (max-width:700px){.equipment-cost-grid{grid-template-columns:1fr}}


/* FASE 13.2.2 - custos exibidos conforme capacidade da impressora */
.equipment-cost-grid > .hidden { display:none !important; }


/* ============================================================
   FASE 13.3 - CUSTO REAL DA PRODUÇÃO
   ============================================================ */

.production-cost-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 14px;
    padding: 14px 16px;
    border: 1px solid #d7e1ea;
    border-radius: 10px;
    background: linear-gradient(180deg, #fbfdff 0%, #f5f9fc 100%);
}

.production-cost-summary > div:first-child {
    display: grid;
    gap: 3px;
}

.production-cost-summary span {
    color: #557086;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .035em;
}

.production-cost-summary strong {
    color: #173d61;
}

.production-cost-summary small {
    color: #748596;
}

.production-cost-summary-value {
    min-width: 190px;
    display: grid;
    justify-items: end;
    gap: 2px;
}

.production-cost-summary-value strong {
    font-size: 22px;
    line-height: 1;
}

.unit-production-cost {
    margin-top: 12px;
    padding: 11px;
    border: 1px solid #dce5ed;
    border-radius: 9px;
    background: #f9fbfd;
}

.unit-production-cost-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
}

.unit-production-cost-head > div {
    display: grid;
    gap: 2px;
}

.unit-production-cost-head span {
    color: #64798b;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
}

.unit-production-cost-head strong {
    color: #173e61;
}

.cost-access-badge {
    padding: 4px 7px;
    border: 1px solid #d6e0e8;
    border-radius: 999px;
    background: #fff;
    color: #5b7183 !important;
    font-size: 7px !important;
    white-space: nowrap;
}

.unit-production-cost-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}

.unit-cost-item {
    min-width: 0;
    display: grid;
    gap: 3px;
    padding: 9px;
    border: 1px solid #e1e7ed;
    border-radius: 7px;
    background: #fff;
}

.unit-cost-item > span {
    color: #718292;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
}

.unit-cost-item > strong {
    color: #1c405f;
    font-size: 14px;
}

.unit-cost-item > small {
    color: #7b8a97;
    font-size: 8px;
    line-height: 1.35;
}

.unit-cost-total {
    border-color: #bcd2e3;
    background: #f1f7fb;
}

.unit-cost-total > strong {
    color: #103f68;
    font-size: 16px;
}

@media (max-width: 1050px) {
    .unit-production-cost-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .production-cost-summary {
        align-items: stretch;
        flex-direction: column;
    }

    .production-cost-summary-value {
        min-width: 0;
        justify-items: start;
    }

    .unit-production-cost-grid {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   FASE 13.3.1 - CUSTO POR UNIDADE NO USO ESTIMADO DE PAPEL
   ============================================================ */

.admin-paper-cost-divider {
    height: 1px;
    margin: 10px 0;
    background: #dfe8ef;
}

.admin-paper-cost-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}

.admin-paper-cost-item {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 8px 9px;
    border: 1px solid #dfe7ed;
    border-radius: 7px;
    background: #fff;
}

.admin-paper-cost-item > span {
    color: #677b8c;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
}

.admin-paper-cost-item > strong {
    color: #173e61;
    font-size: 14px;
}

.admin-paper-cost-item > small {
    color: #7a8996;
    font-size: 8px;
    line-height: 1.35;
}

.admin-paper-cost-total {
    border-color: #b9d0e1;
    background: #eff7fc;
}

.admin-paper-cost-total > strong {
    color: #0e4776;
    font-size: 16px;
}

.cost-pending {
    color: #94701b !important;
}

.os-general-cost {
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid #cbdbe7;
    border-radius: 10px;
    background: linear-gradient(180deg, #fbfdff 0%, #f2f7fb 100%);
}

.os-general-cost-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.os-general-cost-heading > div {
    display: grid;
    gap: 2px;
}

.os-general-cost-heading span {
    color: #60778a;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .035em;
}

.os-general-cost-heading strong {
    color: #173e61;
}

.os-general-cost-value {
    font-size: 22px;
    color: #0d4775 !important;
}

.os-general-cost-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}

.os-general-cost-grid > div {
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    border: 1px solid #dfe7ed;
    border-radius: 7px;
    background: #fff;
}

.os-general-cost-grid span {
    color: #687d8e;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
}

.os-general-cost-grid strong {
    color: #1d435f;
    font-size: 14px;
}

.os-general-cost-total {
    border-color: #b7cfe0 !important;
    background: #edf6fc !important;
}

.os-general-cost-total strong {
    color: #0b4778;
    font-size: 16px;
}

.os-general-cost-warning {
    margin-top: 9px;
    padding: 8px 10px;
    border: 1px solid #ead7a6;
    border-radius: 7px;
    background: #fffaf0;
    color: #7b5b1d;
    font-size: 8px;
    line-height: 1.4;
}

@media (max-width: 1100px) {
    .admin-paper-cost-grid,
    .os-general-cost-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .admin-paper-cost-grid,
    .os-general-cost-grid {
        grid-template-columns: 1fr;
    }

    .os-general-cost-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* FASE 13.4 - Custos nos relatórios */
.report-cost-summary {
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid #cadbe8;
    border-radius: 10px;
    background: linear-gradient(180deg, #fbfdff 0%, #f3f8fb 100%);
}
.report-cost-summary-head {
    display:flex; align-items:center; justify-content:space-between; gap:18px; margin-bottom:11px;
}
.report-cost-summary-head > div:first-child { display:grid; gap:2px; }
.report-cost-summary-head span,.report-cost-cards span {
    color:#63798b; font-size:8px; font-weight:700; text-transform:uppercase; letter-spacing:.035em;
}
.report-cost-summary-head strong { color:#173f62; }
.report-cost-summary-head small { color:#748695; }
.report-cost-total { display:grid; justify-items:end; gap:2px; }
.report-cost-total strong { color:#0d4775; font-size:22px; line-height:1; }
.report-cost-cards { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.report-cost-cards article {
    display:grid; gap:4px; min-width:0; padding:10px 11px;
    border:1px solid #dfe7ed; border-radius:8px; background:#fff;
}
.report-cost-cards article strong { color:#183f60; font-size:16px; }
.report-cost-cards article small { color:#7b8b98; }
.report-cost-card-total { border-color:#b8cfdf !important; background:#edf6fc !important; }
.report-cost-card-total strong { color:#0d4775 !important; font-size:18px !important; }
.report-cost-warning {
    margin-top:9px; padding:8px 10px; border:1px solid #ead8a8; border-radius:7px;
    background:#fffaf0; color:#795b20; font-size:8px; line-height:1.4;
}
.report-unit-cost-cell { display:grid; gap:2px; }
.report-unit-cost-cell strong { color:#16466d; }
.report-unit-cost-cell small { color:#7a8996; font-size:8px; }
.report-cost-pending { display:block; margin-top:2px; color:#946f19; font-size:8px; }
@media (max-width:1050px) { .report-cost-cards { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:680px) {
    .report-cost-summary-head { align-items:flex-start; flex-direction:column; }
    .report-cost-total { justify-items:start; }
    .report-cost-cards { grid-template-columns:1fr; }
}


/* ============================================================
   FASE 14.2 - TURMAS SEPARADAS POR UNIDADE
   ============================================================ */

.classroom-unit-panel {
    display: grid;
    gap: 12px;
}

.classroom-unit-tabs {
    display: flex;
    align-items: stretch;
    gap: 8px;
    padding: 5px;
    border: 1px solid #dde4eb;
    border-radius: 11px;
    background: #edf1f5;
    overflow-x: auto;
}

.classroom-unit-tab {
    position: relative;
    min-width: 185px;
    display: grid;
    gap: 2px;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #536174;
    cursor: pointer;
    text-align: left;
    transition:
        background .15s ease,
        border-color .15s ease,
        box-shadow .15s ease;
}

.classroom-unit-tab:hover {
    background: rgba(255, 255, 255, .62);
}

.classroom-unit-tab.active {
    border-color: #d7dee7;
    background: #fff;
    box-shadow: 0 1px 3px rgba(24, 39, 58, .08);
    color: #172a41;
}

.classroom-unit-tab > span {
    font-size: 10px;
    font-weight: 800;
}

.classroom-unit-tab > small {
    color: #7d8998;
    font-size: 8px;
    font-weight: 700;
}

.classroom-unit-tab.active::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -6px;
    height: 2px;
    border-radius: 999px;
    background: #2a5f8d;
}

.classroom-unit-section {
    display: grid;
    gap: 10px;
}

.classroom-unit-section[hidden] {
    display: none !important;
}

.classroom-unit-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 1px 0;
}

.classroom-unit-heading > div {
    display: grid;
    gap: 2px;
}

.classroom-unit-heading span {
    color: #7a8795;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.classroom-unit-heading h4 {
    margin: 0;
    color: #20364d;
    font-size: 14px;
}

@media (max-width: 700px) {
    .classroom-unit-tab {
        min-width: 155px;
    }

    .classroom-unit-heading {
        align-items: stretch;
        flex-direction: column;
    }
}


/* ============================================================
   PRINTFLOW - IDENTIDADE VISUAL
   Paleta oficial: #3E4095 · #3E76AB · #F1623B
   ============================================================ */
.sidebar-brand {
    justify-content: center;
    margin: 0 0 8px;
    padding: 9px 10px;
    border-radius: 12px;
    background: rgba(255,255,255,.96);
}
.sidebar-brand-logo {
    width: 154px;
}
.auth-logo {
    width: min(245px, 72%);
}
.btn-primary {
    background: linear-gradient(135deg, #3E4095, #3E76AB);
}
.nav-item.active {
    box-shadow: inset 3px 0 0 #F1623B;
}

/* ============================================================
   PRINTFLOW - HOME COMERCIAL
   ============================================================ */
.pf-home{--pf-purple:#3E4095;--pf-blue:#3E76AB;--pf-orange:#F1623B;--pf-ink:#18243a;--pf-muted:#68758a;min-height:100vh;background:#fff;color:var(--pf-ink);font-family:Inter,Segoe UI,Arial,sans-serif;overflow:hidden}.pf-home *{box-sizing:border-box}.pf-home-header{height:84px;max-width:1420px;margin:auto;padding:0 42px;display:flex;align-items:center;gap:42px;border-bottom:1px solid #edf0f5}.pf-home-brand img{display:block;width:178px}.pf-home-nav{margin-left:auto;display:flex;gap:34px}.pf-home-nav a,.pf-home-login{text-decoration:none;color:#526076;font-size:13px;font-weight:700}.pf-home-nav a:hover{color:var(--pf-purple)}.pf-home-login{padding:11px 17px;border:1px solid #dfe4ec;border-radius:9px;color:var(--pf-purple);transition:.2s}.pf-home-login:hover{border-color:var(--pf-purple);transform:translateY(-1px)}.pf-home-login span,.pf-cta-primary span{margin-left:8px}.pf-hero{max-width:1420px;min-height:650px;margin:auto;padding:70px 70px 68px;display:grid;grid-template-columns:1.02fr .98fr;align-items:center;gap:60px;position:relative}.pf-hero:before{content:"";position:absolute;width:460px;height:460px;border-radius:50%;background:rgba(62,118,171,.07);filter:blur(1px);right:-170px;top:10px}.pf-eyebrow{display:flex;align-items:center;gap:10px;color:var(--pf-blue);font-size:11px;font-weight:900;letter-spacing:.13em;text-transform:uppercase}.pf-eyebrow span{width:26px;height:3px;border-radius:9px;background:var(--pf-orange)}.pf-hero h1,.pf-section h2,.pf-dark-section h2,.pf-final-cta h2{margin:18px 0 22px;font-size:58px;line-height:1.03;letter-spacing:-.045em;font-weight:750}.pf-hero h1 strong,.pf-section h2 strong{color:var(--pf-purple);font-weight:800}.pf-hero-copy>p{max-width:590px;color:var(--pf-muted);font-size:18px;line-height:1.72;margin:0}.pf-hero-actions{display:flex;align-items:center;gap:14px;margin-top:34px}.pf-cta-primary,.pf-cta-secondary{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;border-radius:10px;padding:15px 21px;font-size:13px;font-weight:800}.pf-cta-primary{color:#fff;background:linear-gradient(135deg,var(--pf-purple),var(--pf-blue));box-shadow:0 12px 30px rgba(62,64,149,.2)}.pf-cta-secondary{color:#42516a;border:1px solid #dfe4ec;background:#fff}.pf-hero-points{display:flex;gap:23px;flex-wrap:wrap;margin-top:28px;color:#7a8597;font-size:11px;font-weight:700}.pf-hero-points span::first-letter{color:var(--pf-orange)}.pf-hero-visual{min-height:510px;display:flex;align-items:center;justify-content:center;position:relative}.pf-orbit{position:absolute;border:1px solid rgba(62,118,171,.12);border-radius:50%}.pf-orbit-one{width:490px;height:490px}.pf-orbit-two{width:390px;height:390px;border-style:dashed}.pf-flow-card{width:410px;position:relative;z-index:2;background:#fff;border:1px solid #e5e9f0;border-radius:18px;padding:23px;box-shadow:0 28px 70px rgba(27,45,75,.14)}.pf-flow-top{display:flex;justify-content:space-between;align-items:start;padding-bottom:17px;border-bottom:1px solid #edf0f4}.pf-flow-card small{display:block;color:#9aa5b5;font-size:8px;font-weight:900;letter-spacing:.09em}.pf-flow-top b{display:block;margin-top:5px;font-size:18px;color:var(--pf-purple)}.pf-status{font-size:9px;font-weight:800;color:#287954;background:#eaf7f0;border-radius:999px;padding:6px 9px}.pf-flow-material{display:flex;gap:13px;padding:17px 0}.pf-doc-icon{width:36px;height:36px;border-radius:9px;background:#eef2ff;color:var(--pf-purple);display:grid;place-items:center;font-size:18px}.pf-flow-material strong,.pf-flow-material em{display:block}.pf-flow-material strong{font-size:13px;margin:3px 0}.pf-flow-material em{font-size:10px;color:#8490a2;font-style:normal}.pf-flow-line{position:relative;display:grid;grid-template-columns:26px 1fr;gap:9px;padding:8px 0}.pf-flow-line>span{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;border:1px solid #dce2eb;color:#9aa6b6;font-size:9px;background:#fff;z-index:2}.pf-flow-line>span.done{background:#eef8f3;border-color:#cce9da;color:#27805a}.pf-flow-line.active>span{background:#fff2ed;border-color:#ffd6c8;color:var(--pf-orange)}.pf-flow-line b{font-size:11px}.pf-flow-line small{margin-top:2px;letter-spacing:0;font-weight:600}.pf-flow-line i{position:absolute;left:10px;top:30px;width:1px;height:16px;background:#e5e9ef}.pf-flow-footer{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin-top:12px;padding-top:15px;border-top:1px solid #edf0f4}.pf-flow-footer span{padding:9px;background:#f8fafc;border-radius:8px}.pf-flow-footer b{display:block;margin-top:3px;font-size:11px}.pf-float-card{position:absolute;z-index:3;display:flex;gap:10px;align-items:center;padding:12px 15px;background:#fff;border:1px solid #e5e9f0;border-radius:12px;box-shadow:0 14px 35px rgba(27,45,75,.12)}.pf-float-card>span{width:30px;height:30px;border-radius:8px;display:grid;place-items:center;font-weight:900}.pf-float-card small{font-size:7px;color:#9aa5b5;font-weight:900}.pf-float-card b{display:block;font-size:10px;margin-top:2px}.pf-float-alert{top:68px;right:2px}.pf-float-alert>span{background:#eef4fa;color:var(--pf-blue)}.pf-float-cost{bottom:64px;left:-2px}.pf-float-cost>span{background:#fff1eb;color:var(--pf-orange);font-size:10px}.pf-trust-strip{border-top:1px solid #edf0f5;border-bottom:1px solid #edf0f5;min-height:70px;display:flex;align-items:center;justify-content:center;gap:34px;color:#a1a9b6;font-size:10px;font-weight:900;letter-spacing:.18em}.pf-trust-strip i{width:4px;height:4px;border-radius:50%;background:var(--pf-orange)}.pf-section{max-width:1420px;margin:auto;padding:100px 70px}.pf-section-heading{max-width:680px}.pf-section h2{font-size:43px;margin:15px 0}.pf-section-heading>p{color:var(--pf-muted);line-height:1.7;font-size:15px}.pf-feature-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-top:45px}.pf-feature-grid article{position:relative;min-height:230px;padding:25px;border:1px solid #e6eaf0;border-radius:14px;background:#fff;transition:.25s}.pf-feature-grid article:hover{transform:translateY(-4px);box-shadow:0 18px 40px rgba(30,48,75,.08);border-color:#d6dce7}.pf-feature-grid article>span{position:absolute;right:18px;top:17px;color:#e4e8ee;font-size:24px;font-weight:900}.pf-feature-icon{width:42px;height:42px;display:grid;place-items:center;border-radius:10px;background:#f0f2fb;color:var(--pf-purple);font-size:18px}.pf-feature-grid article:nth-child(3) .pf-feature-icon{background:#edf5fa;color:var(--pf-blue)}.pf-feature-grid article:nth-child(4) .pf-feature-icon{background:#fff1ec;color:var(--pf-orange)}.pf-feature-grid h3{margin:24px 0 10px;font-size:16px}.pf-feature-grid p{margin:0;color:#778396;font-size:12px;line-height:1.65}.pf-dark-section{background:#1b2541;color:#fff;padding:85px max(70px,calc((100vw - 1280px)/2));display:grid;grid-template-columns:1fr 1fr;gap:80px;align-items:center;position:relative}.pf-dark-section:after{content:"";position:absolute;right:5%;top:0;width:300px;height:100%;background:radial-gradient(circle,rgba(62,118,171,.18),transparent 65%)}.pf-eyebrow.light{color:#9bb8d2}.pf-dark-section h2{font-size:42px;margin:16px 0}.pf-dark-section h2 strong{color:#aeb7ff}.pf-dark-copy{position:relative;z-index:2}.pf-dark-copy>p{color:#bac3d1;line-height:1.75;font-size:15px}.pf-mini-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:25px}.pf-mini-stats span{padding:13px 10px;border:1px solid rgba(255,255,255,.1);border-radius:8px;color:#c8cfdb;font-size:9px}.pf-mini-stats b{display:block;color:#f58a67;font-size:9px;margin-bottom:5px}.pf-management{display:grid;grid-template-columns:.85fr 1.15fr;gap:90px;align-items:center}.pf-metrics-card{min-height:320px;border:1px solid #e3e8ef;border-radius:18px;padding:28px;background:#f9fbfd;display:grid;grid-template-columns:1fr 1fr;gap:12px;position:relative}.pf-metric{background:#fff;border:1px solid #e7eaf0;border-radius:12px;padding:18px;height:105px}.pf-metric small{font-size:8px;color:#929eaf;font-weight:900}.pf-metric b{display:block;color:var(--pf-purple);font-size:26px;margin:6px 0}.pf-metric span{font-size:9px;color:#8b96a7}.pf-bars{position:absolute;left:28px;right:28px;bottom:28px;height:130px;display:flex;align-items:end;gap:11px;border-bottom:1px solid #dfe4eb}.pf-bars i{flex:1;background:linear-gradient(180deg,var(--pf-blue),var(--pf-purple));border-radius:5px 5px 0 0;opacity:.82}.pf-final-cta{text-align:center;padding:90px 30px;background:linear-gradient(135deg,#3E4095 0%,#35437e 55%,#3E76AB 100%);color:#fff}.pf-final-cta img{width:50px;filter:brightness(0) invert(1);opacity:.9}.pf-final-cta h2{font-size:43px;margin:17px 0}.pf-final-cta h2 strong{color:#fff}.pf-final-cta p{color:#d9def0;margin:0 0 27px}.light-button{background:#fff;color:var(--pf-purple);box-shadow:none}.pf-home-footer{max-width:1420px;margin:auto;padding:32px 70px;display:flex;align-items:center;gap:25px;color:#929cab;font-size:10px}.pf-home-footer img{width:125px}.pf-home-footer small{margin-left:auto}.pf-home-footer span{border-left:1px solid #e1e5eb;padding-left:25px}
@media(max-width:1000px){.pf-home-nav{display:none}.pf-hero{grid-template-columns:1fr;padding:60px 35px}.pf-hero-copy{text-align:center}.pf-eyebrow,.pf-hero-actions,.pf-hero-points{justify-content:center}.pf-hero-copy>p{margin:auto}.pf-hero-visual{min-height:530px}.pf-feature-grid{grid-template-columns:1fr 1fr}.pf-dark-section,.pf-management{grid-template-columns:1fr}.pf-section{padding:75px 35px}.pf-dark-section{padding:70px 35px}.pf-section-heading{max-width:none}.pf-management{gap:35px}}
@media(max-width:620px){.pf-home-header{height:72px;padding:0 18px}.pf-home-brand img{width:145px}.pf-home-login{font-size:0;padding:10px 12px}.pf-home-login:before{content:"Entrar";font-size:12px}.pf-home-login span{font-size:12px}.pf-hero{padding:50px 20px 45px}.pf-hero h1{font-size:40px}.pf-hero-copy>p{font-size:15px}.pf-hero-actions{flex-direction:column;align-items:stretch}.pf-hero-points{gap:10px}.pf-hero-visual{transform:scale(.83);margin:-45px -55px}.pf-trust-strip{gap:12px;font-size:7px}.pf-section{padding:65px 20px}.pf-section h2,.pf-dark-section h2,.pf-final-cta h2{font-size:34px}.pf-feature-grid{grid-template-columns:1fr}.pf-dark-section{padding:65px 20px}.pf-mini-stats{grid-template-columns:1fr 1fr}.pf-metrics-card{grid-template-columns:1fr}.pf-metric:nth-child(2){display:none}.pf-home-footer{padding:25px 20px;flex-wrap:wrap}.pf-home-footer span{display:none}.pf-home-footer small{margin-left:auto}}


/* FASE 16.3 - Navegação suave da Home */
html {
    scroll-behavior: smooth;
}

.pf-home section[id] {
    scroll-margin-top: 88px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}


/* =========================================================
   PrintFlow PWA / Aplicativo instalável — Fase 17.0
   ========================================================= */
.pwa-install-sidebar {
    width: 100%;
    border: 0;
    font: inherit;
    text-align: left;
    cursor: pointer;
    background: rgba(62, 64, 149, .08);
    color: #3E4095;
}

.pwa-install-sidebar:hover {
    background: rgba(62, 64, 149, .14);
}

.pwa-install-sidebar:disabled,
.pf-home-install:disabled {
    opacity: .55;
    cursor: wait;
}

.pf-home-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pf-home-install {
    border: 1px solid rgba(62, 64, 149, .2);
    background: rgba(62, 64, 149, .06);
    color: #3E4095;
    border-radius: 12px;
    padding: 11px 15px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.pf-home-install:hover {
    transform: translateY(-1px);
    background: rgba(62, 64, 149, .1);
    border-color: rgba(62, 64, 149, .34);
}

.printflow-standalone body {
    overscroll-behavior: none;
}

@media (max-width: 860px) {
    .pf-home-header-actions {
        margin-left: auto;
    }

    .pf-home-install {
        display: none !important;
    }
}

/* =========================================================
   PrintFlow Home — Aplicativo instalável / Fase 17.1
   ========================================================= */
.pf-app-section{max-width:1420px;margin:auto;padding:95px 70px 110px;display:grid;grid-template-columns:.9fr 1.1fr;gap:85px;align-items:center;position:relative}.pf-app-section:before{content:"";position:absolute;right:-130px;top:60px;width:410px;height:410px;border-radius:50%;background:rgba(62,118,171,.07);z-index:0}.pf-app-copy,.pf-app-visual{position:relative;z-index:1}.pf-app-copy h2{margin:15px 0 20px;font-size:43px;line-height:1.06;letter-spacing:-.04em}.pf-app-copy h2 strong{color:var(--pf-purple)}.pf-app-copy>p{max-width:580px;margin:0;color:var(--pf-muted);font-size:15px;line-height:1.75}.pf-app-benefits{display:grid;gap:12px;margin-top:29px}.pf-app-benefits>span{display:grid;grid-template-columns:32px 1fr;gap:11px;align-items:start}.pf-app-benefits>span>b{width:28px;height:28px;border-radius:8px;background:#eef1fb;color:var(--pf-purple);display:grid;place-items:center;font-size:12px}.pf-app-benefits em{font-style:normal;color:#7a8698;font-size:11px;line-height:1.5}.pf-app-benefits em strong{display:block;color:#34435b;font-size:12px;margin-bottom:2px}.pf-app-actions{display:flex;align-items:center;gap:16px;margin-top:30px;flex-wrap:wrap}.pf-app-install-button{border:0;cursor:pointer;font:inherit}.pf-app-actions small{max-width:250px;color:#8b96a7;font-size:10px;line-height:1.45}.pf-app-visual{min-height:460px;display:flex;align-items:center;justify-content:center}.pf-app-window{width:min(650px,100%);border:1px solid #dfe5ed;border-radius:18px;overflow:hidden;background:#fff;box-shadow:0 30px 70px rgba(31,48,79,.16);transform:perspective(1200px) rotateY(-2deg) rotateX(1deg)}.pf-app-window-top{height:48px;background:#152039;color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 16px}.pf-app-window-brand{display:flex;align-items:center;gap:8px;font-size:10px;font-weight:800}.pf-app-window-brand img{width:22px;height:22px;border-radius:6px}.pf-app-window-controls{display:flex;gap:8px}.pf-app-window-controls i{width:8px;height:8px;border-radius:50%;background:rgba(255,255,255,.28)}.pf-app-window-body{height:352px;display:grid;grid-template-columns:148px 1fr;background:#f5f8fc}.pf-app-window-body aside{background:#17223d;padding:18px 12px;display:flex;flex-direction:column;gap:7px}.pf-app-window-body aside>img{width:103px;filter:brightness(0) invert(1);margin:2px 5px 18px;opacity:.95}.pf-app-window-body aside>span{display:flex;align-items:center;gap:8px;color:#9ca8be;font-size:8px;padding:9px 9px;border-radius:7px}.pf-app-window-body aside>span.active{background:linear-gradient(135deg,rgba(62,64,149,.95),rgba(62,118,171,.8));color:#fff}.pf-app-window-body aside b{font-weight:700}.pf-app-dashboard{padding:22px}.pf-app-dashboard-head{display:flex;align-items:center;justify-content:space-between}.pf-app-dashboard-head small{display:block;font-size:6px;color:#8995a7;font-weight:900;letter-spacing:.09em}.pf-app-dashboard-head strong{display:block;font-size:14px;color:#29364b;margin-top:4px}.pf-app-dashboard-head>span{font-size:7px;font-weight:800;color:#297c5b;background:#eaf7f0;border-radius:999px;padding:6px 9px}.pf-app-kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:18px}.pf-app-kpis i{font-style:normal;background:#fff;border:1px solid #e5eaf0;border-radius:9px;padding:13px}.pf-app-kpis small{font-size:5.5px;color:#929cac;font-weight:900}.pf-app-kpis b{display:block;margin-top:5px;color:var(--pf-purple);font-size:18px}.pf-app-kpis i:nth-child(2) b{color:var(--pf-orange)}.pf-app-kpis i:nth-child(3) b{color:#2b8862}.pf-app-chart{height:160px;margin-top:16px;padding:18px 16px 0;display:flex;align-items:end;gap:9px;background:#fff;border:1px solid #e5eaf0;border-radius:10px;border-bottom-color:#dce2eb}.pf-app-chart span{flex:1;background:linear-gradient(180deg,var(--pf-blue),var(--pf-purple));border-radius:4px 4px 0 0;opacity:.76}.pf-app-badge{position:absolute;right:-15px;bottom:13px;display:flex;align-items:center;gap:10px;background:#fff;border:1px solid #e1e6ed;border-radius:12px;padding:11px 14px;box-shadow:0 15px 35px rgba(31,49,79,.12)}.pf-app-badge img{width:34px;height:34px;border-radius:9px}.pf-app-badge small{display:block;font-size:6px;color:#9aa4b2;font-weight:900;letter-spacing:.08em}.pf-app-badge strong{display:block;margin-top:3px;color:#34435a;font-size:10px}
@media(max-width:1000px){.pf-app-section{grid-template-columns:1fr;padding:75px 35px;gap:45px}.pf-app-copy{text-align:center}.pf-app-copy .pf-eyebrow,.pf-app-actions{justify-content:center}.pf-app-copy>p{margin:auto}.pf-app-benefits{max-width:600px;margin:29px auto 0;text-align:left}.pf-app-visual{min-height:420px}}
@media(max-width:620px){.pf-app-section{padding:65px 20px}.pf-app-copy h2{font-size:34px}.pf-app-window{transform:none}.pf-app-window-body{grid-template-columns:96px 1fr;height:310px}.pf-app-window-body aside{padding:12px 8px}.pf-app-window-body aside>img{width:72px}.pf-app-window-body aside>span{font-size:0;padding:8px;justify-content:center}.pf-app-window-body aside>span b{display:none}.pf-app-dashboard{padding:15px}.pf-app-kpis{grid-template-columns:1fr 1fr}.pf-app-kpis i:nth-child(3){display:none}.pf-app-chart{height:145px}.pf-app-badge{right:0;bottom:0}.pf-app-actions{flex-direction:column}.pf-app-actions small{max-width:330px}}

/* ============================================================
   FASE 18.0 - RESPONSIVIDADE GLOBAL / MOBILE FIRST COMPLEMENTAR
   Mantém o desktop atual e adapta navegação, formulários,
   tabelas, cards, modais e Home para tablets e celulares.
   ============================================================ */

/* Base defensiva para impedir estouros horizontais em qualquer tela */
img, svg, video, canvas { max-width: 100%; }
input, select, textarea, button { max-width: 100%; }
.main, .content, .panel, .page-heading, .panel-toolbar,
.os-grid, .finishings-grid, .quantity-cards, .tabs,
.table-wrap, .table-responsive { min-width: 0; }

.mobile-menu-toggle,
.mobile-sidebar-backdrop { display: none; }

@media screen and (max-width: 1024px) {
    .content { padding: 22px; }

    .page-heading,
    .panel-toolbar {
        gap: 14px;
    }

    .tabs {
        max-width: 100%;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: thin;
    }

    .tab { flex: 0 0 auto; white-space: nowrap; }

    /* Tabelas permanecem completas, com rolagem apenas quando necessário */
    table {
        max-width: 100%;
    }

    .table-wrap,
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media screen and (max-width: 820px) {
    html { -webkit-text-size-adjust: 100%; }
    body { overflow-x: hidden; }

    .app-shell {
        display: block;
        min-height: 100dvh;
    }

    .main {
        width: 100%;
        min-height: 100dvh;
    }

    /* Sidebar vira drawer lateral, mantendo TODAS as opções disponíveis */
    .sidebar {
        display: flex !important;
        position: fixed;
        inset: 0 auto 0 0;
        width: min(290px, 86vw);
        height: 100dvh;
        z-index: 1002;
        padding: 16px 14px;
        overflow-y: auto;
        overscroll-behavior: contain;
        transform: translateX(-105%);
        transition: transform .24s ease;
        box-shadow: 18px 0 48px rgba(16, 24, 40, .20);
    }

    body.mobile-menu-open { overflow: hidden; }
    body.mobile-menu-open .sidebar { transform: translateX(0); }

    /* Reverte regras antigas do modo "sidebar compacta" */
    .sidebar-brand > div:last-child,
    .nav-item:not(.active) { font-size: 13px; }
    .nav-item {
        justify-content: flex-start;
        min-height: 44px;
        padding: 11px 12px;
        touch-action: manipulation;
    }
    .sidebar-brand { padding: 7px 8px 18px; }
    .sidebar-brand-logo { max-width: 170px; }

    .mobile-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1001;
        border: 0;
        padding: 0;
        background: rgba(16, 24, 40, .48);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .2s ease, visibility .2s ease;
    }
    body.mobile-menu-open .mobile-sidebar-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .mobile-menu-toggle {
        display: inline-grid;
        place-items: center;
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
        padding: 0;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: #fff;
        color: var(--primary);
        cursor: pointer;
        touch-action: manipulation;
    }
    .mobile-menu-toggle svg {
        width: 21px;
        height: 21px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 900;
        min-height: 66px;
        padding: 11px 16px;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start;
        gap: 11px;
        box-shadow: 0 1px 0 rgba(16,24,40,.03);
    }
    .topbar > div:first-of-type {
        min-width: 0;
        flex: 1 1 auto;
    }
    .topbar h1 {
        font-size: 17px;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .topbar p { display: none; }
    .topbar .user-chip {
        flex: 0 0 auto;
    }
    .topbar .user-chip > div:not(.user-avatar) { display: none; }

    .content { padding: 16px; }

    .page-heading {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 14px;
    }
    .page-heading h2 { font-size: 20px; }
    .page-heading > :last-child:not(:first-child) {
        align-self: stretch;
    }

    .panel-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .panel-toolbar > * { width: 100%; }

    .panel {
        padding: 16px;
        border-radius: 11px;
    }

    /* Botões de ação ficam confortáveis para toque */
    .btn,
    button,
    input[type="submit"],
    input[type="button"] {
        min-height: 42px;
    }

    /* Formulários: qualquer grid de múltiplas colunas passa a caber no tablet */
    .form-grid,
    .filters-grid,
    .settings-grid,
    .user-form-grid,
    .report-filters,
    .stock-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    /* Rolagem horizontal para tabelas legadas que não possuem wrapper */
    .panel > table,
    .content > table,
    form > table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    th, td { white-space: nowrap; }

    /* Modais nunca ultrapassam a viewport */
    [class*="modal"] > [class*="card"],
    [class*="modal"] > [class*="dialog"],
    .system-modal-card,
    .modal-card {
        max-width: calc(100vw - 28px) !important;
        max-height: calc(100dvh - 28px);
        overflow-y: auto;
    }

    /* Home pública: reduz elementos decorativos antes que causem overflow */
    .pf-home { overflow-x: hidden; }
    .pf-home-header { padding-inline: 24px; }
    .pf-hero { padding-inline: 28px; }
    .pf-flow-card { max-width: calc(100vw - 54px); }
}

@media screen and (max-width: 600px) {
    :root { --mobile-gutter: 13px; }

    .auth-shell { padding: 16px; }
    .auth-card { padding: 24px 20px; border-radius: 14px; }

    .content { padding: var(--mobile-gutter); }
    .panel { padding: 13px; margin-top: 13px; }

    .welcome {
        padding: 18px;
        gap: 14px;
        border-radius: 12px;
    }
    .welcome h2 { font-size: 19px; }
    .welcome .status-live { white-space: normal; }

    .stats-grid,
    .foundation-grid,
    .form-grid,
    .filters-grid,
    .settings-grid,
    .user-form-grid,
    .report-filters,
    .stock-form-grid,
    .os-grid.cols-2,
    .os-grid.cols-3,
    .finishings-grid,
    .quantity-cards {
        grid-template-columns: 1fr !important;
    }

    .page-heading h2 { font-size: 19px; }
    .page-heading p { line-height: 1.5; }

    .tabs {
        width: 100%;
        padding: 4px;
        gap: 4px;
        border-radius: 9px;
    }
    .tab { padding: 8px 11px; }

    .field input,
    .field select,
    .field textarea,
    input,
    select,
    textarea {
        font-size: 16px; /* evita zoom automático no iOS */
    }

    textarea { min-height: 100px; }

    /* Grupos de ações quebram em linhas sem escapar da tela */
    .actions,
    .form-actions,
    .page-actions,
    .os-actions,
    .detail-actions,
    .toolbar-actions,
    .panel-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .actions > *,
    .form-actions > *,
    .page-actions > *,
    .os-actions > *,
    .detail-actions > *,
    .toolbar-actions > *,
    .panel-actions > * {
        max-width: 100%;
    }

    /* Tabelas em celular: mantém dados íntegros e permite arrastar */
    table {
        font-size: 11px;
    }
    th, td {
        padding-left: 9px !important;
        padding-right: 9px !important;
    }

    /* Cards e badges não forçam largura mínima */
    [class*="card"],
    [class*="badge"],
    [class*="chip"] { min-width: 0; }

    /* HOME */
    .pf-home-header {
        padding: 0 14px;
        gap: 12px;
    }
    .pf-home-brand img { width: 138px; }
    .pf-home-login { flex: 0 0 auto; }

    .pf-hero {
        min-height: auto;
        padding: 42px 16px 30px;
        gap: 18px;
    }
    .pf-hero h1 { font-size: clamp(34px, 10.5vw, 42px); }
    .pf-hero-copy > p { font-size: 15px; line-height: 1.6; }
    .pf-hero-actions { width: 100%; }
    .pf-hero-actions > * { width: 100%; }
    .pf-hero-visual {
        min-height: 400px;
        transform: none;
        margin: 0;
        overflow: visible;
    }
    .pf-orbit-one { width: 390px; height: 390px; }
    .pf-orbit-two { width: 310px; height: 310px; }
    .pf-flow-card {
        width: min(365px, calc(100vw - 32px));
        padding: 17px;
    }
    .pf-float-card { transform: scale(.88); }
    .pf-trust-strip {
        padding-inline: 14px;
        overflow-x: auto;
        justify-content: flex-start;
    }
    .pf-trust-strip > * { flex: 0 0 auto; }

    .pf-section,
    .pf-dark-section,
    .pf-app-section { padding: 56px 16px; }
    .pf-section h2,
    .pf-dark-section h2,
    .pf-final-cta h2,
    .pf-app-copy h2 { font-size: 31px; }

    .pf-feature-grid { gap: 10px; }
    .pf-feature-grid article { min-height: 0; padding: 20px; }
    .pf-mini-stats { grid-template-columns: 1fr 1fr; }

    .pf-metrics-card {
        padding: 18px;
        min-height: 300px;
    }
    .pf-bars { left: 18px; right: 18px; bottom: 18px; }

    .pf-app-visual { min-height: 330px; width: 100%; }
    .pf-app-window {
        width: 100%;
        border-radius: 13px;
    }
    .pf-app-window-body {
        grid-template-columns: 74px minmax(0, 1fr);
        height: 285px;
    }
    .pf-app-window-body aside > img { width: 58px; margin-inline: 0; }
    .pf-app-dashboard { padding: 12px; min-width: 0; }
    .pf-app-kpis { gap: 6px; }
    .pf-app-kpis i { padding: 10px; }
    .pf-app-chart { height: 125px; gap: 5px; padding: 12px 10px 0; }
    .pf-app-badge { right: 6px; bottom: -16px; }

    .pf-final-cta { padding: 65px 16px; }
    .pf-home-footer {
        padding: 24px 16px;
        gap: 14px;
    }
}

@media screen and (max-width: 390px) {
    .topbar { padding-inline: 10px; }
    .mobile-menu-toggle { width: 40px; height: 40px; flex-basis: 40px; }
    .content { padding: 10px; }
    .panel { padding: 11px; }

    .pf-home-brand img { width: 125px; }
    .pf-home-login { padding-inline: 10px; }
    .pf-hero { padding-inline: 13px; }
    .pf-flow-card { width: calc(100vw - 26px); }
    .pf-mini-stats { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .mobile-sidebar-backdrop { transition: none !important; }
}

/* =========================================================
   FASE 18.1 - HOME: EXPERIÊNCIA RESPONSIVA / MOBILE
   ========================================================= */
.pf-mobile-section{max-width:1420px;margin:auto;padding:105px 70px 115px;display:grid;grid-template-columns:1.08fr .92fr;gap:90px;align-items:center;position:relative;overflow:hidden}.pf-mobile-copy{position:relative;z-index:2}.pf-mobile-copy h2{margin:15px 0 20px;font-size:43px;line-height:1.06;letter-spacing:-.04em}.pf-mobile-copy h2 strong{color:var(--pf-purple)}.pf-mobile-copy>p{margin:0;color:var(--pf-muted);font-size:15px;line-height:1.75;max-width:590px}.pf-mobile-benefits{display:grid;gap:10px;margin-top:28px}.pf-mobile-benefits article{display:grid;grid-template-columns:40px 1fr;gap:12px;align-items:start;padding:13px 0;border-bottom:1px solid #edf0f4}.pf-mobile-benefits article>b{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:#f0f2fb;color:var(--pf-purple);font-size:9px}.pf-mobile-benefits article:nth-child(2)>b{background:#edf5fa;color:var(--pf-blue)}.pf-mobile-benefits article:nth-child(3)>b{background:#fff1ec;color:var(--pf-orange)}.pf-mobile-benefits article strong{display:block;color:#34435b;font-size:13px;margin:1px 0 4px}.pf-mobile-benefits article span{display:block;color:#7d899a;font-size:11px;line-height:1.55}.pf-mobile-highlight{margin-top:22px;padding:15px 16px;border:1px solid #e5e9ef;background:#fafbfe;border-radius:12px;display:flex;gap:12px;align-items:center}.pf-mobile-highlight>span{width:36px;height:36px;border-radius:10px;background:linear-gradient(135deg,var(--pf-purple),var(--pf-blue));color:#fff;display:grid;place-items:center;font-weight:900}.pf-mobile-highlight small{display:block;color:#98a2b1;font-size:7px;font-weight:900;letter-spacing:.1em}.pf-mobile-highlight strong{display:block;color:#38465b;font-size:11px;margin-top:4px;line-height:1.4}.pf-mobile-visual{min-height:560px;position:relative;display:flex;align-items:center;justify-content:center}.pf-mobile-glow{position:absolute;width:510px;height:510px;border-radius:50%;background:radial-gradient(circle,rgba(62,118,171,.14),rgba(62,64,149,.05) 48%,transparent 70%)}.pf-tablet-device{position:absolute;width:470px;height:348px;left:0;top:72px;background:#17213a;border:8px solid #202c48;border-radius:24px;box-shadow:0 30px 70px rgba(28,44,75,.19);transform:rotate(-3deg);overflow:hidden;z-index:1}.pf-device-top{height:11px;display:flex;justify-content:center;align-items:center}.pf-device-top span{width:5px;height:5px;border-radius:50%;background:#4b5873}.pf-tablet-screen{height:calc(100% - 11px);background:#f4f7fb;padding:15px}.pf-mobile-appbar{height:42px;background:#18243f;border-radius:9px;display:flex;align-items:center;gap:8px;padding:0 11px;color:#fff}.pf-mobile-appbar img{width:22px;height:22px;border-radius:6px}.pf-mobile-appbar b{font-size:9px}.pf-mobile-appbar i{margin-left:auto;font-size:10px;font-style:normal;opacity:.8}.pf-mobile-screen-title{padding:17px 2px 8px}.pf-mobile-screen-title small,.pf-phone-greeting small{display:block;color:#8f9aab;font-size:6px;font-weight:900;letter-spacing:.1em}.pf-mobile-screen-title strong{display:block;color:#2d3b52;font-size:16px;margin-top:4px}.pf-mobile-kpis{display:grid;grid-template-columns:1fr 1fr;gap:9px}.pf-mobile-kpis span{background:#fff;border:1px solid #e3e8ef;border-radius:9px;padding:13px}.pf-mobile-kpis small{display:block;color:#98a2b1;font-size:5px;font-weight:900}.pf-mobile-kpis b{display:block;color:var(--pf-purple);font-size:20px;margin-top:5px}.pf-mobile-kpis span:nth-child(2) b{color:#29815e}.pf-mobile-list{margin-top:10px;background:#fff;border:1px solid #e3e8ef;border-radius:9px;padding:9px 11px}.pf-mobile-list i{display:block;height:9px;margin:9px 0;border-radius:5px;background:linear-gradient(90deg,#e7ebf1 0 30%,#f3f5f8 30% 100%)}.pf-phone-device{position:absolute;width:220px;height:438px;right:3px;bottom:30px;background:#151f37;border:8px solid #1c2944;border-radius:34px;box-shadow:0 32px 70px rgba(26,42,72,.25);z-index:3;overflow:hidden}.pf-phone-notch{position:absolute;top:0;left:50%;transform:translateX(-50%);width:74px;height:17px;border-radius:0 0 12px 12px;background:#151f37;z-index:4}.pf-phone-screen{height:100%;background:#f5f8fc;padding:17px 10px 10px}.pf-phone-screen .pf-mobile-appbar{margin-top:8px;height:38px}.pf-phone-greeting{padding:17px 3px 10px}.pf-phone-greeting strong{display:block;color:#2c394e;font-size:17px;margin-top:3px}.pf-phone-greeting span{display:block;color:#8995a6;font-size:8px;margin-top:2px}.pf-phone-card{background:linear-gradient(135deg,var(--pf-purple),var(--pf-blue));border-radius:12px;padding:14px;color:#fff}.pf-phone-card small{display:block;font-size:5px;font-weight:900;opacity:.72}.pf-phone-card b{display:block;font-size:26px;margin:4px 0}.pf-phone-card em{font-style:normal;font-size:6px;opacity:.8}.pf-phone-rows{margin-top:9px}.pf-phone-rows i{display:block;height:48px;background:#fff;border:1px solid #e5e9ef;border-radius:9px;margin-bottom:7px;position:relative}.pf-phone-rows i:before{content:"";position:absolute;width:27px;height:27px;left:9px;top:10px;border-radius:7px;background:#eef1fa}.pf-phone-rows i:after{content:"";position:absolute;left:45px;right:12px;top:15px;height:5px;border-radius:4px;background:#d9dfe8;box-shadow:0 10px 0 #eef1f5}.pf-mobile-float{position:absolute;z-index:5;left:35px;bottom:53px;display:flex;align-items:center;gap:10px;background:#fff;border:1px solid #e1e6ed;border-radius:12px;padding:12px 15px;box-shadow:0 15px 35px rgba(31,49,79,.13)}.pf-mobile-float>span{width:32px;height:32px;border-radius:9px;background:#edf8f3;color:#28815e;display:grid;place-items:center;font-weight:900}.pf-mobile-float small{display:block;font-size:6px;color:#9aa4b2;font-weight:900;letter-spacing:.08em}.pf-mobile-float strong{display:block;margin-top:3px;color:#34435a;font-size:10px}
@media(max-width:1000px){.pf-mobile-section{grid-template-columns:1fr;padding:78px 35px;gap:45px}.pf-mobile-copy{text-align:center}.pf-mobile-copy .pf-eyebrow{justify-content:center}.pf-mobile-copy>p{margin:auto}.pf-mobile-benefits{max-width:650px;margin:28px auto 0;text-align:left}.pf-mobile-highlight{max-width:650px;margin:22px auto 0;text-align:left}.pf-mobile-visual{order:2;min-height:520px;max-width:700px;width:100%;margin:auto}.pf-tablet-device{left:7%}.pf-phone-device{right:7%}}
@media(max-width:620px){.pf-mobile-section{padding:64px 20px 72px}.pf-mobile-copy h2{font-size:34px}.pf-mobile-copy>p{font-size:14px}.pf-mobile-visual{min-height:430px;margin-top:2px}.pf-mobile-glow{width:390px;height:390px}.pf-tablet-device{width:340px;height:252px;left:-48px;top:50px;border-width:6px;border-radius:20px}.pf-tablet-screen{padding:10px}.pf-mobile-appbar{height:34px}.pf-mobile-screen-title{padding:10px 2px 6px}.pf-mobile-screen-title strong{font-size:12px}.pf-mobile-kpis span{padding:8px}.pf-mobile-kpis b{font-size:15px}.pf-mobile-list{margin-top:7px;padding:5px 8px}.pf-mobile-list i{height:6px;margin:6px 0}.pf-phone-device{width:170px;height:338px;right:-9px;bottom:20px;border-width:6px;border-radius:28px}.pf-phone-notch{width:57px;height:13px}.pf-phone-screen{padding:12px 7px 7px}.pf-phone-screen .pf-mobile-appbar{height:31px}.pf-phone-greeting{padding:12px 2px 7px}.pf-phone-greeting strong{font-size:13px}.pf-phone-card{padding:10px}.pf-phone-card b{font-size:20px}.pf-phone-rows i{height:35px;margin-bottom:5px}.pf-phone-rows i:before{width:20px;height:20px;left:6px;top:7px}.pf-phone-rows i:after{left:33px;right:7px;top:10px;height:4px;box-shadow:0 8px 0 #eef1f5}.pf-mobile-float{left:0;bottom:18px;padding:9px 11px}.pf-mobile-float>span{width:27px;height:27px}.pf-mobile-float strong{font-size:8px}.pf-mobile-benefits article{grid-template-columns:34px 1fr}.pf-mobile-benefits article>b{width:30px;height:30px}.pf-mobile-highlight{align-items:flex-start}}

/* =========================================================
   FASE 19.3 — PAINEL ADMINISTRADOR MASTER
   ========================================================= */
.master-sidebar-label{margin:4px 20px 10px;color:rgba(255,255,255,.48);font-size:9px;font-weight:800;letter-spacing:.12em}.master-context-card{margin:0 12px 14px;padding:12px;border:1px solid rgba(255,255,255,.12);border-radius:12px;background:rgba(255,255,255,.06)}.master-context-card span,.master-context-card strong,.master-context-card a{display:block}.master-context-card span{font-size:8px;font-weight:800;letter-spacing:.1em;color:rgba(255,255,255,.48)}.master-context-card strong{margin-top:5px;font-size:11px;line-height:1.35;color:#fff}.master-context-card a{margin-top:9px;font-size:9px;font-weight:700;color:#fff;text-decoration:none}.master-stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:18px 0}.master-stat{padding:18px;border:1px solid var(--border);border-radius:14px;background:#fff;box-shadow:0 4px 18px rgba(16,24,40,.04)}.master-stat span,.master-stat strong,.master-stat small{display:block}.master-stat span{font-size:10px;font-weight:700;color:var(--muted)}.master-stat strong{margin:6px 0 3px;font-size:28px;color:var(--primary)}.master-stat small{font-size:9px;color:var(--muted)}.master-panel{margin-top:16px}.master-table td:first-child strong,.master-table td:first-child small{display:block}.master-table td:first-child small{margin-top:3px;color:var(--muted);font-size:9px}.actions-cell{display:flex;gap:6px;align-items:center;justify-content:flex-end;flex-wrap:wrap}.inline-form{display:inline}.status-pill.muted{background:#f2f4f7;color:#667085}.master-modal-card{width:min(900px,calc(100vw - 28px));max-width:900px}.master-admin-fields{margin-top:18px;padding-top:16px;border-top:1px solid var(--border)}.master-admin-fields .section-heading{margin-bottom:12px}.master-admin-fields .section-heading h4{margin:0;font-size:13px}.master-admin-fields .section-heading p{margin:3px 0 0;font-size:9px;color:var(--muted)}
@media(max-width:900px){.master-stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.master-table{min-width:780px}}
@media(max-width:600px){.master-stats-grid{grid-template-columns:1fr 1fr;gap:9px}.master-stat{padding:14px}.master-stat strong{font-size:23px}.master-modal-card .form-grid.cols-2,.master-modal-card .form-grid.cols-3{grid-template-columns:1fr}.page-header{align-items:flex-start;gap:12px}.page-header>.btn{width:100%}}


/* ============================================================
   FASE 19.3.1 — AJUSTE VISUAL DO PAINEL MASTER
   Corrige estrutura de conteúdo, cabeçalho e ações da tabela.
   ============================================================ */
.master-main {
    min-width: 0;
    width: 100%;
}

.master-content {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.master-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.master-page-header > div {
    min-width: 0;
}

.master-page-header .eyebrow {
    display: block;
    margin-bottom: 7px;
    color: #8792a5;
}

.master-page-header h1 {
    margin: 0;
    font-size: 26px;
    line-height: 1.15;
    color: var(--text);
}

.master-page-header p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.master-page-header > .btn {
    flex: 0 0 auto;
}

.master-panel {
    overflow: hidden;
}

.master-panel .panel-heading {
    padding: 20px 20px 16px;
}

.master-panel .panel-heading h2 {
    margin: 6px 0 0;
    font-size: 18px;
}

.master-panel .panel-heading p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.master-panel .table-wrap {
    margin: 0 16px 16px;
}

.master-table {
    min-width: 860px;
}

.master-table th,
.master-table td {
    vertical-align: middle;
}

.master-table .actions-col,
.master-table .actions-cell {
    width: 225px;
    min-width: 225px;
}

.master-table .actions-cell {
    display: table-cell;
    text-align: right !important;
    white-space: nowrap;
}

.master-table .actions-cell > .btn,
.master-table .actions-cell > .inline-form {
    display: inline-block;
    vertical-align: middle;
    margin-left: 5px;
}

.master-table .actions-cell > .btn:first-child {
    margin-left: 0;
}

.master-table .inline-form .btn {
    display: inline-flex;
}

@media (max-width: 1024px) {
    .master-page-header {
        align-items: flex-start;
    }

    .master-table .actions-col,
    .master-table .actions-cell {
        width: 210px;
        min-width: 210px;
    }
}

@media (max-width: 650px) {
    .master-content {
        padding: 16px;
    }

    .master-page-header {
        flex-direction: column;
        gap: 14px;
    }

    .master-page-header h1 {
        font-size: 23px;
    }

    .master-page-header > .btn {
        width: 100%;
        justify-content: center;
    }

    .master-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .master-panel .panel-heading {
        padding: 16px 14px 12px;
    }

    .master-panel .table-wrap {
        margin: 0 10px 10px;
    }
}

@media (max-width: 420px) {
    .master-stats-grid {
        grid-template-columns: 1fr;
    }
}
\n\n/* ============================================================\n   FASE 19.3.2 — AÇÕES DO PAINEL MASTER NO PADRÃO PRINTFLOW\n   ============================================================ */\n.master-table .actions-col,\n.master-table .actions-cell {\n    width: 288px;\n    min-width: 288px;\n}\n\n.master-table .master-actions-cell {\n    display: table-cell;\n    text-align: right !important;\n    white-space: nowrap;\n}\n\n.master-actions-cell > .cadastro-list-action,\n.master-actions-cell > .inline-form {\n    display: inline-flex;\n    vertical-align: middle;\n    margin-left: 5px;\n}\n\n.master-actions-cell > .cadastro-list-action:first-child {\n    margin-left: 0;\n}\n\n.master-actions-cell .inline-form {\n    margin-top: 0;\n    margin-bottom: 0;\n}\n\n.master-actions-cell .cadastro-list-action {\n    min-width: 76px;\n    height: 28px;\n    text-decoration: none;\n}\n\n.master-list-action-enter {\n    color: #245f91;\n    border-color: #c9dbea;\n    background: #f8fbfe;\n}\n\n.master-list-action-enter:hover {\n    color: #164c79;\n    border-color: #afc9df;\n    background: #edf6fc;\n    box-shadow: 0 2px 5px rgba(36, 95, 145, .10);\n}\n\n.master-list-action-disable {\n    color: #b04444;\n    border-color: #ebd0d0;\n}\n\n.master-list-action-disable:hover {\n    color: #943333;\n    border-color: #deb6b6;\n    background: #fff5f5;\n    box-shadow: 0 2px 5px rgba(176, 68, 68, .09);\n}\n\n.master-list-action-enable {\n    color: #287957;\n    border-color: #cce3d8;\n}\n\n.master-list-action-enable:hover {\n    color: #1f6648;\n    border-color: #afd3c1;\n    background: #f3fbf7;\n    box-shadow: 0 2px 5px rgba(40, 121, 87, .09);\n}\n\n@media (max-width: 1024px) {\n    .master-table .actions-col,\n    .master-table .actions-cell {\n        width: 288px;\n        min-width: 288px;\n    }\n}\n
/* ============================================================
   FASE 19.3.3 — ALINHAMENTO DA COLUNA AÇÕES DO PAINEL MASTER
   ============================================================ */
.master-table th.actions-col {
    width: 288px;
    min-width: 288px;
    text-align: center !important;
}

.master-table td.master-actions-cell {
    width: 288px;
    min-width: 288px;
    padding-left: 10px;
    padding-right: 10px;
    text-align: center !important;
    vertical-align: middle;
    white-space: nowrap;
}

.master-actions-cell {
    font-size: 0; /* remove os espaços de texto entre elementos inline */
}

.master-actions-cell > .cadastro-list-action,
.master-actions-cell > .inline-form {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin: 0 3px;
    font-size: initial;
}

.master-actions-cell > .inline-form {
    padding: 0;
}

.master-actions-cell .inline-form .cadastro-list-action,
.master-actions-cell > .cadastro-list-action {
    margin: 0;
    min-width: 76px;
    height: 28px;
}

@media (max-width: 1024px) {
    .master-table th.actions-col,
    .master-table td.master-actions-cell {
        width: 270px;
        min-width: 270px;
    }
}

/* ============================================================
   FASE 19.3.4 — TIPOGRAFIA DAS AÇÕES DO PAINEL MASTER
   ============================================================ */
.master-actions-cell > .cadastro-list-action,
.master-actions-cell > .inline-form {
    font-size: 0;
}

.master-actions-cell .cadastro-list-action {
    font-family: inherit;
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: normal;
}

.master-actions-cell .cadastro-list-action span {
    font: inherit;
    line-height: 1;
}

/* FASE 19.5.2 — ADMINISTRADORES MASTER */
.master-admin-panel{margin-top:16px}.master-admin-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:16px}.master-admin-heading>.btn{flex:0 0 auto}.master-users-table td:first-child small{display:block;margin-top:3px;color:var(--muted);font-size:9px}.master-user-modal-card{width:min(760px,calc(100vw - 28px));max-width:760px}.master-password-field small{display:block;margin-top:5px;color:var(--muted);font-size:9px}.master-security-note{display:flex;gap:10px;align-items:flex-start;margin-top:18px;padding:12px 14px;border:1px solid #d8e4f2;border-radius:10px;background:#f7faff}.master-security-note strong{font-size:10px;white-space:nowrap;color:#274e7a}.master-security-note span{font-size:9px;line-height:1.5;color:var(--muted)}
@media(max-width:700px){.master-admin-heading{align-items:stretch;flex-direction:column}.master-admin-heading>.btn{width:100%}.master-security-note{flex-direction:column}.master-users-table{min-width:760px}}

/* PWA: o atributo HTML hidden deve prevalecer sobre .nav-item/display:flex. */
[data-pwa-install][hidden] {
    display: none !important;
}


/* MASTER — reinício de ano letivo */
.master-list-action-reset{color:#b45309;border-color:#fed7aa;background:#fffaf5}.master-list-action-reset:hover{color:#9a3412;border-color:#fdba74;background:#fff7ed;box-shadow:0 2px 5px rgba(180,83,9,.10)}
.master-reset-modal-card{width:min(650px,calc(100vw - 28px));max-width:650px}.master-reset-warning{margin:4px 0 18px;padding:15px 16px;border:1px solid #fecaca;border-left:4px solid #dc2626;border-radius:10px;background:#fff7f7}.master-reset-warning strong{display:block;color:#b91c1c;font-size:12px;margin-bottom:6px}.master-reset-warning p{margin:0;color:#6b3b3b;font-size:10px;line-height:1.6}.master-reset-target{padding:10px 12px;border-radius:8px;background:#f6f8fb;font-size:10px;color:var(--muted)}.master-reset-target strong{color:var(--text)}.master-reset-submit{background:#b91c1c;color:#fff;border-color:#b91c1c}.master-reset-submit:hover:not(:disabled){background:#991b1b;border-color:#991b1b}.master-reset-submit:disabled{opacity:.45;cursor:not-allowed}

/* FASE 20 — CRIADOR DE ATIVIDADE */
.nav-group-toggle{width:100%;border:0;text-align:left}.nav-group-arrow{margin-left:auto}.nav-submenu{display:grid;gap:2px;margin:0 0 5px 26px;padding-left:9px;border-left:1px solid rgba(255,255,255,.15)}.nav-submenu[hidden]{display:none}.nav-submenu a{padding:7px 8px;border-radius:6px;color:rgba(255,255,255,.68);font-size:9px;text-decoration:none}.nav-submenu a:hover,.nav-submenu a.active{color:#fff;background:rgba(255,255,255,.09)}
.activity-models-page{padding-top:18px}.activity-intro{padding:22px 24px;margin-bottom:18px;border-radius:14px;background:linear-gradient(135deg,#173f70,#285b8f);color:#fff}.activity-kicker{font-size:8px;font-weight:800;letter-spacing:.14em;color:#9fd5ff}.activity-intro h2{margin:7px 0 5px;font-size:20px}.activity-intro p{max-width:720px;margin:0;color:rgba(255,255,255,.75);font-size:10px;line-height:1.6}.activity-template-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.activity-template-card{overflow:hidden;border:1px solid #dfe5ee;border-radius:13px;background:#fff;box-shadow:0 8px 24px rgba(25,45,75,.05)}.activity-template-card.is-disabled{opacity:.62}.activity-template-preview{height:170px;padding:22px;background:#f1f4f8;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center}.activity-template-preview:before{content:"";display:block;width:72px;height:98px;margin-bottom:10px;border-radius:3px;background:#fff;border:1px solid #d9e0e9;box-shadow:0 4px 14px rgba(0,0,0,.08)}.activity-template-preview span{position:absolute;transform:translate(44px,-61px);font-size:7px;font-weight:800;color:#8793a5}.activity-template-preview b{font-size:12px}.activity-template-preview small{margin-top:4px;color:#738096;font-size:9px}.activity-template-info{padding:15px}.activity-template-info h3{margin:8px 0 4px;font-size:12px}.activity-template-info p{margin:0;color:var(--muted);font-size:9px}.activity-card-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:13px}.activity-card-actions form{display:flex;gap:6px;flex-wrap:wrap}.activity-card-actions .btn{min-height:29px;padding:6px 9px;font-size:8px}.activity-empty{grid-column:1/-1;display:flex;min-height:240px;flex-direction:column;align-items:center;justify-content:center;gap:8px;border:1px dashed #cbd5e1;border-radius:14px;background:#fff;color:var(--muted)}.activity-empty strong{color:var(--text);font-size:13px}
.activity-editor-shell .main{overflow:hidden}.activity-editor-flash{margin:10px 18px}.activity-editor-layout{display:grid;grid-template-columns:250px 1fr;height:calc(100vh - 69px);background:#e9edf3}.activity-editor-panel{overflow:auto;padding:16px;background:#fff;border-right:1px solid #d8dee8}.activity-editor-panel h3{margin:2px 0 10px;font-size:10px;text-transform:uppercase;letter-spacing:.08em}.activity-editor-panel label{display:grid;gap:5px;margin-bottom:10px;color:#596579;font-size:8px;font-weight:700}.activity-editor-panel input,.activity-editor-panel select{width:100%;padding:8px 9px;border:1px solid #d7dee8;border-radius:7px;background:#fff;font:inherit;color:#172033}.activity-two-cols{display:grid;grid-template-columns:1fr 1fr;gap:8px}.activity-editor-panel hr{border:0;border-top:1px solid #edf0f4;margin:16px 0}.activity-tool-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}.activity-tool-grid button{padding:9px 6px;border:1px solid #dbe2eb;border-radius:7px;background:#f8fafc;font-size:9px;font-weight:700;cursor:pointer}.activity-tool-grid button:hover{border-color:#3e4095;color:#3e4095}.activity-properties{font-size:9px;color:var(--muted)}.activity-properties label{margin-bottom:8px}.activity-properties .prop-row{display:grid;grid-template-columns:1fr 1fr;gap:7px}.activity-delete-element{width:100%;margin-top:10px}.activity-workspace{min-width:0;overflow:auto}.activity-workspace-toolbar{position:sticky;top:0;z-index:5;height:42px;padding:0 16px;display:flex;align-items:center;justify-content:space-between;background:#fff;border-bottom:1px solid #d8dee8;font-size:9px}.activity-workspace-toolbar button{width:27px;height:27px;border:1px solid #d8dee8;background:#fff;border-radius:6px}.activity-canvas-stage{min-width:850px;min-height:1100px;padding:35px;display:flex;justify-content:center;align-items:flex-start}.activity-page{position:relative;width:794px;height:1123px;transform-origin:top center;background:#fff;box-shadow:0 10px 35px rgba(20,30,50,.18);overflow:hidden}.activity-page.landscape{width:1123px;height:794px}.activity-element{position:absolute;min-width:25px;min-height:18px;padding:3px;box-sizing:border-box;cursor:move;outline:1px solid transparent;resize:both;overflow:hidden}.activity-element:hover{outline:1px dashed #7c86c8}.activity-element.selected{outline:2px solid #3e4095}.activity-element[data-type="line"]{min-height:5px;height:5px;padding:0;border-top:2px solid #172033;resize:horizontal}.activity-element[data-type="box"]{border:1px solid #172033}.activity-element img{width:100%;height:100%;object-fit:contain;pointer-events:none}.activity-field{display:inline-block;padding:3px 6px;border-radius:4px;background:#eef2ff;color:#3e4095;font-weight:700}.topbar-actions{display:flex;gap:8px}
@media(max-width:1100px){.activity-template-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.activity-editor-layout{grid-template-columns:220px 1fr}}@media(max-width:760px){.activity-template-grid{grid-template-columns:1fr}.activity-editor-layout{display:block;height:auto}.activity-editor-panel{border-right:0}.activity-canvas-stage{overflow:auto}.topbar-actions{flex-wrap:wrap}}


/* FASE 20.0.5 — atalhos de teclado e imã de alinhamento */
.activity-editor-toolbar-actions{
    display:flex;
    align-items:center;
    gap:8px;
}
.activity-keyboard-hint{
    font-size:11px;
    color:#687386;
    margin-right:4px;
    white-space:nowrap;
}
.activity-magnet-toggle{
    min-width:110px;
    border:1px solid #cbd4e1;
    background:#fff;
    color:#455268;
    border-radius:7px;
    padding:6px 9px;
    font-weight:700;
    cursor:pointer;
}
.activity-magnet-toggle.is-active{
    border-color:#3E4095;
    color:#2f327e;
    background:#eef0ff;
}
.activity-page{
    position:relative;
}
.activity-snap-guide{
    position:absolute;
    z-index:9999;
    pointer-events:none;
    background:#5b62e8;
    opacity:.85;
}
.activity-snap-guide-v{
    top:0;
    bottom:0;
    width:1px;
}
.activity-snap-guide-h{
    left:0;
    right:0;
    height:1px;
}
.activity-snap-guide[hidden]{
    display:none !important;
}
@media (max-width:1100px){
    .activity-keyboard-hint{display:none;}
}


/* FASE 20.0.6 — Desfazer / Refazer */
.activity-history-btn{
    border:1px solid #cbd4e1;
    background:#fff;
    color:#334155;
    border-radius:7px;
    padding:6px 9px;
    font-weight:700;
    cursor:pointer;
    min-width:92px;
}
.activity-history-btn:hover:not(:disabled){
    border-color:#3E4095;
    color:#2f327e;
    background:#f7f7ff;
}
.activity-history-btn:disabled{
    opacity:.42;
    cursor:not-allowed;
}


/* FASE 20.0.8 — tamanhos de papel no editor */
.activity-canvas-stage{
    overflow:auto;
    align-items:flex-start;
    justify-content:center;
}
.activity-page{
    flex:0 0 auto;
    transform-origin:top center;
}
.activity-editor-panel select[data-paper]{
    font-size:12px;
}


/* FASE 21 — Criador de Atividade: montagem de questões */
.activity-builder{max-width:1050px;margin:0 auto;padding-top:24px}
.activity-builder-steps{display:flex;align-items:center;gap:10px;margin-bottom:18px}
.activity-builder-steps span{flex:1;padding:11px 14px;border:1px solid #dfe4ec;background:#fff;color:#7a8597;border-radius:10px;font-size:12px}
.activity-builder-steps span.is-active{border-color:#3e4095;color:#30337f;background:#f5f6ff}
.activity-builder-steps b{margin-left:5px}
.activity-builder-card{background:#fff;border:1px solid #dfe4ec;border-radius:14px;padding:24px;box-shadow:0 8px 24px rgba(25,34,60,.05)}
.activity-builder-card-head>span{font-size:10px;font-weight:800;letter-spacing:.12em;color:#3e4095}
.activity-builder-card-head h2{margin:6px 0 4px;font-size:24px;color:#192338}
.activity-builder-card-head p{margin:0 0 22px;color:#718096}
.activity-builder-field{display:grid;gap:7px;font-weight:700;color:#2e3748}
.activity-builder-field select,.activity-builder-field textarea{width:100%;border:1px solid #ccd5e3;border-radius:9px;padding:12px;background:#fff;font:inherit;color:#172033}
.activity-builder-field textarea{resize:vertical;min-height:210px;line-height:1.55}
.activity-builder-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}
.activity-builder-actions-split{justify-content:space-between}
.activity-question-counter{margin-top:10px;font-size:12px;color:#718096}
.activity-review-list{display:grid;gap:10px;max-height:420px;overflow:auto}
.activity-review-list article{display:grid;grid-template-columns:32px 1fr;gap:8px;padding:13px;border:1px solid #e1e6ef;border-radius:9px;background:#fbfcfe}
.activity-review-list p{margin:0;line-height:1.5;color:#263247}
.activity-finished-card,.activity-drive-config{max-width:760px;margin:34px auto;background:#fff;border:1px solid #dfe4ec;border-radius:16px;padding:32px;text-align:center;box-shadow:0 12px 34px rgba(25,34,60,.07)}
.activity-finished-icon{width:62px;height:62px;margin:0 auto 14px;border-radius:50%;display:grid;place-items:center;background:#eaf8ef;color:#1f9254;font-size:30px;font-weight:800}
.activity-finished-card h2{font-size:28px;margin:0 0 8px}.activity-finished-card p{color:#718096}.activity-finished-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;margin-top:24px}
.activity-drive-config{text-align:left}.activity-drive-config pre,.activity-code-box{background:#f5f7fb;border:1px solid #dfe4ec;border-radius:10px;padding:14px;overflow:auto}.activity-drive-config code{font-family:Consolas,monospace}
@media(max-width:760px){.activity-builder-steps{display:grid}.activity-builder-actions-split{flex-direction:column}.activity-builder-actions-split .btn{width:100%}}


/* FASE 21.1 — editor visual de cada questão */
.activity-question-step{
    max-width:none;
}
.activity-statement-field textarea{
    min-height:86px !important;
    resize:vertical;
}
.question-designer{
    display:grid;
    grid-template-columns:210px minmax(0,1fr);
    margin-top:18px;
    border:1px solid #dbe2eb;
    border-radius:12px;
    overflow:hidden;
    background:#eef2f7;
}
.question-designer-tools{
    padding:14px;
    background:#fff;
    border-right:1px solid #dbe2eb;
}
.question-designer-tools h3{
    margin:2px 0 10px;
    font-size:10px;
    text-transform:uppercase;
    letter-spacing:.08em;
}
.question-designer-tools hr{
    border:0;
    border-top:1px solid #edf0f4;
    margin:16px 0;
}
.question-designer-tools label{
    display:grid;
    gap:5px;
    margin-bottom:8px;
    color:#596579;
    font-size:9px;
    font-weight:700;
}
.question-designer-tools input,
.question-designer-tools select,
.question-designer-tools textarea{
    width:100%;
    padding:7px 8px;
    border:1px solid #d7dee8;
    border-radius:7px;
    background:#fff;
    font:inherit;
    color:#172033;
    box-sizing:border-box;
}
.question-designer-workspace{
    min-width:0;
    overflow:auto;
}
.question-designer-toolbar{
    min-height:42px;
    padding:6px 12px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    background:#fff;
    border-bottom:1px solid #dbe2eb;
    font-size:10px;
}
.question-designer-toolbar button{
    min-width:28px;
    height:28px;
    border:1px solid #d8dee8;
    background:#fff;
    border-radius:6px;
}
.question-canvas-stage{
    min-width:780px;
    min-height:480px;
    padding:28px;
    display:flex;
    align-items:flex-start;
    justify-content:center;
    overflow:auto;
}
.question-canvas{
    position:relative;
    width:720px;
    height:420px;
    flex:0 0 auto;
    transform-origin:top center;
    background:#fff;
    box-shadow:0 8px 28px rgba(20,30,50,.16);
    overflow:hidden;
}
.question-element{
    z-index:2;
}
.activity-review-list article{
    display:flex;
    align-items:flex-start;
    gap:12px;
}
.activity-review-list article>div{
    flex:1;
}
.activity-review-list small{
    color:#7b8798;
}
@media(max-width:900px){
    .question-designer{grid-template-columns:1fr}
    .question-designer-tools{border-right:0;border-bottom:1px solid #dbe2eb}
}
