:root {
    color-scheme: light;
    font-family: Arial, Helvetica, sans-serif;
    color: #1f2933;
    background: #eef2f6;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    -webkit-text-size-adjust: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

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

.sidebar {
    background: #102033;
    color: #f8fafc;
    padding: 22px 16px;
}

.brand {
    display: grid;
    gap: 4px;
    margin-bottom: 24px;
}

.brand span {
    font-size: 22px;
    font-weight: 800;
}

.brand small,
nav small {
    color: #b8c4d2;
}

nav {
    display: grid;
    gap: 6px;
}

nav a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
}

nav a:hover,
nav a.active {
    background: #1f3957;
}

.content {
    padding: clamp(14px, 4vw, 28px);
    min-width: 0;
}

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

h1 {
    margin: 0 0 6px;
}

p {
    margin: 0;
    color: #5b6775;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: 6px;
    background: #1769aa;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.button.muted {
    background: #d9e2ec;
    color: #1f2933;
}

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

.stats div,
.module,
.notice,
.toolbar,
.table-wrap,
.panel,
pre {
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
}

.stats div,
.module {
    padding: 18px;
}

.stats strong {
    display: block;
    font-size: 28px;
}

.stats span,
.module span,
.module small {
    display: block;
    margin-top: 6px;
    color: #5b6775;
}

.grid {
    margin-top: 16px;
}

.choice-grid {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.choice-card {
    display: grid;
    gap: 6px;
    padding: 16px;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    background: #ffffff;
}

.choice-card:hover {
    border-color: #1769aa;
    background: #eef7ff;
}

.choice-card strong {
    color: #1769aa;
    font-size: 18px;
}

.config-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.config-tabs button {
    background: #d9e2ec;
    color: #1f2933;
}

.config-tabs button.active {
    background: #1769aa;
    color: #ffffff;
}

.pdv-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 16px;
    align-items: start;
}

.pdv-product-line {
    position: relative;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 120px 120px;
    gap: 12px;
    align-items: end;
}

.pdv-product-line label,
.pdv-payment label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.pdv-suggest {
    left: 0;
    top: 72px;
}

.pdv-payment {
    position: sticky;
    top: 16px;
}

.pdv-totals {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
    background: #f6f8fb;
}

.pdv-totals span {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.pdv-total {
    font-size: 22px;
    color: #1769aa;
}

.receipt {
    max-width: 920px;
}

.routine-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(16, 32, 51, .55);
}

.routine-modal[hidden] {
    display: none;
}

.routine-modal__panel {
    width: min(960px, 100%);
    max-height: min(720px, calc(100vh - 36px));
    overflow: auto;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 20px 60px rgba(16, 32, 51, .28);
}

.routine-modal__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #d9e2ec;
    background: #f6f8fb;
}

.pix-modal__panel {
    max-width: 520px;
}

.pix-modal__content {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.pix-qrcode {
    display: grid;
    place-items: center;
    padding: 12px;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    background: #ffffff;
}

.pix-qrcode img {
    width: 260px;
    max-width: 100%;
    height: auto;
}

.pix-modal textarea {
    width: 100%;
    min-height: 96px;
    padding: 10px;
    border: 1px solid #c7d2de;
    border-radius: 6px;
    resize: vertical;
}

@media print {
    .topbar,
    form,
    .notice,
    .button {
        display: none !important;
    }

    body {
        background: #ffffff;
    }

    .panel {
        border: 0;
        padding: 0;
    }
}

.module:hover {
    border-color: #1769aa;
}

.notice {
    display: grid;
    gap: 8px;
    padding: 16px;
}

.notice.error {
    border-color: #e0a2a2;
    background: #fff5f5;
}

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

.toolbar form {
    display: flex;
    gap: 8px;
    flex: 1;
}

input,
select {
    min-height: 38px;
    font-size: 16px;
    width: 100%;
    border: 1px solid #c7d2de;
    border-radius: 6px;
    padding: 0 12px;
}

.check-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.check-row input[type="checkbox"] {
    width: auto;
    min-height: auto;
}

h2,
h3 {
    margin: 0;
}

td small {
    display: block;
    margin-top: 4px;
    color: #5b6775;
}

.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

th,
td {
    padding: 10px 12px;
    border-bottom: 1px solid #e6ebf1;
    text-align: left;
    white-space: nowrap;
}

th {
    background: #f6f8fb;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 14px;
}

.pagination a {
    color: #1769aa;
    font-weight: 700;
}

.installer {
    width: min(760px, calc(100% - 32px));
    margin: 40px auto;
}

.panel {
    display: grid;
    gap: 12px;
    margin-top: 20px;
    padding: 18px;
}

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

.form-grid.compact {
    grid-template-columns: minmax(180px, 280px) auto;
    align-items: end;
}

.form-grid label {
    display: grid;
    gap: 6px;
    color: #1f2933;
    font-weight: 700;
}

.field-hint {
    color: #5b6775;
    font-size: 13px;
    font-weight: 400;
}

.field-hint.error {
    color: #b42318;
}

.form-grid .wide {
    grid-column: 1 / -1;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.actions a {
    color: #1769aa;
    font-weight: 700;
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid #b9d2e8;
    border-radius: 6px;
    background: #eef7ff;
    color: #1769aa;
    font-size: 13px;
    line-height: 1;
}

.action-button:hover {
    border-color: #1769aa;
    background: #dff0ff;
}

.action-button.danger {
    border-color: #efc0c0;
    background: #fff3f3;
    color: #b42318;
}

.action-button.danger:hover {
    border-color: #b42318;
    background: #ffe3e3;
}

.label-sheet {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.stock-label {
    min-height: 78px;
    padding: 10px;
    border: 1px dashed #5b6775;
    background: #ffffff;
    display: grid;
    align-content: center;
    gap: 4px;
    font-family: "Courier New", monospace;
}

.stock-label strong,
.stock-label span {
    display: block;
}

.seller-grid {
    margin-top: 14px;
}

.seller-grid input,
.seller-grid select {
    min-width: 86px;
    min-height: 32px;
    padding: 0 8px;
}

.seller-grid td:nth-child(2),
.seller-grid td:nth-child(5) {
    min-width: 70px;
}

.seller-grid td:nth-child(3) {
    min-width: 280px;
}

.seller-product-cell {
    position: relative;
}

.seller-grid input[data-seller-search] {
    min-width: 260px;
}

.seller-suggest {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    left: 12px;
    width: min(440px, 82vw);
    max-height: 280px;
    overflow: auto;
    border: 1px solid #b9d2e8;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(16, 32, 51, .18);
}

.seller-suggest-item {
    display: grid;
    width: 100%;
    min-height: auto;
    padding: 9px 10px;
    border: 0;
    border-bottom: 1px solid #e6ebf1;
    border-radius: 0;
    background: #ffffff;
    color: #1f2933;
    text-align: left;
    font-weight: 400;
}

.seller-suggest-item:hover,
.seller-suggest-item:focus {
    background: #eef7ff;
}

.seller-suggest-item strong {
    color: #1769aa;
}

.seller-suggest-item span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.seller-suggest-item small {
    color: #5b6775;
}

.summary-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
}

.summary-grid strong {
    font-size: 20px;
}

.parameter-notes {
    display: grid;
    gap: 6px;
    margin-top: 16px;
}

.late-row td {
    background: #fff3f3;
    color: #7a1d16;
}

pre {
    overflow: auto;
    padding: 16px;
}

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

    .sidebar {
        position: static;
    }

    .topbar,
    .toolbar,
    .toolbar form,
    .form-grid.compact {
        align-items: stretch;
        flex-direction: column;
        grid-template-columns: 1fr;
    }

    .table-wrap {
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 520px) {
    th,
    td {
        padding: 8px 10px;
        font-size: 13px;
    }

    .button,
    button {
        width: 100%;
    }
}
