:root {
  --green: #4c9046;
  --bright: #63c55a;
  --ink: #163018;
  --paper: #f7faf4;
  --line: #dce7d8;
  --soft: #eef5ea;
  --warn: #fff1c7;
  --danger: #b93737;
  --shadow: 0 16px 45px rgba(27, 68, 28, .08);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.45 Inter, Arial, sans-serif; }
a { color: var(--green); text-decoration: none; }
.topbar { min-height: 72px; padding: 14px max(24px, calc((100vw - 1180px)/2)); display: flex; align-items: center; justify-content: space-between; gap: 24px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-size: 26px; font-weight: 900; letter-spacing: -1.5px; color: var(--ink); }
.brand span { color: var(--bright); }
.brand small { margin-left: 7px; font-size: 9px; letter-spacing: 2px; color: #6c806c; }
.brand.big { text-align: center; font-size: 42px; margin: 28px; }
nav { display: flex; align-items: center; gap: 22px; }
nav > a:not(.button) { color: #526252; font-weight: 650; }
.nav-logout { margin: 0; }
.nav-logout .link-button { color: #7a8978; font-weight: 700; }
.menu-toggle { display: none; width: 44px; height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; }
.menu-toggle span { display: block; height: 2px; margin: 5px 0; border-radius: 2px; background: var(--ink); transition: transform .2s ease, opacity .2s ease; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.container { width: min(1180px, calc(100% - 32px)); margin: 36px auto 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 0 0 24px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(30px, 4vw, 48px); line-height: 1.05; letter-spacing: -1.7px; }
h2 { font-size: 21px; letter-spacing: -.4px; }
.eyebrow { margin-bottom: 8px; color: var(--green); text-transform: uppercase; letter-spacing: 1.8px; font-size: 11px; font-weight: 800; }
.button { appearance: none; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border: 0; border-radius: 11px; background: var(--green); color: #fff; font: inherit; font-weight: 750; cursor: pointer; box-shadow: 0 7px 18px rgba(76,144,70,.18); }
.button.small { min-height: 38px; padding: 8px 14px; }
.button.secondary { background: var(--ink); }
.button.danger { background: var(--danger); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stats article { padding: 22px; background: var(--ink); color: white; border-radius: 16px; box-shadow: var(--shadow); }
.stats strong { display: block; font-size: 30px; line-height: 1; }
.stats span { display: block; color: #bdd0bc; margin-top: 8px; }
.card { padding: 24px; margin-bottom: 20px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.card.narrow { max-width: 760px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.grid.two { display: grid; grid-template-columns: 1.35fr .65fr; gap: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.request-layout { display: grid; gap: 20px; max-width: 980px; }
label { display: flex; flex-direction: column; gap: 6px; color: #4a5d4b; font-size: 13px; font-weight: 700; }
label.wide, .wide { grid-column: 1 / -1; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; background: #fbfdf9; border: 1px solid #cddac9; border-radius: 10px; color: var(--ink); font: inherit; outline: none; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--bright); box-shadow: 0 0 0 3px rgba(99,197,90,.13); }
label small, td small { display: block; color: #7a8978; font-weight: 400; }
.check { flex-direction: row; align-items: center; }
.check input { width: 18px; min-height: auto; accent-color: var(--green); }
fieldset { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
legend { padding: 0 7px; color: var(--ink); font-weight: 800; }
details > summary { cursor: pointer; color: var(--ink); font-size: 20px; }
.spaced { margin-top: 20px; }
.choice-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-height: 260px; padding: 10px; margin: 8px 0 12px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fbfdf9; }
.choice-list.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 180px; }
.choice-list .check { min-height: 34px; padding: 5px 7px; border-radius: 7px; font-weight: 600; }
.choice-list .check:hover { background: var(--soft); }
.option-search { min-height: 38px; margin-top: 4px; }
.file { padding: 16px; margin: 18px 0; border: 1px dashed #adc2aa; border-radius: 12px; }
.file input { border: 0; background: transparent; padding: 6px 0; }
.actions { display: flex; align-items: center; justify-content: flex-end; gap: 20px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 12px; border-bottom: 1px solid var(--line); color: #748273; text-align: left; text-transform: uppercase; font-size: 10px; letter-spacing: 1px; white-space: nowrap; }
td { padding: 14px 12px; border-bottom: 1px solid #edf1eb; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
.price { font-weight: 850; color: var(--green); }
.pill { display: inline-block; padding: 5px 9px; border-radius: 99px; background: var(--soft); color: #526252; font-size: 11px; font-weight: 750; white-space: nowrap; }
.pill.success { background: #dff5d9; color: #397034; }
.pill.warning { background: var(--warn); color: #805d00; }
.pill.danger-pill, .danger-pill { background: #f8dddd; color: #8f2929; }
.notice { padding: 13px 16px; margin-bottom: 18px; border-radius: 10px; background: #dff5d9; color: #397034; }
.notice.error { background: #f8dddd; color: #8f2929; }
.hint { margin-top: 14px; font-size: 13px; }
.link-button { padding: 0; border: 0; background: none; color: var(--green); cursor: pointer; }
.danger-link { display: block; margin-top: 7px; color: var(--danger); }
.muted-row { opacity: .48; }
.empty { padding: 52px 16px; text-align: center; color: #718071; }
.attempt { display: inline-block; margin: 2px 3px; padding: 3px 7px; background: #e6f4e2; border-radius: 7px; font-size: 10px; }
.attempt.bad { background: #f8dddd; color: #8f2929; }
.channel-status { display: block; margin-bottom: 4px; font-size: 11px; color: #526252; }
.preview-card { border-color: #a9cda4; }
.preview-result strong.preview-count { display: block; margin-bottom: 12px; color: var(--green); font-size: 34px; }
.preview-supplier { display: grid; grid-template-columns: 28px 1fr; align-items: start; gap: 8px; padding: 8px 0; border-bottom: 1px solid #edf1eb; }
.preview-supplier input { margin-top: 3px; }
.danger-zone { border-color: #edc8c8; }
.template-form { display: grid; gap: 18px; }
.template-card { margin-bottom: 0; }
.template-card textarea { font-family: ui-monospace, Consolas, monospace; line-height: 1.55; }
.variable-help { border-color: #b9d7b4; }
.variable-list { display: flex; flex-wrap: wrap; gap: 8px; }
.variable-list code { padding: 7px 9px; border-radius: 7px; background: var(--soft); font-size: 12px; }
.message-preview { margin-top: 14px; padding: 16px; white-space: pre-wrap; overflow-wrap: anywhere; border: 1px dashed #adc2aa; border-radius: 10px; background: #fbfdf9; color: #354936; }
.message-preview.static { margin: 0; font: inherit; line-height: 1.55; }
.template-panel { margin: 10px 0; border: 1px solid var(--line); border-radius: 12px; background: #fbfdf9; }
.template-panel > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; list-style: none; font-size: 15px; }
.template-panel > summary::-webkit-details-marker { display: none; }
.template-panel-body { padding: 0 16px 16px; }
.template-panel-body textarea { font-family: ui-monospace, Consolas, monospace; line-height: 1.55; }
.message-actions { margin-top: 18px; }
code { font-size: 11px; color: #445744; }
footer { padding: 30px; color: #859184; text-align: center; font-size: 12px; }
.public-page { background: linear-gradient(150deg, #f5faef, #e4f1df); min-height: 100vh; }
.public-wrap { width: min(700px, calc(100% - 28px)); margin: 0 auto 60px; }
.request-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 22px 0; }
.request-facts span { padding: 14px; border-radius: 11px; background: var(--soft); font-weight: 800; }
.request-facts small { display: block; color: #758474; font-weight: 500; }
.success-card { padding: 56px 30px; text-align: center; }
.success-icon { width: 70px; height: 70px; display: grid; place-items: center; margin: 0 auto 20px; border-radius: 50%; background: var(--bright); color: white; font-size: 36px; }
.disabled-fields { opacity: .35; }
.decline-form { display: flex; justify-content: center; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.connect-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px; }
.landing-page { min-height: 100vh; background: linear-gradient(145deg, #f8fbf5 0%, #e5f1df 100%); }
.landing-wrap { width: min(1080px, calc(100% - 32px)); margin: 0 auto; }
.landing-brand { display: inline-block; margin-top: 28px; }
.landing-hero { max-width: 760px; padding: clamp(70px, 14vh, 150px) 0 100px; }
.landing-hero h1 { max-width: 700px; font-size: clamp(44px, 8vw, 82px); }
.landing-hero > p:not(.eyebrow) { max-width: 650px; color: #526252; font-size: clamp(18px, 2.5vw, 23px); }
.landing-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.login-wrap { width: min(480px, calc(100% - 28px)); margin: 0 auto 60px; }
.login-card h1 { font-size: 36px; }
@media (max-width: 780px) {
  .topbar { min-height: 72px; padding: 12px 16px; align-items: center; }
  .brand { font-size: 23px; }
  .menu-toggle { display: block; margin-left: auto; }
  nav { display: none; position: absolute; top: calc(100% + 1px); left: 0; right: 0; padding: 12px 16px 18px; flex-direction: column; align-items: stretch; gap: 4px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 14px 30px rgba(27,68,28,.12); }
  nav.is-open { display: flex; }
  nav > a:not(.button) { display: block; padding: 12px 10px; border-radius: 9px; }
  nav > a:not(.button):hover { background: var(--soft); }
  nav .button { margin-top: 6px; }
  .nav-logout { padding: 10px; }
  .container { margin-top: 24px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid.two, .form-grid, .filter-grid, .choice-list, .choice-list.compact { grid-template-columns: 1fr; }
  .request-facts { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; flex-direction: column; }
}
