:root {
  color-scheme: light;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  color: #142b22;
  background: #f5f7f3;
  --forest: #15372a;
  --green: #21583f;
  --ink: #142b22;
  --muted: #52665b;
  --line: #dfe7de;
  --paper: #fff;
  --gold: #f1d087;
  --shadow: 0 2px 6px #142b2207;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .42; cursor: default; }
svg { flex: none; vertical-align: middle; }
img { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
strong, b { font-weight: 700; }
:focus-visible { outline: 3px solid #447b64; outline-offset: 3px; }
.landing-hero :focus-visible { outline-color: var(--gold); }
h1:focus, #main-content:focus, #dialog-title:focus { outline: none; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: fixed; z-index: 10; left: 12px; top: 10px; transform: translateY(-160%); background: #fff; border-radius: 8px; padding: 12px; }
.skip:focus { transform: translateY(0); }
.brand { display: inline-flex; align-items: center; gap: 11px; width: fit-content; line-height: 1.06; flex-shrink: 0; }
.brand-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--gold); color: #1c3b2c; }
.brand strong { display: block; font-size: 1.22rem; letter-spacing: -.035em; }
.brand small { display: block; margin-top: 5px; color: var(--muted); font-size: .79rem; letter-spacing: .04em; }
.connection { display: inline-flex; align-items: center; column-gap: 7px; border-radius: 999px; color: #20563b; background: #e9f3eb; border: 1px solid #d9eadc; padding: 7px 11px; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.connection.offline { color: #734a1c; background: #fbefd9; border-color: #f3dfb8; }
.workspace-content { margin: auto; display: flex; flex-direction: column; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; min-width: 0; }
.page-heading h1 { font-size: clamp(1.75rem, 2.9vw, 2.45rem); letter-spacing: -.055em; line-height: 1.13; }
.page-heading p { display: flex; align-items: center; gap: 7px; margin-top: 7px; color: var(--muted); line-height: 1.45; font-size: .98rem; }
.heading-date { text-transform: lowercase; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.section-title h2, .panel-head h2, .copy-panel h2 { font-size: 1.18rem; font-weight: 700; letter-spacing: -.025em; }
.section-title > span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .83rem; }

.btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px; border: 1px solid transparent; border-radius: 9px; color: var(--green); background: transparent; text-align: center; line-height: 1.22; font-size: .91rem; font-weight: 700; transition: background .15s, border-color .15s; }
.btn.primary { background: var(--forest); color: #fff; border-color: var(--forest); }
.btn.primary:hover { background: #24583e; border-color: #24583e; }
.btn.outline { background: #fff; border-color: #cddbd0; color: var(--green); }
.btn.outline:hover { background: #f1f6f1; border-color: #a5bfab; }
.btn.gold { color: #23392a; background: var(--gold); border-color: var(--gold); }
.btn.gold:hover { background: #f9dfa6; border-color: #f9dfa6; }
.btn.on-dark { border-color: #ffffff54; color: #fff; background: #122e2360; }
.btn.on-dark:hover { background: #ffffff25; }
.btn.text { padding-inline: 7px; }
.btn.text:hover { background: #ecf4ee; }
.btn.danger { color: #fff; background: #963936; border-color: #963936; }
.btn.danger:hover { background: #7c2e2c; }
.btn.danger-outline { color: #8d3736; border-color: #e3c5c3; background: #fff; }
.btn.danger-outline:hover { background: #fdf0ed; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.icon-btn { min-width: 42px; min-height: 42px; display: inline-grid; place-items: center; border: 0; border-radius: 8px; color: var(--green); background: transparent; }
.icon-btn:hover:not(:disabled) { background: #ecf4ee; }

.panel { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.metric { padding: 15px 15px 14px; }
.metric-top { display: flex; align-items: center; gap: 8px; min-height: 35px; color: #3c5548; font-size: .89rem; font-weight: 650; }
.tile-icon { width: 36px; height: 36px; flex: none; display: inline-grid; place-items: center; border-radius: 9px; }
.tile-icon.sage { color: #286247; background: #e7f2e9; }
.tile-icon.sky { color: #365f77; background: #e9f0f7; }
.tile-icon.sand { color: #886019; background: #fbf0da; }
.tile-icon.lilac { color: #70528c; background: #f1ebf7; }
.metric > strong { display: block; margin-top: 10px; font-size: clamp(1.5rem, 2.1vw, 2rem); line-height: 1.15; letter-spacing: -.055em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.money small { font-size: .58em; font-weight: 700; letter-spacing: 0; color: #547062; }
.metric p { margin-top: 5px; color: var(--muted); font-size: .81rem; line-height: 1.35; }
.single-metric { width: min(100%, 325px); }
.shortcuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.shortcut { display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 69px; padding: 9px 11px; text-align: left; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: #213b2d; box-shadow: var(--shadow); transition: background .15s, border-color .15s; }
.shortcut:hover { background: #f5faf6; border-color: #b4caba; }
.shortcut > span:nth-child(2) { flex: 1; min-width: 0; }
.shortcut strong, .shortcut small { display: block; }
.shortcut strong { font-size: .85rem; line-height: 1.19; }
.shortcut small { color: var(--muted); font-size: .74rem; line-height: 1.22; margin-top: 3px; }
.shortcut > svg { color: #527561; }
.split { display: grid; grid-template-columns: minmax(0, 1.64fr) minmax(0, 1fr); align-items: start; gap: 15px; }
.dashboard-split { align-items: stretch; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 16px 17px 9px; }
.panel-head p { margin-top: 4px; color: var(--muted); font-size: .85rem; }
.stock-panel > .btn { margin: 0 10px 6px; }
.stock-panel > .list { padding: 0 15px; }
.summary .totals { margin: 0 16px 16px; }
.badge { display: inline-flex; align-items: center; justify-content: center; padding: 4px 8px; border-radius: 999px; white-space: nowrap; font-size: .78rem; font-weight: 700; line-height: 1.25; }
.badge.subtle { background: #eef3ee; color: #415d4d; }
.badge.due, .badge.partial { background: #fbefd9; color: #765019; }
.badge.paid { background: #e6f2e8; color: #266244; }
.badge.cancelled { background: #f5e8e7; color: #863b38; }
.chart { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 8px; height: 159px; margin: 15px 18px 16px; }
.chart-scale { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; padding-bottom: 25px; color: var(--muted); font-size: .75rem; }
.chart-data { position: relative; }
.chart-grid { position: absolute; inset: 3px 0 24px; border-block: 1px dashed #dce6de; }
.chart-grid::after { content: ''; position: absolute; top: 50%; width: 100%; border-top: 1px dashed #dce6de; }
.chart-empty { position: absolute; z-index: 1; top: 44%; left: 50%; transform: translate(-50%,-50%); width: max-content; max-width: 95%; padding: 7px 9px; text-align: center; border: 1px solid #edf2ed; background: #f8faf7; border-radius: 7px; color: var(--muted); font-size: .82rem; }
.chart-bars { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); height: 100%; }
.chart-slot { position: relative; text-align: center; display: flex; flex-flow: column; justify-content: flex-end; padding-bottom: 23px; align-items: center; }
.chart-slot > span { position: absolute; bottom: 0; font-size: .75rem; color: var(--muted); }
.bar { height: var(--height); width: min(60%, 38px); background: #80a58e; border-radius: 6px 6px 0 0; }
.today .bar { background: #24704b; }
.today > span { color: #1e5b3c; font-weight: 700; }

.toolbar { display: flex; justify-content: space-between; gap: 12px; padding: 15px; border-bottom: 1px solid #edf1ec; }
.search { display: flex; gap: 9px; align-items: center; flex: 1; max-width: 400px; padding-left: 10px; color: var(--muted); background: #fff; border: 1px solid #cbd9cf; border-radius: 8px; }
.search input { flex: 1; min-width: 0; width: 100%; min-height: 43px; background: transparent; border: 0; color: var(--ink); padding: 8px 10px 8px 0; outline: none; }
.search:focus-within { outline: 2px solid #447b64; outline-offset: 1px; }
.toolbar > select { width: auto; min-width: 146px; }
.table-wrap { overflow: auto; border-radius: 0 0 13px 13px; }
table { width: 100%; border-collapse: collapse; font-size: .91rem; }
thead th { padding: 11px 12px; text-align: left; white-space: nowrap; background: #f6f9f5; color: #3e574a; font-size: .83rem; font-weight: 700; }
tbody td { padding: 8px 12px; text-align: left; border-top: 1px solid #edf1ec; }
th:first-child, td:first-child { padding-left: 17px; }
th:last-child, td:last-child { width: 44px; padding: 4px 6px; text-align: right; }
td:not(:first-child) { white-space: nowrap; }
tbody tr:hover { background: #fcfdfa; }
td small { display: block; margin-top: 3px; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
td small:empty { display: none; }
.row-link { display: inline-block; background: transparent; border: 0; padding: 7px 0; color: #20543a; text-align: left; font-weight: 700; overflow-wrap: anywhere; }
.row-link:hover { text-decoration: underline; }
.list { padding: 0; margin: 0; list-style: none; }
.list li { display: flex; align-items: center; gap: 9px; border-bottom: 1px solid #eaf0ea; padding: 8px 0; }
.list li:last-child { border-bottom: none; }
.list li > div { min-width: 0; flex: 1; }
.list li strong, .list li small { display: block; overflow-wrap: anywhere; }
.list li small { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.list li > strong { white-space: nowrap; }
.empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 26px 16px; }
.empty .tile-icon { width: 45px; height: 45px; }
.empty p { max-width: 30ch; color: var(--muted); line-height: 1.45; font-size: .91rem; }
.empty > .btn { margin-top: 4px; }
.totals { margin: 8px 0; }
.totals > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid #e7eee8; }
.totals > div:first-child { border-top: 0; }
.totals dt { color: var(--muted); }
.totals dd { font-weight: 700; text-align: right; margin: 0; overflow-wrap: anywhere; }
.totals .strong { color: #205a3d; border-top-color: #c9e0d1; font-size: 1.07rem; }
.totals .strong dt { color: inherit; font-weight: 700; }

.period-panel { padding: 16px; }
.period { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 13px; }
.period-fields { display: flex; flex-wrap: wrap; gap: 11px; }
.period .form-error { width: 100%; }
.results-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
.settings-split { grid-template-columns: repeat(2,minmax(0,1fr)); align-items: stretch; }
.copy-panel { padding: 18px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.copy-panel > .btn, .copy-panel > .actions { margin-top: 4px; }
.copy-panel p, .notice p, .confirm-copy { color: #455e50; line-height: 1.55; overflow-wrap: anywhere; }
.notice { display: flex; gap: 10px; border: 1px solid #d8e6df; background: #edf6ef; padding: 12px; border-radius: 10px; color: #24543b; }
.notice.warn { background: #fbf3e3; border-color: #eddaba; color: #69471a; }
.notice.warn p { color: #684f2e; }
.notice > div { min-width: 0; }
.notice strong + p { margin-top: 5px; }
.notice .btn { margin-top: 5px; }
.demo-banner { display: flex; justify-content: space-between; gap: 8px; align-items: center; color: #684a18; background: #fcf2dd; border: 1px solid #efdfbf; border-radius: 10px; padding: 5px 10px; }
.demo-banner > div { display: flex; align-items: center; gap: 8px; }
.demo-banner small { font-size: .87rem; }
.demo-banner .btn { color: #684a18; }
.demo-banner .btn:hover { background: #f7e7c4; }

.offer-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.offer { display: flex; flex-direction: column; align-items: flex-start; padding: 20px; gap: 11px; }
.offer.featured { border-color: #9ebfa7; box-shadow: 0 3px 14px #123b2210; }
.offer-title { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 5px; }
.offer-title h2 { font-size: 1.22rem; }
.offer-price strong { font-size: 2rem; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.offer-price > span, .offer p { color: var(--muted); }
.offer ul { display: grid; gap: 8px; padding: 10px 0; margin: 0; list-style: none; }
.offer li { display: flex; align-items: flex-start; gap: 7px; line-height: 1.4; }
.offer li svg { color: #3b7856; margin-top: 3px; }
.offer .btn { margin-top: auto; }

dialog { width: min(calc(100% - 28px), 560px); max-width: none; max-height: min(88dvh, 820px); padding: 0; border: 1px solid #cadbcf; border-radius: 16px; color: var(--ink); box-shadow: 0 14px 50px #12271e35; }
dialog.wide-dialog { width: min(calc(100% - 28px), 680px); }
dialog::backdrop { background: #0b271dc2; }
.dialog-inner > header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff; border-bottom: 1px solid #ebf1ec; padding: 9px 15px 9px 18px; }
.dialog-inner > header h2 { font-size: 1.32rem; letter-spacing: -.026em; overflow-wrap: anywhere; }
.close-btn { color: #516c5d; }
.dialog-content { padding: 16px 18px 18px; }
.form { display: flex; flex-direction: column; gap: 13px; }
.field { min-width: 0; display: grid; gap: 6px; color: var(--ink); }
.field > span { font-size: .88rem; font-weight: 700; }
.field small, .hint { color: var(--muted); line-height: 1.36; font-size: .82rem; }
.form-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: start; gap: 11px; }
.field input, .field textarea, select { min-width: 0; width: 100%; padding: 9px 10px; min-height: 44px; background: #fff; color: var(--ink); border: 1px solid #cbd9cf; border-radius: 8px; }
select { appearance: none; padding-right: 30px; background: #fff linear-gradient(45deg,transparent 50%,#486656 50%) calc(100% - 15px) center / 5px 5px no-repeat; background-image: linear-gradient(45deg,transparent 50%,#486656 50%),linear-gradient(135deg,#486656 50%,transparent 50%); background-position: calc(100% - 15px) center,calc(100% - 10px) center; }
.field textarea { resize: vertical; }
.form-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; margin-top: 5px; }
.form-actions .danger-outline { margin-right: auto; }
.form-error { color: #873933; border: 1px solid #e8c3bb; background: #fff1ed; padding: 9px; border-radius: 8px; }
.sale-line { display: grid; grid-template-columns: minmax(0,1fr) minmax(70px, 100px) 42px; align-items: end; gap: 6px 9px; padding: 8px 0; border-bottom: 1px solid #eef3ee; }
.sale-line .line-price { grid-column: 1 / -1; color: var(--muted); font-size: .83rem; }
.sale-line .line-price:empty { display: none; }
.sale-total, .sale-balance { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sale-total { background: #ecf4ed; border-radius: 8px; padding: 10px 12px; color: #265b40; }
.sale-total strong { font-size: 1.23rem; }
.sale-balance strong { margin-left: 5px; }
.detail-actions { margin: 4px 0 10px; }
.detail-heading { margin: 15px 0 5px; font-size: 1rem; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 7px; margin-bottom: 10px; color: var(--muted); }
.detail-note { background: #f3f7f3; border-radius: 8px; padding: 9px; }
.preserve { white-space: pre-wrap; overflow-wrap: anywhere; }
.history-list .tile-icon { width: 32px; height: 32px; }
.more-nav { display: grid; gap: 6px; }
.more-nav a { display: flex; align-items: center; min-height: 44px; gap: 9px; padding: 10px; border-radius: 8px; background: #f3f7f3; }
.more-nav a[aria-current], .more-nav a:hover { background: #e0ede2; color: #245a3f; }
#toast { position: fixed; z-index: 8; right: 16px; bottom: 16px; display: grid; pointer-events: none; max-width: min(450px,calc(100vw - 32px)); }
.toast-message { display: flex; align-items: center; gap: 9px; border-radius: 9px; background: #1c5239; color: #fff; padding: 12px 15px; box-shadow: 0 5px 20px #12271e35; }
.toast-error { background: #873633; }

.landing-header, .landing-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: 1200px; margin: 0 auto; padding: 18px 26px; }
.landing-header nav { display: flex; align-items: center; gap: 8px; }
.landing { max-width: 1200px; margin: 0 auto; padding: 0 26px; }
.landing-hero { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.04fr); overflow: hidden; background: #193a2c; color: #fff; border-radius: 18px; }
.landing-hero > div { padding: clamp(20px,4.8vw,63px); align-self: center; }
.landing-tag { display: inline-flex; gap: 7px; align-items: center; color: var(--gold); font-size: .87rem; font-weight: 700; }
.landing-hero h1 { margin: 16px 0 12px; font: 500 clamp(2.4rem,5.5vw,5.5rem)/.97 Georgia, 'Times New Roman', serif; letter-spacing: -.06em; }
.landing-hero p { color: #ecf4ed; line-height: 1.55; max-width: 35ch; }
.landing-hero .actions { margin-top: 20px; }
.landing-hero img { width: 100%; height: 100%; min-height: 330px; object-fit: cover; object-position: 67% center; }
.landing-section { margin: 38px 0; }
.section-intro { max-width: 640px; margin-bottom: 19px; }
.landing-section h2 { font-size: clamp(1.42rem,2.8vw,2rem); letter-spacing: -.045em; }
.landing-section .offer h2 { font-size: 1.2rem; }
.landing-section p { color: #4e6658; margin-top: 8px; line-height: 1.55; }
.landing-features { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.landing-features article, .offline-section { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.landing-features h3, .offline-section h2 { margin-top: 12px; }
.offline-section { display: grid; align-items: start; grid-template-columns: 1.4fr 1fr; gap: 22px; }
.offline-section > div:last-child { align-self: center; }
.landing-footer { border-top: 1px solid var(--line); }

.tool-banner { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 13px 16px; color: #234832; background: #e7f2e9; border: 1px solid #cfdfd2; border-radius: 12px; }
.tool-banner > div { flex: 1 1 210px; }
.tool-banner p, .tool-title p, .plan-audience { margin-top: 4px; color: var(--muted); font-size: .92rem; line-height: 1.45; }
.tool-layout { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(0,1fr); gap: 15px; align-items: start; }
.tool-panel { padding: 17px; min-width: 0; }
.tool-panel h2 { font-size: 1.18rem; line-height: 1.3; }
.tool-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tool-title .btn { flex-shrink: 0; }
.tool-aside { position: sticky; top: 12px; display: grid; gap: 10px; }
.tool-aside .btn { justify-self: start; }
.tool-empty { display: grid; place-items: center; gap: 8px; padding: 15px 8px 10px; text-align: center; color: var(--muted); line-height: 1.45; }
.tool-empty p { max-width: 34ch; }
.cost-title { margin-top: 4px; }
#cost-lines { display: grid; gap: 10px; }
.cost-line { min-width: 0; margin: 0; padding: 9px 11px 11px; border: 1px solid var(--line); border-radius: 10px; background: #f8faf7; }
.cost-line legend { padding: 0 6px; font-size: .81rem; font-weight: 700; color: #416450; }
.cost-head { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(0,1fr) 43px; gap: 8px; align-items: end; }
.cost-delete { color: #873633; }
.cost-buy, .cost-use { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(0,1fr); align-items: end; gap: 8px; margin-top: 8px; }
.cost-qty { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(0,1fr); gap: 8px; align-items: end; }
.profit-result { display: grid; gap: 4px; border-radius: 10px; background: #e6f2e9; color: #204e36; padding: 13px; }
.profit-result.negative { background: #fbefe0; color: #74451b; }
.profit-result strong { font-size: clamp(1.6rem,3vw,2.4rem); line-height: 1.08; font-variant-numeric: tabular-nums; letter-spacing: -.03em; overflow-wrap: anywhere; }
.profit-result small { color: inherit; }
.tool-totals { font-size: .92rem; }
.tool-details { margin-top: 8px; color: #245b3e; }
.tool-details summary { cursor: pointer; font-weight: 700; }
.tool-details ul { list-style: none; margin: 7px 0 0; padding: 0; }
.tool-details li { display: flex; justify-content: space-between; gap: 9px; margin-top: 5px; font-size: .87rem; }

.marketing-layout { grid-template-columns: minmax(0,1fr) minmax(0,1.15fr); }
.strategy-plan { display: grid; gap: 12px; }
.plan-audience { margin: 0; }
.plan-steps { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
.plan-steps li { border: 1px solid var(--line); padding: 10px; border-radius: 9px; }
.plan-steps li > span { color: #426852; font-size: .82rem; font-weight: 700; }
.plan-steps h3, .plan-indicators h3, .sale-documents h3 { font-size: .98rem; }
.plan-steps p, .plan-indicators ul { margin-top: 4px; color: var(--muted); line-height: 1.44; }
.plan-indicators ul { padding: 0; list-style: none; }
.plan-indicators li { display: flex; align-items: flex-start; gap: 7px; margin-top: 4px; }
.plan-indicators svg { margin-top: 4px; }
.strategy-plan .btn { justify-self: start; }

.company-upload { display: grid; grid-template-columns: 72px minmax(0,1fr); align-items: start; gap: 12px; }
.company-upload #logo-preview { align-self: center; }
.company-upload input[type=file] { color: var(--muted); max-width: 100%; }
.company-upload .hint { margin: 5px 0 0; }
.company-logo, .company-mark { width: 68px; height: 68px; object-fit: contain; display: inline-grid; place-items: center; }
.company-mark { color: #35634a; background: #eaf3ec; border-radius: 12px; }
.company-card { padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #f8faf7; }
.company-card-head { display: flex; align-items: center; gap: 10px; min-width: 0; overflow-wrap: anywhere; }
.company-card-head .company-logo, .company-card-head .company-mark { flex: 0 0 auto; }
.company-card-head p, .company-card-details, .company-footer-preview { color: #465e50; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.company-card-details:not(:empty) { margin-top: 8px; }
.company-footer-preview { margin-top: 8px; color: #3d5949; }
.sale-documents { margin: 13px 0; background: #f3f8f3; border: 1px solid var(--line); border-radius: 9px; padding: 10px; }
.sale-documents h3 { margin-bottom: 7px; }

dialog.document-dialog { width: min(calc(100% - 22px), 1060px); }
.document-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.14fr); gap: 15px; align-items: start; }
.document-preview { min-width: 0; padding: 9px; background: #edf2ed; border-radius: 9px; }
.paper-document { padding: 14px; background: #fff; color: #16231b; border-radius: 6px; font-size: .86rem; line-height: 1.4; overflow-wrap: anywhere; }
.paper-ticket { width: min(100%, 73mm); margin: 0 auto; }
.paper-header { display: flex; justify-content: space-between; align-items: start; gap: 9px; padding-bottom: 9px; border-bottom: 1px solid #b6c5ba; }
.paper-header > div { min-width: 0; }
.paper-header .company-logo, .paper-header .company-mark { width: 45px; height: 45px; flex-basis: 45px; }
.paper-header .company-mark svg { width: 25px; }
.paper-ticket .paper-header { display: grid; justify-content: stretch; text-align: center; }
.paper-ticket .company-card-head { justify-content: center; }
.paper-reference { text-align: right; }
.paper-ticket .paper-reference { text-align: center; }
.paper-reference h2 { font-size: 1.12rem; text-transform: uppercase; letter-spacing: .025em; }
.paper-cancelled { margin: 7px 0; padding: 4px 6px; border: 1px solid #bd7470; color: #7c2d2a; font-weight: 750; text-transform: uppercase; }
.paper-buyer { margin: 8px 0; white-space: pre-wrap; }
.paper-table { margin-top: 9px; font-size: inherit; }
.paper-table th, .paper-table td { padding: 5px 4px; text-align: right; border-bottom: 1px solid #d4ded5; }
.paper-table th:first-child, .paper-table td:first-child { padding-left: 0; text-align: left; }
.paper-table th:last-child, .paper-table td:last-child { padding-right: 0; width: auto; }
.paper-table th { font-size: inherit; white-space: normal; }
.paper-table td small { font-size: .85em; }
.paper-table th:first-child { width: 41%; }
.paper-totals { margin: 8px 0; }
.paper-totals > div { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; }
.paper-totals dd { margin: 0; text-align: right; font-weight: 700; }
.paper-totals > div:first-child { font-weight: 750; font-size: 1.08em; }
.paper-note, .paper-payment { margin-top: 6px; white-space: pre-wrap; }
.paper-document .company-footer-preview { font-size: .83em; }
#print-area { display: none; }
.paper-footer { border-top: 1px solid #c6d2c8; padding-top: 5px; }

@media (max-width: 1210px) {
  .shortcut small { display: none; }
}
@media (max-width: 920px) {
  .metrics, .shortcuts { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .results-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-split { grid-template-columns: minmax(0,1fr); }
  .offer-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .shortcut small { display: block; }
  .tool-layout { grid-template-columns: minmax(0,1fr); }
  .tool-aside { position: static; }
}
@media (max-width: 550px) {
  .page-heading { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
  .page-heading p { font-size: .9rem; }
  .page-heading > .btn { min-height: 42px; }
  .metric { padding: 10px; }
  .metric-top { gap: 6px; font-size: .82rem; }
  .metric-top .tile-icon { height: 31px; width: 31px; }
  .metrics, .shortcuts, .split { gap: 8px; }
  .shortcut { padding-inline: 7px; min-height: 57px; }
  .shortcut .tile-icon { width: 29px; height: 29px; }
  .shortcut .tile-icon svg { width: 17px; height: 17px; }
  .shortcut small { display: none; }
  .shortcut > svg { width: 12px; }
  .section-title > span { font-size: .75rem; }
  .table-wrap .wide-col { display: none; }
  table { font-size: .84rem; }
  thead th { font-size: .76rem; }
  td, thead th { padding-inline: 7px; }
  th:first-child, td:first-child { padding-left: 10px; }
  .row-more { min-width: 32px; }
  .badge { padding-inline: 6px; font-size: .73rem; }
  .toolbar { flex-wrap: wrap; padding: 10px; gap: 7px; }
  .toolbar .search { min-width: 100%; max-width: 100%; }
  .toolbar > select { width: 100%; }
  .settings-split, .offer-grid, .landing-hero, .landing-features, .offline-section { grid-template-columns: minmax(0,1fr); }
  .landing-header, .landing, .landing-footer { padding-inline: 13px; }
  .landing-header nav .text { display: none; }
  .landing-header .btn { font-size: .84rem; padding-inline: 8px; }
  .landing-hero img { min-height: 0; height: 225px; }
  .landing-section { margin-block: 25px; }
  .dialog-inner > header, .dialog-content { padding-inline: 12px; }
  .dialog-inner > header h2 { font-size: 1.22rem; }
  .period-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: 100%; }
  .tool-panel { padding: 11px; }
  .tool-title { flex-wrap: wrap; }
  .cost-head { grid-template-columns: minmax(0,1fr) 42px; }
  .cost-head > .field:first-child { grid-column: 1/-1; }
  .cost-buy, .cost-use { grid-template-columns: minmax(0,1fr); }
  .marketing-layout .form-grid { grid-template-columns: minmax(0,1fr); }
  .document-layout { grid-template-columns: minmax(0,1fr); }
  .paper-document { padding: 8px; font-size: .75rem; }
}
@media (max-width: 360px) {
  .section-title > span svg { display: none; }
  .sale-line { grid-template-columns: minmax(0,1fr) 63px 34px; gap: 5px; }
  .sale-line .icon-btn { min-width: 34px; }
  .metric-top .tile-icon { width: 26px; height: 26px; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { transition-duration: 0s !important; } }

@page pgm-invoice { size: A4; margin: 13mm; }
@page pgm-ticket { size: auto; margin: 3mm; }
@media print {
  body[data-printing] { background: #fff !important; margin: 0; }
  body[data-printing] > :not(#print-area) { display: none !important; }
  body[data-printing] > #print-area { display: block; }
  .paper-print { padding: 0; border-radius: 0; color: #000; font-size: 11pt; }
  .paper-print.paper-invoice { page: pgm-invoice; }
  .paper-print.paper-ticket { page: pgm-ticket; width: 72mm; max-width: 100%; margin: 0 auto; font-size: 9pt; }
  .paper-print .company-mark { display: none; }
  .paper-print .paper-header, .paper-print .paper-buyer, .paper-print .paper-totals, .paper-print tr { break-inside: avoid; }
  .paper-print thead { display: table-header-group; }
}
