:root {
    --bg: #f5efe8;
    --bg-soft: #efe2d5;
    --surface: rgba(255, 255, 255, 0.76);
    --surface-strong: #fffdf9;
    --surface-alt: rgba(255, 244, 236, 0.92);
    --panel: rgba(255, 255, 255, 0.72);
    --panel-strong: rgba(255, 253, 249, 0.94);
    --panel-alt: rgba(255, 240, 230, 0.9);
    --text: #221b16;
    --text-soft: #4f443d;
    --muted: #665c54;
    --line: rgba(77, 52, 33, 0.12);
    --surface-border: rgba(77, 52, 33, 0.12);
    --surface-border-strong: rgba(239, 91, 42, 0.22);
    --brand: #ef5b2a;
    --brand-deep: #c84217;
    --brand-soft: #ffe0d3;
    --accent: #ef5b2a;
    --accent-soft: #ffe0d3;
    --accent-deep: #c84217;
    --primary: var(--brand);
    --primary-strong: var(--brand-deep);
    --secondary: #ff8d64;
    --warning: #d97706;
    --danger: #c2413b;
    --success: #ef5b2a;
    --success-soft: #ffe0d3;
    --danger-soft: #fde2df;
    --warning-soft: #fff0cf;
    --shadow: 0 24px 70px rgba(80, 51, 28, 0.14);
    --shadow-soft: 0 16px 40px rgba(90, 56, 31, 0.1);
    --radius-xl: 34px;
    --radius-lg: 26px;
    --radius-md: 18px;
    --radius-sm: 14px;
    --max: 1200px;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    line-height: 1.5;
    overflow-x: hidden;
    font-family: "Segoe UI Variable Display", "Bahnschrift", "Segoe UI", "Trebuchet MS", sans-serif;
    background:
        radial-gradient(circle at 12% 16%, rgba(239, 91, 42, 0.18), transparent 26%),
        radial-gradient(circle at 88% 12%, rgba(255, 106, 55, 0.16), transparent 24%),
        radial-gradient(circle at 52% 88%, rgba(255, 194, 163, 0.24), transparent 32%),
        linear-gradient(180deg, #fffaf4 0%, #f7eee6 48%, #f4e7da 100%);
    background-attachment: fixed;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

body::before {
    background:
        linear-gradient(rgba(124, 85, 58, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 85, 58, 0.04) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at center, black 42%, transparent 100%);
    opacity: 0.34;
}

body::after {
    background: radial-gradient(circle at center, rgba(239, 91, 42, 0.07), transparent 58%);
}

body:has([data-pos-app]) .ai-widget {
    display: none !important;
}

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

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

img,
svg,
video,
canvas {
    max-width: 100%;
}

strong,
h1,
h2,
h3,
h4 {
    letter-spacing: -0.02em;
}

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

.auth-card {
    width: min(1160px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
    border-radius: 36px;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(255, 253, 249, 0.96), rgba(255, 244, 236, 0.92));
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow);
    position: relative;
    isolation: isolate;
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(239, 91, 42, 0.14), transparent 30%),
        radial-gradient(circle at 80% 18%, rgba(239, 91, 42, 0.1), transparent 28%);
    opacity: 0.9;
    z-index: -1;
}

.auth-brand,
.auth-panel,
.card,
.sidebar,
.topbar,
.banner,
.total-box,
.gateway-card,
.pix-panel,
.quick-product-panel,
.feedback-text {
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.auth-brand {
    padding: clamp(36px, 6vw, 68px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 18px;
    background:
        radial-gradient(circle at 50% 42%, rgba(239, 91, 42, 0.22), transparent 34%),
        radial-gradient(circle at 12% 88%, rgba(255, 255, 255, 0.05), transparent 28%),
        linear-gradient(160deg, #080807 0%, #15110f 52%, #21130d 100%);
}

.auth-brand h1 {
    margin: 0;
    font-size: clamp(2.4rem, 5vw, 4.6rem);
    line-height: 0.95;
    color: var(--text);
}

.auth-brand p {
    margin: 0;
    max-width: 32rem;
    color: rgba(255, 244, 237, 0.8);
    font-size: 1.05rem;
}

.auth-panel {
    padding: clamp(28px, 4vw, 44px);
    background: rgba(255, 253, 249, 0.95);
    border-left: 1px solid rgba(77, 52, 33, 0.08);
}

.app-shell {
    display: grid;
    grid-template-columns: 312px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    background:
        radial-gradient(circle at top left, rgba(239, 91, 42, 0.14), transparent 30%),
        linear-gradient(180deg, rgba(255, 251, 247, 0.96), rgba(248, 236, 226, 0.94));
    border-right: 1px solid rgba(77, 52, 33, 0.08);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.45);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.brand-mark {
    width: 72px;
    height: 62px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background:
        linear-gradient(145deg, var(--brand), #ff9a72);
    color: #fff8f4;
    font-size: 1.25rem;
    font-weight: 800;
    box-shadow: 0 18px 36px rgba(239, 91, 42, 0.22);
}

.brand-logo {
    overflow: visible;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.auth-logo {
    width: min(460px, 92%);
    max-height: 280px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    filter: none;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: var(--muted);
    margin-top: 4px;
}

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

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

.nav-list a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 13px 15px;
    border-radius: 16px;
    color: var(--text-soft);
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.38);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.nav-list a,
.btn,
.badge,
.payment-chip,
.cell-actions,
.pagination {
    white-space: nowrap;
}

.nav-list a::before {
    content: none;
}

.nav-icon {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    border: 1px solid rgba(239, 91, 42, 0.42);
    background:
        linear-gradient(135deg, rgba(239, 91, 42, 0.22), rgba(239, 91, 42, 0.04));
    position: relative;
}

.nav-icon::before,
.nav-icon::after {
    content: none;
}

.nav-icon svg {
    width: 16px;
    height: 16px;
    color: var(--brand-deep);
    display: block;
}

.nav-icon-dashboard::before {
    inset: 5px;
    border: 2px solid #ff6a2e;
    border-radius: 4px;
}

.nav-icon-dashboard::after {
    width: 7px;
    height: 2px;
    left: 7px;
    top: 10px;
    background: #ff6a2e;
}

.nav-icon-plan::before {
    width: 10px;
    height: 12px;
    left: 5px;
    top: 4px;
    border: 2px solid #ff6a2e;
    border-radius: 3px;
}

.nav-icon-plan::after {
    width: 6px;
    height: 2px;
    left: 8px;
    top: 9px;
    background: #ff6a2e;
}

.nav-icon-pos::before {
    width: 12px;
    height: 9px;
    left: 4px;
    top: 5px;
    border: 2px solid #ff6a2e;
    border-radius: 3px;
}

.nav-icon-pos::after {
    width: 10px;
    height: 2px;
    left: 6px;
    bottom: 5px;
    background: #ff6a2e;
}

.nav-icon-pix::before {
    width: 8px;
    height: 8px;
    left: 6px;
    top: 6px;
    border: 2px solid #ff6a2e;
    transform: rotate(45deg);
}

.nav-icon-products::before,
.nav-icon-stock::before {
    width: 12px;
    height: 10px;
    left: 4px;
    top: 6px;
    border: 2px solid #ff6a2e;
    border-radius: 3px;
}

.nav-icon-sales::before {
    width: 3px;
    height: 10px;
    left: 5px;
    bottom: 5px;
    background: #ff6a2e;
    box-shadow: 5px -4px 0 #ff6a2e, 10px -1px 0 #ff6a2e;
}

.nav-icon-pdf::before {
    width: 10px;
    height: 12px;
    left: 5px;
    top: 4px;
    border: 2px solid #ff6a2e;
    border-radius: 2px;
}

.nav-icon-admin::before {
    width: 10px;
    height: 10px;
    left: 5px;
    top: 5px;
    border: 2px solid #ff6a2e;
    border-radius: 999px;
}

.nav-list a.active .nav-icon,
.nav-list a:hover .nav-icon {
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    border-color: rgba(239, 91, 42, 0.38);
}

.nav-list a.active .nav-icon svg,
.nav-list a:hover .nav-icon svg {
    color: #fff8f4;
}

.nav-list a.active,
.nav-list a:hover {
    transform: translateX(2px);
    color: var(--text);
    border-color: rgba(239, 91, 42, 0.36);
    background: linear-gradient(135deg, rgba(239, 91, 42, 0.14), rgba(255, 255, 255, 0.52));
}

.nav-list a.active::before,
.nav-list a:hover::before {
    background: var(--primary);
    box-shadow: 0 0 18px rgba(239, 91, 42, 0.3);
}

.sidebar .btn-with {
    color: var(--text);
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(77, 52, 33, 0.08);
}

.main-content {
    padding: 22px 24px;
    min-width: 0;
    width: 100%;
}

.main-content > * {
    width: min(100%, var(--max));
    margin-left: auto;
    margin-right: auto;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
    padding: 22px 24px;
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(239, 91, 42, 0.16), transparent 34%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(255, 244, 236, 0.9));
    box-shadow: var(--shadow-soft);
    color: var(--text);
    min-width: 0;
}

.topbar > div,
.card-head > div,
.gateway-card-head > div {
    min-width: 0;
}

.topbar h1,
.card-head h2,
.section-heading h2 {
    margin: 0;
}

.topbar h1 {
    font-size: clamp(1.5rem, 3vw, 2.3rem);
}

.topbar p,
.section-heading p,
.muted,
.empty-state,
.feedback-text,
.item-info p,
.item-info small,
.product-search-main small,
.product-search-meta small,
.product-search-empty span {
    color: var(--muted);
}

.topbar p,
.topbar .muted {
    color: var(--muted);
}

.section-heading p,
.card-head p,
.card > p {
    margin: 6px 0 0;
}

.grid-cards,
.grid-main,
.page-grid,
.pos-layout {
    display: grid;
    gap: 20px;
    min-width: 0;
    align-items: start;
}

.grid-cards {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 20px;
}

.grid-main {
    grid-template-columns: minmax(0, 1fr) minmax(420px, 1.2fr);
}

.page-grid {
    grid-template-columns: minmax(0, 1.18fr) minmax(330px, 0.82fr);
}

.products-page {
    grid-template-columns: minmax(280px, 0.74fr) minmax(0, 1.26fr);
}

.products-page > .products-form-panel {
    order: -1;
}

.payments-page {
    display: grid;
    grid-template-columns: minmax(0, 860px);
    gap: 20px;
}

.profile-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
    gap: 20px;
    align-items: start;
}

.profile-card {
    min-width: 0;
}

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

.profile-summary {
    display: grid;
    gap: 12px;
}

.profile-summary > div {
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(77, 52, 33, 0.08);
}

.profile-summary span {
    display: block;
    color: var(--muted);
    font-size: 0.86rem;
    margin-bottom: 4px;
}

.profile-summary strong {
    color: var(--text);
}

.profile-note {
    margin-bottom: 0;
    background: rgba(255, 224, 211, 0.44);
    border-color: rgba(239, 91, 42, 0.16);
    color: var(--brand-deep);
}

.suppliers-page {
    padding-bottom: 22px;
}

.suppliers-workspace {
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
}

.suppliers-lists {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
}

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

.supplier-product-fields {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(239, 91, 42, 0.16);
    border-radius: 16px;
    background: rgba(255, 244, 236, 0.62);
}

.table-subtext {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: normal;
}

.ai-widget {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 30;
    display: grid;
    justify-items: end;
    gap: 12px;
}

.ai-widget.ai-widget-pos-safe {
    right: 12px !important;
    left: auto !important;
    bottom: 220px !important;
}

.ai-toggle {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 8px 14px 8px 8px;
    border: 0;
    border-radius: 20px;
    color: var(--text);
    font-weight: 800;
    cursor: pointer;
    text-align: left;
    background:
        radial-gradient(circle at top right, rgba(239, 91, 42, 0.16), transparent 42%),
        linear-gradient(135deg, rgba(255, 253, 249, 0.98), rgba(255, 232, 219, 0.96));
    border: 1px solid rgba(239, 91, 42, 0.18);
    box-shadow: 0 18px 38px rgba(200, 66, 23, 0.22);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ai-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 48px rgba(200, 66, 23, 0.28);
}

.ai-avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #fff8f4;
    background:
        radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.34), transparent 22%),
        linear-gradient(135deg, var(--brand), var(--brand-deep));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 10px 22px rgba(200, 66, 23, 0.3);
}

.ai-avatar svg {
    width: 18px;
    height: 18px;
    display: block;
}

.ai-toggle-text {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.ai-toggle-text strong,
.ai-toggle-text small {
    display: block;
    line-height: 1.1;
}

.ai-toggle-text strong {
    font-size: 0.92rem;
}

.ai-toggle-text small {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
}

.ai-panel {
    width: min(380px, calc(100vw - 28px));
    max-height: min(620px, calc(100vh - 110px));
    display: grid;
    grid-template-rows: auto minmax(220px, 1fr) auto;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(77, 52, 33, 0.12);
    background:
        radial-gradient(circle at top right, rgba(239, 91, 42, 0.16), transparent 34%),
        linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(255, 244, 236, 0.98));
    box-shadow: 0 28px 80px rgba(80, 51, 28, 0.22);
}

.ai-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid rgba(77, 52, 33, 0.08);
}

.ai-panel-head strong,
.ai-panel-head small {
    display: block;
}

.ai-panel-head small {
    color: var(--muted);
}

.ai-panel-head button {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: rgba(239, 91, 42, 0.1);
    color: var(--brand-deep);
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
}

.ai-messages {
    display: grid;
    gap: 10px;
    align-content: start;
    overflow-y: auto;
    padding: 16px;
}

.ai-message {
    max-width: 92%;
    padding: 11px 13px;
    border-radius: 16px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 0.94rem;
}

.ai-message-bot {
    justify-self: start;
    color: var(--text);
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(77, 52, 33, 0.08);
}

.ai-message-user {
    justify-self: end;
    color: #fff8f4;
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
}

.ai-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 14px;
    border-top: 1px solid rgba(77, 52, 33, 0.08);
}

.ai-form textarea {
    width: 100%;
    min-height: 44px;
    max-height: 120px;
    resize: vertical;
    padding: 11px 12px;
    border-radius: 14px;
    border: 1px solid rgba(77, 52, 33, 0.12);
    background: rgba(255, 255, 255, 0.76);
    color: var(--text);
}

.ai-form textarea:focus {
    outline: none;
    border-color: rgba(239, 91, 42, 0.36);
    box-shadow: 0 0 0 4px rgba(239, 91, 42, 0.1);
}

.pos-layout {
    align-items: start;
    grid-template-columns: minmax(0, 1.06fr) minmax(360px, 0.94fr);
}

.card {
    position: relative;
    min-width: 0;
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--surface-border);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 246, 239, 0.9));
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(239, 91, 42, 0.3), transparent);
    opacity: 0.7;
}

.card > * {
    position: relative;
    z-index: 1;
}

.card-head,
.topbar-actions,
.row-actions,
.quick-actions,
.barcode-row,
.inline-form,
.payment-grid {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.card-head {
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.topbar-actions {
    justify-content: flex-end;
}

.stat-card {
    min-height: 170px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        radial-gradient(circle at top right, rgba(239, 91, 42, 0.12), transparent 36%),
        linear-gradient(180deg, rgba(255, 253, 250, 0.96), rgba(255, 241, 232, 0.92));
}

.stat-card span,
.stat-card small {
    color: var(--muted);
}

.stat-card strong {
    display: block;
    margin-top: 10px;
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-cta {
    background:
        radial-gradient(circle at top right, rgba(239, 91, 42, 0.16), transparent 35%),
        linear-gradient(145deg, rgba(255, 248, 243, 0.98), rgba(255, 231, 218, 0.92));
    border-color: rgba(239, 91, 42, 0.18);
}

.card-cta p {
    margin-top: 0;
}

.dashboard-chart-card {
    margin-bottom: 20px;
}

.dashboard-fintech-card {
    width: min(100%, var(--max));
    margin: 0 auto 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.34fr);
    gap: 18px;
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--surface-border);
    background:
        radial-gradient(circle at top right, rgba(239, 91, 42, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 246, 239, 0.94));
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.fintech-chart-main,
.fintech-chart-side {
    min-width: 0;
}

.fintech-chart-main {
    display: grid;
    gap: 16px;
}

.fintech-chart-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.fintech-chart-head h2,
.fintech-chart-head p,
.fintech-total span,
.fintech-total strong,
.fintech-chart-side span,
.fintech-chart-side strong,
.fintech-chart-side small {
    display: block;
}

.eyebrow {
    color: var(--brand-deep);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.fintech-chart-head h2 {
    margin: 4px 0 0;
    font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.fintech-chart-head p {
    margin: 6px 0 0;
    color: var(--muted);
}

.fintech-total {
    flex: 0 0 auto;
    min-width: 180px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(239, 91, 42, 0.16);
    background: rgba(255, 255, 255, 0.62);
    text-align: right;
}

.fintech-total span,
.fintech-chart-side span,
.fintech-chart-side small {
    color: var(--muted);
}

.fintech-total strong {
    margin-top: 4px;
    color: var(--brand-deep);
    font-size: clamp(1.25rem, 2vw, 1.7rem);
    white-space: nowrap;
}

.fintech-line-wrap {
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0 2px;
}

.fintech-line-chart {
    width: 100%;
    min-width: 560px;
    height: auto;
    display: block;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 240, 230, 0.7));
    border: 1px solid rgba(77, 52, 33, 0.08);
}

.line-grid {
    fill: none;
    stroke: rgba(77, 52, 33, 0.1);
    stroke-width: 1;
}

.line-area {
    fill: url(#areaGradient);
}

.line-stroke {
    fill: none;
    stroke: url(#lineGradient);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.line-dot {
    fill: #fff8f4;
    stroke: var(--brand);
    stroke-width: 3;
}

.fintech-bars {
    min-height: 220px;
    grid-template-columns: repeat(7, minmax(74px, 1fr));
    padding-top: 6px;
}

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

.fintech-chart-side article {
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(77, 52, 33, 0.08);
    background: rgba(255, 255, 255, 0.58);
}

.fintech-chart-side strong {
    margin-top: 5px;
    color: var(--text);
    font-size: 1.15rem;
}

.payment-breakdown {
    display: grid;
    gap: 10px;
}

.payment-row {
    display: grid;
    gap: 7px;
}

.payment-row > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.payment-row span {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(239, 91, 42, 0.12);
}

.payment-row i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), var(--brand-deep));
}

.dashboard-chart {
    min-height: 280px;
    display: grid;
    grid-template-columns: repeat(7, minmax(64px, 1fr));
    gap: 12px;
    align-items: end;
    overflow-x: auto;
    padding: 18px 6px 2px;
}

.chart-column {
    min-width: 64px;
    display: grid;
    gap: 8px;
    justify-items: center;
    text-align: center;
}

.chart-value {
    min-height: 18px;
    color: var(--brand-deep);
    font-size: 0.78rem;
    font-weight: 800;
}

.chart-track {
    width: 100%;
    max-width: 56px;
    height: 160px;
    padding: 5px;
    display: flex;
    align-items: end;
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 224, 211, 0.72));
    border: 1px solid rgba(239, 91, 42, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.chart-bar {
    width: 100%;
    min-height: 8px;
    border-radius: 999px;
    background:
        linear-gradient(180deg, #ff9a72 0%, var(--brand) 48%, var(--brand-deep) 100%);
    box-shadow: 0 12px 24px rgba(239, 91, 42, 0.24);
}

.chart-column strong {
    font-size: 0.86rem;
    color: var(--text);
}

.chart-column small {
    color: var(--muted);
    font-size: 0.76rem;
}

.quick-actions {
    margin-top: 18px;
}

.stack {
    display: grid;
    gap: 14px;
}

.field {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.field span {
    color: var(--text-soft);
    font-size: 0.92rem;
    font-weight: 600;
}

.field input,
.field select,
.field textarea,
.inline-form input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(77, 52, 33, 0.12);
    background: rgba(255, 255, 255, 0.68);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.field input::placeholder,
.field textarea::placeholder,
.inline-form input::placeholder {
    color: rgba(102, 92, 84, 0.72);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.inline-form input:focus {
    outline: none;
    transform: translateY(-1px);
    border-color: rgba(239, 91, 42, 0.36);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 4px rgba(239, 91, 42, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    cursor: pointer;
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 700;
    min-height: 42px;
    transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease, background 0.16s ease;
    max-width: 100%;
    text-align: center;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.68;
    transform: none;
}

.stack > .btn:not(.btn-lg):not(.w-full),
form.stack > .btn:not(.btn-lg):not(.w-full) {
    width: auto;
    justify-self: start;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    color: #fff8f4;
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    box-shadow: 0 16px 30px rgba(200, 66, 23, 0.22);
}

.btn-secondary {
    color: #fff8f4;
    background: linear-gradient(135deg, #ff7a3d, var(--brand-deep));
    box-shadow: 0 16px 30px rgba(200, 66, 23, 0.2);
}

.btn-light {
    color: var(--text-soft);
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(77, 52, 33, 0.08);
}

.btn-danger {
    color: var(--danger);
    background: rgba(194, 65, 59, 0.09);
    border: 1px solid rgba(194, 65, 59, 0.16);
}

.btn-sm {
    padding: 8px 11px;
    border-radius: 10px;
    min-height: 36px;
    font-size: 0.88rem;
}

.btn-lg {
    width: 100%;
    padding: 13px 18px;
    font-size: 1.02rem;
    min-height: 50px;
}

.w-full {
    width: 100%;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(239, 91, 42, 0.1);
    border: 1px solid rgba(239, 91, 42, 0.14);
    color: var(--primary-strong);
    font-size: 0.82rem;
    white-space: nowrap;
}

.badge-success {
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    border-color: rgba(239, 91, 42, 0.22);
    color: #fff8f4;
}

.badge-danger {
    background: rgba(194, 65, 59, 0.1);
    border-color: rgba(194, 65, 59, 0.16);
    color: var(--danger);
}

.banner,
.toast {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(77, 52, 33, 0.08);
    margin-bottom: 18px;
}

.banner-warning,
.toast-error {
    background: var(--warning-soft);
    color: #9a5a08;
    border-color: rgba(217, 119, 6, 0.18);
}

.toast-success {
    background: var(--brand-soft);
    color: var(--brand-deep);
    border-color: rgba(239, 91, 42, 0.18);
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(77, 52, 33, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.48);
}

.table-scroll {
    max-height: min(62vh, 620px);
    overflow: auto;
}

.table-scroll-md {
    max-height: min(52vh, 440px);
}

.table-scroll-lg {
    max-height: min(64vh, 680px);
}

.table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff0e5;
    box-shadow: 0 1px 0 rgba(77, 52, 33, 0.08);
}

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

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

.products-table {
    min-width: 760px;
    table-layout: fixed;
}

.products-table th,
.products-table td {
    padding: 10px 8px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.products-table th:nth-child(1),
.products-table td:nth-child(1) {
    width: 18%;
}

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

.products-table th:nth-child(3),
.products-table td:nth-child(3),
.products-table th:nth-child(4),
.products-table td:nth-child(4) {
    width: 14%;
}

.products-table th:nth-child(5),
.products-table td:nth-child(5) {
    width: 10%;
}

.products-table th:nth-child(6),
.products-table td:nth-child(6) {
    width: 19%;
}

.products-table .row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.products-table .row-actions form,
.products-table .row-actions .btn {
    width: 100%;
}

.products-table .btn-sm {
    min-height: 36px;
    padding: 8px 9px;
    font-size: 0.82rem;
}

.products-mobile-list {
    display: none;
}

thead {
    background: rgba(255, 239, 229, 0.7);
}

th,
td {
    text-align: left;
    padding: 11px 12px;
    border-bottom: 1px solid rgba(77, 52, 33, 0.08);
    vertical-align: middle;
    white-space: nowrap;
}

th {
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.cell-strong {
    color: var(--text);
    font-weight: 700;
}

.cell-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.cell-strong,
td:first-child,
td:nth-child(2) {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-card .table-wrap,
.table-scroll,
.table-scroll-md,
.table-scroll-lg {
    max-height: none;
}

.history-card {
    padding-bottom: 14px;
}

tbody tr {
    transition: background 0.18s ease;
}

tbody tr:hover {
    background: rgba(239, 91, 42, 0.04);
}

.auth-link,
.auth-link a {
    color: var(--text-soft);
}

.auth-link a {
    color: var(--primary-strong);
    font-weight: 700;
}

.auth-legal-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    color: var(--text-soft);
    font-size: 0.88rem;
}

.auth-legal-links a {
    color: var(--primary-strong);
    font-weight: 800;
}

.legal-page {
    width: min(980px, 100%);
}

.legal-card,
.support-card {
    border-radius: 20px;
}

.legal-section {
    display: grid;
    gap: 6px;
}

.legal-section h3,
.support-card h3 {
    margin: 0;
}

.legal-section p,
.support-card p {
    margin: 0;
}

.legal-section a,
.support-card h3 {
    color: var(--brand-deep);
}

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

.support-label {
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

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

.text-success {
    color: var(--brand-deep);
}

.text-danger {
    color: var(--danger);
}

.pos-panel,
.pos-cart {
    position: relative;
    overflow: hidden;
}

.pos-panel {
    background:
        radial-gradient(circle at top right, rgba(239, 91, 42, 0.14), transparent 34%),
        linear-gradient(180deg, rgba(255, 252, 248, 0.96), rgba(255, 240, 230, 0.92));
}

.pos-cart {
    background:
        radial-gradient(circle at top right, rgba(239, 91, 42, 0.1), transparent 34%),
        linear-gradient(180deg, rgba(255, 253, 249, 0.96), rgba(246, 237, 229, 0.94));
    display: grid;
    gap: 16px;
}

.barcode-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.barcode-row input {
    min-width: 0;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}

.feedback-text {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.48);
    border: 1px solid rgba(77, 52, 33, 0.08);
}

.feedback-text.feedback-error {
    color: #c44536;
}

.feedback-text.feedback-ok {
    color: var(--muted);
}

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

.compact-head h3 {
    margin: 0;
}

.product-search-results,
.quick-product-panel,
.product-search-main,
.product-search-meta,
.product-search-empty {
    display: grid;
    gap: 8px;
}

.product-search-results {
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.product-search-item,
.product-search-empty,
.gateway-card {
    border-radius: 18px;
    border: 1px solid rgba(77, 52, 33, 0.08);
    background: rgba(255, 255, 255, 0.44);
    box-shadow: var(--shadow-soft);
}

.product-search-item {
    width: 100%;
    padding: 11px 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    text-align: left;
    color: var(--text);
}

.product-search-item.is-disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.product-search-main strong,
.product-search-meta strong {
    font-size: 0.92rem;
}

.product-search-meta {
    justify-items: end;
}

.product-search-empty {
    padding: 14px;
}

.quick-product-panel {
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.44);
}

.quick-product-grid,
.admin-form-grid,
.subscription-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.admin-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.subscription-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.subscription-page {
    grid-template-columns: minmax(0, 920px);
    justify-content: center;
    gap: 18px;
}

.subscription-card,
.subscription-help {
    align-self: start;
}

.subscription-summary {
    margin-bottom: 6px;
}

.subscription-summary .stat-card {
    min-height: 150px;
    padding: 20px;
}

.subscription-summary .stat-card strong {
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.subscription-action .btn {
    width: auto;
    min-width: 220px;
}

.subscription-help {
    display: grid;
    gap: 14px;
}

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

.subscription-steps p {
    min-height: 76px;
    margin: 0;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.54);
    border: 1px solid rgba(77, 52, 33, 0.08);
    display: flex;
    align-items: center;
    gap: 10px;
}

.subscription-steps span {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    color: #fff8f4;
    font-weight: 800;
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    box-shadow: 0 12px 24px rgba(239, 91, 42, 0.22);
}

.page-grid.admin-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gateway-card {
    padding: 18px;
    min-width: 0;
}

.gateway-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

.gateway-card-head h3 {
    margin: 0 0 6px;
}

.admin-user-list {
    display: grid;
    gap: 16px;
}

.admin-user-list > * {
    min-width: 0;
}

.cart-items {
    min-height: 220px;
    max-height: min(42vh, 380px);
    overflow-y: auto;
    display: grid;
    gap: 10px;
    align-content: start;
    padding-right: 4px;
}

.cart-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 11px;
    border-radius: 16px;
    border: 1px solid rgba(77, 52, 33, 0.08);
    background: rgba(255, 255, 255, 0.46);
}

.item-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.item-info h4 {
    margin: 0 0 6px;
    font-size: 0.96rem;
}

.item-info strong {
    color: var(--brand-deep);
}

.item-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.item-controls button {
    min-width: 28px;
    height: 28px;
    border: 0;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
}

.item-controls span {
    min-width: 18px;
    text-align: center;
    color: var(--brand-deep);
    font-weight: 700;
}

.item-controls .remove-btn {
    background: rgba(194, 65, 59, 0.12);
    color: var(--danger);
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-button {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 0;
    background: rgba(255, 255, 255, 0.72);
    color: var(--text);
    cursor: pointer;
}

.total-box {
    padding: 18px 20px;
    border-radius: 20px;
    border: 1px solid rgba(239, 91, 42, 0.18);
    background:
        radial-gradient(circle at top right, rgba(239, 91, 42, 0.08), transparent 42%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 248, 243, 0.96));
    box-shadow: 0 18px 38px rgba(80, 51, 28, 0.1);
}

.total-box span {
    color: var(--muted);
}

.total-box strong {
    display: block;
    margin-top: 6px;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    color: var(--text);
}

.pos-cart > .btn-lg {
    margin-top: 2px;
    position: relative;
    z-index: 80;
}

.pix-panel {
    gap: 14px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(239, 91, 42, 0.14);
    background: rgba(255, 255, 255, 0.48);
    min-width: 0;
}

.gateway-card form,
table,
td,
th {
    min-width: 0;
}

td,
.muted,
.empty-state {
    overflow-wrap: anywhere;
}

.pix-panel h3 {
    margin: 0;
}

.pix-panel-body {
    display: grid;
    gap: 14px;
}

#pix-qr-image,
#subscription-qr-image,
.pix-qr-image {
    width: min(240px, 100%);
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    margin: 0 auto;
    padding: 12px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(77, 52, 33, 0.08);
}

#subscription-panel .pix-panel-body {
    justify-items: stretch;
}

#subscription-panel,
.subscription-pix-panel-body,
#subscription-copy-paste,
#pix-copy-paste {
    width: 100%;
    max-width: 100%;
}

#subscription-copy-paste,
#pix-copy-paste {
    min-height: 96px;
    resize: vertical;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.subscription-payment-grid {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.subscription-qr-box {
    min-width: 0;
    display: grid;
    justify-items: center;
}

.subscription-payment-details {
    min-width: 0;
}

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

.payment-chip {
    flex: 1 1 92px;
    min-width: 0;
    min-height: 38px;
    padding: 9px 12px;
    border-radius: 14px;
    border: 1px solid rgba(77, 52, 33, 0.08);
    background: rgba(255, 255, 255, 0.52);
    color: var(--text-soft);
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.payment-chip:hover,
.payment-chip.active {
    transform: translateY(-1px);
    color: #fff8f4;
    border-color: rgba(239, 91, 42, 0.24);
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
}

.scanner-box {
    width: 100%;
    height: clamp(240px, 34vw, 300px);
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid rgba(239, 91, 42, 0.18);
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.14), transparent 44%),
        linear-gradient(180deg, #4e2e1f, #2f1b12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 22px 42px rgba(80, 41, 17, 0.24);
}

.scanner-box::before {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 234, 223, 0.24);
    pointer-events: none;
    z-index: 1;
}

.scanner-box::after {
    content: "Centralize o codigo na faixa para leitura";
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 2;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(34, 27, 22, 0.78);
    border: 1px solid rgba(255, 224, 211, 0.18);
    color: rgba(255, 248, 244, 0.94);
    font-size: 0.8rem;
    white-space: nowrap;
}

.scanner-box[data-ready="false"]::after {
    content: "Preparando camera traseira...";
}

.scanner-viewport {
    width: 100%;
    height: 100%;
    position: relative;
}

.scanner-viewport video,
.scanner-viewport canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
}

.scanner-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 3;
    background: linear-gradient(90deg, transparent 0%, #ef5b2a 20%, #ff8d64 50%, #ef5b2a 80%, transparent 100%);
    box-shadow: 0 0 20px rgba(239, 91, 42, 0.5);
    animation: scanner-sweep 2.8s ease-in-out infinite;
}

@keyframes scanner-sweep {
    0%, 100% {
        top: 14%;
        opacity: 0.74;
    }
    50% {
        top: 84%;
        opacity: 1;
    }
}

.hidden {
    display: none !important;
}

.download-frame {
    position: absolute;
    width: 1px;
    height: 1px;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.back-to-top {
    position: fixed;
    right: 22px;
    bottom: 96px;
    z-index: 90;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(239, 91, 42, 0.18);
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    color: #ffffff;
    font-size: 1.1rem;
    line-height: 1;
    font-weight: 900;
    box-shadow: 0 10px 22px rgba(196, 66, 23, 0.2);
    cursor: pointer;
}

@media (max-width: 720px) {
    .back-to-top {
        right: 18px;
        bottom: 178px;
    }
}

.back-to-top.hidden,
.app-route-pos .back-to-top {
    display: none;
}

@media (min-width: 1440px) {
    .main-content {
        padding: 26px 32px;
    }

    .grid-main {
        grid-template-columns: minmax(0, 0.88fr) minmax(480px, 1.12fr);
    }

    .subscription-page {
        grid-template-columns: minmax(0, 960px);
    }

    .page-grid {
        grid-template-columns: minmax(0, 1.22fr) minmax(380px, 0.78fr);
    }

    .products-page {
        grid-template-columns: minmax(300px, 0.7fr) minmax(0, 1.3fr);
    }
}

@media (max-width: 1280px) {
    .page-grid {
        grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
    }

    .products-page {
        grid-template-columns: minmax(280px, 0.76fr) minmax(0, 1.24fr);
    }

    .grid-main {
        grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr);
    }

    .subscription-page {
        grid-template-columns: minmax(0, 920px);
    }

    .pos-layout {
        grid-template-columns: minmax(0, 1fr) minmax(330px, 0.92fr);
    }
}

@media (max-width: 1180px) {
    .auth-card,
    .subscription-summary {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 1080px) {
    .grid-main,
    .page-grid,
    .pos-layout,
    .profile-page,
    .suppliers-workspace,
    .suppliers-lists {
        grid-template-columns: 1fr;
    }

    .products-page {
        grid-template-columns: 1fr;
    }

    .dashboard-fintech-card {
        grid-template-columns: 1fr;
    }

    .subscription-page {
        grid-template-columns: minmax(0, 1fr);
    }

    .table-scroll,
    .table-scroll-md,
    .table-scroll-lg {
        max-height: none;
    }
}

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

    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid rgba(77, 52, 33, 0.08);
        padding: 18px 14px;
        gap: 18px;
    }

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

    .main-content {
        padding: 16px 14px 20px;
    }

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

    .inline-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
    }

    .payment-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

    .product-search-item,
    .cart-item {
        grid-template-columns: 1fr;
    }

    .product-search-meta {
        justify-items: start;
    }

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

@media (max-width: 760px) {
    .topbar,
    .card-head,
    .fintech-chart-head,
    .gateway-card-head,
    .inline-form,
    .row-actions {
        flex-direction: column;
        align-items: stretch;
    }

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

    .stack > .btn,
    form.stack > .btn,
    .subscription-action .btn,
    .btn-lg,
    .topbar-actions .btn {
        width: 100%;
        justify-self: stretch;
    }

    .subscription-payment-grid {
        grid-template-columns: 1fr;
    }

    .subscription-steps {
        grid-template-columns: 1fr;
    }

    #subscription-qr-image,
    .pix-qr-image {
        width: min(220px, 100%);
    }

    .dashboard-fintech-card {
        padding: 16px;
        border-radius: 20px;
    }

    .fintech-total {
        min-width: 0;
        text-align: left;
    }
}

@media (max-width: 640px) {
    .auth-shell,
    .main-content {
        padding: 14px;
    }

    .auth-card {
        border-radius: 24px;
    }

    .auth-brand,
    .auth-panel,
    .card,
    .topbar {
        padding: 16px;
    }

    .sidebar {
        padding: 14px 12px;
    }

    .brand {
        gap: 10px;
        margin-bottom: 16px;
    }

    .brand-mark {
        width: 54px;
        height: 50px;
        font-size: 1.05rem;
        border-radius: 14px;
    }

    .brand-logo {
        width: 68px;
        height: 54px;
        padding: 0;
    }

    .grid-cards,
    .quick-product-grid,
    .subscription-summary,
    .profile-form-grid,
    .supplier-form-grid,
    .admin-form-grid,
    .page-grid.admin-form-grid,
    .nav-list,
    .payment-grid {
        grid-template-columns: 1fr;
    }

    .barcode-row {
        grid-template-columns: 1fr;
    }

    .topbar h1 {
        font-size: 1.3rem;
    }

    .topbar p,
    .muted,
    .badge,
    .item-info p,
    .item-info small,
    .feedback-text {
        font-size: 0.9rem;
    }

    .nav-list a {
        padding: 12px 14px 12px 18px;
        min-height: 48px;
    }

    .scanner-box {
        height: min(64vw, 260px);
        min-height: 220px;
    }

    .fintech-bars {
        grid-template-columns: repeat(7, minmax(64px, 1fr));
    }

    .cart-items {
        max-height: 320px;
        min-height: 0;
    }

    .ai-widget {
        right: 14px;
        bottom: 14px;
        left: 14px;
    }

    .ai-panel {
        width: 100%;
        max-height: calc(100vh - 92px);
    }

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

    .ai-toggle {
        justify-self: end;
        grid-template-columns: 40px minmax(0, 1fr);
        max-width: 184px;
    }

    .app-route-pos .ai-widget,
    .app-route-products .ai-widget {
        display: none;
    }

    .pos-cart > .btn-lg {
        position: relative;
        z-index: 4;
    }
}

@media (max-width: 420px) {
    .card,
    .topbar,
    .auth-brand,
    .auth-panel {
        padding: 14px;
        border-radius: 18px;
    }

    .btn,
    .field input,
    .field select,
    .field textarea,
    .inline-form input {
        font-size: 16px;
    }

    .btn {
        min-height: 44px;
        padding: 11px 14px;
        border-radius: 14px;
    }

    .stat-card strong,
    .total-box strong {
        font-size: 1.42rem;
    }

    .payment-chip {
        min-height: 36px;
    }
}

@media (max-width: 640px) {
    .products-table-wrap {
        display: none;
    }

    .products-mobile-list {
        display: grid;
        gap: 12px;
    }

    .product-mobile-card {
        display: grid;
        gap: 12px;
        padding: 14px;
        border: 1px solid rgba(77, 52, 33, 0.08);
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.72);
        box-shadow: 0 12px 24px rgba(80, 51, 28, 0.06);
        min-width: 0;
    }

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

    .product-mobile-main strong,
    .product-mobile-main span {
        display: block;
        min-width: 0;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .product-mobile-main strong {
        color: var(--text);
        font-size: 0.98rem;
        line-height: 1.25;
    }

    .product-mobile-main span {
        color: var(--muted);
        font-size: 0.82rem;
        font-variant-numeric: tabular-nums;
    }

    .product-mobile-data {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin: 0;
    }

    .product-mobile-data div {
        min-width: 0;
        padding: 10px;
        border-radius: 12px;
        background: rgba(255, 244, 236, 0.72);
        border: 1px solid rgba(77, 52, 33, 0.06);
    }

    .product-mobile-data dt,
    .product-mobile-data dd {
        margin: 0;
        min-width: 0;
    }

    .product-mobile-data dt {
        color: var(--text-soft);
        font-size: 0.68rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        margin-bottom: 3px;
    }

    .product-mobile-data dd {
        color: var(--text);
        font-weight: 800;
        font-size: 0.9rem;
        line-height: 1.2;
        white-space: nowrap;
    }

    .product-mobile-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .product-mobile-actions form,
    .product-mobile-actions .btn {
        width: 100%;
        min-width: 0;
    }

    .table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .table-wrap table {
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0 12px;
    }

    .table-wrap thead {
        display: none;
    }

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

    .table-wrap tr {
        padding: 12px;
        border: 1px solid rgba(77, 52, 33, 0.08);
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.66);
        box-shadow: 0 12px 24px rgba(80, 51, 28, 0.06);
    }

    .table-wrap td {
        display: grid;
        grid-template-columns: minmax(92px, 0.42fr) minmax(0, 1fr);
        gap: 10px;
        align-items: center;
        padding: 9px 0;
        border-bottom: 1px solid rgba(77, 52, 33, 0.06);
        white-space: normal;
        max-width: none;
        text-align: left;
    }

    .table-wrap td::before {
        content: attr(data-label);
        color: var(--text-soft);
        font-size: 0.75rem;
        font-weight: 800;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .table-wrap td:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .table-wrap td:not([data-label]),
    .table-wrap .empty-state {
        display: block;
        text-align: center;
    }

    .table-wrap td:not([data-label])::before,
    .table-wrap .empty-state::before {
        content: none;
    }

    .table-wrap .cell-actions {
        width: 100%;
        text-align: left;
        white-space: normal;
    }

    .table-wrap td.cell-actions,
    .table-wrap td[data-label="Acoes"] {
        grid-template-columns: 1fr;
    }

    .table-wrap td.cell-actions::before,
    .table-wrap td[data-label="Acoes"]::before {
        margin-bottom: 2px;
    }

    .table-wrap .row-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .table-wrap .row-actions form,
    .table-wrap .row-actions .btn,
    .table-wrap .cell-actions .btn {
        width: 100%;
    }

    .products-table {
        min-width: 0 !important;
        table-layout: auto !important;
    }

    .products-table,
    .products-table tbody,
    .products-table tr,
    .products-table td {
        display: block !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
    }

    .products-table td {
        min-height: 0;
        display: flex !important;
        align-items: flex-start;
        justify-content: space-between;
        gap: 14px;
        padding: 10px 0;
        white-space: nowrap;
        word-break: keep-all;
        overflow-wrap: normal;
    }

    .products-table td::before {
        flex: 0 0 86px;
        max-width: 86px;
        margin: 0;
    }

    .products-table td {
        text-align: right;
    }

    .products-table td[data-label="Codigo"],
    .products-table td[data-label="Nome"] {
        white-space: normal;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .products-table td[data-label="Acoes"] {
        display: block !important;
        text-align: left;
        white-space: normal;
    }

    .products-table td[data-label="Acoes"]::before {
        display: block;
        max-width: none;
        margin-bottom: 8px;
    }

    .products-table .row-actions {
        grid-template-columns: repeat(2, minmax(96px, 1fr));
    }

    .products-table .row-actions .btn {
        min-width: 0;
    }

    .products-page {
        padding-bottom: 96px;
    }
}

@media (max-width: 920px) {
    .products-page .products-table-wrap {
        display: none !important;
    }

    .products-page .products-mobile-list {
        display: grid !important;
        gap: 12px;
    }

    .products-page .product-mobile-card {
        display: grid;
        gap: 12px;
        min-width: 0;
        padding: 14px;
        border: 1px solid rgba(77, 52, 33, 0.08);
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.72);
        box-shadow: 0 12px 24px rgba(80, 51, 28, 0.06);
    }

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

    .products-page .product-mobile-main strong,
    .products-page .product-mobile-main span {
        display: block;
        min-width: 0;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .products-page .product-mobile-main strong {
        color: var(--text);
        font-size: 0.98rem;
        line-height: 1.25;
    }

    .products-page .product-mobile-main span {
        color: var(--muted);
        font-size: 0.82rem;
        font-variant-numeric: tabular-nums;
    }

    .products-page .product-mobile-data {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin: 0;
    }

    .products-page .product-mobile-data div {
        min-width: 0;
        padding: 10px;
        border-radius: 12px;
        background: rgba(255, 244, 236, 0.72);
        border: 1px solid rgba(77, 52, 33, 0.06);
    }

    .products-page .product-mobile-data dt,
    .products-page .product-mobile-data dd {
        margin: 0;
        min-width: 0;
    }

    .products-page .product-mobile-data dt {
        margin-bottom: 3px;
        color: var(--text-soft);
        font-size: 0.68rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }

    .products-page .product-mobile-data dd {
        color: var(--text);
        font-size: 0.9rem;
        font-weight: 800;
        line-height: 1.2;
        white-space: nowrap;
    }

    .products-page .product-mobile-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .products-page .product-mobile-actions form,
    .products-page .product-mobile-actions .btn {
        width: 100%;
        min-width: 0;
    }

    .ai-widget {
        right: 12px;
        left: auto;
        bottom: calc(118px + env(safe-area-inset-bottom, 0px));
        display: grid;
    }

    .app-route-pos .ai-widget {
        display: grid !important;
        right: 12px !important;
        left: auto !important;
        bottom: 220px !important;
    }

    .app-route-products .ai-widget {
        bottom: calc(140px + env(safe-area-inset-bottom, 0px));
    }

    .ai-toggle {
        grid-template-columns: 38px minmax(0, 1fr);
        max-width: 154px;
        min-height: 52px;
        padding: 7px 10px 7px 7px;
    }

    .ai-avatar {
        width: 38px;
        height: 38px;
    }

    .ai-toggle-text strong {
        font-size: 0.84rem;
    }

    .ai-toggle-text small {
        font-size: 0.68rem;
    }
}
