* {
    box-sizing: border-box;
}

/* Premium Cell Tech visual refresh */
body {
    background: #f4f7fa;
    color: #1e293b;
}

.topbar {
    min-height: 118px;
    padding: 18px 32px;
    background: #030607;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 38px rgba(7, 19, 26, 0.14);
}

.brand-block {
    gap: 22px;
}

.brand-logo {
    width: 320px;
    height: 88px;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.brand-separator {
    width: 1px;
    height: 58px;
    background: rgba(116, 228, 239, 0.34);
}

.brand-cnpj {
    color: #f8fafc;
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 18px;
    border-right: 1px solid rgba(116, 228, 239, 0.34);
}

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

.user-chip small {
    color: #05bcd4;
    font-weight: 700;
}

.user-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    color: #fff;
    font-weight: 900;
}

.app-layout {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 0;
    min-height: calc(100vh - 118px);
    padding: 0;
}

.side-nav {
    position: static;
    min-height: calc(100vh - 118px);
    background: linear-gradient(180deg, #061015 0%, #0c1820 100%);
    border: 0;
    border-radius: 0;
    padding: 28px 12px;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
}

.side-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #dbe7ea;
    padding: 13px 16px;
    font-size: 15px;
}

.side-nav-item.active,
.side-nav-item:hover {
    background: linear-gradient(90deg, #008a9a 0%, #05a7b9 100%);
    border-color: rgba(5, 188, 212, 0.48);
    color: #fff;
    box-shadow: 0 10px 18px rgba(5, 188, 212, 0.16);
}

.side-nav-item span {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    font-size: 11px;
    font-weight: 900;
}

.side-nav-note {
    padding: 0 12px;
}

main {
    padding: 28px 24px;
}

.section-title-line {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.header-action-button {
    margin-left: auto;
    min-height: 42px;
    white-space: nowrap;
}

.section-title-line h2 {
    margin: 0;
    font-size: 25px;
}

.section-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(5, 188, 212, 0.12);
    color: #08899a;
    font-size: 12px;
    font-weight: 900;
}

.dashboard-grid {
    grid-template-columns: repeat(4, minmax(170px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.dashboard-grid article {
    position: relative;
    min-height: 108px;
    background: #fff;
    border: 1px solid #dfe7ec;
    border-radius: 9px;
    padding: 24px 20px 20px 92px;
    box-shadow: 0 10px 26px rgba(15, 32, 38, 0.07);
}

.dashboard-grid article::before {
    content: "$";
    position: absolute;
    left: 24px;
    top: 26px;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    background: linear-gradient(135deg, #058b98, #05bcd4);
    color: #fff;
    font-size: 28px;
    font-weight: 800;
}

.dashboard-grid article:nth-child(2)::before {
    content: "OS";
    font-size: 17px;
    background: linear-gradient(135deg, #2b7fff, #51a4ff);
}

.dashboard-grid article:nth-child(3)::before {
    content: "SV";
    font-size: 17px;
    background: linear-gradient(135deg, #ff7a00, #ff9d2e);
}

.dashboard-grid article:nth-child(4)::before {
    content: "NF";
    font-size: 17px;
    background: linear-gradient(135deg, #ef4444, #fb7185);
}

.dashboard-grid article:nth-child(5)::before {
    content: "GA";
    font-size: 17px;
    background: linear-gradient(135deg, #047c8a, #0fb5c7);
}

.dashboard-grid article:nth-child(6)::before {
    content: "R$";
    font-size: 17px;
    background: linear-gradient(135deg, #0f766e, #05bcd4);
}

.dashboard-grid span {
    color: #475569;
    font-size: 14px;
}

.dashboard-grid strong {
    margin-top: 8px;
    font-size: 26px;
    color: #03242b;
}

/* Full-screen work dialogs */
.modal:not(.small-modal) {
    width: calc(100vw - 28px) !important;
    max-width: calc(100vw - 28px) !important;
    height: calc(100vh - 28px) !important;
    max-height: calc(100vh - 28px) !important;
    margin: auto !important;
    overflow: hidden !important;
}

.modal:not(.small-modal) .modal-panel {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
}

.modal:not(.small-modal) .modal-head,
.modal:not(.small-modal) .customer-tools,
.modal:not(.small-modal) .report-controls,
.modal:not(.small-modal) .report-period-label {
    flex: 0 0 auto;
}

.modal:not(.small-modal) .customer-layout {
    flex: 1 1 auto;
    height: auto !important;
    min-height: 0;
    overflow: hidden;
}

.modal:not(.small-modal) .customer-list,
.modal:not(.small-modal) .customer-detail,
.modal:not(.small-modal) .status-dialog-orders {
    min-height: 0;
    overflow: auto;
}

.modal:not(.small-modal) .reports {
    overflow: auto !important;
}

.modal:not(.small-modal) .reports .report-grid,
.modal:not(.small-modal) .reports .report-lists {
    flex: 0 0 auto;
}

.modal:not(.small-modal) .status-window-panel {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
}

.modal:not(.small-modal) .modal-form {
    overflow: auto !important;
}

.modal:not(.small-modal) .modal-form .actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #dfe7ec;
    padding-top: 12px;
}

.modal:not(.small-modal) .suppliers-panel,
.modal:not(.small-modal) .customers-panel,
.modal:not(.small-modal) .status-window-panel {
    padding: 22px;
}

.fiado-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: -4px 0 18px;
    border: 1px solid #fecaca;
    border-left: 6px solid #dc2626;
    border-radius: 8px;
    background: #fff1f2;
    color: #7f1d1d;
    padding: 13px 16px;
    box-shadow: 0 10px 24px rgba(127, 29, 29, 0.08);
}

.fiado-alert strong {
    white-space: nowrap;
}

.fiado-alert[hidden] {
    display: none;
}

.shop-access-warning {
    border: 1px solid #f59e0b;
    border-radius: 8px;
    background: #fffbeb;
    color: #92400e;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-weight: 800;
}

.shop-access-warning[hidden] {
    display: none;
}

.workspace {
    grid-template-columns: minmax(340px, 500px) 1fr;
    gap: 18px;
    margin-top: 0;
}

.admin-shell {
    padding: 28px 32px 40px;
}

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

.admin-hero h1 {
    margin: 0 0 6px;
    font-size: 28px;
}

.admin-hero p {
    margin: 0;
    color: #52616a;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
    gap: 18px;
}

.admin-form small {
    color: #52616a;
    margin: -8px 0 8px;
}

.shops-list {
    display: grid;
    gap: 10px;
}

.shop-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid #dfe7ec;
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}

.shop-card.blocked {
    border-color: #fecaca;
    background: #fff7f7;
}

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

.shop-card strong {
    font-size: 17px;
    color: #03242b;
}

.shop-card span {
    color: #087e8d;
    font-weight: 800;
}

.shop-card small {
    color: #52616a;
    margin-top: 4px;
}

.shop-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.shop-status {
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 800;
}

.shop-status.blocked {
    background: #fee2e2;
    color: #991b1b;
}

.shop-block-reason {
    color: #991b1b !important;
}

.blocked-box {
    text-align: center;
}

.blocked-reason {
    border-radius: 8px;
    background: #fee2e2;
    color: #991b1b !important;
    padding: 10px;
    font-weight: 800;
}

.panel {
    border-radius: 10px;
    padding: 22px;
    box-shadow: 0 10px 26px rgba(15, 32, 38, 0.07);
}

/* OS tabs compact final pass - keep at EOF */
#order-dialog .modal-form {
    height: min(860px, calc(100vh - 28px)) !important;
    max-height: calc(100vh - 28px) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

#order-dialog .modal-head {
    flex: 0 0 auto !important;
    min-height: 68px !important;
    padding: 14px 22px !important;
}

#order-dialog .os-progress {
    flex: 0 0 auto;
    padding: 14px 24px 8px !important;
    gap: 8px !important;
}

#order-dialog .os-progress span {
    min-height: 42px !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
}

#order-dialog .os-progress span.done {
    background: #dff7ec !important;
    color: #047857 !important;
}

#order-dialog .os-progress span.active {
    background: linear-gradient(135deg, #0f766e, #12b981) !important;
    color: #fff !important;
}

#order-dialog .os-tabs {
    flex: 0 0 auto;
    position: static !important;
    padding: 0 24px 10px !important;
    overflow-x: auto;
}

#order-dialog .os-tabs button {
    min-height: 38px !important;
    padding: 8px 14px !important;
    white-space: nowrap;
}

#order-dialog #os-summary,
#order-dialog .os-notes-grid,
#order-dialog #os-parts,
#order-dialog #os-history {
    flex: 1 1 auto;
    overflow: auto;
}

#order-dialog #os-summary {
    padding: 16px 24px 110px !important;
}

#order-dialog .os-notes-grid {
    padding: 0 24px 110px !important;
}

#order-dialog .os-card-grid {
    grid-template-columns: repeat(3, minmax(260px, 1fr)) !important;
    align-content: start;
}

#order-dialog .os-card-grid:has([data-os-tab-card][hidden]) {
    grid-template-columns: repeat(2, minmax(320px, 1fr)) !important;
}

#order-dialog .os-card {
    min-height: auto !important;
    padding: 16px !important;
}

#order-dialog .os-card h3 {
    margin-bottom: 12px !important;
    font-size: 17px !important;
}

#order-dialog .compact-field {
    margin-bottom: 9px !important;
}

#order-dialog .os-card input,
#order-dialog .os-card select,
#order-dialog .os-card textarea {
    min-height: 38px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
}

#order-dialog .os-card textarea {
    min-height: 180px !important;
}

#order-dialog .compact-pattern .pattern-grid {
    grid-template-columns: repeat(3, 30px) !important;
    gap: 6px !important;
}

#order-dialog .compact-pattern .pattern-grid button {
    width: 30px !important;
    height: 30px !important;
    min-height: 30px !important;
    font-size: 12px !important;
}

#order-dialog .order-parts-box {
    margin: 0 24px 110px !important;
    max-height: none !important;
    overflow: visible !important;
}

#order-dialog .actions {
    flex: 0 0 auto !important;
    position: sticky !important;
    bottom: 0 !important;
    min-height: 74px;
    margin-top: auto;
}

/* OS must behave like a full app screen, not like a small dialog. */
#order-dialog[open] {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    height: 100vh !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #f4f9fc !important;
    overflow: hidden !important;
}

#order-dialog[open]::backdrop {
    background: transparent !important;
}

#order-dialog[open] .modal-form {
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    max-height: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    display: grid !important;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto !important;
    overflow: hidden !important;
}

#order-dialog[open] #os-summary,
#order-dialog[open] .os-notes-grid,
#order-dialog[open] #os-parts,
#order-dialog[open] #os-history {
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

#order-dialog[open] #os-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    padding: 18px 32px !important;
}

#order-dialog[open] .os-notes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    padding: 0 32px 18px !important;
}

#order-dialog[open] .os-card {
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 0 !important;
}

#order-dialog[open] .actions {
    position: static !important;
    min-height: 72px !important;
}

@media (max-width: 1180px) {
    #order-dialog[open] #os-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 760px) {
    #order-dialog[open] #os-summary,
    #order-dialog[open] .os-notes-grid {
        grid-template-columns: 1fr !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

/* OS fullscreen correction: one viewport, one scroll, no cropped cards */
#order-dialog.modal {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
}

#order-dialog .modal-form {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: block !important;
}

#order-dialog .modal-head {
    position: sticky !important;
    top: 0 !important;
    z-index: 20 !important;
    min-height: 66px !important;
}

#order-dialog .os-progress {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(120px, 1fr)) !important;
    padding: 18px 32px 10px !important;
}

#order-dialog .os-progress span {
    min-width: 0 !important;
}

#order-dialog .os-tabs {
    position: sticky !important;
    top: 66px !important;
    z-index: 19 !important;
    display: flex !important;
    padding: 0 32px 10px !important;
    background: rgba(255, 255, 255, 0.98) !important;
    border-bottom: 1px solid #dce7ee !important;
}

#order-dialog #os-summary,
#order-dialog .os-notes-grid,
#order-dialog #os-parts,
#order-dialog #os-history {
    overflow: visible !important;
}

#order-dialog #os-summary {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap: 16px !important;
    padding: 22px 32px 16px !important;
}

#order-dialog .os-card-grid:has([data-os-tab-card][hidden]) {
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)) !important;
}

#order-dialog .os-notes-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)) !important;
    gap: 16px !important;
    padding: 0 32px 100px !important;
}

#order-dialog .os-notes-grid.summary-notes {
    padding-top: 0 !important;
}

#order-dialog [data-os-tab-card]:not([hidden]) {
    width: 100% !important;
    max-width: 100% !important;
}

#order-dialog .os-card {
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
}

#order-dialog .os-card input,
#order-dialog .os-card select,
#order-dialog .os-card textarea {
    max-width: 100% !important;
}

#order-dialog .os-card textarea {
    min-height: 145px !important;
}

#order-dialog .order-parts-box {
    margin: 22px 32px 100px !important;
}

#order-dialog .actions {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 22 !important;
    min-height: 76px !important;
    padding: 12px 32px !important;
}

@media (min-width: 1280px) {
    #order-dialog #os-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    #order-dialog .os-notes-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 900px) {
    #order-dialog .os-progress {
        grid-template-columns: 1fr !important;
    }

    #order-dialog .os-tabs {
        top: 66px !important;
        overflow-x: auto !important;
    }

    #order-dialog #os-summary,
    #order-dialog .os-notes-grid {
        grid-template-columns: 1fr !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

/* OS tabs compact final pass */
#order-dialog .modal-form {
    height: min(860px, calc(100vh - 28px)) !important;
    max-height: calc(100vh - 28px) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

#order-dialog .modal-head {
    flex: 0 0 auto !important;
    min-height: 68px !important;
    padding: 14px 22px !important;
}

#order-dialog .os-progress {
    flex: 0 0 auto;
    padding: 14px 24px 8px !important;
    gap: 8px !important;
}

#order-dialog .os-progress span {
    min-height: 42px !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
}

#order-dialog .os-progress span.done {
    background: #dff7ec !important;
    color: #047857 !important;
}

#order-dialog .os-progress span.active {
    background: linear-gradient(135deg, #0f766e, #12b981) !important;
    color: #fff !important;
}

#order-dialog .os-tabs {
    flex: 0 0 auto;
    position: static !important;
    padding: 0 24px 10px !important;
    overflow-x: auto;
}

#order-dialog .os-tabs button {
    min-height: 38px !important;
    padding: 8px 14px !important;
    white-space: nowrap;
}

#order-dialog #os-summary,
#order-dialog .os-notes-grid,
#order-dialog #os-parts,
#order-dialog #os-history {
    flex: 1 1 auto;
    overflow: auto;
}

#order-dialog #os-summary {
    padding: 16px 24px 110px !important;
}

#order-dialog .os-notes-grid {
    padding: 0 24px 110px !important;
}

#order-dialog .os-card-grid {
    grid-template-columns: repeat(3, minmax(260px, 1fr)) !important;
    align-content: start;
}

#order-dialog .os-card-grid:has([data-os-tab-card][hidden]) {
    grid-template-columns: repeat(2, minmax(320px, 1fr)) !important;
}

#order-dialog .os-card {
    min-height: auto !important;
    padding: 16px !important;
}

#order-dialog .os-card h3 {
    margin-bottom: 12px !important;
    font-size: 17px !important;
}

#order-dialog .compact-field {
    margin-bottom: 9px !important;
}

#order-dialog .os-card input,
#order-dialog .os-card select,
#order-dialog .os-card textarea {
    min-height: 38px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
}

#order-dialog .os-card textarea {
    min-height: 180px !important;
}

#order-dialog .compact-pattern .pattern-grid {
    grid-template-columns: repeat(3, 30px) !important;
    gap: 6px !important;
}

#order-dialog .compact-pattern .pattern-grid button {
    width: 30px !important;
    height: 30px !important;
    min-height: 30px !important;
    font-size: 12px !important;
}

#order-dialog .order-parts-box {
    margin: 0 24px 110px !important;
    max-height: none !important;
    overflow: visible !important;
}

#order-dialog .actions {
    flex: 0 0 auto !important;
    position: sticky !important;
    bottom: 0 !important;
    min-height: 74px;
    margin-top: auto;
}

/* OS real tab behavior */
#order-dialog [data-os-tab-card][hidden] {
    display: none !important;
}

#order-dialog .os-tabs button.active {
    color: #078ca0 !important;
    border-bottom-color: #05a7b9 !important;
    background: rgba(5, 188, 212, 0.08) !important;
}

#order-dialog .os-card-grid {
    align-items: stretch;
}

#order-dialog .os-card-grid:has([data-os-tab-card][hidden]) {
    grid-template-columns: repeat(2, minmax(320px, 1fr)) !important;
}

#order-dialog .os-card-grid .os-card:not([hidden]) {
    min-height: 260px;
}

#order-dialog .os-notes-grid .os-card:not([hidden]),
#order-dialog #os-parts:not([hidden]),
#order-dialog #os-history:not([hidden]) {
    min-height: 420px;
}

/* Final priority: OS visual layout */
#order-dialog.modal {
    padding: 14px;
}

#order-dialog .modal-form {
    width: min(1540px, calc(100vw - 28px)) !important;
    max-height: calc(100vh - 28px) !important;
    padding: 0 !important;
    overflow: auto !important;
    background:
        radial-gradient(circle at right top, rgba(5, 188, 212, 0.18), transparent 260px),
        linear-gradient(180deg, #ffffff 0%, #f4f9fc 100%) !important;
}

#order-dialog .modal-head {
    position: sticky !important;
    top: 0;
    z-index: 12;
    min-height: 78px;
    padding: 18px 22px !important;
    background: linear-gradient(90deg, #071019 0%, #0b1723 100%) !important;
    box-shadow: 0 14px 24px rgba(15, 23, 42, 0.14);
}

#order-dialog .modal-head h2 {
    color: #fff !important;
    font-size: 24px;
}

#order-dialog .os-progress,
#order-dialog .os-tabs,
#order-dialog .os-card-grid,
#order-dialog .os-notes-grid {
    width: 100%;
}

#order-dialog .os-card-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(240px, 1fr));
    gap: 16px;
    padding: 18px 24px;
}

#order-dialog .os-notes-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 0 24px 18px;
}

#order-dialog .os-card {
    border-radius: 8px;
    padding: 18px;
}

#order-dialog .order-parts-box {
    margin: 0 24px 18px !important;
}

#order-dialog .actions {
    position: sticky !important;
    bottom: 0;
    z-index: 12;
    justify-content: center;
    padding: 14px 22px !important;
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: 0 -14px 28px rgba(15, 23, 42, 0.08);
}

@media (max-width: 980px) {
    #order-dialog .os-card-grid,
    #order-dialog .os-notes-grid {
        grid-template-columns: 1fr;
    }
}

/* OS visual workspace */
#order-dialog::backdrop {
    background: rgba(6, 16, 24, 0.58);
}

#order-dialog .modal-form {
    width: min(1540px, calc(100vw - 28px));
    max-height: calc(100vh - 28px);
    padding: 0;
    overflow: auto;
    background:
        radial-gradient(circle at right top, rgba(5, 188, 212, 0.18), transparent 260px),
        linear-gradient(180deg, #ffffff 0%, #f4f9fc 100%);
}

#order-dialog .modal-head {
    position: sticky;
    top: 0;
    z-index: 8;
    display: flex;
    align-items: center;
    min-height: 78px;
    padding: 18px 22px;
    background: linear-gradient(90deg, #071019 0%, #0b1723 100%);
    border-bottom: 0;
    box-shadow: 0 14px 24px rgba(15, 23, 42, 0.14);
}

#order-dialog .modal-head h2 {
    margin: 0;
    color: #fff;
    font-size: 24px;
}

#order-dialog #close-order {
    margin-left: auto;
    background: #eef5f8;
    color: #082f3a;
}

.os-progress {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 18px 24px 12px;
}

.os-progress span {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 46px;
    border-radius: 999px;
    background: #eef4f8;
    color: #334155;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.os-progress span.done {
    background: linear-gradient(135deg, #0f766e, #11b981);
    color: #fff;
}

.os-tabs {
    position: sticky;
    top: 78px;
    z-index: 7;
    display: flex;
    gap: 8px;
    padding: 0 24px 14px;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid #dce7ee;
}

.os-tabs button {
    min-height: 42px;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    color: #334155;
    font-weight: 800;
}

.os-tabs button:hover,
.os-tabs button:focus {
    color: #078ca0;
    border-bottom-color: #05a7b9;
}

.os-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(240px, 1fr));
    gap: 16px;
    padding: 18px 24px;
}

.os-notes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 0 24px 18px;
}

.os-card {
    min-height: 180px;
    border: 1px solid #dce7ee;
    border-radius: 8px;
    padding: 18px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.os-card h3 {
    margin: 0 0 14px;
    color: #082f3a;
    font-size: 18px;
}

.os-card-teal {
    background: linear-gradient(135deg, #0096a8, #075f70);
    color: #fff;
}

.os-card-purple {
    background: linear-gradient(135deg, #6d39c6, #43218d);
    color: #fff;
}

.os-card-blue {
    background: linear-gradient(135deg, #1265d8, #083a8f);
    color: #fff;
}

.os-card-orange h3,
.os-card-green h3,
.os-card-pink h3 {
    color: #082f3a;
}

.os-card-orange {
    border-top: 6px solid #ff9800;
}

.os-card-green {
    border-top: 6px solid #7bbf43;
}

.os-card-pink {
    border-top: 6px solid #f04493;
}

.os-card-note {
    border-top: 6px solid #0ea5b7;
}

.os-card-laudo {
    border-top: 6px solid #f59e0b;
}

.os-card-teal h3,
.os-card-purple h3,
.os-card-blue h3 {
    color: #fff;
}

.compact-field {
    margin-bottom: 12px;
}

#order-dialog .compact-field label,
#order-dialog .os-card > label,
#order-dialog .pattern-field label {
    display: block;
    margin-bottom: 6px;
    color: inherit;
    font-size: 12px;
    font-weight: 900;
    opacity: 0.86;
}

#order-dialog .os-card input,
#order-dialog .os-card select,
#order-dialog .os-card textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(148, 163, 184, 0.38);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.94);
    color: #0f172a;
    font-size: 15px;
}

#order-dialog .os-card-teal input,
#order-dialog .os-card-teal select,
#order-dialog .os-card-purple input,
#order-dialog .os-card-purple select,
#order-dialog .os-card-blue input,
#order-dialog .os-card-blue select {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

#order-dialog .os-card-teal input::placeholder,
#order-dialog .os-card-purple input::placeholder,
#order-dialog .os-card-blue input::placeholder {
    color: rgba(255, 255, 255, 0.74);
}

#order-dialog .os-card-teal select option,
#order-dialog .os-card-purple select option,
#order-dialog .os-card-blue select option {
    color: #0f172a;
}

#order-dialog .selected-customer-hint {
    display: block;
    margin: -4px 0 12px;
    color: inherit;
    opacity: 0.78;
}

#order-dialog .compact-pattern .pattern-grid {
    grid-template-columns: repeat(3, 34px);
    gap: 7px;
    margin: 8px 0;
}

#order-dialog .compact-pattern .pattern-grid button {
    width: 34px;
    height: 34px;
    min-height: 34px;
    border-radius: 999px;
}

#order-dialog .order-parts-box {
    margin: 0 24px 18px;
    border-radius: 8px;
}

#order-dialog .actions {
    position: sticky;
    bottom: 0;
    z-index: 9;
    justify-content: center;
    gap: 10px;
    padding: 14px 22px;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid #dce7ee;
    box-shadow: 0 -14px 28px rgba(15, 23, 42, 0.08);
}

#order-dialog .actions button {
    min-height: 42px;
}

@media (max-width: 980px) {
    .os-card-grid,
    .os-notes-grid {
        grid-template-columns: 1fr;
    }

    .os-progress {
        grid-template-columns: 1fr;
    }

    .os-tabs {
        overflow-x: auto;
    }
}

/* Final override: large dialogs always open as full-screen workspaces. */
.modal:not(.small-modal) {
    width: calc(100vw - 28px) !important;
    max-width: calc(100vw - 28px) !important;
    height: calc(100vh - 28px) !important;
    max-height: calc(100vh - 28px) !important;
    margin: auto !important;
    overflow: hidden !important;
}

.modal:not(.small-modal) .modal-panel {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
}

.modal:not(.small-modal) .modal-head,
.modal:not(.small-modal) .customer-tools,
.modal:not(.small-modal) .report-controls,
.modal:not(.small-modal) .report-period-label {
    flex: 0 0 auto;
}

.modal:not(.small-modal) .customer-layout {
    flex: 1 1 auto;
    height: auto !important;
    min-height: 0;
    overflow: hidden;
}

.modal:not(.small-modal) .customer-list,
.modal:not(.small-modal) .customer-detail,
.modal:not(.small-modal) .status-dialog-orders {
    min-height: 0;
    overflow: auto;
}

.modal:not(.small-modal) .reports {
    overflow: auto !important;
}

.modal:not(.small-modal) .reports .report-grid,
.modal:not(.small-modal) .reports .report-lists {
    flex: 0 0 auto;
}

.modal:not(.small-modal) .status-window-panel {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
}

.modal:not(.small-modal) .modal-form {
    overflow: auto !important;
}

.modal:not(.small-modal) .modal-form .actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #dfe7ec;
    padding-top: 12px;
}

.modal:not(.small-modal) .suppliers-panel,
.modal:not(.small-modal) .customers-panel,
.modal:not(.small-modal) .status-window-panel {
    padding: 22px;
}

/* Hide text inside dashboard color circles */
.dashboard-grid article::before,
.dashboard-grid article:nth-child(2)::before,
.dashboard-grid article:nth-child(3)::before,
.dashboard-grid article:nth-child(4)::before,
.dashboard-grid article:nth-child(5)::before,
.dashboard-grid article:nth-child(6)::before {
    content: "" !important;
}

/* Customer registry */
.inline-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.compact-button {
    min-height: 42px;
    padding: 0 14px;
}

.selected-customer-hint {
    display: block;
    margin-top: 6px;
    color: #08899a;
    font-weight: 700;
}

.customers-panel {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#customers-dialog {
    width: min(1500px, 96vw);
    max-width: 96vw;
    height: 92vh;
    max-height: 92vh;
}

#status-dialog {
    width: min(1500px, 96vw);
    max-width: 96vw;
    height: 92vh;
    max-height: 92vh;
}

.status-window-panel {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: 12px;
}

.status-dialog-orders {
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.customer-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    margin-bottom: 16px;
}

.customer-layout {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 18px;
    height: calc(92vh - 132px);
    min-height: 0;
}

.customer-list {
    max-height: none;
    min-height: 0;
    height: 100%;
    overflow: auto;
    border: 1px solid #dfe7ec;
    border-radius: 10px;
    padding: 10px;
    background: #f8fbfc;
}

.customer-row {
    width: 100%;
    display: grid;
    gap: 4px;
    text-align: left;
    margin-bottom: 8px;
    padding: 12px;
    border: 1px solid #dfe7ec;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    box-shadow: none;
}

.customer-row:hover {
    border-color: #05bcd4;
    background: #effbfc;
}

.customer-row-final {
    border-left: 5px solid #7dd3fc;
}

.customer-row-lojista {
    border-left: 5px solid #facc15;
}

.customer-row strong {
    color: #03242b;
}

.customer-row span,
.customer-row small {
    color: #475569;
}

.customer-type-chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-right: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.customer-type-chip.cliente-final {
    background: #e0f2fe;
    color: #0369a1;
}

.customer-type-chip.lojista {
    background: #fef3c7;
    color: #92400e;
}

.credit-chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 4px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
}

.manual-credit-form,
.editable-credit {
    display: grid;
    gap: 8px;
}

.manual-credit-form {
    grid-template-columns: minmax(120px, 180px) minmax(0, 1fr) auto;
    margin-bottom: 12px;
}

.editable-credit {
    margin-bottom: 10px;
}

.editable-credit input {
    min-width: 0;
}

.danger-button {
    border-color: #fecaca;
    color: #991b1b;
}

.danger-button:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.pattern-field {
    align-self: start;
}

.pattern-grid {
    display: grid;
    grid-template-columns: repeat(3, 44px);
    gap: 8px;
    margin-top: 8px;
}

.pattern-grid button {
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    box-shadow: none;
    font-weight: 800;
}

.pattern-grid button.active {
    background: #05a7b9;
    border-color: #02899a;
    color: #fff;
}

.customer-detail {
    display: grid;
    grid-template-columns: minmax(280px, 450px) minmax(0, 1fr);
    gap: 18px;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.customer-form {
    display: grid;
    gap: 10px;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.customer-code-card {
    border-radius: 10px;
    padding: 16px;
    background: linear-gradient(135deg, #031116, #06353d);
    color: #fff;
}

.customer-code-card span,
.customer-code-card strong {
    display: block;
}

.customer-code-card span {
    color: #9feaf2;
    font-size: 13px;
}

.customer-code-card strong {
    margin-top: 4px;
    font-size: 30px;
}

.customer-history {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.customer-history h3 {
    margin-top: 0;
}

.order-parts-box {
    margin-top: 16px;
    border: 1px solid #dfe7ec;
    border-radius: 8px;
    background: #f8fafc;
    padding: 14px;
}

.section-head-inline {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-head-inline h3,
.section-head-inline p {
    margin: 0;
}

.section-head-inline p {
    color: #52616a;
    font-size: 13px;
}

.parts-add-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.supplier-picker-field {
    position: relative;
    min-width: 0;
}

.supplier-picker-field input {
    width: 100%;
}

.supplier-suggestions {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    max-height: 260px;
    overflow: auto;
    border: 1px solid #cfd8df;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    padding: 6px;
}

.supplier-suggestions[hidden] {
    display: none;
}

.supplier-suggestions button {
    width: 100%;
    display: grid;
    gap: 2px;
    text-align: left;
    border-radius: 6px;
    margin-bottom: 4px;
    padding: 9px;
    background: #fff;
    color: #0f172a;
}

.supplier-suggestions button:hover {
    background: #effbfc;
}

.supplier-suggestions strong,
.supplier-suggestions small {
    display: block;
}

.supplier-suggestions small {
    color: #64727c;
}

.parts-list,
#supplier-parts-list {
    display: grid;
    gap: 9px;
}

.supplier-part-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
    align-items: start;
    gap: 14px;
    border: 1px solid #dfe7ec;
    border-radius: 8px;
    background: #fff;
    padding: 14px;
}

.supplier-part-card.part-open {
    border-left: 5px solid #dc2626;
}

.supplier-part-card.part-paid {
    border-left: 5px solid #16a34a;
}

.supplier-part-card.part-returned {
    border-left: 5px solid #2563eb;
}

.supplier-part-main {
    display: grid;
    grid-template-columns: minmax(220px, 1.3fr) repeat(4, minmax(130px, 0.75fr));
    gap: 10px 14px;
    min-width: 0;
}

.supplier-part-title,
.supplier-part-meta,
.supplier-part-card small {
    display: block;
}

.supplier-part-title strong {
    color: #03242b;
    display: block;
    font-size: 16px;
}

.supplier-part-meta span {
    display: block;
    color: #64727c;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.supplier-part-meta strong {
    display: block;
    color: #20313a;
    margin-top: 3px;
    font-size: 14px;
    line-height: 1.25;
}

.supplier-part-wide {
    grid-column: span 2;
}

.supplier-part-card small {
    color: #64727c;
    margin-top: 3px;
}

.warranty-expired-label {
    display: inline-block !important;
    width: fit-content;
    border-radius: 999px;
    background: #fee2e2;
    color: #991b1b !important;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 800;
}

.part-actions {
    position: relative;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
    max-width: none;
}

.part-actions button {
    padding: 7px 9px;
    font-size: 12px;
}

.part-menu {
    position: absolute;
    z-index: 25;
    right: 0;
    top: calc(100% + 6px);
    display: grid;
    gap: 6px;
    min-width: 170px;
    padding: 8px;
    border: 1px solid #d6e0e6;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18);
}

.part-menu[hidden] {
    display: none;
}

.part-menu button {
    width: 100%;
    text-align: left;
}

.suppliers-panel {
    width: min(1680px, calc(100vw - 28px));
}

.supplier-list-only {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    align-content: start;
    gap: 12px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 4px;
}

.supplier-list-only .customer-row {
    min-height: 116px;
}

.supplier-full-panel {
    width: min(1680px, calc(100vw - 28px));
}

.supplier-full-panel .supplier-parts-wide {
    flex: 1 1 auto;
    min-height: 0;
}

.supplier-full-panel #supplier-parts-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.supplier-detail-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
}

.supplier-detail-actions {
    display: flex;
    justify-content: flex-end;
}

.sales-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sales-report-grid {
    margin-top: 10px;
}

.sales-panel .customer-tools {
    grid-template-columns: minmax(0, 1fr) 150px auto auto;
    margin-bottom: 0;
}

.sales-layout.customer-layout {
    grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
}

.sales-list-panel {
    min-height: 0;
    overflow: auto;
}

.sales-list-only {
    flex: 1 1 auto;
    height: auto;
    max-height: none;
}

.sales-list {
    display: grid;
    gap: 10px;
}

.sale-device-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    border-left: 5px solid #7dd3fc;
}

.sale-device-row.part-paid {
    border-left-color: #50d890;
}

.sale-device-row.part-open {
    border-left-color: #facc15;
}

.sale-device-row.part-returned {
    border-left-color: #f08a8a;
}

.sale-device-row .part-actions {
    align-items: flex-end;
    min-width: 124px;
}

.sale-device-row .part-actions button {
    width: 100%;
    padding: 9px 12px;
}

.sale-device-price {
    color: #03242b;
    font-size: 18px;
    text-align: right;
    white-space: nowrap;
}

.sale-device-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-bottom: 1px solid #dce7ee;
    padding-bottom: 8px;
}

.sale-device-tabs button {
    min-height: 38px;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    color: #334155;
    font-weight: 800;
    white-space: nowrap;
}

.sale-device-tabs button.active {
    color: #078ca0;
    border-bottom-color: #05a7b9;
    background: rgba(5, 188, 212, 0.08);
}

.sale-device-tab-panel {
    display: grid;
    gap: 10px;
}

.device-checklist {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 10px;
}

.device-checklist label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #dfe7ec;
    border-radius: 8px;
    background: #f8fbfc;
    font-weight: 800;
}

.device-checklist input {
    width: auto;
}

.sale-device-sale-info {
    border: 1px solid #dfe7ec;
    border-radius: 8px;
    padding: 14px;
    background: #f8fbfc;
}

.sale-info-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 10px 14px;
    margin: 0;
}

.sale-info-list div {
    min-width: 0;
}

.sale-info-list dt {
    color: #52616a;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.sale-info-list dd {
    margin: 2px 0 0;
    color: #0f172a;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.sales-detail {
    grid-template-columns: minmax(280px, 520px);
}

.sales-form {
    max-width: 520px;
    width: min(760px, calc(100vw - 28px));
    max-width: min(760px, calc(100vw - 28px));
    max-height: calc(100vh - 28px);
    overflow: auto;
}

.sales-report-list {
    margin-top: 12px;
}

#sale-device-form-dialog {
    width: calc(100vw - 28px) !important;
    max-width: calc(100vw - 28px) !important;
    height: calc(100vh - 28px) !important;
    max-height: calc(100vh - 28px) !important;
    margin: auto !important;
    overflow: hidden !important;
}

#sale-device-form-dialog .sales-form {
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 22px;
}

#sale-device-form-dialog .modal-head,
#sale-device-form-dialog .customer-code-card,
#sale-device-form-dialog .sale-device-tabs,
#sale-device-form-dialog .actions {
    flex: 0 0 auto;
}

#sale-device-form-dialog .sale-device-tab-panel {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    align-content: start;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 12px 18px;
    padding: 14px 4px 18px 0;
}

#sale-device-form-dialog .sale-device-tab-panel[hidden] {
    display: none !important;
}

#sale-device-form-dialog .sale-device-tab-panel label,
#sale-device-form-dialog .sale-device-tab-panel input,
#sale-device-form-dialog .sale-device-tab-panel select,
#sale-device-form-dialog .sale-device-tab-panel textarea {
    min-width: 0;
}

#sale-device-form-dialog .sale-device-tab-panel textarea,
#sale-device-form-dialog .sale-device-sale-info,
#sale-device-form-dialog #sell-selected-device-button {
    grid-column: 1 / -1;
}

#sale-device-form-dialog .device-checklist,
#sale-device-form-dialog .sale-info-list {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
}

#sale-device-form-dialog .actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin-top: 0;
    padding-top: 12px;
    background: #fff;
    border-top: 1px solid #dfe7ec;
}

.accessories-panel {
    width: min(1680px, calc(100vw - 28px));
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.accessories-layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 16px;
    flex: 1 1 auto;
    min-height: 0;
}

.accessory-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.accessory-sidebar > button {
    width: 100%;
}

.accessory-categories {
    display: grid;
    gap: 10px;
    align-content: start;
    min-height: 0;
    overflow: auto;
    padding: 2px;
}

.accessory-categories button {
    text-align: left;
    border: 1px solid #dfe7ec;
    border-left: 5px solid #d7eef3;
    border-radius: 8px;
    background: #f8fbfc;
    color: #0f172a;
    padding: 12px;
}

.accessory-categories button.active {
    border-left-color: #0f9cad;
    background: #e9fbfd;
}

.accessory-categories strong,
.accessory-categories small {
    display: block;
}

.accessory-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    min-height: 0;
}

.accessory-main .customer-tools {
    grid-template-columns: minmax(0, 1fr) auto auto;
    margin-bottom: 0;
}

.accessories-list-panel {
    flex: 1 1 auto;
    height: auto;
    max-height: none;
}

.accessory-list {
    display: grid;
    gap: 10px;
}

.accessory-row {
    grid-template-columns: minmax(0, 1fr) auto;
    border-left: 5px solid #50d890;
}

.accessory-row.part-open {
    border-left-color: #facc15;
}

.accessory-row.part-returned {
    border-left-color: #f08a8a;
}

.accessory-row .part-actions {
    align-items: flex-end;
    min-width: 180px;
}

.accessory-row .part-actions button {
    width: 100%;
}

#accessory-form-dialog,
#accessory-sale-dialog {
    width: calc(100vw - 28px) !important;
    max-width: calc(100vw - 28px) !important;
    height: calc(100vh - 28px) !important;
    max-height: calc(100vh - 28px) !important;
    margin: auto !important;
    overflow: hidden !important;
}

#accessory-form-dialog .accessory-form-panel,
#accessory-sale-dialog .accessory-sale-panel {
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 22px;
}

.accessory-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 12px 18px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 4px 18px 0;
    align-content: start;
}

.accessory-form-grid label,
.accessory-form-grid input,
.accessory-form-grid select,
.accessory-form-grid textarea,
.accessory-form-grid .inline-control,
.accessory-form-grid small {
    min-width: 0;
}

.accessory-form-grid textarea,
.accessory-form-grid .inline-control,
.accessory-form-grid small {
    grid-column: 1 / -1;
}

#accessory-form-dialog .modal-head,
#accessory-form-dialog .customer-code-card,
#accessory-form-dialog .actions,
#accessory-sale-dialog .modal-head,
#accessory-sale-dialog .customer-code-card,
#accessory-sale-dialog .actions {
    flex: 0 0 auto;
}

#accessory-form-dialog .actions,
#accessory-sale-dialog .actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin-top: 0;
    padding-top: 12px;
    background: #fff;
    border-top: 1px solid #dfe7ec;
}

@media (max-width: 980px) {
    .sales-panel .customer-tools,
    .sales-layout.customer-layout,
    .accessories-layout,
    .accessory-main .customer-tools {
        grid-template-columns: 1fr;
    }

    .sale-device-row,
    .accessory-row {
        grid-template-columns: 1fr;
    }

    .sale-device-row .part-actions,
    .accessory-row .part-actions {
        align-items: stretch;
        min-width: 0;
    }

    .device-checklist,
    .sale-info-list {
        grid-template-columns: 1fr;
    }

    #sale-device-form-dialog .sale-device-tab-panel,
    #sale-device-form-dialog .device-checklist,
    #sale-device-form-dialog .sale-info-list,
    .accessory-form-grid {
        grid-template-columns: 1fr;
    }
}

.supplier-standalone-grid {
    grid-template-columns: minmax(180px, 1.5fr) repeat(4, minmax(120px, 1fr)) auto;
}

.suppliers-layout {
    grid-template-columns: 360px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    height: calc(100% - 84px);
    min-height: 0;
}

.supplier-detail {
    grid-template-columns: minmax(320px, 1.1fr) minmax(240px, 0.8fr) minmax(320px, 1fr);
    grid-template-rows: minmax(0, auto) minmax(340px, 1fr);
    align-items: start;
    overflow: hidden;
    height: 100%;
}

.supplier-detail .customer-history {
    min-height: 0;
}

.supplier-detail .parts-add-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.supplier-detail #supplier-parts-list {
    max-height: none;
    min-height: 0;
    height: auto;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.supplier-parts-wide {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow: hidden;
    border: 1px solid #dfe7ec;
    border-radius: 10px;
    background: #f8fafc;
    padding: 14px;
}

.supplier-parts-wide .section-head-inline {
    margin-bottom: 10px;
}

#supplier-part-search {
    flex: 0 0 auto;
    margin-bottom: 10px;
}

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

.part-detail-grid article {
    border: 1px solid #dfe7ec;
    border-radius: 8px;
    padding: 10px;
    background: #f8fafc;
}

.part-detail-grid span,
.part-detail-grid strong,
.part-detail-history small {
    display: block;
}

.part-detail-grid span {
    color: #64727c;
    font-size: 12px;
    font-weight: 800;
}

.part-detail-history {
    border-top: 1px solid #e2e8f0;
    margin-top: 14px;
    padding-top: 12px;
}

.supplier-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.supplier-summary article {
    border: 1px solid #dfe7ec;
    border-radius: 8px;
    background: #fff;
    padding: 14px;
}

.supplier-summary span,
.supplier-summary strong {
    display: block;
}

.supplier-summary span {
    color: #52616a;
    font-size: 13px;
    font-weight: 800;
}

.supplier-summary strong {
    margin-top: 6px;
    color: #03242b;
    font-size: 24px;
}

.part-action-field[hidden] {
    display: none;
}

.part-action-field {
    display: grid;
    gap: 6px;
}

.history-card,
.part-history {
    border-top: 1px solid #e6edf1;
    padding-top: 8px;
    margin-top: 8px;
}

.history-card strong,
.history-card span,
.history-card small,
.part-history small {
    display: block;
}

.history-card strong {
    color: #03242b;
}

.customer-order-row {
    cursor: pointer;
}

@media (max-width: 980px) {
    .customer-layout,
    .customer-detail {
        grid-template-columns: 1fr;
        height: auto;
        overflow: auto;
    }

    .customer-list {
        max-height: 300px;
        height: auto;
    }

    .parts-add-grid {
        grid-template-columns: 1fr;
    }

    .supplier-part-card {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .supplier-part-main {
        grid-template-columns: 1fr;
    }

    .supplier-part-wide {
        grid-column: auto;
    }

    .part-actions {
        justify-content: flex-start;
        min-width: 0;
        max-width: none;
    }

    #customers-dialog {
        width: 96vw;
        height: 94vh;
        max-height: 94vh;
    }

    #status-dialog {
        width: 96vw;
        height: 94vh;
        max-height: 94vh;
    }
}

.dashboard-grid article::before,
.dashboard-grid article:nth-child(2)::before,
.dashboard-grid article:nth-child(3)::before,
.dashboard-grid article:nth-child(4)::before,
.dashboard-grid article:nth-child(5)::before,
.dashboard-grid article:nth-child(6)::before {
    content: "";
}

body {
    margin: 0;
    background: #e9eef1;
    color: #172026;
    font-family: "Segoe UI", Arial, sans-serif;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 18% 18%, rgba(0, 188, 212, 0.18), transparent 32%),
        linear-gradient(135deg, #061015 0%, #101b22 45%, #eef2f5 45%, #eef2f5 100%);
}

.login-box {
    width: min(420px, calc(100vw - 32px));
    background: #fff;
    border: 1px solid #dce5ea;
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 22px 70px rgba(7, 19, 26, 0.22);
}

.login-brand {
    margin-bottom: 18px;
}

.login-brand img {
    display: block;
    width: 100%;
    max-height: 128px;
    object-fit: contain;
    background: #050505;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 14px;
}

.login-box h1 {
    margin: 0;
    font-size: 28px;
}

.login-box p {
    margin: 4px 0 20px;
    color: #5a6972;
}

label {
    display: block;
    margin: 10px 0 5px;
    color: #47545c;
    font-size: 13px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #c9d1d8;
    border-radius: 6px;
    padding: 10px;
    font: inherit;
    background: #fff;
}

textarea {
    min-height: 92px;
    resize: vertical;
}

button {
    border: 0;
    border-radius: 6px;
    padding: 10px 13px;
    background: #0897a7;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.secondary {
    background: #e8eef2;
    color: #1f2a30;
}

.login-box button {
    width: 100%;
    margin-top: 16px;
}

.login-error,
.message.error {
    color: #b42318;
    font-weight: 700;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 28px;
    background:
        linear-gradient(90deg, #05090d 0%, #071319 48%, #09232b 100%);
    border-bottom: 3px solid #05bcd4;
    color: #fff;
    box-shadow: 0 14px 34px rgba(7, 19, 26, 0.18);
}

.brand-block {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 20px;
}

.brand-logo {
    width: 286px;
    height: 104px;
    object-fit: contain;
    background: #050505;
    border: 1px solid rgba(5, 188, 212, 0.55);
    border-radius: 10px;
    padding: 6px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 14px 28px rgba(0, 0, 0, 0.28);
}

.brand-copy h1 {
    margin: 0;
    font-size: 34px;
    letter-spacing: 0;
    line-height: 1;
}

.brand-copy p {
    display: inline-flex;
    margin: 10px 0 0;
    color: #d7f7fb;
    font-size: 13px;
    font-weight: 700;
    background: rgba(5, 188, 212, 0.13);
    border: 1px solid rgba(5, 188, 212, 0.34);
    border-radius: 999px;
    padding: 7px 11px;
}

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

.app-layout {
    display: grid;
    grid-template-columns: 238px minmax(0, 1fr);
    gap: 18px;
    padding: 18px 24px 24px;
}

.side-nav {
    position: sticky;
    top: 18px;
    align-self: start;
    min-height: calc(100vh - 168px);
    background: #071319;
    border: 1px solid #12323b;
    border-radius: 10px;
    padding: 16px;
    color: #e6f7fa;
    box-shadow: 0 16px 36px rgba(7, 19, 26, 0.14);
}

.side-nav-title {
    color: #74e4ef;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.side-nav-item {
    display: block;
    width: 100%;
    margin-bottom: 8px;
    border: 1px solid rgba(116, 228, 239, 0.16);
    border-radius: 8px;
    background: transparent;
    color: #e6f7fa;
    padding: 11px 12px;
    text-align: left;
    text-decoration: none;
    font-weight: 800;
}

.side-nav-item.active,
.side-nav-item:hover {
    background: rgba(5, 188, 212, 0.14);
    border-color: rgba(5, 188, 212, 0.48);
}

.side-nav-divider {
    height: 1px;
    margin: 14px 0;
    background: rgba(116, 228, 239, 0.16);
}

.side-nav-note {
    color: #a9cdd3;
    font-size: 12px;
    line-height: 1.45;
}

main {
    min-width: 0;
}

.panel {
    background: #fff;
    border: 1px solid #dce5ea;
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(15, 32, 38, 0.05);
}

h2 {
    margin: 0 0 14px;
    font-size: 18px;
}

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

.report-grid article {
    background: #f7faf9;
    border: 1px solid #d9e3e0;
    border-radius: 8px;
    padding: 12px;
}

.report-reasons-box {
    border: 1px solid #d8e3ea;
    border-radius: 8px;
    padding: 14px;
    margin: 12px 0;
    background: #f8fbfc;
}

.report-reasons-box h3 {
    margin: 0 0 10px;
}

.reason-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    margin: 0 8px 8px 0;
    border-radius: 999px;
    background: #fff1f1;
    color: #86181d;
    border: 1px solid #f1b8b8;
    font-weight: 700;
}

.report-grid span {
    display: block;
    color: #55636b;
    font-size: 12px;
    font-weight: 700;
}

.report-grid strong {
    display: block;
    margin-top: 4px;
    font-size: 20px;
}

.report-controls {
    display: grid;
    grid-template-columns: minmax(120px, 170px) minmax(150px, 190px) minmax(150px, 190px) auto;
    align-items: end;
    gap: 8px 10px;
    margin-bottom: 10px;
}

.report-controls label {
    display: none;
}

.report-period-label {
    margin: 0 0 12px;
    color: #47545c;
    font-weight: 700;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.dashboard-grid article {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
    border: 1px solid #dce5ea;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 8px 22px rgba(15, 32, 38, 0.05);
}

.dashboard-action {
    cursor: pointer;
}

.dashboard-grid span {
    display: block;
    color: #55636b;
    font-size: 12px;
    font-weight: 700;
}

.dashboard-grid strong {
    display: block;
    margin-top: 4px;
    font-size: 22px;
    color: #03242b;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(320px, 430px) 1fr;
    gap: 18px;
    margin-top: 18px;
}

.actions,
.orders-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.actions {
    justify-content: flex-end;
    margin-top: 14px;
}

.orders-head {
    justify-content: space-between;
}

.orders-meta {
    margin: -8px 0 0;
    color: #64727c;
    font-size: 13px;
    font-weight: 700;
}

.status-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.status-filter {
    border: 1px solid #c9d1d8;
    border-radius: 999px;
    background: #fff;
    color: #25313a;
    padding: 8px 11px;
    white-space: nowrap;
}

.status-filter.active {
    background: #0897a7;
    border-color: #0897a7;
    color: #fff;
}

.status-filter.filter-evaluation {
    background: #e8f0f7;
    border-color: #b8d4e8;
    color: #24506b;
}

.status-filter.filter-budget {
    background: #fff4d8;
    border-color: #f3d27a;
    color: #7a4f00;
}

.status-filter.filter-service {
    background: #ffedd5;
    border-color: #fdba74;
    color: #9a3412;
}

.status-filter.filter-ready {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.status-filter.filter-delivered {
    background: #fff;
    border-color: #aeb8c2;
    color: #1f2a30;
}

.status-filter.filter-returned {
    background: #ffe4ef;
    border-color: #f9a8d4;
    color: #9d174d;
}

.status-filter.filter-cannot {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.status-filter.filter-warranty {
    background: #f1e8ff;
    border-color: #c4b5fd;
    color: #5b21b6;
}

.status-filter.active {
    outline: 3px solid rgba(15, 118, 110, 0.25);
}

.search {
    margin-bottom: 12px;
}

.orders {
    max-height: 560px;
    overflow: auto;
}

.order {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border: 1px solid #e3e8ed;
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 12px;
    cursor: pointer;
}

.order:hover {
    border-color: #b8c4cc;
    background: #fbfcfd;
}

.order.fiado-open {
    border-color: #f4a3a3;
    background: #fff1f1;
    box-shadow: inset 4px 0 0 #dc2626;
}

.order.fiado-open:hover {
    border-color: #dc2626;
    background: #ffe7e7;
}

.receive-payment-button {
    background: #16a34a;
    color: #fff;
}

.receive-payment-button:hover {
    background: #15803d;
}

.debt-reminder-button {
    border: 0;
    border-radius: 8px;
    background: #dc2626;
    color: #fff;
    padding: 9px 12px;
    font-weight: 800;
}

.debt-reminder-button:hover {
    background: #b91c1c;
}

.fiados-list {
    max-height: none;
    flex: 1 1 auto;
}

.fiado-debt-row {
    align-items: stretch;
}

.fiado-values {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 8px;
    color: #334155;
}

.debt-days {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #fee2e2;
    color: #991b1b;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 900;
}

.order-main-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 5px;
}

.order-number {
    color: #087e8d;
    font-weight: 800;
}

.order-customer {
    font-weight: 800;
}

.order-device {
    color: #46545d;
    font-weight: 700;
}

.customer-type {
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 8px;
}

.customer-type.cliente-final {
    background: #e8f0f7;
    color: #24506b;
}

.customer-type.lojista {
    background: #fef3c7;
    color: #92400e;
}

.order-summary {
    margin: 0;
    color: #52616a;
    font-size: 13px;
    line-height: 1.35;
}

.order-side {
    display: grid;
    justify-items: end;
    gap: 7px;
}

.order-date {
    color: #64727c;
    font-size: 12px;
    font-weight: 700;
}

.warranty-badge {
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 9px;
    white-space: nowrap;
}

.warranty-badge.warranty-ok {
    background: #dcfce7;
    color: #166534;
}

.warranty-badge.warranty-ending {
    background: #fef3c7;
    color: #92400e;
}

.warranty-badge.warranty-expired {
    background: #fee2e2;
    color: #991b1b;
}

.quick-budget-actions {
    display: flex;
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: wrap;
}

.authorize-button,
.decline-button {
    padding: 7px 10px;
    font-size: 12px;
}

.authorize-button {
    background: #16a34a;
}

.authorize-button:hover {
    background: #15803d;
}

.decline-button {
    background: #dc2626;
}

.decline-button:hover {
    background: #b91c1c;
}

.status-badge {
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 9px;
    white-space: nowrap;
}

.status-badge.avaliacao {
    background: #e8f0f7;
    color: #24506b;
}

.status-badge.orcamento {
    background: #fff4d8;
    color: #7a4f00;
}

.status-badge.servico {
    background: #e9f7ef;
    color: #17603a;
}

.status-badge.pronto {
    background: #dcfce7;
    color: #166534;
}

.status-badge.nao-faz {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.garantia {
    background: #f1e8ff;
    color: #5b21b6;
}

.status-badge.finalizado {
    background: #eef1f3;
    color: #5c6870;
}

.order-info {
    display: block;
    color: #8a4b08;
    font-weight: 700;
}

.order-info.delivered {
    color: #166534;
}

.order-info.returned {
    color: #8a4b08;
}

.order-info.waiting-return {
    color: #991b1b;
}

.message {
    min-height: 24px;
    margin-top: 12px;
    color: #087e8d;
    font-weight: 700;
}

.modal {
    width: min(920px, calc(100vw - 28px));
    max-height: calc(100vh - 28px);
    border: 0;
    border-radius: 8px;
    padding: 0;
    background: transparent;
}

#order-dialog[open] {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    height: 100vh !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #f4f9fc !important;
    overflow: hidden !important;
}

#order-dialog[open]::backdrop {
    background: transparent !important;
}

#order-dialog[open] .modal-form {
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    max-height: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    display: grid !important;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto !important;
    overflow: hidden !important;
}

#order-dialog[open] .modal-head {
    position: static !important;
}

#order-dialog[open] .os-tabs {
    position: static !important;
}

#order-dialog[open] #os-summary,
#order-dialog[open] .os-notes-grid,
#order-dialog[open] #os-parts,
#order-dialog[open] #os-history {
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

#order-dialog[open] #os-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 16px !important;
    padding: 18px 32px !important;
}

#order-dialog[open] .os-notes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
    padding: 0 32px 18px !important;
}

#order-dialog[open] .os-card {
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 0 !important;
    overflow: visible !important;
}

#order-dialog[open] .actions {
    position: static !important;
    min-height: 72px !important;
}

.small-modal {
    width: min(520px, calc(100vw - 28px));
}

.modal::backdrop {
    background: rgba(15, 23, 42, 0.42);
}

.modal-panel {
    background: #fff;
    border: 1px solid #d7dde2;
    border-radius: 8px;
    padding: 18px;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.modal-head h2 {
    margin: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 0 12px;
}

.modal-form textarea {
    min-height: 210px;
}

.report-lists {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.report-lists section,
.credit-row {
    border: 1px solid #d7dde2;
    border-radius: 8px;
    padding: 12px;
}

.report-lists h3 {
    margin: 0 0 8px;
    font-size: 15px;
}

.report-lists p,
.credit-row small,
.credit-row span {
    display: block;
    margin: 4px 0;
    color: #52616a;
}

.deliver-credit-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 6px 0 10px;
    padding: 10px 12px;
    border: 1px solid #b9f4cf;
    border-radius: 8px;
    background: #f0fff6;
}

.deliver-credit-box small {
    color: #075c2f;
    font-weight: 800;
}

.use-credit-button {
    min-height: 34px !important;
    padding: 7px 12px !important;
    background: #16a34a !important;
    color: #fff !important;
}

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

.report-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 420px;
    font-size: 14px;
}

.report-table th,
.report-table td {
    border-bottom: 1px solid #e7ecef;
    padding: 10px 8px;
    text-align: left;
    vertical-align: top;
}

.report-table th {
    color: #52616a;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.report-table td:nth-child(3),
.report-table td:nth-child(4) {
    white-space: nowrap;
}

@media (max-width: 980px) {
    .workspace {
        grid-template-columns: 1fr;
    }

    .report-grid {
        grid-template-columns: repeat(2, minmax(130px, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(130px, 1fr));
    }

    .report-controls {
        grid-template-columns: 1fr;
    }

    .order {
        grid-template-columns: 1fr;
    }

    .order-side {
        justify-items: start;
    }

    .topbar,
    .topbar-actions,
    .modal-head {
        align-items: stretch;
        flex-direction: column;
    }

    .brand-block {
        align-items: stretch;
        flex-direction: column;
    }

    .brand-logo {
        width: 100%;
        max-width: 280px;
    }

    .app-layout {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .side-nav {
        position: static;
        min-height: auto;
    }

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

    .report-lists {
        grid-template-columns: 1fr;
    }
}

/* Final premium overrides for the Cell Tech branded layout */
body {
    background: #f4f7fa;
    color: #1e293b;
}

.topbar {
    min-height: 118px;
    padding: 18px 32px;
    background: #030607;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 38px rgba(7, 19, 26, 0.14);
}

.brand-block {
    gap: 22px;
}

.brand-logo {
    width: 320px;
    height: 88px;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.brand-separator {
    width: 1px;
    height: 58px;
    background: rgba(116, 228, 239, 0.34);
}

.brand-cnpj {
    color: #f8fafc;
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 18px;
    border-right: 1px solid rgba(116, 228, 239, 0.34);
}

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

.user-chip small {
    color: #05bcd4;
    font-weight: 700;
}

.user-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    color: #fff;
    font-weight: 900;
}

.app-layout {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 0;
    min-height: calc(100vh - 118px);
    padding: 0;
}

.side-nav {
    position: static;
    min-height: calc(100vh - 118px);
    background: linear-gradient(180deg, #061015 0%, #0c1820 100%);
    border: 0;
    border-radius: 0;
    padding: 28px 12px;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
}

.side-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #dbe7ea;
    padding: 13px 16px;
    font-size: 15px;
}

.side-nav-item.active,
.side-nav-item:hover {
    background: linear-gradient(90deg, #008a9a 0%, #05a7b9 100%);
    border-color: rgba(5, 188, 212, 0.48);
    color: #fff;
    box-shadow: 0 10px 18px rgba(5, 188, 212, 0.16);
}

.side-nav-item span {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    font-size: 11px;
    font-weight: 900;
}

.side-nav-note {
    padding: 0 12px;
}

main {
    padding: 28px 24px;
}

.section-title-line {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.section-title-line h2 {
    margin: 0;
    font-size: 25px;
}

.section-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(5, 188, 212, 0.12);
    color: #08899a;
    font-size: 12px;
    font-weight: 900;
}

.dashboard-grid {
    grid-template-columns: repeat(4, minmax(170px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.dashboard-grid article {
    position: relative;
    min-height: 108px;
    background: #fff;
    border: 1px solid #dfe7ec;
    border-radius: 9px;
    padding: 24px 20px 20px 92px;
    box-shadow: 0 10px 26px rgba(15, 32, 38, 0.07);
}

.dashboard-grid article::before {
    content: "$";
    position: absolute;
    left: 24px;
    top: 26px;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    background: linear-gradient(135deg, #058b98, #05bcd4);
    color: #fff;
    font-size: 28px;
    font-weight: 800;
}

.dashboard-grid article:nth-child(2)::before {
    content: "OS";
    font-size: 17px;
    background: linear-gradient(135deg, #2b7fff, #51a4ff);
}

.dashboard-grid article:nth-child(3)::before {
    content: "SV";
    font-size: 17px;
    background: linear-gradient(135deg, #ff7a00, #ff9d2e);
}

.dashboard-grid article:nth-child(4)::before {
    content: "NF";
    font-size: 17px;
    background: linear-gradient(135deg, #ef4444, #fb7185);
}

.dashboard-grid article:nth-child(5)::before {
    content: "GA";
    font-size: 17px;
    background: linear-gradient(135deg, #047c8a, #0fb5c7);
}

.dashboard-grid article:nth-child(6)::before {
    content: "R$";
    font-size: 17px;
    background: linear-gradient(135deg, #0f766e, #05bcd4);
}

.dashboard-grid span {
    color: #475569;
    font-size: 14px;
}

.dashboard-grid strong {
    margin-top: 8px;
    font-size: 26px;
    color: #03242b;
}

.workspace {
    grid-template-columns: minmax(340px, 500px) 1fr;
    gap: 18px;
    margin-top: 0;
}

.panel {
    border-radius: 10px;
    padding: 22px;
    box-shadow: 0 10px 26px rgba(15, 32, 38, 0.07);
}

/* OS tabs compact final pass - real EOF */
#order-dialog .modal-form {
    height: min(860px, calc(100vh - 28px)) !important;
    max-height: calc(100vh - 28px) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

#order-dialog .modal-head {
    flex: 0 0 auto !important;
    min-height: 68px !important;
    padding: 14px 22px !important;
}

#order-dialog .os-progress {
    flex: 0 0 auto;
    padding: 14px 24px 8px !important;
    gap: 8px !important;
}

#order-dialog .os-progress span {
    min-height: 42px !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
}

#order-dialog .os-progress span.done {
    background: #dff7ec !important;
    color: #047857 !important;
}

#order-dialog .os-progress span.active {
    background: linear-gradient(135deg, #0f766e, #12b981) !important;
    color: #fff !important;
}

#order-dialog .os-tabs {
    flex: 0 0 auto;
    position: static !important;
    padding: 0 24px 10px !important;
    overflow-x: auto;
}

#order-dialog .os-tabs button {
    min-height: 38px !important;
    padding: 8px 14px !important;
    white-space: nowrap;
}

#order-dialog #os-summary,
#order-dialog .os-notes-grid,
#order-dialog #os-parts,
#order-dialog #os-history {
    flex: 1 1 auto;
    overflow: auto;
}

#order-dialog #os-summary {
    padding: 16px 24px 110px !important;
}

#order-dialog .os-notes-grid {
    padding: 0 24px 110px !important;
}

#order-dialog .os-card-grid {
    grid-template-columns: repeat(3, minmax(260px, 1fr)) !important;
    align-content: start;
}

#order-dialog .os-card-grid:has([data-os-tab-card][hidden]) {
    grid-template-columns: repeat(2, minmax(320px, 1fr)) !important;
}

#order-dialog .os-card {
    min-height: auto !important;
    padding: 16px !important;
}

#order-dialog .os-card h3 {
    margin-bottom: 12px !important;
    font-size: 17px !important;
}

#order-dialog .compact-field {
    margin-bottom: 9px !important;
}

#order-dialog .os-card input,
#order-dialog .os-card select,
#order-dialog .os-card textarea {
    min-height: 38px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
}

#order-dialog .os-card textarea {
    min-height: 180px !important;
}

#order-dialog .compact-pattern .pattern-grid {
    grid-template-columns: repeat(3, 30px) !important;
    gap: 6px !important;
}

#order-dialog .compact-pattern .pattern-grid button {
    width: 30px !important;
    height: 30px !important;
    min-height: 30px !important;
    font-size: 12px !important;
}

#order-dialog .order-parts-box {
    margin: 0 24px 110px !important;
    max-height: none !important;
    overflow: visible !important;
}

#order-dialog .actions {
    flex: 0 0 auto !important;
    position: sticky !important;
    bottom: 0 !important;
    min-height: 74px;
    margin-top: auto;
}
