:root {
    --app-bg: #071120;
    --app-bg-soft: #0c1728;
    --panel: #07101f;
    --panel-soft: #111c30;
    --panel-strong: #172945;
    --line: rgba(145, 163, 194, .2);
    --line-soft: rgba(145, 163, 194, .1);
    --input: #0b1830;
    --text: #eef4ff;
    --text-strong: #ffffff;
    --muted: #98a7bd;
    --muted-strong: #cdd8e8;
    --brand: #416a9d;
    --brand-strong: #34a5ff;
    --button: #416a9d;
    --button-hover: #4c79b0;
    --danger: #ff5b66;
    --success: #17c979;
    --warning: #ffd24d;
    --shadow: rgba(0, 0, 0, .32);
    color-scheme: dark;
}

:root[data-theme="light"] {
    --app-bg: #f4f4f5;
    --app-bg-soft: #ffffff;
    --panel: #ffffff;
    --panel-soft: #eef1f6;
    --panel-strong: #e9eef6;
    --line: rgba(16, 24, 40, .13);
    --line-soft: rgba(16, 24, 40, .08);
    --input: #f1f4f9;
    --text: #101828;
    --text-strong: #071120;
    --muted: #7a7f8c;
    --muted-strong: #5f6470;
    --brand: #416a9d;
    --brand-strong: #0f8ee8;
    --button: #416a9d;
    --button-hover: #315b8c;
    --shadow: rgba(16, 24, 40, .12);
    color-scheme: light;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 50% 38%, rgba(67, 106, 157, .66) 0, rgba(41, 70, 113, .48) 18%, rgba(13, 28, 54, .96) 46%, #071120 78%),
        #071120;
    font: 16px/1.45 Arial, Helvetica, sans-serif;
    overflow: hidden;
}

:root[data-theme="light"] body {
    background:
        radial-gradient(circle at 50% 38%, rgba(65, 106, 157, .2) 0, rgba(235, 241, 249, .9) 34%, #f7f8fb 78%),
        #f7f8fb;
}

body.is-dashboard {
    overflow: auto;
    background: var(--app-bg);
}

.page {
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-shell {
    width: min(100%, 354px);
    display: grid;
    justify-items: center;
    gap: 26px;
}

.brand {
    display: grid;
    justify-items: center;
    gap: 6px;
    text-align: center;
}

.brand-logo {
    width: 72px;
    height: auto;
    max-height: 72px;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .34));
}

.login-shell > .brand .brand-logo { width: 92px; max-height: 92px; }
.user-modal .brand-logo { width: 82px; max-height: 82px; }

:root[data-theme="light"] .brand-logo {
    filter: invert(1) drop-shadow(0 2px 3px rgba(0, 0, 0, .12));
}

.brand-text {
    display: grid;
    line-height: 1;
}

.brand-text strong {
    color: rgba(255, 255, 255, .76);
    font-size: 16px;
    font-weight: 500;
}

.brand-text em {
    color: #fff;
    font-size: 16px;
    font-style: italic;
    font-weight: 800;
}

:root[data-theme="light"] .brand-text strong,
:root[data-theme="light"] .brand-text em {
    color: var(--text-strong);
}

.login-card {
    width: 100%;
    min-height: 413px;
    padding: 30px 32px 26px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(37, 63, 101, .62), rgba(14, 26, 50, .76));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 28px 80px var(--shadow);
}

:root[data-theme="light"] .login-card {
    background: rgba(255, 255, 255, .82);
}

.login-card h1 {
    margin: 0 0 26px;
    font-size: 21px;
    line-height: 1.15;
    font-weight: 800;
    text-align: center;
}

.field {
    display: grid;
    gap: 5px;
    margin-bottom: 23px;
}

label {
    color: var(--muted-strong);
    font-size: 15px;
    font-weight: 700;
}

input {
    width: 100%;
    height: 46px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 0 16px;
    color: var(--text-strong);
    background: var(--input);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    outline: 0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .24);
    transition: border-color .16s ease, box-shadow .16s ease;
}

input::placeholder { color: var(--muted); }
input:focus {
    border-color: rgba(91, 154, 219, .72);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .22), 0 0 0 4px rgba(33, 162, 255, .13);
}

.password-control { position: relative; }
.password-control input { padding-right: 48px; }

button,
.button-like {
    font: inherit;
}

.login-card > button,
.modal-actions button {
    width: 100%;
    height: 48px;
    margin: 3px 0 21px;
    border: 0;
    border-radius: 11px;
    color: #fff;
    background: var(--button);
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 9px 18px rgba(0, 0, 0, .22);
    transition: background .16s ease, transform .16s ease;
}

.login-card > button:hover,
.modal-actions button:hover {
    background: var(--button-hover);
    transform: translateY(-1px);
}

.toggle-password {
    position: absolute;
    right: 9px;
    bottom: 7px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    margin: 0;
    border: 0;
    border-radius: 8px;
    color: var(--muted);
    background: transparent;
    box-shadow: none;
    padding: 0;
    font-size: 0;
    cursor: pointer;
}

.toggle-password:hover {
    color: var(--text-strong);
    background: rgba(127, 139, 160, .12);
}

.toggle-password svg {
    width: 18px;
    height: 18px;
}

.actions {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.actions p { margin: 0; }

.alert {
    margin: -8px 0 16px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 128, 128, .28);
    border-radius: 8px;
    color: #ffd6d6;
    background: rgba(159, 36, 36, .22);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.alert.is-success {
    border-color: rgba(101, 255, 171, .24);
    color: #c9ffdf;
    background: rgba(18, 136, 58, .2);
}

a {
    color: var(--brand-strong);
    font-weight: 800;
    text-decoration: none;
}

a:hover { text-decoration: underline; }

.certificate {
    display: grid;
    grid-template-columns: 31px 1fr;
    align-items: center;
    gap: 12px;
    min-width: 191px;
    padding: 13px 22px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--text-strong);
    background: rgba(26, 39, 66, .62);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 18px 52px var(--shadow);
}

:root[data-theme="light"] .certificate { background: rgba(255, 255, 255, .8); }

.shield {
    width: 23px;
    height: 27px;
    display: grid;
    place-items: center;
}

.shield svg {
    width: 23px;
    height: 27px;
    display: block;
}

.certificate strong {
    display: block;
    font-size: 14px;
    line-height: 1.08;
}

.certificate span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.1;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: none;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 50% 36%, rgba(67, 106, 157, .62) 0, rgba(41, 70, 113, .4) 24%, rgba(7, 17, 32, .94) 68%),
        rgba(7, 17, 32, .88);
}

:root[data-theme="light"] .modal-backdrop {
    background: rgba(247, 248, 251, .9);
}

.modal-backdrop.is-open { display: grid; }

.user-modal {
    width: min(100%, 430px);
    display: grid;
    justify-items: center;
    gap: 20px;
}

.modal-card {
    width: 100%;
    padding: 26px 32px 24px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(37, 63, 101, .74), rgba(14, 26, 50, .86));
    box-shadow: 0 34px 90px var(--shadow);
}

:root[data-theme="light"] .modal-card { background: #fff; }

.modal-card h2 {
    margin: 0 0 20px;
    font-size: 23px;
    text-align: center;
}

.modal-card .field { margin-bottom: 14px; }
.modal-card input {
    height: 39px;
    border-radius: 9px;
}

.modal-actions {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.modal-actions button {
    margin: 0;
    height: 44px;
    border-radius: 10px;
}

.modal-actions .cancel-button {
    background: #2a303b;
    box-shadow: none;
}

:root[data-theme="light"] .modal-actions .cancel-button { background: #e5e7eb; color: #111827; }
.modal-actions .cancel-button:hover { background: #343b49; }
:root[data-theme="light"] .modal-actions .cancel-button:hover { background: #d4d8df; }

.dashboard {
    width: 100%;
    min-height: 100svh;
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    background: var(--app-bg);
    color: var(--text);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100svh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 12px;
    padding: 24px 16px 0;
    border-right: 1px solid var(--line);
    background: var(--app-bg-soft);
    overflow: hidden;
}

.sidebar > div:first-child {
    display: contents;
}

.side-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 0 0 6px;
}

.logo-sidebar {
    width: 206px;
    max-height: 48px;
    object-fit: contain;
    filter: none;
}

.logo-sidebar-light { display: none; }
:root[data-theme="light"] .logo-sidebar-dark { display: none; }
:root[data-theme="light"] .logo-sidebar-light { display: block; }

.side-nav {
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 2px 10px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, .34) transparent;
}

.side-nav::-webkit-scrollbar {
    width: 6px;
}

.side-nav::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(100, 116, 139, .34);
}

.side-nav::-webkit-scrollbar-track {
    background: transparent;
}

.menu-title {
    margin: 12px 10px 4px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.nav-button {
    width: 100%;
    min-height: 42px;
    display: grid;
    grid-template-columns: 20px 1fr 16px;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    color: var(--muted-strong);
    background: transparent;
    font-size: 15px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

a.nav-button:hover {
    text-decoration: none;
}

.nav-button svg {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    display: block;
}

.nav-button:hover,
.nav-button:focus-visible,
.nav-button.is-active,
.menu-group.is-open > .nav-button {
    color: var(--text-strong);
    background: var(--panel-soft);
    outline: 0;
    text-decoration: none;
    transform: translateY(-1px);
}

:root[data-theme="light"] .menu-group.is-open > .nav-button {
    color: #fff;
    background: var(--brand);
}

.nav-button .chev {
    justify-self: end;
    font-size: 20px;
    line-height: 1;
    color: currentColor;
    transition: transform .16s ease;
}

.menu-group.is-open .chev { transform: rotate(90deg); }

.submenu {
    display: none;
    position: relative;
    margin: 4px 0 8px 25px;
    padding-left: 16px;
    gap: 3px;
}

.menu-group.is-open .submenu { display: grid; }

.submenu::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--line);
}

.submenu::after {
    content: "";
    position: absolute;
    left: -1px;
    top: 6px;
    width: 3px;
    height: 20px;
    border-radius: 99px;
    background: var(--brand-strong);
}

.submenu button,
.submenu a {
    width: 100%;
    min-height: 31px;
    display: flex;
    align-items: center;
    border: 0;
    border-radius: 8px;
    padding: 0 10px;
    color: var(--muted);
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
    transition: background .16s ease, color .16s ease;
}

.submenu button:hover,
.submenu button:focus-visible,
.submenu button.is-active,
.submenu a:hover,
.submenu a:focus-visible,
.submenu a.is-active {
    color: var(--brand-strong);
    background: rgba(65, 106, 157, .45);
    outline: 0;
    text-decoration: none;
}

:root[data-theme="light"] .submenu button.is-active,
:root[data-theme="light"] .submenu a.is-active {
    color: #fff;
    background: #111827;
}

.sidebar-bottom {
    display: grid;
    align-self: end;
    gap: 0;
    margin: 8px -16px 0;
    background: var(--app-bg-soft);
}

.cert-mini {
    display: grid;
    grid-template-columns: 27px 1fr;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin: 0 16px 8px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--text-strong);
    background: rgba(255, 255, 255, .03);
}

:root[data-theme="light"] .cert-mini {
    background: #fff;
    box-shadow: 0 12px 34px rgba(16, 24, 40, .06);
}

.cert-mini .shield {
    width: 27px;
    height: 27px;
    border-radius: 7px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

:root[data-theme="light"] .cert-mini .shield {
    color: var(--text-strong);
    background: #edf0f5;
}

.cert-mini .shield svg {
    width: 15px;
    height: 18px;
}

.cert-mini .shield svg path {
    stroke: currentColor;
}

.cert-mini strong {
    display: block;
    font-size: 11px;
    line-height: 1.12;
}

.cert-mini span {
    color: var(--muted);
    font-size: 10px;
}

.user-strip {
    height: 48px;
    display: grid;
    grid-template-columns: 28px 1fr 24px;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-top: 1px solid var(--line);
    color: var(--text-strong);
}

.avatar {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #c58bff, #e0b184);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    object-fit: cover;
}

.user-strip strong {
    display: block;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-strip span {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.logout-icon {
    display: grid;
    place-items: center;
    color: var(--muted-strong);
}

.dash-main {
    min-width: 0;
    padding: 34px 32px 28px;
}

.dash-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 30px;
}

.dash-top h1 {
    margin: 0;
    color: var(--text-strong);
    font-size: 28px;
    line-height: 1.1;
}

.dash-top p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    width: min(360px, 32vw);
    height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--panel);
    color: var(--muted);
    font-size: 13px;
}

.icon-button {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--panel);
    color: var(--muted-strong);
    cursor: pointer;
    transition: background .16s ease, color .16s ease;
}

.icon-button:hover {
    color: var(--text-strong);
    background: var(--panel-soft);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card,
.chart-card,
.recent-card {
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .02);
}

:root[data-theme="light"] .stat-card,
:root[data-theme="light"] .chart-card,
:root[data-theme="light"] .recent-card {
    box-shadow: 0 12px 34px rgba(16, 24, 40, .05);
}

.stat-card {
    min-height: 126px;
    padding: 20px;
    position: relative;
}

.stat-card small {
    display: block;
    color: var(--muted-strong);
    font-size: 13px;
    margin-bottom: 24px;
}

.stat-card strong {
    display: block;
    color: var(--text-strong);
    font-size: 26px;
    line-height: 1;
}

.stat-card span {
    display: block;
    margin-top: 12px;
    color: var(--success);
    font-size: 12px;
    font-weight: 800;
}

.stat-card span.is-down { color: var(--danger); }

.stat-icon {
    position: absolute;
    top: 17px;
    right: 17px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--brand-strong);
    background: rgba(52, 165, 255, .18);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 20px;
    align-items: stretch;
}

.chart-card,
.recent-card {
    height: clamp(360px, calc(100svh - 300px), 560px);
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.chart-card,
.recent-card {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    margin-bottom: 0;
    padding: 0 20px;
    border-bottom: 1px solid var(--line-soft);
}

.card-head h2 {
    margin: 0;
    color: var(--text-strong);
    font-size: 17px;
}

.card-head a {
    color: var(--brand-strong);
    font-size: 13px;
}

.bars {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    align-items: end;
    gap: clamp(10px, 2vw, 24px);
    padding: 34px 20px 20px;
}

.bar-pair {
    height: 100%;
    display: flex;
    align-items: end;
    justify-content: center;
}

.bar {
    width: clamp(28px, 4.3vw, 56px);
    border-radius: 4px 4px 0 0;
    background: #31557f;
}

.bar.is-bright { background: #3190c9; }

.recent-list {
    display: grid;
    align-content: start;
    gap: 0;
    overflow: hidden;
}

.sale-row {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    padding: 0 20px;
    border-bottom: 1px solid var(--line-soft);
}

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

.sale-avatar {
    width: 29px;
    height: 29px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(52, 165, 255, .18);
    color: var(--brand-strong);
}

.sale-row strong {
    display: block;
    color: var(--text-strong);
    font-size: 13px;
}

.sale-row small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.sale-value {
    color: var(--text-strong);
    text-align: right;
    font-size: 12px;
    font-weight: 800;
}

.page-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 30px;
}

.page-top > div:first-child {
    flex: 0 0 auto;
    min-width: max-content;
}

.page-top h1 {
    margin: 0;
    color: var(--text-strong);
    font-size: 28px;
    line-height: 1.1;
    white-space: nowrap;
}

.page-top p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.list-actions,
.form-actions {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: 0;
    white-space: nowrap;
}

.search-input {
    width: clamp(280px, 30vw, 430px);
    height: 44px;
    display: grid;
    grid-template-columns: 20px 1fr;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    color: var(--muted);
    background: var(--panel);
}

.search-input svg {
    width: 18px;
    height: 18px;
}

.search-input input {
    height: auto;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--text-strong);
    font-size: 13px;
}

.receivable-top-actions .search-input {
    width: clamp(300px, 32vw, 470px);
}

.filter-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    place-items: center;
    padding: 22px;
    background: rgba(2, 8, 23, .66);
    backdrop-filter: blur(8px);
}

.filter-modal.is-open {
    display: grid;
}

.receivable-filters {
    width: min(720px, 100%);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 14px;
    padding: 22px;
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .32);
}

:root[data-theme="light"] .filter-modal {
    background: rgba(15, 23, 42, .34);
}

.filter-modal-head {
    grid-column: 1 / -1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 4px;
}

.filter-modal-head h2 {
    margin: 0;
    color: var(--text-strong);
    font-size: 22px;
}

.filter-modal-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.filter-modal-head button {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    color: var(--text-strong);
    background: var(--panel-soft);
    font-size: 25px;
    font-weight: 800;
    cursor: pointer;
}

.receivable-filters label {
    display: grid;
    gap: 7px;
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 900;
}

.receivable-filters input,
.receivable-filters select {
    width: 100%;
    height: 40px;
    min-width: 0;
    padding: 0 12px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    color: var(--text-strong);
    background: var(--input-bg);
    font-size: 13px;
    font-weight: 700;
}

.receivable-filter-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.receivable-filter-actions .primary-action,
.receivable-filter-actions .ghost-action {
    min-height: 40px;
    padding-inline: 16px;
}

.ghost-action,
.primary-action,
.cancel-action {
    flex: 0 0 auto;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 18px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    color: var(--text-strong);
    background: var(--panel);
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    box-shadow: none;
    white-space: nowrap;
}

.ghost-action svg {
    width: 18px;
    height: 18px;
}

.primary-action {
    min-width: 158px;
    border-color: var(--brand);
    color: #fff;
    background: var(--brand);
}

.primary-action:hover,
.cancel-action:hover,
.ghost-action:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.page-alert {
    position: fixed;
    top: 22px;
    right: 24px;
    z-index: 40;
    max-width: min(360px, calc(100vw - 32px));
    margin: 0;
    padding: 11px 14px;
    border: 1px solid rgba(255, 128, 128, .28);
    border-radius: 12px;
    color: #ffd6d6;
    background: rgba(159, 36, 36, .22);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .18);
    backdrop-filter: blur(12px);
    font-size: 13px;
    font-weight: 800;
    animation: toast-in .22s ease-out both;
}

.page-alert.is-hiding {
    opacity: 0;
    transform: translateX(calc(100% + 32px));
    transition: opacity .22s ease, transform .22s ease;
}

.page-alert.is-success {
    border-color: rgba(23, 201, 121, .24);
    color: var(--success);
    background: color-mix(in srgb, var(--panel) 88%, rgba(23, 201, 121, .25));
}

.lookup-status {
    display: none;
    position: fixed;
    top: 22px;
    right: 24px;
    z-index: 42;
    max-width: min(360px, calc(100vw - 32px));
    margin: 0;
    padding: 11px 14px;
    border: 1px solid rgba(65, 106, 157, .18);
    border-radius: 12px;
    color: var(--brand-strong);
    background: color-mix(in srgb, var(--panel) 88%, rgba(65, 106, 157, .28));
    box-shadow: 0 18px 48px rgba(0, 0, 0, .18);
    backdrop-filter: blur(12px);
    font-size: 13px;
    font-weight: 800;
    transform: translateX(calc(100% + 32px));
    opacity: 0;
    transition: opacity .22s ease, transform .22s ease;
}

.lookup-status.is-visible {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

.lookup-status.is-hiding {
    opacity: 0;
    transform: translateX(calc(100% + 32px));
}

.lookup-status.is-error {
    border-color: rgba(255, 91, 102, .26);
    color: var(--danger);
    background: color-mix(in srgb, var(--panel) 88%, rgba(255, 91, 102, .2));
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(calc(100% + 32px));
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.contacts-card,
.form-card {
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    background: var(--panel);
    overflow: visible;
}

:root[data-theme="light"] .contacts-card,
:root[data-theme="light"] .form-card {
    box-shadow: 0 12px 34px rgba(16, 24, 40, .05);
}

.contacts-card {
    height: min(calc(100svh - 170px), 638px);
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
}

.contacts-card > [data-bulk-payables-form] {
    display: none;
}

.payables-table {
    align-content: start;
}

.contacts-card:has(.payables-table) {
    height: min(calc(100svh - 170px), 638px);
    max-height: none;
}

.payables-table .contacts-scroll {
    max-height: calc(64px * 8);
}

.payables-table .contacts-head {
    min-height: 42px;
}

.finance-accounts-card {
    height: min(calc(100svh - 170px), 620px);
}

.contacts-table {
    min-width: 900px;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.contacts-scroll {
    min-height: 0;
    max-height: calc(64px * 8);
    overflow-y: auto;
    overflow-x: visible;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, .34) transparent;
}

.contacts-scroll::-webkit-scrollbar {
    width: 7px;
}

.contacts-scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(100, 116, 139, .34);
}

.contacts-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.contacts-head,
.contacts-row {
    display: grid;
    grid-template-columns: 2.1fr 1.4fr 1fr 1.1fr .55fr .45fr;
    align-items: center;
    gap: 16px;
    padding: 0 22px;
}

.users-table .contacts-head,
.users-table .contacts-row {
    grid-template-columns: 2fr 1.8fr .8fr 1fr .45fr;
}

.products-table .contacts-head,
.products-table .contacts-row {
    grid-template-columns: 2.1fr 1fr .9fr .55fr .9fr .75fr .45fr;
}

.sellers-table .contacts-head,
.sellers-table .contacts-row {
    grid-template-columns: 2fr 1.8fr .8fr 1.15fr .45fr;
}

.commissions-table .contacts-head,
.commissions-table .contacts-row {
    grid-template-columns: 2.1fr 1.25fr .8fr 1.25fr .9fr .8fr .45fr;
}

.receivables-table .contacts-head,
.receivables-table .contacts-row {
    grid-template-columns: 1.4fr 1.8fr .85fr .85fr .85fr .85fr .45fr;
}

.payables-table .contacts-head,
.payables-table .contacts-row {
    grid-template-columns: 34px 1.4fr 1.8fr .85fr .85fr .85fr .85fr .45fr;
}

.finance-accounts-table .contacts-head,
.finance-accounts-table .contacts-row {
    grid-template-columns: 1.8fr .85fr 1fr 1.15fr .9fr .45fr;
}

.stock-table .contacts-head,
.stock-table .contacts-row {
    grid-template-columns: minmax(210px, 2fr) minmax(108px, .85fr) 54px minmax(82px, .75fr) minmax(96px, .8fr) minmax(108px, .8fr);
    gap: 12px;
}

.stock-history-table .contacts-head,
.stock-history-table .contacts-row {
    grid-template-columns: minmax(118px, .9fr) minmax(210px, 1.8fr) minmax(86px, .75fr) minmax(80px, .75fr) minmax(128px, 1fr) minmax(96px, .8fr);
    gap: 12px;
}

.mp-finance-table .contacts-head,
.mp-finance-table .contacts-row {
    grid-template-columns: .9fr 1.35fr 1.3fr 1fr .75fr .8fr .45fr;
}

.cashflow-table .contacts-head,
.cashflow-table .contacts-row {
    grid-template-columns: .75fr 2.2fr .75fr .85fr 1.1fr .9fr .45fr;
}

.orders-table .contacts-head,
.orders-table .contacts-row {
    grid-template-columns: .85fr 1.7fr .85fr 1.25fr .9fr .45fr;
}

.order-receivable-indicator {
    display: block;
    margin-top: 4px;
    color: var(--success);
    font-size: 11px;
    font-weight: 800;
}

.receivable-totals {
    min-width: min(620px, 100%);
    display: grid;
    gap: 5px;
    color: var(--text-strong);
    font-size: 12px;
}

.receivable-total-head,
.receivable-total-values {
    display: grid;
    grid-template-columns: .7fr 1.15fr 1.15fr 1.15fr 1.15fr;
    align-items: center;
    gap: 14px;
    text-align: right;
}

.receivable-total-head {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.receivable-total-head span:first-child,
.receivable-total-values strong:first-child {
    text-align: left;
}

.receivable-totals span,
.receivable-totals strong {
    white-space: nowrap;
}

.receivable-totals .is-danger {
    color: var(--danger);
}

.cashflow-totals {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.cashflow-totals strong {
    margin-left: 6px;
    color: var(--text-strong);
}

.cash-in {
    color: var(--success);
}

.cash-out {
    color: var(--danger);
}

.stock-main {
    gap: 18px;
    overflow-x: hidden;
}

.stock-main .page-top {
    align-items: flex-start;
}

.stock-main .page-top > div:first-child {
    min-width: 0;
}

.stock-main .page-top p {
    white-space: normal;
}

.stock-main .list-actions {
    flex-wrap: wrap;
    min-width: min(100%, 600px);
}

.stock-main .search-input {
    flex: 1 1 280px;
    width: auto;
}

.filter-select {
    min-width: 160px;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    color: var(--text-strong);
    background: var(--surface);
    font-weight: 800;
}

.date-filter {
    min-width: 138px;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    color: var(--text-strong);
    background: var(--surface);
    font-weight: 800;
}

.mp-finance-actions {
    flex-wrap: wrap;
}

.mp-finance-actions .search-input {
    flex: 1 1 300px;
    width: auto;
}

.mp-finance-card {
    height: min(calc(100svh - 295px), 620px);
}

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

.stock-summary article {
    min-height: 86px;
    display: grid;
    align-content: center;
    gap: 8px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 16px 18px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.stock-summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.stock-summary strong {
    color: var(--text-strong);
    font-size: 24px;
    line-height: 1;
}

.stock-movement-card {
    height: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px 20px;
}

.stock-movement-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    min-width: 0;
}

.stock-movement-head p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.35;
    white-space: nowrap;
}

.stock-movement-card h2,
.section-inline-head h2 {
    margin: 0;
    color: var(--text-strong);
    font-size: 18px;
}

.stock-movement-fields {
    display: grid;
    grid-template-columns: minmax(240px, 1.7fr) minmax(130px, .65fr) minmax(150px, .7fr) minmax(200px, 1fr) auto;
    align-items: end;
    gap: 12px;
    min-width: 0;
}

.stock-movement-card label {
    display: grid;
    gap: 7px;
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 900;
}

.stock-movement-card input,
.stock-movement-card select,
.stock-movement-card textarea {
    width: 100%;
    min-height: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    color: var(--text-strong);
    background: var(--surface);
    font: inherit;
    font-weight: 700;
    resize: vertical;
}

.stock-movement-card .primary-action {
    min-height: 44px;
    align-self: end;
    white-space: nowrap;
}

.stock-card,
.stock-history-card {
    min-width: 0;
    overflow: hidden;
}

.stock-card {
    width: 100%;
    height: min(calc(100svh - 360px), 520px);
    min-height: 360px;
}

.stock-history-card {
    height: auto;
    min-height: 0;
}

.stock-history-card .contacts-table {
    grid-template-rows: auto auto;
}

.stock-history-card .contacts-scroll {
    max-height: 260px;
}

.stock-history-card .empty-row {
    min-height: 72px;
    display: flex;
    align-items: center;
}

.stock-main .contacts-table {
    width: 100%;
    min-width: 0;
}

.stock-main .contacts-scroll {
    overflow-x: auto;
    overflow-y: auto;
}

.stock-main .contacts-head,
.stock-main .contacts-row {
    min-width: 720px;
    padding-right: 18px;
    padding-left: 18px;
}

.stock-main .contacts-head > span,
.stock-main .contacts-row > span,
.stock-main .contacts-row > div,
.stock-main .contacts-row strong {
    min-width: 0;
}

.stock-main .contacts-row > span,
.stock-main .contacts-row small,
.stock-main .contacts-row strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stock-row {
    color: inherit;
    text-decoration: none;
}

.stock-row .is-positive {
    color: var(--success);
}

.stock-row .is-zero {
    color: var(--muted);
}

.stock-row .is-negative {
    color: var(--danger);
}

.section-inline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 22px 0;
}

.section-inline-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

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

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

    .stock-movement-card .primary-action {
        grid-column: 1 / -1;
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 860px) {
    .stock-movement-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .stock-movement-head p {
        white-space: normal;
    }

    .stock-movement-fields {
        grid-template-columns: 1fr;
    }

    .stock-movement-card .primary-action {
        grid-column: auto;
        justify-content: center;
        width: 100%;
    }
}

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

    .section-inline-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .stock-card {
        height: 440px;
    }
}

.user-list-name {
    min-width: 0;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.user-list-name .avatar {
    width: 34px;
    height: 34px;
}

.contacts-head {
    min-height: 52px;
    border-bottom: 1px solid var(--line-soft);
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.contacts-row {
    min-height: 64px;
    border-bottom: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
}

.contacts-row:hover {
    background: rgba(65, 106, 157, .08);
}

.contacts-row strong {
    display: block;
    color: var(--text-strong);
    font-size: 15px;
    line-height: 1.18;
}

.contacts-row small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.type-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 11px;
    border: 1px solid #5a96ff;
    border-radius: 999px;
    color: #5a96ff;
    background: rgba(90, 150, 255, .1);
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
}

.type-pill.is-supplier {
    border-color: #b66cff;
    color: #b66cff;
    background: rgba(182, 108, 255, .12);
}

.type-pill.is-admin {
    border-color: #17c979;
    color: #17c979;
    background: rgba(23, 201, 121, .12);
}

.type-pill.is-service {
    border-color: #f0b84f;
    color: #f0b84f;
    background: rgba(240, 184, 79, .12);
}

.type-pill[class*="is-status-"] {
    min-width: 78px;
    justify-content: center;
}

.type-pill.is-status-faturado {
    border-color: #17c979;
    color: #17c979;
    background: rgba(23, 201, 121, .12);
}

.type-pill.is-status-cancelado {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(255, 91, 102, .12);
}

.type-pill.is-status-estornado {
    border-color: #f0b84f;
    color: #b7791f;
    background: rgba(240, 184, 79, .14);
}

.type-pill.is-stock-entrada {
    border-color: #17c979;
    color: #17c979;
    background: rgba(23, 201, 121, .12);
}

.type-pill.is-stock-saida {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(255, 91, 102, .12);
}

.type-pill.is-stock-ajuste {
    border-color: #5a96ff;
    color: #5a96ff;
    background: rgba(90, 150, 255, .1);
}

.dots-button {
    width: auto;
    height: auto;
    margin: 0;
    border: 0;
    color: var(--muted);
    background: transparent;
    box-shadow: none;
    font-size: 18px;
    letter-spacing: .08em;
}

.action-cell {
    position: relative;
    justify-self: end;
    z-index: 4;
}

.row-actions-menu {
    position: fixed;
    top: var(--row-menu-top, 0);
    left: var(--row-menu-left, 0);
    right: auto;
    z-index: 80;
    min-width: 132px;
    display: none;
    padding: 6px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--panel);
    box-shadow: 0 16px 38px var(--shadow);
}

.action-cell.is-open .row-actions-menu {
    display: grid;
}

.action-cell.is-open {
    z-index: 90;
}

.row-actions-menu a,
.row-actions-menu button {
    width: 100%;
    min-height: 34px;
    display: flex;
    align-items: center;
    margin: 0;
    border: 0;
    border-radius: 8px;
    padding: 0 10px;
    color: var(--text-strong);
    background: transparent;
    box-shadow: none;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    text-align: left;
    text-decoration: none;
}

.row-actions-menu button {
    color: var(--danger);
    cursor: pointer;
}

.row-actions-menu button[data-open-payable-settle],
.row-actions-menu button[data-open-receivable-settle],
.row-actions-menu button[data-open-receivable-payments],
.row-actions-menu button[data-open-payable-payments] {
    color: var(--brand);
}

.row-actions-menu a:hover,
.row-actions-menu button:hover {
    background: var(--panel-soft);
    text-decoration: none;
}

.list-actions .ghost-action.is-danger {
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 42%, var(--line-soft));
}

.list-actions .ghost-action:disabled {
    opacity: .48;
    cursor: not-allowed;
}

.contacts-head input[type="checkbox"],
.contacts-row input[type="checkbox"] {
    appearance: none;
    width: 17px;
    height: 17px;
    min-height: 17px;
    display: grid;
    place-content: center;
    margin: 0;
    border: 1.5px solid color-mix(in srgb, var(--muted) 48%, transparent);
    border-radius: 4px;
    background: var(--panel);
    accent-color: var(--brand);
    cursor: pointer;
}

.contacts-head input[type="checkbox"]::before,
.contacts-row input[type="checkbox"]::before {
    content: "";
    width: 8px;
    height: 8px;
    transform: scale(0);
    border-radius: 2px;
    background: var(--brand);
    transition: transform .12s ease;
}

.contacts-head input[type="checkbox"]:checked,
.contacts-row input[type="checkbox"]:checked {
    border-color: var(--brand);
    background: color-mix(in srgb, var(--brand) 12%, var(--panel));
}

.contacts-head input[type="checkbox"]:checked::before,
.contacts-row input[type="checkbox"]:checked::before {
    transform: scale(1);
}

.settle-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, .58);
}

.settle-modal.is-open {
    display: flex;
}

.settle-modal-card {
    width: min(680px, 96vw);
    display: grid;
    gap: 22px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 20px;
    background: var(--panel);
    box-shadow: 0 26px 80px rgba(0, 0, 0, .28);
}

.settle-modal-card h2 {
    margin: 0;
    color: var(--text-strong);
    font-size: 24px;
    font-weight: 950;
}

.payments-modal-card {
    width: min(860px, 96vw);
}

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

.payments-modal-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.payments-modal-head button {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    color: var(--text-strong);
    background: var(--panel-soft);
    cursor: pointer;
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
}

.payments-list {
    overflow: hidden;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
}

.payments-list-head,
.payments-list-row {
    display: grid;
    grid-template-columns: 90px 130px 150px minmax(180px, 1fr) 110px;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
}

.payments-list-head {
    color: var(--text-strong);
    background: var(--panel-soft);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

.payments-list-row {
    min-height: 54px;
    border-top: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.payments-list-row strong {
    color: var(--text-strong);
    text-align: right;
}

.payments-empty {
    padding: 18px 14px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.payments-actions {
    grid-template-columns: minmax(180px, 260px);
    justify-content: end;
}

.pdv-page {
    gap: 18px;
}

.pdv-top {
    align-items: center;
}

.pdv-clock {
    display: grid;
    gap: 3px;
    min-width: 150px;
    padding: 12px 16px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--panel);
    text-align: right;
}

.pdv-clock strong {
    color: var(--text-strong);
    font-size: 15px;
    font-weight: 950;
}

.pdv-clock span {
    color: var(--success);
    font-size: 12px;
    font-weight: 900;
}

.pdv-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
    gap: 18px;
    min-height: calc(100vh - 150px);
}

.pdv-sale,
.pdv-summary {
    min-width: 0;
}

.pdv-sale {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
}

.pdv-product-entry,
.pdv-panel,
.pdv-totals,
.pdv-cart {
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--panel);
    box-shadow: 0 18px 44px rgba(15, 23, 42, .06);
}

.pdv-product-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px 150px;
    gap: 12px;
    align-items: end;
    padding: 16px;
}

.pdv-product-entry label,
.pdv-panel label,
.pdv-totals label {
    display: grid;
    gap: 7px;
    color: var(--text-strong);
    font-size: 13px;
    font-weight: 900;
}

.pdv-product-entry input,
.pdv-panel input,
.pdv-panel select,
.pdv-totals input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    padding: 0 12px;
    color: var(--text-strong);
    background: var(--input);
    font: inherit;
    font-weight: 850;
    outline: 0;
}

.pdv-cart {
    overflow: hidden;
}

.pdv-cart-head,
.pdv-cart-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 100px 120px 120px 42px;
    gap: 12px;
    align-items: center;
}

.pdv-cart-head {
    padding: 13px 16px;
    color: var(--text-strong);
    background: var(--panel-soft);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

.pdv-cart-body {
    max-height: calc(100vh - 285px);
    overflow-y: auto;
}

.pdv-cart-row {
    min-height: 68px;
    padding: 12px 16px;
    border-top: 1px solid var(--line-soft);
}

.pdv-cart-row strong {
    color: var(--text-strong);
    font-size: 14px;
    font-weight: 950;
}

.pdv-cart-row span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.pdv-cart-row input {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 0 10px;
    color: var(--text-strong);
    background: var(--input);
    font-weight: 900;
    text-align: center;
}

.pdv-cart-row button {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 9%, var(--panel-soft));
    cursor: pointer;
    font-size: 20px;
    font-weight: 950;
}

.pdv-empty {
    padding: 26px 16px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 850;
    text-align: center;
}

.pdv-summary {
    display: grid;
    align-content: start;
    gap: 14px;
}

.pdv-panel,
.pdv-totals {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.pdv-panel h2 {
    margin: 0 0 2px;
    color: var(--text-strong);
    font-size: 17px;
    font-weight: 950;
}

.pdv-totals > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 850;
}

.pdv-totals strong {
    color: var(--text-strong);
    font-size: 18px;
    font-weight: 950;
}

.pdv-grand-total {
    margin-top: 4px;
    padding-top: 13px;
    border-top: 1px solid var(--line-soft);
}

.pdv-grand-total strong {
    color: var(--brand);
    font-size: 30px;
}

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

.pdv-actions .primary-action,
.pdv-actions .cancel-action {
    min-height: 50px;
}

.pdv-receipt-card {
    width: min(440px, 96vw);
}

.pdv-receipt {
    display: grid;
    gap: 8px;
    color: #111827;
    background: #fff;
    padding: 18px;
    border-radius: 8px;
    font-family: "Courier New", monospace;
    font-size: 12px;
}

.receipt-center {
    display: grid;
    gap: 3px;
    text-align: center;
}

.pdv-receipt hr {
    width: 100%;
    border: 0;
    border-top: 1px dashed #9ca3af;
}

.receipt-line {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.receipt-line strong {
    text-align: right;
}

.receipt-items {
    display: grid;
    gap: 9px;
}

.receipt-items div {
    display: grid;
    gap: 3px;
}

.receipt-items span {
    text-align: right;
}

.receipt-total {
    font-size: 15px;
    font-weight: 950;
}

.receipt-thanks {
    margin-top: 6px;
    font-weight: 950;
}

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

    .pdv-product-entry {
        grid-template-columns: 1fr;
    }

    .pdv-cart-head,
    .pdv-cart-row {
        grid-template-columns: minmax(160px, 1fr) 80px 96px 96px 36px;
    }
}

@media print {
    body * {
        visibility: hidden !important;
    }

    [data-pdv-receipt-print-area],
    [data-pdv-receipt-print-area] * {
        visibility: visible !important;
    }

    [data-pdv-receipt-print-area] {
        position: fixed;
        inset: 0 auto auto 0;
        width: 80mm;
        min-height: auto;
        padding: 0;
        box-shadow: none;
        border-radius: 0;
    }

    .no-print {
        display: none !important;
    }
}

/* PDV full-screen counter */
.pdv-screen {
    min-height: 100vh;
    overflow: hidden;
    background: #f7f7f8;
    color: #001747;
}

.pdv-header {
    height: 76px;
    display: grid;
    grid-template-columns: 48px 120px minmax(180px, 1fr) auto auto minmax(220px, auto);
    align-items: center;
    gap: 22px;
    padding: 0 22px;
    color: #fff;
    background: #223b5a;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .32);
}

.pdv-menu-button {
    width: 32px;
    display: grid;
    gap: 5px;
    color: #fff;
    text-decoration: none;
}

.pdv-menu-button span {
    display: block;
    height: 4px;
    border-radius: 999px;
    background: currentColor;
}

.pdv-brand {
    display: grid;
    line-height: .92;
}

.pdv-brand span {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: .02em;
}

.pdv-brand strong {
    font-size: 24px;
    font-weight: 950;
}

.pdv-mode {
    font-size: 25px;
    font-weight: 950;
    letter-spacing: .02em;
}

.pdv-date,
.pdv-time {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 25px;
    font-weight: 950;
    white-space: nowrap;
}

.pdv-date span,
.pdv-time span {
    font-size: 22px;
}

.pdv-sale-number {
    display: grid;
    justify-items: center;
    line-height: 1.15;
}

.pdv-sale-number span {
    font-size: 18px;
    font-weight: 950;
}

.pdv-sale-number strong {
    font-size: 17px;
    font-weight: 950;
}

.pdv-alert {
    position: fixed;
    z-index: 30;
    right: 18px;
    top: 88px;
    width: min(420px, calc(100vw - 36px));
}

.pdv-counter {
    height: calc(100vh - 76px);
    display: grid;
    grid-template-columns: minmax(420px, 43%) minmax(520px, 1fr);
    grid-template-rows: minmax(0, 1fr) 166px;
    grid-template-areas:
        "entry items"
        "entry close";
    gap: 12px 26px;
    padding: 14px 34px 18px;
}

.pdv-entry-card {
    grid-area: entry;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 32px;
    padding: 20px 22px 46px;
    border-radius: 18px;
    color: #fff;
    background: #223b5a;
    box-shadow: 0 0 5px rgba(0, 0, 0, .78);
}

.pdv-field {
    display: grid;
    gap: 8px;
    color: #fff;
    font-size: 18px;
    font-weight: 950;
}

.pdv-field input,
.pdv-field select {
    width: 100%;
    min-height: 57px;
    border: 0;
    border-radius: 6px;
    padding: 0 12px;
    color: #001747;
    background: #fff;
    font-size: 24px;
    font-weight: 500;
    outline: 0;
}

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

.pdv-product-field input {
    padding-right: 58px;
}

.pdv-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    width: 38px;
    height: 38px;
    transform: translateY(-50%);
    border: 0;
    color: #416a9d;
    background: transparent;
    cursor: pointer;
    font-size: 40px;
    font-weight: 950;
    line-height: 1;
}

.pdv-entry-grid {
    display: grid;
    grid-template-columns: minmax(130px, 150px) minmax(160px, 180px);
    justify-content: space-between;
    gap: 28px;
}

.pdv-entry-grid input {
    text-align: center;
    font-size: 18px;
    font-weight: 950;
}

.pdv-line-total {
    display: grid;
    grid-template-columns: auto 64px minmax(190px, 238px);
    align-items: center;
    align-self: center;
    gap: 26px;
}

.pdv-line-total strong,
.pdv-line-total span {
    color: #fff;
    font-size: 25px;
    font-weight: 950;
}

.pdv-line-total input {
    min-height: 57px;
    border: 0;
    border-radius: 6px;
    padding: 0 12px;
    color: #001747;
    background: #fff;
    font-size: 22px;
    font-weight: 950;
}

.pdv-add-button,
.pdv-cancel-button,
.pdv-finish-button {
    border: 0;
    border-radius: 6px;
    color: #fff;
    background: #416a9d;
    cursor: pointer;
    font-size: 18px;
    font-weight: 950;
}

.pdv-add-button {
    min-height: 65px;
    margin-top: auto;
    font-size: 25px;
}

.pdv-items-card {
    grid-area: items;
    min-width: 0;
    padding: 16px 22px 36px;
    border: 1px solid rgba(0, 23, 71, .4);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 0 6px rgba(0, 0, 0, .45);
}

.pdv-items-table {
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid #416a9d;
    border-radius: 5px;
}

.pdv-items-head,
.pdv-cart-row {
    display: grid;
    grid-template-columns: 76px minmax(210px, 1fr) 82px 112px 112px 116px;
    align-items: center;
    gap: 8px;
}

.pdv-items-head {
    min-height: 56px;
    padding: 0 16px;
    border-bottom: 1px solid #416a9d;
    color: #001747;
    font-size: 24px;
    font-weight: 950;
}

.pdv-items-body {
    min-height: 0;
    overflow-y: auto;
}

.pdv-cart-row {
    min-height: 54px;
    padding: 9px 16px;
    border-bottom: 1px solid rgba(65, 106, 157, .25);
    color: #001747;
    font-size: 14px;
    font-weight: 950;
}

.pdv-cart-row > strong:first-child,
.pdv-cart-row input {
    text-align: center;
}

.pdv-cart-row div strong {
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: #001747;
    text-overflow: ellipsis;
}

.pdv-cart-row div span {
    display: block;
    margin-top: 3px;
    color: #334c76;
    font-size: 12px;
}

.pdv-cart-row input {
    width: 72px;
    min-height: 34px;
    border: 1px solid #416a9d;
    border-radius: 5px;
    color: #001747;
    font-weight: 950;
}

.pdv-row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.pdv-row-actions button {
    width: 46px;
    height: 30px;
    border: 0;
    border-radius: 5px;
    cursor: pointer;
    color: #fff;
    background: #416a9d;
    font-size: 10px;
    font-weight: 950;
}

.pdv-row-actions button:last-child {
    background: #ef4444;
}

.pdv-empty {
    padding: 26px 16px;
    color: #64748b;
    font-size: 15px;
    font-weight: 850;
    text-align: center;
}

.pdv-close-card {
    grid-area: close;
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 28px;
    padding: 14px 18px 20px;
    border-radius: 18px;
    color: #fff;
    background: #223b5a;
    box-shadow: 0 0 6px rgba(0, 0, 0, .55);
}

.pdv-close-total {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 32px;
    padding-right: 18px;
}

.pdv-close-total span {
    font-size: 25px;
    font-weight: 950;
}

.pdv-close-total strong {
    min-width: 150px;
    min-height: 56px;
    display: grid;
    place-items: center;
    border-radius: 5px;
    color: #001747;
    background: #fff;
    font-size: 24px;
    font-weight: 950;
}

.pdv-close-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 0 22px;
}

.pdv-cancel-button,
.pdv-finish-button {
    min-height: 44px;
}

.pdv-finish-button:disabled {
    opacity: .58;
    cursor: not-allowed;
}

.pdv-payment-card {
    width: min(1180px, 96vw);
}

.pdv-payment-closeout {
    gap: 22px;
    padding: 20px 20px 22px;
    background: #fff;
    max-height: calc(100svh - 24px);
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
}

.pdv-payment-closeout .payments-modal-head {
    align-items: center;
    display: grid;
    grid-template-columns: 44px 1fr 44px;
}

.pdv-payment-closeout .payments-modal-head h2 {
    text-align: center;
    color: #07184a;
    font-size: 31px;
}

.pdv-back-button {
    width: 44px;
    min-height: 44px;
    border: 0;
    color: #41699b;
    background: transparent;
    font-size: 34px;
    font-weight: 950;
    cursor: pointer;
}

.pdv-closeout-box {
    display: grid;
    grid-template-columns: minmax(360px, .92fr) minmax(420px, 1.08fr);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 22px;
    border: 1.5px solid #41699b;
    border-radius: 8px;
    padding: 20px;
    min-height: 0;
    max-height: calc(100svh - 108px);
    overflow-y: auto;
}

.pdv-paid-panel {
    display: grid;
    grid-template-rows: auto minmax(132px, 1fr) auto;
    gap: 0;
    min-height: 0;
}

.pdv-paid-head,
.pdv-paid-row {
    display: grid;
    grid-template-columns: 1fr 1fr .8fr;
    align-items: center;
    text-align: center;
}

.pdv-paid-head {
    min-height: 42px;
    border-radius: 6px 6px 0 0;
    color: #fff;
    background: #243b59;
    font-size: 14px;
    font-weight: 950;
}

.pdv-paid-list {
    min-height: 132px;
    max-height: 238px;
    overflow: auto;
    border: 1px solid #d1d5db;
    border-top: 0;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .14);
}

.pdv-paid-row {
    min-height: 36px;
    border-bottom: 1px solid #d1d5db;
    color: #050f35;
    font-size: 14px;
    font-weight: 900;
}

.pdv-paid-empty {
    padding: 36px 18px;
    color: #6b7280;
    text-align: center;
    font-weight: 850;
}

.pdv-closeout-totals {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 32px;
    align-items: end;
    margin-top: 24px;
}

.pdv-closeout-totals label {
    display: grid;
    gap: 4px;
    color: #07184a;
    font-size: 18px;
    font-weight: 950;
}

.pdv-closeout-totals input,
.pdv-closeout-totals strong {
    min-height: 52px;
    display: grid;
    place-items: center;
    border: 1px solid #dbe2ef;
    border-radius: 6px;
    padding: 0 14px;
    color: #07184a;
    background: #fff;
    font-size: 25px;
    font-weight: 950;
}

.pdv-pay-panel {
    display: grid;
    gap: 20px;
    align-content: start;
    min-height: 286px;
    border-radius: 6px;
    padding: 24px 32px 30px;
    color: #fff;
    background: #243b59;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .3);
}

.pdv-pay-panel h3 {
    margin: 0;
    text-align: center;
    font-size: 25px;
    font-weight: 950;
}

.pdv-pay-grid {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) 90px minmax(150px, 1fr);
    gap: 14px;
    align-items: end;
}

.pdv-pay-grid label {
    display: grid;
    gap: 8px;
    color: #fff;
    font-size: 17px;
    font-weight: 950;
}

.pdv-pay-grid input,
.pdv-pay-grid select {
    width: 100%;
    min-height: 52px;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 0 14px;
    color: #07184a;
    background: #fff;
    font-size: 18px;
    font-weight: 950;
}

.pdv-pay-grid button {
    grid-column: 1 / -1;
    min-height: 64px;
    margin: 18px auto 0;
    width: min(405px, 100%);
    border: 0;
    border-radius: 6px;
    color: #fff;
    background: #41699b;
    font-size: 25px;
    font-weight: 950;
    cursor: pointer;
}

.pdv-pay-grid button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.pdv-final-actions {
    grid-column: 2;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-height: 760px) {
    .settle-modal:has(.pdv-payment-closeout) {
        padding: 8px;
    }

    .pdv-payment-closeout {
        gap: 10px;
        max-height: calc(100svh - 16px);
        padding: 12px;
    }

    .pdv-payment-closeout .payments-modal-head h2 {
        font-size: 25px;
    }

    .pdv-closeout-box {
        max-height: calc(100svh - 78px);
        gap: 14px 18px;
        padding: 14px;
    }

    .pdv-paid-panel {
        grid-template-rows: auto minmax(105px, 1fr) auto;
    }

    .pdv-paid-list {
        min-height: 105px;
        max-height: 170px;
    }

    .pdv-closeout-totals {
        gap: 16px;
        margin-top: 14px;
    }

    .pdv-closeout-totals label {
        font-size: 15px;
    }

    .pdv-closeout-totals input,
    .pdv-closeout-totals strong {
        min-height: 46px;
        font-size: 20px;
    }

    .pdv-pay-panel {
        min-height: 245px;
        gap: 14px;
        padding: 20px 28px 24px;
    }

    .pdv-pay-grid input,
    .pdv-pay-grid select {
        min-height: 46px;
    }

    .pdv-pay-grid button {
        min-height: 52px;
        margin-top: 10px;
        font-size: 21px;
    }

    .pdv-payment-closeout .pdv-final-actions button {
        min-height: 64px;
        font-size: 19px;
    }
}

.pdv-final-actions button {
    min-height: 88px;
    border: 0;
    border-radius: 14px;
    color: #fff;
    background: #41699b;
    font-size: 24px;
    font-weight: 950;
    cursor: pointer;
}

.pdv-final-actions span {
    display: inline-block;
    margin-right: 8px;
}

.pdv-sale-type-card {
    width: min(764px, 94vw);
    padding: 20px;
    background: #fff;
}

.pdv-sale-type-box {
    display: grid;
    gap: 28px;
    justify-items: center;
    border: 2px solid #41699b;
    border-radius: 8px;
    padding: 26px 38px 12px;
}

.pdv-sale-type-box h2 {
    margin: 0;
    color: #07184a;
    font-size: clamp(48px, 7vw, 92px);
    line-height: .95;
    font-weight: 950;
}

.pdv-sale-type-logo {
    width: 150px;
    height: 150px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: #071322;
    box-shadow: 0 6px 14px rgba(15, 23, 42, .3);
}

.pdv-sale-type-logo img {
    width: 118px;
    max-height: 118px;
    object-fit: contain;
}

.pdv-sale-type-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.pdv-sale-type-actions button {
    min-height: 150px;
    border: 0;
    border-radius: 16px;
    color: #fff;
    background: #41699b;
    font-size: 27px;
    font-weight: 950;
    cursor: pointer;
}

.pdv-payment-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 8px;
    color: #fff;
    background: #223b5a;
}

.pdv-payment-total span,
.pdv-payment-total strong {
    font-size: 22px;
    font-weight: 950;
}

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

.pdv-payment-methods-head,
.pdv-payment-balance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pdv-payment-methods-head strong,
.pdv-payment-balance strong {
    color: var(--text-strong);
    font-weight: 950;
}

.pdv-payment-methods-head button {
    min-height: 34px;
    border: 0;
    border-radius: 8px;
    padding: 0 14px;
    color: #fff;
    background: var(--brand);
    font-weight: 900;
    cursor: pointer;
}

.pdv-payment-rows {
    display: grid;
    gap: 8px;
    max-height: min(28vh, 250px);
    overflow: auto;
    padding-right: 2px;
}

.pdv-payment-row {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(130px, 1fr) 118px 92px 34px;
    align-items: end;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: color-mix(in srgb, var(--input) 72%, transparent);
}

.pdv-payment-row label {
    gap: 5px;
    font-size: 12px;
}

.pdv-payment-row input,
.pdv-payment-row select {
    min-height: 40px;
}

.pdv-payment-row > button {
    width: 34px;
    min-height: 40px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: #4b5563;
    font-size: 20px;
    font-weight: 950;
    cursor: pointer;
}

.pdv-payment-row > button:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.pdv-card-installments {
    opacity: .42;
}

.pdv-card-installments.is-visible {
    opacity: 1;
}

.pdv-payment-balance {
    padding-top: 2px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}

.pdv-payment-balance .is-balanced,
.pdv-payment-balance strong.is-balanced {
    color: #16a34a;
}

.pdv-mercado-pago-card {
    width: min(860px, 96vw);
    max-height: calc(100dvh - 24px);
    gap: clamp(10px, 1.6vh, 18px);
    padding: clamp(14px, 2vh, 20px);
    overflow: hidden;
}

.pdv-mp-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.pdv-mp-summary div {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--input);
}

.pdv-mp-summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.pdv-mp-summary strong {
    color: var(--text-strong);
    font-size: 20px;
    font-weight: 950;
}

.pdv-mp-note {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.45;
}

.pdv-mp-qrcode {
    display: grid;
    grid-template-columns: minmax(210px, 280px) minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: clamp(10px, 1.5vh, 16px);
    background: var(--panel-soft);
}

.pdv-mp-qrcode[hidden],
.pdv-mp-point[hidden] {
    display: none !important;
}

.pdv-mp-qr-render {
    width: min(280px, 34vh);
    min-width: 210px;
    min-height: 0;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border: 8px solid #fff;
    border-radius: 8px;
    background: #fff;
}

.pdv-mp-qr-render img,
.pdv-mp-qr-render canvas {
    width: 100% !important;
    max-width: 280px;
    height: auto !important;
}

.pdv-mp-qr-copy {
    min-width: 0;
    display: grid;
    gap: 9px;
}

.pdv-mp-qr-copy strong {
    color: var(--text-strong);
    font-size: 13px;
}

.pdv-mp-qr-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pdv-mp-qr-head span {
    border-radius: 999px;
    padding: 6px 10px;
    color: #9a6700;
    background: #fff4ce;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.pdv-mp-qr-head span.is-expiring {
    color: #b42318;
    background: #fff1f2;
}

.pdv-mp-qr-copy textarea {
    width: 100%;
    min-height: 92px;
    resize: none;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 10px;
    color: var(--muted-strong);
    background: var(--input);
    font: 11px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.pdv-mp-qr-copy button {
    min-height: 40px;
    border: 1px solid var(--brand);
    border-radius: 8px;
    color: var(--brand-strong);
    background: var(--panel);
    font-weight: 900;
    cursor: pointer;
}

.pdv-mp-point {
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 18px;
    background: var(--panel-soft);
}

.pdv-mp-point-icon {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: var(--brand);
    font-size: 27px;
}

.pdv-mp-point div { display: grid; gap: 4px; }
.pdv-mp-point strong { color: var(--text-strong); font-size: 15px; }
.pdv-mp-point p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; }

.pdv-mp-feedback {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 11px 13px;
    color: var(--muted-strong);
    background: var(--panel-soft);
}

.pdv-mp-feedback-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #d97706;
    font-size: 13px;
    font-weight: 950;
}

.pdv-mp-feedback > div { min-width: 0; display: grid; gap: 2px; }
.pdv-mp-feedback strong { color: var(--text-strong); font-size: 14px; font-weight: 950; }
.pdv-mp-feedback p { margin: 0; color: var(--muted-strong); font-size: 12px; font-weight: 750; line-height: 1.35; }

.pdv-mp-feedback.is-approved {
    border-color: #16a34a;
    background: #ecfdf3;
}

.pdv-mp-feedback.is-approved .pdv-mp-feedback-icon { background: #16a34a; }

.pdv-mp-feedback.is-error {
    border-color: #ef4444;
    background: #fff1f2;
}

.pdv-mp-feedback.is-error .pdv-mp-feedback-icon { background: #dc2626; }

@media (max-height: 720px) and (min-width: 621px) {
    .settle-modal:has(.pdv-mercado-pago-card) { padding: 8px; }
    .pdv-mercado-pago-card { max-height: calc(100dvh - 16px); gap: 8px; padding: 12px; }
    .pdv-mercado-pago-card .payments-modal-head h2 { font-size: 20px; }
    .pdv-mp-summary div { gap: 2px; padding: 8px 12px; }
    .pdv-mp-summary strong { font-size: 17px; }
    .pdv-mp-qr-render { width: min(230px, 31vh); min-width: 180px; }
    .pdv-mp-qr-copy textarea { min-height: 58px; }
    .pdv-mp-qrcode { grid-template-columns: minmax(180px, 230px) minmax(0, 1fr); }
    .pdv-mp-point { padding: 12px; }
}

@media (max-width: 620px) {
    .pdv-mp-qrcode {
        grid-template-columns: 1fr;
    }

    .pdv-mp-qr-render {
        width: min(190px, 28vh);
        min-width: 160px;
        justify-self: center;
    }

    .pdv-mp-qr-copy textarea { min-height: 48px; }
}

@media (max-width: 1060px) {
    .pdv-header {
        grid-template-columns: 38px 92px 1fr;
        height: auto;
        min-height: 76px;
        gap: 12px;
    }

    .pdv-date,
    .pdv-time,
    .pdv-sale-number {
        display: none;
    }

    .pdv-counter {
        height: auto;
        min-height: calc(100vh - 76px);
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        grid-template-areas:
            "entry"
            "items"
            "close";
        padding: 14px;
    }

    .pdv-close-card {
        grid-area: close;
    }
}

.pdv-screen .pdv-counter {
    height: calc(100vh - 76px);
    grid-template-columns: minmax(430px, 42%) minmax(560px, 1fr);
    grid-template-rows: minmax(0, 1fr) 166px;
    grid-template-areas:
        "entry items"
        "entry close";
    padding: 14px 34px 18px;
}

.pdv-screen .pdv-entry-card {
    grid-area: entry;
    min-height: 0;
    grid-template-rows: auto auto minmax(110px, 1fr) auto;
    gap: clamp(22px, 4.5vh, 54px);
}

.pdv-screen .pdv-items-card {
    grid-area: items;
    min-height: 0;
}

.pdv-screen .pdv-close-card {
    grid-area: close;
}

.pdv-screen .pdv-items-head,
.pdv-screen .pdv-cart-row {
    grid-template-columns: 70px minmax(180px, 1fr) 76px 100px 100px 100px;
    gap: 8px;
}

.pdv-screen .pdv-items-head {
    padding: 0 14px;
    font-size: 25px;
}

.pdv-screen .pdv-cart-row {
    min-height: 52px;
    padding: 8px 14px;
}

.pdv-screen .pdv-row-actions {
    min-width: 96px;
}

.pdv-screen .pdv-row-actions button {
    width: 44px;
}

.pdv-screen .pdv-add-button {
    width: 100%;
    align-self: end;
    min-height: 64px;
    margin-top: 0;
}

@media (max-width: 1060px) {
    .pdv-screen .pdv-counter {
        height: auto;
        min-height: calc(100vh - 76px);
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        grid-template-areas:
            "entry"
            "items"
            "close";
        padding: 14px;
    }
}

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

.settle-grid label {
    display: grid;
    gap: 7px;
    color: var(--text-strong);
    font-size: 13px;
    font-weight: 900;
}

.settle-grid input,
.settle-grid select,
.settle-grid textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    padding: 0 12px;
    color: var(--text-strong);
    background: var(--input);
    font: inherit;
    font-weight: 800;
    outline: 0;
}

.settle-grid textarea {
    min-height: 98px;
    padding-block: 12px;
    resize: vertical;
}

.settle-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 34px;
}

.settle-actions .primary-action,
.settle-actions .cancel-action {
    min-height: 45px;
    justify-content: center;
}

.empty-row {
    padding: 36px 24px;
    color: var(--muted);
    font-weight: 800;
}

.contacts-footer {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 24px;
    border-top: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

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

.pager button {
    width: 34px;
    height: 34px;
    margin: 0;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    color: var(--muted-strong);
    background: var(--panel);
    box-shadow: none;
}

.pager button.is-active {
    color: #fff;
    background: var(--brand);
}

.customer-form {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.form-page-main {
    height: 100svh;
    overflow: hidden;
}

.customer-form .page-top {
    flex: 0 0 auto;
    margin-bottom: 18px;
}

.form-card {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 30px 28px 32px;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, .34) transparent;
}

.form-card::-webkit-scrollbar {
    width: 7px;
}

.form-card::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(100, 116, 139, .34);
}

.form-card::-webkit-scrollbar-track {
    background: transparent;
}

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

.form-grid label,
.form-grid .form-field {
    display: grid;
    gap: 9px;
    margin: 0;
    color: var(--text-strong);
    font-size: 14px;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 0 14px;
    color: var(--text-strong);
    background: var(--input);
    font: inherit;
    font-weight: 700;
    outline: 0;
}

.input-with-action {
    position: relative;
    display: block;
}

.input-with-action input {
    padding-right: 46px;
}

.lookup-button {
    position: absolute;
    right: 7px;
    top: 50%;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    margin: 0;
    border: 0;
    border-radius: 8px;
    color: var(--muted);
    background: transparent;
    box-shadow: none;
    cursor: pointer;
}

.lookup-button:hover {
    color: var(--text-strong);
    background: rgba(65, 106, 157, .12);
    transform: translateY(-50%);
}

.lookup-button {
    transform: translateY(-50%);
}

.lookup-button svg {
    width: 18px;
    height: 18px;
}

.logo-upload {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    min-height: 132px;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    padding: 14px;
    background: var(--input);
}

.logo-preview {
    width: 100px;
    height: 100px;
    display: grid;
    place-items: center;
    border: 1px dashed color-mix(in srgb, var(--muted) 46%, transparent);
    border-radius: 14px;
    color: var(--muted);
    background: color-mix(in srgb, var(--panel) 78%, transparent);
    overflow: hidden;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.profile-preview {
    border-radius: 50%;
}

.profile-preview img {
    object-fit: cover;
    padding: 0;
}

.logo-upload-copy {
    min-width: 0;
    display: grid;
    gap: 7px;
}

.logo-upload-copy strong,
.logo-upload-copy span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logo-upload-copy span {
    color: var(--muted);
    font-size: 12px;
}

.file-input {
    min-height: 42px !important;
    padding: 9px 12px !important;
    cursor: pointer;
}

.permissions-card {
    display: grid;
    gap: 10px;
    margin-top: 4px;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    padding: 16px;
    background: var(--input);
}

.permissions-card > strong {
    color: var(--text-strong);
    font-size: 14px;
}

.permissions-card > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

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

.seller-create-user-toggle {
    min-height: 42px;
    display: flex !important;
    align-items: center;
    gap: 9px !important;
    align-self: end;
    padding-bottom: 4px;
}

.seller-create-user-toggle input {
    width: 16px;
    min-height: 16px;
    accent-color: var(--brand);
}

.seller-user-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    padding: 14px;
    background: color-mix(in srgb, var(--input) 86%, var(--brand) 4%);
}

.permission-option {
    min-height: 42px;
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 10px !important;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 0 12px;
    background: var(--panel);
    cursor: pointer;
}

.permission-option input {
    width: 16px;
    min-height: 16px;
    accent-color: var(--brand);
}

.permission-option span {
    color: var(--text-strong);
    font-size: 13px;
    font-weight: 800;
}

.form-grid textarea {
    min-height: 94px;
    padding-top: 14px;
    resize: vertical;
}

.product-card {
    padding-top: 24px;
}

.order-card {
    padding-top: 24px;
}

.order-items {
    display: grid;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    background: var(--input);
    overflow: hidden;
}

.order-items-head,
.order-item-row {
    display: grid;
    grid-template-columns: 1.45fr 1.6fr .55fr .45fr .75fr .65fr .75fr;
    gap: 8px;
    align-items: center;
    padding: 9px 12px;
}

.sales-order-form .page-top {
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1100px;
    margin-inline: auto;
    margin-bottom: 36px;
}

.sales-order-form .page-top > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.sales-grid {
    gap: 16px 16px;
}

.sales-grid label {
    gap: 5px;
    font-size: 12px;
    font-weight: 950;
}

.sales-grid input,
.sales-grid select,
.sales-grid textarea {
    min-height: 40px;
    border-radius: 9px;
    font-size: 14px;
    text-align: left;
}

.sales-grid input[readonly] {
    color: var(--text-strong);
    background: color-mix(in srgb, var(--panel) 82%, var(--brand) 5%);
}

.sales-divider {
    height: 1px;
    border-top: 2px solid color-mix(in srgb, var(--brand) 62%, transparent);
}

.icon-only-action {
    min-width: 56px;
}

.sales-order-form .form-actions {
    flex: 0 0 auto;
    justify-content: flex-end;
}

.sales-order-form .order-card {
    max-width: 1100px;
    margin-inline: auto;
    padding: 26px 30px 34px;
}

.sales-order-form .ghost-action,
.sales-order-form .primary-action,
.sales-order-form .cancel-action {
    min-height: 34px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 950;
}

.sales-order-form .primary-action {
    min-width: 150px;
}

.sales-order-form .cancel-action {
    min-width: 150px;
    color: #fff;
    background: #3f4248;
}

.sales-order-form .icon-only-action {
    min-width: 56px;
    width: 56px;
    padding-inline: 0;
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}

.print-page {
    min-height: 100svh;
    padding: 28px;
    background: #eef2f7;
    color: #071a3b;
    font-family: Arial, Helvetica, sans-serif;
}

.print-actions {
    width: min(980px, 100%);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin: 0 auto 16px;
}

.print-sheet {
    width: min(980px, 100%);
    margin: 0 auto;
    padding: 34px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 22px 60px rgba(15, 23, 42, .14);
}

.print-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: start;
    padding-bottom: 20px;
    border-bottom: 2px solid #315f9d;
}

.print-brand {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.print-brand img {
    max-width: 110px;
    max-height: 64px;
    object-fit: contain;
}

.print-brand strong,
.print-title h1 {
    display: block;
    margin: 0 0 6px;
    color: #001845;
    font-size: 22px;
}

.print-brand span,
.print-title span,
.print-box span,
.print-footer span {
    display: block;
    color: #475569;
    font-size: 12px;
    line-height: 1.45;
}

.print-title {
    text-align: right;
}

.print-title strong {
    display: block;
    color: #315f9d;
    font-size: 26px;
}

.print-box-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 16px;
    margin-top: 18px;
}

.print-box {
    min-height: 112px;
    padding: 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

.print-box h2,
.print-section h2 {
    margin: 0 0 10px;
    color: #001845;
    font-size: 15px;
}

.print-box strong {
    display: block;
    margin-bottom: 6px;
    color: #001845;
    font-size: 14px;
}

.print-section {
    margin-top: 20px;
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #cbd5e1;
}

.print-table th,
.print-table td {
    padding: 8px 9px;
    border-bottom: 1px solid #dbe3ef;
    border-right: 1px solid #dbe3ef;
    color: #0f172a;
    font-size: 12px;
    text-align: left;
    vertical-align: top;
}

.print-table th {
    color: #001845;
    background: #eaf1fb;
    font-weight: 800;
}

.print-table th:nth-child(4),
.print-table th:nth-child(5),
.print-table th:nth-child(6),
.print-table th:nth-child(7),
.print-table td:nth-child(4),
.print-table td:nth-child(5),
.print-table td:nth-child(6),
.print-table td:nth-child(7) {
    text-align: right;
}

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

.print-totals div {
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    text-align: right;
}

.print-totals span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}

.print-totals strong {
    display: block;
    margin-top: 4px;
    color: #001845;
    font-size: 17px;
}

.print-notes {
    min-height: 70px;
    margin: 0;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #0f172a;
    font-size: 12px;
    line-height: 1.5;
}

.print-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
    padding-top: 12px;
    border-top: 1px solid #cbd5e1;
}

@media print {
    @page {
        size: A4;
        margin: 12mm;
    }

    body {
        background: #fff !important;
    }

    .print-page {
        min-height: auto;
        padding: 0;
        background: #fff;
    }

    .print-actions {
        display: none !important;
    }

    .print-sheet {
        width: 100%;
        margin: 0;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
    }
}

.sales-order-items .order-items-head,
.sales-order-items .order-item-row {
    grid-template-columns: 2.8fr .6fr .42fr .56fr .72fr .72fr 42px;
}

.sales-order-items .order-item-row {
    padding-inline: 0;
    border-bottom: 0;
}

.sales-order-items {
    border: 0;
    border-radius: 0;
    background: transparent;
}

.sales-order-items .order-items-head {
    border-bottom: 0;
    padding-inline: 0;
}

.sales-order-items .order-items-body {
    gap: 10px;
}

.sales-item-entry {
    display: grid;
    grid-template-columns: minmax(280px, 2.7fr) minmax(96px, .68fr) minmax(62px, .42fr) minmax(98px, .6fr) minmax(104px, .72fr) minmax(98px, .68fr) 58px;
    gap: 14px;
    align-items: end;
}

.product-search {
    position: relative;
}

.catalog-field-head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
    min-height: 18px;
    color: var(--text-strong);
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
}

.catalog-field-head .field-link-button {
    min-height: auto;
    border: 0;
    padding: 0;
    color: var(--link);
    background: transparent;
    font: inherit;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.catalog-field-head .field-link-button:hover,
.catalog-field-head .field-link-button:focus-visible {
    color: var(--brand);
    text-decoration: underline;
}

.product-suggestions {
    position: absolute;
    z-index: 50;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    display: none;
    max-height: 220px;
    overflow: auto;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--panel);
    box-shadow: 0 18px 42px color-mix(in srgb, #000 22%, transparent);
}

.product-suggestions.is-open {
    display: grid;
}

.product-suggestions button {
    display: grid;
    gap: 3px;
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--line-soft);
    color: var(--text-strong);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.product-suggestions button:hover,
.product-suggestions button:focus-visible,
.product-suggestions button.is-active {
    background: color-mix(in srgb, var(--brand) 14%, transparent);
}

.product-suggestions button:last-child {
    border-bottom: 0;
}

.product-suggestions strong {
    font-size: 12px;
    font-weight: 900;
}

.product-suggestions span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}

.order-lines-wrap {
    overflow-x: hidden;
    border: 1px solid color-mix(in srgb, var(--brand) 50%, var(--line-soft));
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel) 90%, var(--brand) 3%);
}

.order-lines-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    table-layout: fixed;
}

.order-lines-table th,
.order-lines-table td {
    padding: 8px 7px;
    border-bottom: 1px solid var(--line-soft);
    border-right: 1px solid color-mix(in srgb, var(--line-soft) 80%, transparent);
    color: var(--text-strong);
    font-size: 11px;
    font-weight: 850;
    vertical-align: middle;
}

.order-lines-table th {
    color: var(--text-strong);
    background: color-mix(in srgb, var(--panel) 82%, var(--brand) 8%);
    font-size: 10px;
    font-weight: 950;
    text-align: left;
}

.order-lines-table td:first-child,
.order-lines-table td:nth-child(4),
.order-lines-table td:nth-child(5),
.order-lines-table td:nth-child(6),
.order-lines-table td:nth-child(7),
.order-lines-table td:nth-child(8),
.order-lines-table th:first-child,
.order-lines-table th:nth-child(4),
.order-lines-table th:nth-child(5),
.order-lines-table th:nth-child(6),
.order-lines-table th:nth-child(7),
.order-lines-table th:nth-child(8) {
    text-align: center;
}

.order-lines-table td:nth-child(3) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-lines-table th:nth-child(1),
.order-lines-table td:nth-child(1) {
    width: 4.2%;
}

.order-lines-table th:nth-child(2),
.order-lines-table td:nth-child(2) {
    width: 12%;
}

.order-lines-table th:nth-child(3),
.order-lines-table td:nth-child(3) {
    width: 31%;
}

.order-lines-table th:nth-child(4),
.order-lines-table td:nth-child(4) {
    width: 6%;
}

.order-lines-table th:nth-child(5),
.order-lines-table td:nth-child(5) {
    width: 11%;
}

.order-lines-table th:nth-child(6),
.order-lines-table td:nth-child(6),
.order-lines-table th:nth-child(7),
.order-lines-table td:nth-child(7),
.order-lines-table th:nth-child(8),
.order-lines-table td:nth-child(8) {
    width: 11%;
}

.order-lines-table th:nth-child(9),
.order-lines-table td:nth-child(9) {
    width: 8.8%;
}

.order-lines-table tr:last-child td {
    border-bottom: 0;
}

.line-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.line-actions button {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    margin: 0;
    border: 0;
    border-radius: 7px;
    color: var(--brand);
    background: transparent;
    font-size: 16px;
    font-weight: 950;
    cursor: pointer;
}

.line-actions svg {
    width: 16px;
    height: 16px;
}

.line-actions button:hover,
.line-actions button:focus-visible {
    color: #fff;
    background: var(--brand);
}

.line-confirm {
    width: 58px;
    height: 40px;
    margin: 0;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: var(--brand);
    font-size: 22px;
    font-weight: 950;
}

.item-edit-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
    place-items: center;
    padding: 20px;
    background: rgba(5, 13, 28, .64);
    backdrop-filter: blur(8px);
}

.item-edit-modal.is-open {
    display: grid;
}

.item-edit-dialog {
    width: min(620px, 100%);
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .32);
    overflow: hidden;
}

.item-edit-dialog header,
.item-edit-dialog footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line-soft);
}

.item-edit-dialog footer {
    justify-content: flex-end;
    border-top: 1px solid var(--line-soft);
    border-bottom: 0;
}

.item-edit-dialog h2 {
    margin: 0;
    color: var(--text-strong);
    font-size: 22px;
}

.item-edit-dialog header button {
    width: 34px;
    height: 34px;
    margin: 0;
    border: 0;
    border-radius: 8px;
    color: var(--text-strong);
    background: color-mix(in srgb, var(--panel) 82%, var(--brand) 8%);
    font-size: 24px;
    cursor: pointer;
}

.item-edit-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
    padding: 22px;
}

.item-edit-grid label {
    display: grid;
    gap: 6px;
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 950;
}

.installments-table {
    display: grid;
    gap: 14px;
    margin-top: 4px;
}

.installments-head,
.installment-row {
    display: grid;
    grid-template-columns: .45fr 1.15fr 1.35fr 1.15fr 2.2fr;
    gap: 12px;
    align-items: center;
}

.installments-body {
    display: grid;
    gap: 10px;
}

.installments-head {
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 950;
}

.installment-row input,
.installment-row select {
    min-height: 38px;
}

.installment-auto-option {
    min-height: 40px;
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px !important;
    align-self: end;
    padding-bottom: 3px;
}

.installment-auto-option input {
    width: 16px;
    min-height: 16px;
    accent-color: var(--brand);
}

.installment-auto-option span {
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 850;
}

.generate-installments {
    min-height: 40px;
    align-self: end;
    margin: 0;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: var(--brand);
    font-weight: 900;
}

.sales-grid textarea {
    min-height: 100px;
}

.order-items-head {
    border-bottom: 1px solid var(--line-soft);
    color: var(--text-strong);
    font-size: 11px;
    font-weight: 950;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.order-items-body {
    display: grid;
    gap: 0;
}

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

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

.order-item-row input,
.order-item-row select {
    min-height: 38px;
    border-radius: 8px;
    font-size: 12px;
}

.order-item-row [readonly] {
    color: var(--text-strong);
    background: color-mix(in srgb, var(--panel) 80%, var(--brand) 5%);
}

.order-summary {
    display: flex;
    justify-content: flex-end;
    gap: 18px;
    border-top: 2px solid var(--brand);
    padding-top: 14px;
}

.order-summary span {
    min-width: 170px;
    display: grid;
    gap: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.order-summary strong {
    color: var(--text-strong);
    font-size: 22px;
}

.product-grid {
    gap: 16px 18px;
}

.product-grid label {
    display: grid;
    gap: 7px;
    align-content: start;
    font-size: 12px;
    font-weight: 920;
}

.product-grid input,
.product-grid select,
.product-grid textarea {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    color: var(--text-strong);
    background: var(--input);
    box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 5%, transparent);
    font-size: 13px;
    font-weight: 750;
    box-sizing: border-box;
}

.product-grid select {
    appearance: none;
    padding-right: 34px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 18px,
        calc(100% - 12px) 18px;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.product-grid input:focus,
.product-grid select:focus,
.product-grid textarea:focus {
    border-color: color-mix(in srgb, var(--brand) 72%, var(--line-soft));
    outline: 0;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent);
}

.product-grid textarea {
    min-height: 108px;
    padding-top: 12px;
    line-height: 1.45;
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 16px;
    align-items: start;
}

.fiscal-code-row {
    align-items: end;
    margin-top: -2px;
    padding: 14px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: color-mix(in srgb, var(--panel) 90%, var(--brand) 4%);
}

.is-disabled-field {
    opacity: .58;
}

.is-disabled-field input,
.is-disabled-field button,
.is-disabled-field select,
.is-disabled-field textarea {
    cursor: not-allowed;
}

.is-disabled-field input,
.is-disabled-field select,
.is-disabled-field textarea {
    background: color-mix(in srgb, var(--input) 68%, var(--panel) 32%);
}

.ai-warning {
    color: var(--danger);
    font-size: 11px;
    font-weight: 700;
}

.ai-action {
    width: 100%;
    min-height: 40px;
    margin: 0;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: var(--brand);
    font-size: 13px;
    font-weight: 900;
}

.form-section-title {
    min-height: 22px;
    display: flex;
    align-items: center;
    border-top: 2px solid var(--brand);
    padding-top: 6px;
    color: var(--text-strong);
    font-size: 15px;
    font-weight: 950;
}

.catalog-active-field {
    justify-content: flex-start;
    align-self: start;
    min-height: 24px;
    padding: 0;
}

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

.catalog-app-fields {
    display: grid;
    align-content: start;
    gap: 12px;
}

.catalog-inputs-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.catalog-app-fields label,
.catalog-inputs-grid label {
    min-height: auto;
}

.field-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
}

.field-link-row button {
    border: 0;
    color: var(--brand-strong);
    background: transparent;
    cursor: pointer;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.field-link-row button:hover {
    text-decoration: underline;
}

.category-search,
.category-search input {
    width: 100%;
}

.check-line {
    min-height: 42px;
    display: flex !important;
    align-items: center;
    gap: 7px !important;
    padding-bottom: 4px;
}

.check-line input {
    width: 16px;
    min-height: 16px;
    accent-color: var(--brand);
}

.image-upload-small {
    position: relative;
    width: 100%;
    height: 78px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    color: var(--muted);
    background: var(--input);
    overflow: hidden;
    text-align: center;
    font-size: 12px;
    font-weight: 750;
}

.image-upload-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-upload-small input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.product-grid label.span-1 {
    white-space: nowrap;
}

.product-images-panel {
    align-self: stretch;
    display: grid;
    gap: 8px;
    min-width: 0;
}

.product-images-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.product-images-head strong {
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 900;
}

.image-add-button {
    width: auto;
    height: 32px;
    min-height: 32px;
    display: flex !important;
    align-items: center;
    place-items: center;
    padding: 0 12px;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    color: #fff;
    background: var(--brand);
    cursor: pointer;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.image-add-button input {
    display: none;
}

.product-image-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    max-height: 178px;
    overflow: auto;
    padding-right: 2px;
}

.product-image-item {
    min-width: 0;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 58px 30px;
    align-items: center;
    gap: 9px;
    min-height: 54px;
    padding: 6px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: color-mix(in srgb, var(--input) 82%, var(--panel) 18%);
}

.product-image-thumb {
    width: 48px;
    height: 40px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--input);
    overflow: hidden;
    cursor: zoom-in;
}

.product-image-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.product-image-info {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.product-image-info strong {
    overflow: hidden;
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-image-info span {
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-cover-choice {
    min-height: auto;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 5px !important;
    color: var(--muted-strong);
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
    overflow: hidden;
}

.image-cover-choice input[type="radio"] {
    width: 13px;
    min-height: 13px;
    accent-color: var(--brand);
}

.image-delete-button {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    color: var(--danger);
    background: color-mix(in srgb, var(--panel) 80%, var(--danger) 6%);
    cursor: pointer;
}

.image-delete-button:hover {
    color: #fff;
    background: var(--danger);
}

.image-delete-button svg {
    width: 15px;
    height: 15px;
}

.image-help {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.image-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    place-items: center;
    padding: 28px;
    background: rgba(2, 8, 20, .76);
}

.image-preview-modal.is-open {
    display: grid;
}

.image-preview-modal img {
    max-width: min(900px, 92vw);
    max-height: 84vh;
    border-radius: 12px;
    background: var(--panel);
    box-shadow: 0 28px 70px rgba(0, 0, 0, .34);
}

.image-preview-modal button {
    position: absolute;
    top: 22px;
    right: 24px;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    font-size: 24px;
    cursor: pointer;
}

.category-modal {
    position: fixed;
    inset: 0;
    z-index: 88;
    display: none;
    place-items: center;
    padding: 22px;
    background: rgba(2, 8, 20, .68);
}

.category-modal.is-open {
    display: grid;
}

.category-modal-card {
    width: min(440px, 94vw);
    display: grid;
    gap: 14px;
    border: 1px solid var(--line-soft);
    border-radius: 16px;
    padding: 18px;
    background: var(--panel);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}

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

.category-modal-head h2 {
    margin: 0;
    color: var(--text-strong);
    font-size: 20px;
}

.category-modal-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.category-modal-head button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    color: var(--text-strong);
    background: var(--input);
    cursor: pointer;
    font-size: 22px;
}

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

.category-create-row input {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 0 12px;
    color: var(--text-strong);
    background: var(--input);
    font-weight: 750;
}

.category-create-row button {
    min-height: 40px;
    border: 0;
    border-radius: 10px;
    padding: 0 14px;
    color: #fff;
    background: var(--brand);
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
}

.category-list {
    display: grid;
    gap: 7px;
    max-height: 260px;
    overflow: auto;
}

.category-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 6px 7px 6px 12px;
    background: color-mix(in srgb, var(--input) 82%, var(--panel) 18%);
}

.category-row button:first-child {
    min-width: 0;
    overflow: hidden;
    border: 0;
    color: var(--text-strong);
    background: transparent;
    cursor: pointer;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 850;
}

.category-delete-button {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    color: var(--danger);
    background: color-mix(in srgb, var(--panel) 82%, var(--danger) 6%);
    cursor: pointer;
}

.category-delete-button:hover {
    color: #fff;
    background: var(--danger);
}

.category-delete-button svg {
    width: 15px;
    height: 15px;
}

.category-empty {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.image-count {
    display: grid;
    gap: 8px;
    align-items: end;
}

.product-grid > .span-1 {
    min-width: 0;
}

.product-grid > .span-1 input {
    padding-inline: 8px;
    text-align: center;
}

.image-count strong {
    color: var(--text-strong);
    font-size: 12px;
}

.image-count button {
    width: 38px;
    height: 38px;
    margin: 0;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    color: #fff;
    background: var(--brand);
    font-size: 28px;
    line-height: 1;
}

.span-1 { grid-column: span 1; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-9 { grid-column: span 9; }
.span-10 { grid-column: span 10; }
.span-11 { grid-column: span 11; }
.span-12 { grid-column: span 12; }

.badge {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    color: #72ff9d;
    background: rgba(18, 136, 58, .35);
    font-size: 10px;
}

.badge.is-pending {
    color: var(--warning);
    background: rgba(146, 105, 0, .35);
}

@media (max-width: 1260px) {
    .dashboard {
        grid-template-columns: 238px minmax(0, 1fr);
    }

    .sidebar { padding-inline: 12px; }
    .side-logo { margin-left: 0; }
    .logo-sidebar { width: 184px; max-height: 44px; }
    .nav-button {
        min-height: 38px;
        padding-inline: 9px;
        font-size: 13px;
    }
    .submenu { margin-left: 22px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .page-top {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .page-top > div:first-child {
        min-width: 0;
    }
    .page-top h1,
    .page-top p {
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .list-actions,
    .form-actions {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 2px;
    }
    .search-input {
        flex: 0 0 360px;
        width: 360px;
    }
    .receivable-filter-actions {
        justify-content: flex-start;
    }
    .chart-card,
    .recent-card {
        height: auto;
        min-height: 360px;
    }
    .bars {
        height: 300px;
    }
    .contacts-card {
        height: calc(100svh - 220px);
        min-height: 420px;
    }
    .sales-item-entry {
        grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(90px, .4fr)) 42px;
    }
    .sales-item-entry label:first-child {
        grid-column: span 5;
    }
    .sales-item-entry label:nth-child(5),
    .sales-item-entry label:nth-child(6) {
        grid-column: span 2;
    }
}

@media (max-width: 1040px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sales-item-entry {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .sales-item-entry label,
    .sales-item-entry label:first-child,
    .sales-item-entry label:nth-child(5),
    .sales-item-entry label:nth-child(6) {
        grid-column: span 1;
    }
    .sales-item-entry .line-confirm {
        width: 100%;
    }
}

@media (max-width: 900px) {
    body.is-dashboard { overflow: auto; }

    .dashboard {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
        min-height: auto;
        max-width: 100%;
        gap: 14px;
        padding: 16px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .side-logo {
        margin: 0;
        justify-content: center;
    }

    .logo-sidebar { width: 142px; max-height: 38px; }

    .side-nav {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .menu-title,
    .submenu {
        display: none !important;
    }

    .menu-group { flex: 0 0 auto; }

    .nav-button {
        width: auto;
        min-width: 48px;
        min-height: 44px;
        grid-template-columns: 20px auto;
        padding: 0 14px;
        gap: 9px;
        white-space: nowrap;
        font-size: 14px;
    }

    .nav-button .chev { display: none; }

    .sidebar-bottom {
        margin: 0;
        display: none;
    }

    .dash-main { padding: 22px 16px; }
    .form-page-main {
        height: auto;
        min-height: 100svh;
        overflow: visible;
    }
    .customer-form {
        height: auto;
        display: block;
    }
    .form-card {
        max-height: none;
        overflow: visible;
    }
    .logo-upload {
        grid-template-columns: 1fr;
    }
    .mini-grid,
    .catalog-panel,
    .catalog-app-layout,
    .catalog-inputs-grid {
        grid-template-columns: 1fr;
    }
    .order-items {
        overflow-x: auto;
    }
    .order-items-head,
    .order-item-row {
        min-width: 900px;
    }
    .order-summary {
        display: grid;
        justify-content: stretch;
    }
    .permissions-grid {
        grid-template-columns: 1fr;
    }
    .seller-user-fields {
        grid-template-columns: 1fr;
    }
    .dash-top { display: grid; }
    .top-actions,
    .search-box { width: 100%; }
    .receivable-filters {
        grid-template-columns: 1fr;
    }
    .contacts-footer {
        align-items: flex-start;
        flex-direction: column;
        padding-block: 12px;
    }
    .receivable-totals {
        justify-content: flex-start;
    }
    .bars { gap: 12px; }
    .bar { width: 32px; }
    .chart-card,
    .recent-card {
        min-height: 320px;
    }
}

@media (max-width: 640px) {
    body { overflow: auto; }
    .page { padding: 34px 17px; }
    .login-shell { gap: 24px; }
    .login-card {
        min-height: auto;
        padding: 30px 24px 28px;
        border-radius: 22px;
    }
    .login-card h1 {
        margin-bottom: 26px;
        font-size: 22px;
    }
    label { font-size: 16px; }
    input { height: 50px; }
    .login-card > button { height: 50px; font-size: 17px; }
    .actions { font-size: 14px; }
    .stats-grid { grid-template-columns: 1fr; }
    .chart-card,
    .recent-card { min-height: 320px; }
    .bars { height: 220px; }
    .sale-row {
        grid-template-columns: 30px 1fr;
    }
    .sale-value {
        grid-column: 2;
        text-align: left;
    }
}

/* Integracoes */
.integrations-form {
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: 12px;
}

.integrations-form > .page-top { grid-row: 1; }
.integrations-form > .integrations-feedback { grid-row: 2; }
.integrations-form > .integration-tabs { grid-row: 3; }
.integrations-form > .integrations-card {
    min-height: 0;
    grid-row: 4;
}

.integrations-feedback:empty {
    display: none;
}

.integrations-feedback {
    display: grid;
    gap: 8px;
}

.integrations-card {
    display: grid;
    align-content: start;
    gap: 20px;
    padding: 22px 24px 26px;
}

.integration-tabs {
    min-width: 0;
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 8px 10px;
    background: var(--panel);
    box-shadow: var(--shadow-soft);
    scrollbar-width: thin;
}

.integration-tab {
    width: 150px;
    min-width: 150px;
    height: 54px;
    min-height: 54px;
    flex: 0 0 150px;
    display: grid;
    grid-template-columns: 34px 1fr;
    grid-template-rows: 1fr auto;
    align-items: center;
    gap: 0 9px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 7px 11px;
    color: var(--muted-strong);
    background: var(--panel-soft);
    text-align: left;
}

.integration-tab strong {
    font-size: 13px;
    white-space: nowrap;
}

.integration-tab small {
    grid-column: 2;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
}

.integration-tab.is-active {
    border-color: var(--brand);
    color: var(--text-strong);
    background: color-mix(in srgb, var(--brand) 8%, var(--panel));
    box-shadow: inset 0 -2px 0 var(--brand);
}

.integration-tab:disabled {
    cursor: not-allowed;
    opacity: .62;
}

.integration-provider-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    grid-row: 1 / 3;
    border-radius: 8px;
    color: #fff;
    font-size: 11px;
    font-weight: 950;
}

.integration-provider-mark.mp { background: #168ddb; }
.integration-provider-mark.wa { background: #24b866; }
.integration-provider-mark.os { background: #e5484d; }
.integration-provider-mark.ef { background: #26364b; }
.integration-provider-mark.tn { background: #2764c4; }

.integration-provider-head,
.integration-provider-head > div,
.integration-section-head,
.integration-enable,
.integration-check {
    display: flex;
    align-items: center;
}

.integration-provider-head {
    justify-content: space-between;
    gap: 20px;
    padding: 2px 2px 0;
}

.integration-provider-head > div {
    gap: 12px;
}

.integration-provider-head .integration-provider-mark {
    width: 44px;
    height: 44px;
    font-size: 13px;
}

.integration-provider-head h2,
.integration-section h3 {
    margin: 0;
    color: var(--text-strong);
}

.integration-provider-head h2 { font-size: 21px; }
.integration-section h3 { font-size: 16px; }

.integration-provider-head p,
.integration-section-head p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.integration-enable,
.integration-check {
    gap: 9px;
    color: var(--text-strong);
    font-size: 13px;
    font-weight: 850;
}

.integration-enable input,
.integration-check input {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    accent-color: var(--brand);
}

.integration-section {
    display: grid;
    gap: 16px;
    border-top: 2px solid color-mix(in srgb, var(--brand) 72%, var(--line-soft));
    padding: 17px 2px 2px;
}

.integration-section-head {
    justify-content: space-between;
    gap: 18px;
}

.integration-environment {
    width: min(220px, 100%);
    display: grid;
    gap: 6px;
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 850;
}

.integration-environment select,
.integration-fields-grid input,
.integration-fields-grid select {
    width: 100%;
    height: 44px;
    min-height: 44px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 0 12px;
    color: var(--text-strong);
    background: var(--input);
    font-size: 13px;
    font-weight: 750;
}

.integration-token-status {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 12px 14px;
    background: var(--panel-soft);
}

.integration-connect-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 16px;
    background: var(--panel-soft);
}

.integration-connect-card.is-connected {
    border-color: color-mix(in srgb, #0ea66b 42%, var(--line-soft));
    background: color-mix(in srgb, #0ea66b 6%, var(--panel));
}

.integration-connect-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: #159ad6;
    font-size: 14px;
    font-weight: 950;
}

.integration-connect-card.is-connected .integration-connect-icon {
    background: #0ea66b;
    font-size: 22px;
}

.integration-connect-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.integration-connect-copy strong {
    color: var(--text-strong);
    font-size: 16px;
    font-weight: 950;
}

.integration-connect-copy p,
.integration-connect-copy small {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.4;
}

.integration-connect-copy small {
    color: #0a8b5a;
    font-weight: 850;
}

.integration-connect-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.integration-connect-actions button {
    min-height: 42px;
    margin: 0;
    border-radius: 8px;
    padding: 0 17px;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.integration-connect-actions .secondary-action {
    border: 1px solid var(--brand);
    color: var(--brand-strong);
    background: var(--panel);
}

.button-like {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.integration-mobile-connect {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 156px auto;
    align-items: center;
    gap: 16px;
    border: 1px dashed color-mix(in srgb, var(--brand) 48%, var(--line-soft));
    border-radius: 8px;
    padding: 14px 16px;
    background: color-mix(in srgb, var(--brand) 5%, var(--panel));
}

.integration-mobile-connect strong {
    color: var(--text-strong);
    font-size: 14px;
    font-weight: 950;
}

.integration-mobile-connect p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.4;
}

.integration-mobile-connect .secondary-action {
    min-height: 40px;
    border: 1px solid var(--brand);
    border-radius: 8px;
    padding: 0 16px;
    color: var(--brand-strong);
    background: var(--panel);
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.integration-oauth-qr {
    width: 156px;
    height: 156px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 10px;
    background: #fff;
}

.integration-oauth-qr canvas,
.integration-oauth-qr img,
.integration-oauth-qr svg {
    width: 132px !important;
    height: 132px !important;
}

.integration-oauth-qr span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.credentials-modal {
    z-index: 80;
}

.credentials-card {
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100dvh - 40px);
    overflow: auto;
}

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

.credentials-list label {
    display: grid;
    gap: 6px;
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 850;
}

.credentials-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
}

.credentials-field input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 0 12px;
    color: var(--text-strong);
    background: var(--input);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    font-weight: 750;
}

.credentials-field button {
    min-width: 74px;
    border: 1px solid var(--brand);
    border-radius: 8px;
    padding: 0 12px;
    color: var(--brand-strong);
    background: var(--panel);
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.credentials-warning {
    margin-top: 14px;
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--muted-strong);
    background: var(--panel-soft);
    font-size: 12px;
    font-weight: 750;
}

.integration-token-status > div:not(.integration-status-pill) {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.integration-token-status span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
}

.integration-token-status strong {
    overflow: hidden;
    color: var(--text-strong);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.integration-api-actions button {
    min-height: 42px;
    margin: 0;
    border: 1px solid var(--brand);
    border-radius: 8px;
    padding: 0 18px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.integration-api-actions .primary-action {
    color: #fff;
    background: var(--brand);
}

.integration-api-actions .secondary-action {
    color: var(--brand-strong);
    background: var(--panel);
}

.integration-api-actions button:disabled {
    border-color: var(--line-soft);
    color: var(--muted);
    background: var(--panel-soft);
    cursor: not-allowed;
    opacity: .72;
}

.integration-status-pill {
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    padding: 7px 10px;
    color: var(--muted-strong);
    background: var(--panel);
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.integration-status-pill.is-ready {
    border-color: color-mix(in srgb, #0ea66b 45%, var(--line-soft));
    color: #0a8b5a;
    background: color-mix(in srgb, #0ea66b 9%, var(--panel));
}

.integration-fields-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 16px;
}

.integration-fields-grid label {
    min-width: 0;
    display: grid;
    align-content: end;
    gap: 7px;
    margin: 0;
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 850;
}

.integration-fields-grid label > small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.35;
}

.integration-secret {
    width: 100%;
}

.integration-secret .toggle-password {
    bottom: 6px;
    color: var(--muted) !important;
}

.integration-secret .toggle-password:hover {
    color: var(--text-strong) !important;
}

.integration-fields-grid.operational {
    grid-template-columns: repeat(2, minmax(0, 1fr)) repeat(2, max-content);
    align-items: end;
}

.integration-fields-grid.operational .integration-check {
    min-height: 44px;
    padding: 0 6px;
}

.integration-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

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

.integration-fields-grid .span-two {
    grid-column: 1 / -1;
}

.integration-mp-resources .integration-section-head > button {
    min-height: 40px;
    margin: 0;
    border: 1px solid var(--brand);
    border-radius: 8px;
    padding: 0 16px;
    color: var(--brand-strong);
    background: var(--panel);
    font-weight: 850;
    cursor: pointer;
}

.integration-resource-status {
    border-radius: 7px;
    padding: 9px 12px;
    color: var(--muted-strong);
    background: var(--panel-soft);
    font-size: 12px;
    font-weight: 750;
}

.integration-resource-status.is-success { color: #087c52; }
.integration-resource-status.is-error { color: #c33b49; }

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

.integration-resource-card {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 12px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 14px;
    background: var(--panel-soft);
}

.integration-resource-card h4 {
    margin: 0;
    color: var(--text-strong);
    font-size: 14px;
}

.integration-resource-card label,
.integration-resource-fields label {
    min-width: 0;
    display: grid;
    gap: 6px;
    color: var(--text-strong);
    font-size: 11px;
    font-weight: 850;
}

.integration-resource-card input,
.integration-resource-card select {
    width: 100%;
    height: 42px;
    min-height: 42px;
    border: 1px solid var(--line-soft);
    border-radius: 7px;
    padding: 0 11px;
    color: var(--text-strong);
    background: var(--input);
    font-size: 12px;
    font-weight: 750;
}

.integration-resource-card > button,
.integration-resource-fields > button {
    min-height: 40px;
    margin: 0;
    border: 0;
    border-radius: 7px;
    padding: 0 13px;
    color: #fff;
    background: var(--brand);
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.integration-resource-card button:disabled { opacity: .55; cursor: wait; }

.integration-resource-create {
    border-top: 1px solid var(--line-soft);
    padding-top: 10px;
}

.integration-resource-create summary {
    color: var(--brand-strong);
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.integration-resource-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding-top: 12px;
}

.integration-resource-fields .span-two { grid-column: 1 / -1; }

.integration-print-fields {
    display: grid;
    gap: 10px;
    padding-top: 12px;
}

.integration-print-fields label {
    display: grid;
    gap: 6px;
}

.integration-print-fields textarea {
    width: 100%;
    min-height: 88px;
    resize: vertical;
    border: 1px solid var(--line-soft);
    border-radius: 7px;
    padding: 10px 11px;
    color: var(--text-strong);
    background: var(--input);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.4;
}

.integration-print-preview {
    width: 100%;
    border: 1px dashed var(--line-soft);
    border-radius: 8px;
    padding: 8px;
    background: var(--panel);
}

.integration-print-preview img {
    width: 100%;
    max-height: 150px;
    object-fit: contain;
    display: block;
}

.integration-operation-summary {
    display: grid;
    gap: 9px;
}

.integration-operation-summary span {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line-soft);
    padding: 7px 0;
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 700;
}

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

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

    .integration-fields-grid.operational {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .integration-resource-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .integrations-form {
        gap: 10px;
    }

    .integration-tabs {
        min-height: 68px;
        padding: 6px 8px;
    }

    .integrations-card {
        padding-inline: 16px;
    }

    .integration-provider-head,
    .integration-section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .integration-token-status,
    .integration-fields-grid,
    .integration-fields-grid.operational,
    .integration-fields-grid.compact {
        grid-template-columns: 1fr;
    }

    .integration-fields-grid .span-two {
        grid-column: auto;
    }

    .integration-status-pill {
        justify-self: start;
    }

    .integration-connect-card {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .integration-connect-icon {
        width: 44px;
        height: 44px;
    }

    .integration-connect-actions {
        grid-column: 1 / -1;
        flex-wrap: wrap;
    }

    .integration-mobile-connect {
        grid-template-columns: 1fr;
    }

    .integration-oauth-qr {
        justify-self: start;
    }

    .credentials-field {
        grid-template-columns: 1fr;
    }

    .integration-resource-fields { grid-template-columns: 1fr; }
    .integration-resource-fields .span-two { grid-column: auto; }
}
