:root {
    --bg: #f4f7f6;
    --surface: #ffffff;
    --surface-alt: #eef4f2;
    --text: #1e2a2f;
    --muted: #66757d;
    --line: #d7e0dc;
    --primary: #14746f;
    --primary-dark: #0e514d;
    --accent: #c9533d;
    --warning: #9f6b00;
    --success: #247a3d;
    --danger: #b3261e;
    --shadow: 0 12px 30px rgba(24, 44, 49, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Roboto', Arial, Helvetica, sans-serif;
    line-height: 1.45;
    overflow-x: hidden;
}

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

button,
input,
select,
textarea {
    font: inherit;
}

.auth-main {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.app-main {
    width: min(1480px, calc(100% - 20px));
    margin: 24px auto 56px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 10px;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--primary-dark);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 4px;
    margin-left: auto;
}

.nav-links a,
.nav-links button.logout-link,
.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.92rem;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a:focus,
.nav-links a.active,
.nav-links button.logout-link:hover,
.nav-links button.logout-link:focus,
.nav-dropdown-toggle:hover,
.nav-dropdown-toggle:focus,
.nav-dropdown.active > .nav-dropdown-toggle {
    background: var(--surface-alt);
    color: var(--primary-dark);
}

.nav-links a.active,
.nav-dropdown.active > .nav-dropdown-toggle {
    font-weight: 700;
}

.nav-links svg,
.btn svg {
    width: 17px;
    height: 17px;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle svg:last-child {
    width: 15px;
    height: 15px;
    transition: transform 160ms ease;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 30;
    display: grid;
    gap: 2px;
    min-width: 180px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.nav-dropdown-menu a {
    display: flex;
    width: 100%;
}

.nav-dropdown.open .nav-dropdown-menu,
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-dropdown.open .nav-dropdown-toggle svg:last-child,
.nav-dropdown:hover .nav-dropdown-toggle svg:last-child,
.nav-dropdown:focus-within .nav-dropdown-toggle svg:last-child {
    transform: rotate(180deg);
}

.nav-logout-form {
    margin: 0;
}

.nav-links button.logout-link {
    font-family: inherit;
}

.logout-link {
    color: var(--danger) !important;
}

.audit-main-row td {
    border-bottom: 0;
}

.audit-detail-row td {
    padding-top: 0;
    border-top: 0;
    background: #f8fbfa;
}

.audit-details {
    width: 100%;
}

.audit-details summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--primary-dark);
    font-weight: 700;
    padding: 6px 0;
}

.audit-detail-content {
    display: grid;
    gap: 10px;
    padding: 8px 0 12px;
}

.audit-detail-content p {
    margin: 0;
}

.audit-change-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.audit-details pre {
    width: 100%;
    max-height: 260px;
    overflow: auto;
    margin: 8px 0 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-alt);
    color: var(--text);
    font-size: 0.82rem;
    white-space: pre-wrap;
}

.backup-actions-panel {
    display: grid;
    gap: 10px;
}

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

.backup-restore-note h2 {
    margin-top: 0;
}

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

    .backup-actions-grid .btn {
        width: 100%;
        justify-content: center;
    }
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.page-head h1,
.auth-card h1 {
    margin: 0 0 6px;
    font-size: clamp(1.45rem, 2vw, 2rem);
    letter-spacing: 0;
}

.page-head p,
.auth-card p {
    margin: 0;
    color: var(--muted);
}

.page-head > .actions {
    margin-top: 0;
}

.auth-card,
.panel,
.table-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.auth-card {
    width: min(440px, 100%);
    padding: 28px;
}

.auth-helper {
    display: flex;
    justify-content: flex-end;
    margin-top: -4px;
    color: var(--primary-dark);
    font-size: 0.9rem;
    font-weight: 700;
}

.auth-helper a:hover {
    text-decoration: underline;
}

.auth-actions-split {
    justify-content: space-between;
}

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

.table-panel {
    overflow: hidden;
}

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

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

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label {
    font-size: 0.88rem;
    font-weight: 700;
    color: #314149;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
    color: var(--text);
}

.field textarea {
    min-height: 88px;
    resize: vertical;
}

.field input[readonly] {
    background: #f1f5f4;
    color: var(--muted);
}

.footer-links-editor {
    display: grid;
    gap: 12px;
    margin: 16px 0;
}

.footer-link-row {
    display: grid;
    grid-template-columns: minmax(180px, 0.9fr) minmax(260px, 1.3fr) auto;
    align-items: end;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7faf9;
}

.footer-link-row .btn {
    min-height: 42px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--primary);
    outline: 3px solid rgba(20, 116, 111, 0.16);
}

.check-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 500;
}

.field .check-inline input[type="checkbox"] {
    width: 17px;
    min-height: 17px;
    padding: 0;
    flex: 0 0 auto;
}

.store-options-field {
    justify-content: flex-start;
}

.product-image-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7faf9;
}

.product-image-preview img,
.product-thumb {
    display: block;
    width: 58px;
    height: 58px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.product-thumb {
    width: 48px;
    height: 48px;
}

.product-image-preview img.placeholder,
.product-thumb.placeholder {
    object-fit: contain;
    padding: 6px;
}

.products-table {
    min-width: 1280px;
}

.products-table th,
.products-table td {
    padding: 12px 14px;
}

.products-table th:nth-child(1),
.products-table td:nth-child(1) {
    width: 86px;
    text-align: center;
}

.products-table th:nth-child(2),
.products-table td:nth-child(2) {
    width: 380px;
}

.products-table th:nth-child(3),
.products-table td:nth-child(3) {
    width: 140px;
}

.products-table th:nth-child(4),
.products-table td:nth-child(4) {
    width: 150px;
}

.products-table th:nth-last-child(1),
.products-table td:nth-last-child(1) {
    width: 270px;
}

.products-table td:nth-child(n+5):not(:last-child) {
    white-space: nowrap;
}

.product-main-text {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.product-main-text strong {
    display: block;
    max-width: 100%;
    line-height: 1.28;
    overflow-wrap: normal;
    word-break: normal;
}

.product-main-text .muted {
    display: block;
}

.product-barcode {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.2;
}

.store-status-cell {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.store-badges {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.store-slug {
    display: block;
    max-width: 126px;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.product-actions {
    justify-content: flex-start;
}

.actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.actions > form {
    display: inline-flex;
    margin: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    min-height: 40px;
    padding: 9px 13px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    line-height: 1;
}

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

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.btn.secondary {
    background: var(--surface);
    border-color: var(--line);
    color: var(--text);
}

.btn.secondary:hover {
    background: var(--surface-alt);
}

.btn.danger {
    background: var(--danger);
}

.btn.danger:hover {
    background: #8e1d18;
}

.btn.whatsapp {
    background: #1f8f5f;
}

.btn.whatsapp:hover {
    background: #176b47;
}

.btn.whatsapp:disabled {
    background: #1f8f5f;
}

.btn.small {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 0.86rem;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) repeat(2, auto);
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.filter-bar input,
.filter-bar select {
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 11px;
    background: #fff;
}

.sales-filter {
    grid-template-columns: minmax(220px, 1fr) minmax(170px, 220px) minmax(170px, 220px) auto;
}

.products-filter,
.category-filter {
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) minmax(180px, 240px) auto;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    background: #f7faf9;
    color: #3c4b52;
    font-size: 0.82rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.sort-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    text-decoration: none;
}

.sort-link:hover {
    color: var(--primary);
}

.sort-link.active {
    color: var(--primary);
}

.sort-indicator {
    display: inline-grid;
    min-width: 10px;
    place-items: center;
    font-size: 0.78rem;
    line-height: 1;
}

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

.actions-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.actions-row form,
.actions-cell form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.actions-row .btn,
.actions-cell .btn {
    width: auto;
    flex: 0 0 auto;
}

.mini-control,
.mini-file,
.mini-money,
.mini-number {
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 6px 8px;
    max-width: 150px;
}

.mini-file {
    max-width: 180px;
}

.mini-number {
    width: 76px;
    max-width: 76px;
}

.mini-money {
    width: 96px;
    max-width: 96px;
}

.inline-correction-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.stock-payment-form {
    align-items: flex-start;
    flex-wrap: wrap;
    white-space: normal;
}

.stock-payment-forecast {
    display: block;
    min-width: 180px;
    font-size: 0.84rem;
}

.nowrap {
    white-space: nowrap;
}

.orders-table {
    min-width: 0;
    table-layout: auto;
    font-size: 0.93rem;
}

.orders-table td {
    white-space: nowrap;
    padding: 10px 9px;
}

.orders-table th {
    padding: 10px 9px;
}

.orders-table .client-cell {
    min-width: 190px;
}

.orders-table .actions-cell {
    min-width: 500px;
    width: 500px;
}

.order-link {
    color: var(--primary-dark);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.empty {
    padding: 26px;
    color: var(--muted);
    text-align: center;
}

.pagination {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    padding: 14px;
}

.page-link {
    display: grid;
    place-items: center;
    min-width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
}

.page-link.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.page-ellipsis {
    display: grid;
    min-width: 28px;
    height: 36px;
    place-items: center;
    color: var(--muted);
    font-weight: 800;
    line-height: 1;
}

.alert {
    position: fixed;
    top: 72px;
    right: 20px;
    z-index: 50;
    max-width: min(420px, calc(100% - 40px));
    padding: 13px 15px;
    border-radius: 8px;
    border: 1px solid;
    background: #fff;
    box-shadow: var(--shadow);
}

.alert-success {
    border-color: rgba(36, 122, 61, 0.35);
    color: var(--success);
}

.alert-error,
.alert-danger {
    border-color: rgba(179, 38, 30, 0.35);
    color: var(--danger);
}

.alert-warning {
    border-color: rgba(159, 107, 0, 0.35);
    color: var(--warning);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.badge.success {
    background: rgba(36, 122, 61, 0.12);
    color: var(--success);
}

.badge.warning {
    background: rgba(159, 107, 0, 0.14);
    color: var(--warning);
}

.badge.info {
    background: rgba(124, 82, 152, 0.14);
    color: #6b3f88;
}

.badge.danger {
    background: rgba(179, 38, 30, 0.12);
    color: var(--danger);
}

.badge.muted {
    background: #edf1f0;
    color: var(--muted);
}

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

.metric {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.metric span {
    display: block;
    color: var(--muted);
    font-size: 0.88rem;
    margin-bottom: 8px;
}

.metric strong {
    font-size: clamp(1.25rem, 2.2vw, 1.8rem);
}

.cash-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
}

.online-order-metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 18px;
}

.customer-admin-metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 18px;
}

.customer-admin-filter {
    grid-template-columns: minmax(220px, 1fr) minmax(170px, 220px) auto auto;
}

.customer-admin-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.42fr);
    gap: 18px;
    align-items: start;
}

.customer-admin-profile h2,
.customer-admin-side h2,
.customer-admin-side h3,
.customer-panel-head h2 {
    margin: 0 0 14px;
}

.customer-admin-side {
    display: grid;
    gap: 18px;
}

.customer-admin-actions {
    display: grid;
    gap: 10px;
}

.customer-admin-actions form,
.customer-admin-actions .btn {
    width: 100%;
}

.customer-admin-section {
    margin-top: 18px;
}

.customer-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 18px 0;
}

.panel .customer-panel-head {
    padding: 0;
    margin-bottom: 14px;
}

.customer-panel-head p {
    margin: 0;
    color: var(--muted);
}

.customer-admin-mini-list {
    display: grid;
    gap: 8px;
}

.customer-admin-mini-list > div {
    display: grid;
    gap: 3px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7faf9;
}

.customer-admin-mini-list span {
    color: var(--muted);
    font-size: 0.86rem;
}

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

.customer-favorite-card {
    display: grid;
    gap: 7px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7faf9;
}

.customer-favorite-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    object-fit: contain;
}

.customer-favorite-card span {
    color: var(--muted);
    font-size: 0.78rem;
}

.customer-favorite-card strong {
    min-height: 42px;
    color: var(--text);
}

.customer-favorite-card em {
    color: var(--primary-dark);
    font-style: normal;
    font-weight: 800;
}

.online-order-filter {
    grid-template-columns: minmax(220px, 1fr) minmax(170px, 220px) minmax(170px, 220px) minmax(160px, 200px) auto;
}

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

.summary-grid > div {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7faf9;
}

.summary-grid span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.summary-grid strong {
    min-width: 0;
    color: var(--text);
    overflow-wrap: anywhere;
}

.order-operation-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.72fr);
    gap: 18px;
    align-items: start;
}

.order-operation-summary .badge {
    width: fit-content;
}

.detail-list {
    display: grid;
    gap: 8px;
}

.detail-list p {
    margin: 0;
    color: var(--text);
}

.order-items-panel {
    margin-bottom: 18px;
}

.order-item-product {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 240px;
}

.order-item-product > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.danger-panel {
    border-color: rgba(179, 38, 30, 0.28);
}

.online-orders-table .actions-cell {
    width: 180px;
    min-width: 180px;
}

.order-history {
    position: relative;
    display: grid;
    gap: 14px;
}

.history-item {
    position: relative;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 12px;
}

.history-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 19px;
    bottom: -15px;
    width: 2px;
    background: var(--line);
}

.history-marker {
    position: relative;
    z-index: 1;
    width: 18px;
    height: 18px;
    margin-top: 4px;
    border: 3px solid var(--primary);
    border-radius: 50%;
    background: var(--surface);
}

.history-content {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7faf9;
}

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

.history-head strong {
    color: var(--primary-dark);
}

.history-head span,
.history-content small {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.history-content p {
    margin: 0;
}

.compact-head {
    margin-bottom: 14px;
}

.compact-head h1 {
    font-size: 1.2rem;
}

.cash-filter {
    grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(150px, 0.6fr)) auto;
    align-items: end;
}

.cash-filter .actions {
    grid-column: auto;
    margin-top: 0;
}

.cashflow-filter {
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    align-items: end;
}

.cashflow-filter .actions {
    grid-column: auto;
    margin-top: 0;
    justify-content: flex-end;
}

.cashflow-metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.cashflow-chart-panel {
    overflow: hidden;
}

.cashflow-chart {
    display: grid;
    gap: 12px;
}

.cashflow-chart-row {
    display: grid;
    grid-template-columns: minmax(150px, 0.28fr) minmax(0, 1fr);
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7faf9;
}

.cashflow-chart-label {
    display: grid;
    align-content: center;
    gap: 4px;
}

.cashflow-chart-label strong {
    color: var(--text);
    font-size: 1rem;
}

.cashflow-chart-label span {
    color: var(--muted);
    font-size: 0.88rem;
}

.cashflow-bars {
    display: grid;
    gap: 8px;
}

.cashflow-bar-line {
    display: grid;
    grid-template-columns: 74px minmax(120px, 1fr) 110px;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.cashflow-bar-line > div {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e6eeeb;
}

.cashflow-bar-line strong {
    color: var(--text);
    text-align: right;
    white-space: nowrap;
}

.cashflow-bar {
    display: block;
    min-width: 2px;
    height: 100%;
    border-radius: inherit;
}

.cashflow-bar.in {
    background: var(--success);
}

.cashflow-bar.out {
    background: var(--danger);
}

.cashflow-bar.planned {
    background: #d99a1e;
}

.indicator-page-head {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.indicator-page-head h1 {
    margin: 4px 0 8px;
    color: #0b2f2d;
    font-size: clamp(1.7rem, 2.4vw, 2.45rem);
    line-height: 1.1;
}

.indicator-page-head p {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.indicator-period-card {
    display: grid;
    align-content: center;
    min-width: 260px;
    padding: 18px;
    border: 1px solid rgba(20, 116, 111, 0.2);
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #edf7f5 100%);
    box-shadow: var(--shadow);
}

.indicator-period-card svg {
    width: 22px;
    height: 22px;
    margin-bottom: 10px;
    color: var(--primary);
}

.indicator-period-card span {
    color: var(--muted);
    font-size: 0.84rem;
}

.indicator-period-card strong {
    color: var(--primary-dark);
    font-size: 1.05rem;
}

.indicator-period-card .btn {
    width: 100%;
    margin-top: 12px;
    justify-content: center;
}

.indicator-filter-panel {
    padding: 16px;
}

.indicator-filter {
    align-items: end;
    grid-template-columns: repeat(2, minmax(0, 220px)) minmax(0, 1fr);
}

.indicator-filter .actions {
    grid-column: auto;
    justify-content: flex-end;
    margin-top: 0;
}

.indicator-hero {
    display: grid;
    grid-template-columns: 1.2fr repeat(2, minmax(0, 0.9fr));
    gap: 14px;
    margin-bottom: 18px;
}

.indicator-highlight,
.indicator-card {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.indicator-highlight {
    padding: 20px;
    border-color: rgba(20, 116, 111, 0.22);
    background: linear-gradient(135deg, #ffffff 0%, #edf7f5 100%);
}

.indicator-highlight.featured {
    background: linear-gradient(135deg, #0f625e 0%, #14746f 100%);
    color: #fff;
}

.indicator-highlight.negative {
    border-color: rgba(179, 38, 30, 0.24);
    background: linear-gradient(135deg, #ffffff 0%, #fff1ef 100%);
}

.indicator-highlight.featured.negative {
    background: linear-gradient(135deg, #8e1d18 0%, #b3261e 100%);
}

.indicator-highlight.neutral {
    background: linear-gradient(135deg, #ffffff 0%, #f4f7f6 100%);
}

.indicator-highlight-head,
.indicator-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.indicator-highlight-head svg,
.indicator-card-head svg {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    padding: 8px;
    border-radius: 8px;
    background: rgba(20, 116, 111, 0.1);
    color: var(--primary);
}

.indicator-highlight.featured .indicator-highlight-head svg {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.indicator-highlight.negative .indicator-highlight-head svg {
    background: rgba(179, 38, 30, 0.1);
    color: var(--danger);
}

.indicator-highlight.featured.negative .indicator-highlight-head svg {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.indicator-highlight span,
.indicator-card span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.indicator-highlight strong {
    display: block;
    color: var(--primary-dark);
    font-size: clamp(1.55rem, 2.7vw, 2.25rem);
    line-height: 1.1;
}

.indicator-highlight.featured span,
.indicator-highlight.featured strong,
.indicator-highlight.featured small {
    color: #fff;
}

.indicator-highlight.negative strong {
    color: var(--danger);
}

.indicator-highlight.featured.negative strong {
    color: #fff;
}

.indicator-highlight small,
.indicator-card small,
.indicator-note {
    color: var(--muted);
    font-size: 0.86rem;
}

.indicator-highlight small {
    display: block;
    margin-top: 8px;
}

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

.indicator-grid.small {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 0;
}

.indicator-card {
    padding: 16px;
}

.indicator-card strong {
    display: block;
    margin-bottom: 6px;
    color: var(--text);
    font-size: clamp(1.12rem, 2vw, 1.45rem);
    line-height: 1.12;
}

.indicator-card-head span {
    min-width: 0;
}

.indicator-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
    gap: 18px;
    align-items: start;
    margin-bottom: 18px;
}

.indicator-section-title {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 4px 0 14px;
}

.indicator-section-title.inside {
    margin-top: 0;
}

.indicator-section-title h2,
.indicator-columns h2,
.panel > h2 {
    margin: 0 0 14px;
    font-size: 1.15rem;
}

.indicator-section-title h2 {
    margin: 2px 0 0;
    color: var(--text);
}

.dre-panel {
    overflow: hidden;
}

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

.dre-table {
    min-width: 620px;
}

.dre-table th,
.dre-table td {
    padding: 13px 16px;
}

.dre-table th:nth-child(2),
.dre-table th:nth-child(3),
.dre-table td:nth-child(2),
.dre-table td:nth-child(3) {
    text-align: right;
    white-space: nowrap;
}

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

.dre-table .dre-subtotal td,
.dre-table .dre-total td {
    background: #f7faf9;
    font-weight: 800;
}

.dre-table .dre-total td {
    border-top: 2px solid rgba(20, 116, 111, 0.35);
    color: var(--primary-dark);
    font-size: 1.02rem;
}

.dre-table .negative td:nth-child(2),
.dre-table .negative td:nth-child(3) {
    color: var(--danger);
}

.dre-table .positive td:nth-child(2),
.dre-table .positive td:nth-child(3) {
    color: var(--success);
}

.indicator-lines {
    display: grid;
    gap: 0;
}

.indicator-lines div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.indicator-lines span {
    color: var(--muted);
}

.indicator-lines strong {
    white-space: nowrap;
}

.indicator-lines .total {
    color: var(--primary-dark);
    font-weight: 800;
}

.indicator-lines .total span {
    color: var(--primary-dark);
}

.indicator-note {
    margin: 14px 0 0;
}

.freight-help {
    display: grid;
    gap: 6px;
    color: #3c4b52;
}

.freight-help strong {
    color: var(--primary-dark);
}

.freight-help p {
    margin: 0;
    color: var(--muted);
}

.debt-help {
    display: grid;
    gap: 6px;
    color: #3c4b52;
}

.debt-help strong {
    color: var(--primary-dark);
}

.debt-help p {
    margin: 0;
    color: var(--muted);
}

.compact-table {
    min-width: 0;
}

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

.payment-card {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7faf9;
}

.payment-card span,
.payment-card small {
    display: block;
    color: var(--muted);
}

.payment-card span {
    margin-bottom: 6px;
    font-size: 0.84rem;
    font-weight: 800;
}

.payment-card strong {
    display: block;
    margin-bottom: 4px;
    color: var(--primary-dark);
    font-size: 1.25rem;
}

.tutorial-panel {
    margin-top: 18px;
}

.accordion summary {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--primary-dark);
    font-weight: 800;
    list-style: none;
}

.accordion summary::-webkit-details-marker {
    display: none;
}

.accordion summary::after {
    content: '+';
    margin-left: auto;
    color: var(--muted);
    font-size: 1.25rem;
    line-height: 1;
}

.accordion[open] summary::after {
    content: '-';
}

.accordion-content {
    margin-top: 18px;
    border-top: 1px solid var(--line);
    padding-top: 18px;
    animation: accordion-open 180ms ease-out;
    transform-origin: top;
}

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

.tutorial-grid h3 {
    margin: 0 0 6px;
    color: var(--text);
    font-size: 0.98rem;
}

.tutorial-grid p {
    margin: 0;
    color: var(--muted);
}

@keyframes accordion-open {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scanner-box {
    display: none;
    margin-top: 10px;
    border: 1px dashed var(--primary);
    border-radius: 8px;
    padding: 10px;
    background: #f7fbfa;
}

.scanner-box.active {
    display: block;
}

.scanner-region {
    width: min(100%, 520px);
    min-height: 300px;
    margin: 0 auto;
}

.scanner-help {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

.scanner-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.scanner-controls .btn {
    width: auto;
}

.scanner-controls .btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.product-search-field {
    position: relative;
}

.product-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 50;
    display: grid;
    gap: 4px;
    max-height: 312px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.product-search-results[hidden] {
    display: none;
}

.product-search-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.product-search-option:hover,
.product-search-option:focus {
    background: var(--surface-alt);
}

.product-search-main {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.product-search-main strong,
.product-search-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-search-main small {
    color: var(--muted);
}

.product-search-price {
    flex: 0 0 auto;
    color: var(--primary-dark);
    font-weight: 800;
}

.product-search-empty {
    padding: 10px;
    color: var(--muted);
}

.order-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 18px;
    align-items: start;
}

.sale-type-panel {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
}

.sale-type-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.sale-type-head h2 {
    margin: 0 0 4px;
    font-size: 1.15rem;
}

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

.sale-type-option-form {
    margin: 0;
}

.sale-type-card {
    display: grid;
    gap: 8px;
    width: 100%;
    min-height: 112px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.sale-type-card:hover,
.sale-type-card.active {
    border-color: var(--primary);
    box-shadow: 0 12px 28px rgba(15, 118, 110, 0.12);
    transform: translateY(-1px);
}

.sale-type-card strong {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.sale-type-card strong svg {
    width: 20px;
    height: 20px;
}

.sale-type-card span {
    color: var(--muted);
    line-height: 1.45;
}

.order-summary {
    position: sticky;
    top: 86px;
}

.order-summary h2 {
    margin: 0 0 12px;
    font-size: 1.15rem;
}

.sale-kit-panel h2 {
    margin: 0 0 14px;
    font-size: 1.15rem;
}

.kit-draft {
    display: grid;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.kit-draft-head,
.kit-draft-item,
.order-kit-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.kit-draft-head > div,
.kit-draft-item > div,
.order-kit-title > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.kit-draft-head span,
.kit-draft-item span,
.order-kit-title span {
    font-size: 0.84rem;
}

.kit-draft-list {
    display: grid;
    gap: 8px;
}

.kit-draft-item {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7faf9;
}

.scan-button-field {
    justify-content: end;
}

.order-items-table {
    min-width: 0;
}

.order-items-table th,
.order-items-table td {
    padding: 10px 9px;
}

.order-items-table .order-product-cell {
    min-width: 180px;
}

.order-items-table .order-remove-cell {
    width: 54px;
    text-align: right;
}

.order-items-table .order-remove-cell .btn {
    width: auto;
}

.order-item-list {
    display: grid;
    gap: 8px;
}

.order-item-head,
.order-item-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 58px 94px 42px;
    gap: 10px;
    align-items: center;
}

.order-item-head {
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
    color: #3c4b52;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.order-item-row {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.order-kit-row {
    display: grid;
    gap: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7faf9;
}

.order-kit-row + .order-kit-row,
.order-kit-row + .order-item-row,
.order-item-row + .order-kit-row {
    margin-top: 8px;
}

.order-kit-title {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.kit-component-row {
    padding-left: 12px;
}

.kit-component-row:last-child {
    border-bottom: 0;
}

.order-item-product {
    min-width: 0;
}

.order-item-product strong,
.order-item-product span {
    display: block;
    overflow-wrap: anywhere;
}

.order-item-data {
    white-space: nowrap;
}

.order-item-row form {
    display: flex;
    justify-content: flex-end;
}

.order-empty {
    padding: 18px 0;
    color: var(--muted);
    text-align: center;
    border-bottom: 1px solid var(--line);
}

.kit-receipt-row td {
    background: #fff7fb;
}

.kit-receipt-row strong,
.kit-receipt-row span {
    display: block;
}

.kit-component-cell {
    padding-left: 28px;
}

.label-preview-wrap {
    display: flex;
    justify-content: center;
    padding: 18px;
    background: #f7faf9;
    border: 1px dashed var(--line);
    border-radius: 8px;
}

.thermal-label {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr auto;
    align-items: center;
    justify-items: center;
    width: 53mm;
    min-height: 15mm;
    padding: 1mm 1.5mm;
    background: #fff;
    color: #000;
    border: 1px solid #d7e0dc;
    border-radius: 4px;
    font-family: Arial, Helvetica, sans-serif;
    text-align: center;
}

.label-product {
    display: block;
    justify-self: start;
    max-width: calc(100% - 17mm);
    overflow: hidden;
    color: #000;
    font-size: 6px;
    line-height: 1;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.label-price {
    color: #000;
    font-size: 7px;
    font-weight: 800;
    line-height: 1;
    min-width: 15mm;
    position: absolute;
    right: 1.5mm;
    text-align: right;
    top: 1mm;
}

.label-code,
.barcode-code {
    color: #000;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 6px;
    letter-spacing: 0;
}

.barcode-image {
    display: block;
    width: 100%;
    max-width: 49mm;
    height: 8.5mm;
    object-fit: fill;
}

.print-area {
    display: none;
}


.total-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.total-line strong {
    font-size: 1.25rem;
}

.receipt {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

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

.post-generator-controls {
    position: sticky;
    top: 82px;
}

.post-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.template-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.template-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.template-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.template-card strong {
    color: var(--text);
}

.template-card span {
    color: var(--muted);
    font-size: 0.9rem;
}

.template-radio:checked + .template-card {
    border-color: var(--primary);
    background: #eef9f7;
    box-shadow: 0 0 0 3px rgba(20, 116, 111, 0.14);
}

.post-preview-panel {
    min-width: 0;
}

.post-preview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.post-preview-head h2 {
    margin: 0 0 4px;
    font-size: 1.25rem;
}

.post-preview-head p {
    margin: 0;
    color: var(--muted);
}

.post-canvas-wrap {
    display: grid;
    place-items: center;
    width: 100%;
    padding: 16px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #f7faf9;
}

#instagram-post-canvas {
    display: block;
    width: min(100%, 720px);
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    box-shadow: 0 16px 38px rgba(24, 44, 49, 0.15);
}

[data-post-discount-field].is-hidden {
    display: none;
}

.muted {
    color: var(--muted);
}

@media (max-width: 900px) {
    .metrics,
    .cash-metrics,
    .cashflow-metrics,
    .online-order-metrics,
    .indicator-hero,
    .indicator-main-grid,
    .indicator-columns,
    .order-grid,
    .order-operation-grid,
    .post-generator-grid {
        grid-template-columns: 1fr;
    }

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

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

    .indicator-page-head {
        flex-direction: column;
    }

    .indicator-period-card {
        min-width: 0;
    }

    .order-summary {
        position: static;
    }

    .post-generator-controls {
        position: static;
    }

    .sale-order-grid {
        gap: 14px;
    }
}

@media (max-width: 1024px) {
    .sale-order-panel .form-grid,
    .sale-kit-panel .form-grid,
    .sale-customer-panel .form-grid {
        grid-template-columns: 1fr;
    }

    .sale-order-panel,
    .sale-kit-panel,
    .sale-customer-panel,
    .order-summary,
    .sale-order-grid {
        max-width: 100%;
        min-width: 0;
    }

    .scan-button-field {
        justify-content: stretch;
    }

    .sale-order-panel .btn,
    .sale-kit-panel .btn,
    .sale-customer-panel .btn {
        width: 100%;
        white-space: normal;
    }
}

@media (max-width: 760px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    input,
    select,
    textarea,
    button {
        max-width: 100%;
    }

    .sale-type-head {
        flex-direction: column;
    }

    .sale-type-options {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: center;
        padding: 12px 16px;
        z-index: 80;
    }

    .nav-toggle {
        display: inline-flex;
        flex: 0 0 auto;
    }

    .nav-links {
        position: fixed;
        top: 67px;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 70;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 4px;
        margin-left: 0;
        padding: 14px 16px 28px;
        background: var(--surface);
        border-top: 1px solid var(--line);
        box-shadow: var(--shadow);
        opacity: 0;
        overflow-y: auto;
        pointer-events: none;
        transform: translateX(100%);
        transition: opacity 160ms ease, transform 220ms ease;
    }

    .nav-links.open {
        opacity: 1;
        pointer-events: auto;
        transform: translateX(0);
    }

    body.admin-nav-open {
        overflow: hidden;
    }

    .nav-links a,
    .nav-links button.logout-link,
    .nav-dropdown-toggle {
        justify-content: flex-start;
        padding: 12px;
    }

    .nav-logout-form {
        width: 100%;
    }

    .nav-links button.logout-link {
        width: 100%;
    }

    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown-toggle {
        width: 100%;
    }

    .nav-dropdown-menu {
        position: static;
        gap: 0;
        min-width: 0;
        padding: 0 0 6px 18px;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        opacity: 0;
        visibility: hidden;
        transform: none;
        pointer-events: none;
        display: none;
    }

    .nav-dropdown.open .nav-dropdown-menu {
        display: grid;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .app-main {
        width: calc(100% - 12px);
        margin-top: 18px;
    }

    .page-head {
        flex-direction: column;
        align-items: stretch;
    }

    .form-grid,
    .filter-bar,
    .cash-filter,
    .cashflow-filter,
    .online-order-filter,
    .indicator-grid,
    .indicator-grid.small,
    .payment-breakdown,
    .tutorial-grid,
    .footer-link-row {
        grid-template-columns: 1fr;
    }

    .form-grid,
    .field,
    .actions,
    .panel,
    .post-generator-grid,
    .order-operation-grid,
    .post-preview-panel,
    .post-canvas-wrap,
    .table-wrap,
    .sale-order-grid,
    .sale-order-panel,
    .sale-customer-panel,
    .order-summary {
        min-width: 0;
        max-width: 100%;
    }

    .panel {
        padding: 14px;
    }

    .sale-order-panel,
    .sale-customer-panel,
    .order-summary {
        margin-bottom: 14px;
    }

    .scan-button-field {
        justify-content: stretch;
    }

    .scanner-box {
        padding: 8px;
    }

    .scanner-region {
        min-height: 240px;
    }

    .actions {
        justify-content: stretch;
    }

    .btn {
        width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }

    .order-item-head {
        display: none;
    }

    .order-item-row {
        grid-template-columns: 1fr;
        gap: 8px;
        align-items: stretch;
    }

    .order-item-data {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        white-space: normal;
    }

    .order-item-data::before {
        content: attr(data-label);
        color: #3c4b52;
        font-size: 0.78rem;
        font-weight: 700;
        text-transform: uppercase;
    }

    .order-item-row form,
    .order-item-row form .btn {
        width: 100%;
    }

    .total-line {
        align-items: flex-start;
    }

    .orders-table {
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0;
    }

    .orders-table thead {
        display: none;
    }

    .orders-table,
    .orders-table tbody,
    .orders-table tr,
    .orders-table td {
        display: block;
        width: 100%;
    }

    .orders-table tr {
        padding: 12px;
        border-bottom: 1px solid var(--line);
    }

    .orders-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 8px 0;
        border-bottom: 0;
        white-space: normal;
        text-align: right;
    }

    .orders-table td::before {
        content: attr(data-label);
        flex: 0 0 110px;
        color: #3c4b52;
        font-size: 0.78rem;
        font-weight: 700;
        text-align: left;
        text-transform: uppercase;
    }

    .orders-table .client-cell,
    .orders-table .actions-cell {
        min-width: 0;
        width: 100%;
    }

    .orders-table .actions-cell {
        display: block;
        text-align: left;
    }

    .orders-table .actions-cell::before {
        display: block;
        margin-bottom: 8px;
    }

    .orders-table .actions-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .orders-table .actions-row form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        width: 100%;
    }

    .orders-table .actions-row > a,
    .orders-table .actions-row > form:last-child {
        display: flex;
        width: 100%;
    }

    .orders-table .actions-row > form:last-child .btn {
        width: 100%;
    }

    .orders-table .actions-row .btn {
        width: 100%;
    }

    .orders-table .mini-control,
    .orders-table .mini-file {
        max-width: none;
        width: 100%;
    }

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

    .cash-filter .actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .cashflow-filter .actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .cashflow-chart-row,
    .cashflow-bar-line {
        grid-template-columns: 1fr;
    }

    .customer-admin-layout,
    .customer-admin-metrics {
        grid-template-columns: 1fr;
    }

    .customer-admin-filter {
        grid-template-columns: 1fr;
    }

    .cashflow-bar-line strong {
        text-align: left;
    }

    .indicator-lines div {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
}

@media print {
    @page {
        size: 53mm 15mm;
        margin: 0;
    }

    * {
        box-shadow: none !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    html,
    body {
        width: 53mm;
        height: 15mm;
        margin: 0;
        padding: 0;
        overflow: hidden;
        background: #fff;
    }

    body * {
        visibility: hidden !important;
    }

    .print-area,
    .print-area * {
        visibility: visible !important;
    }

    .print-area {
        display: block !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 53mm;
        height: 15mm;
        margin: 0;
        padding: 0;
        background: #fff;
        overflow: hidden;
    }

    .print-area .thermal-label {
        display: grid !important;
        width: 53mm;
        height: 15mm;
        min-height: 0;
        max-height: 15mm;
        margin: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        overflow: hidden;
    }

    .print-area .label-product,
    .print-area .label-price,
    .print-area .barcode-image,
    .print-area .label-code {
        display: block !important;
        visibility: visible !important;
    }
}
