/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: 0 1.1rem; border-radius: 6px; border: 1px solid transparent; font-weight: 700; text-decoration: none; cursor: pointer; background: var(--emerald-800); color: #fff; line-height: 1.1; }
.btn:hover { background: var(--emerald-700); color: #fff; }
.btn.gold { background: linear-gradient(#e1b342, #c99218); color: #1d1a0e; }
.btn.gold:hover { background: linear-gradient(#e8bf55, #d29c22); color: #1d1a0e; }
.btn.ghost { background: transparent; color: var(--emerald-800); border-color: var(--emerald-600); }
.btn.ghost:hover { background: var(--emerald-50); color: var(--emerald-800); }
.btn.danger { background: var(--danger); }
.btn.sm { min-height: 36px; padding: 0 .75rem; font-size: .875rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--emerald-700); text-decoration: underline; cursor: pointer; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
.field { margin-bottom: 1rem; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .8rem; display: block; }
input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], input[type="date"], select, textarea {
  width: 100%; min-height: 44px; padding: .55rem .75rem; border: 1px solid #aebbb5; border-radius: 6px; background: #fff; }
textarea { min-height: 110px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { box-shadow: var(--focus); outline: none; border-color: var(--emerald-600); }
.checks { display: grid; gap: .1rem; }
.check { display: flex; align-items: flex-start; gap: .55rem; font-weight: 400; padding: .3rem 0; min-height: 32px; margin: 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--emerald-700); flex: none; }
.check .n { margin-left: auto; color: var(--muted); font-size: .8rem; }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
legend { font-weight: 700; font-size: .9rem; padding: 0; margin-bottom: .25rem; }
.formgrid { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.errtext { color: var(--danger); font-size: .9rem; margin-top: .25rem; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 700; padding: .2rem .55rem; border-radius: 99px; background: var(--emerald-100); color: var(--emerald-800); white-space: nowrap; }
.badge.gold { background: var(--gold-100); color: var(--gold-700); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.plain { background: #eceeed; color: #38403d; }
.badge.demo { background: #2a2a2a; color: #fff; letter-spacing: .08em; }
.badges { display: flex; flex-wrap: wrap; gap: .35rem; }

/* ---------- alerts ---------- */
.alert { border-left: 4px solid var(--emerald-600); background: var(--emerald-50); padding: .75rem 1rem; border-radius: 4px; }
.alert.warn { border-color: var(--gold-500); background: var(--warn-bg); color: #3d2a00; }
.alert.danger { border-color: var(--danger); background: var(--danger-bg); color: #5c1313; }
.alert ul { margin: .25rem 0 0; padding-left: 1.2rem; }

/* ---------- cards & lists ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; }
.card.pad-lg { padding: 1.5rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.kv dt { font-weight: 700; color: var(--muted); font-size: .85rem; }
.kv dd { margin: 0; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: .5rem; } }

/* ---------- tables ---------- */
.tablewrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--emerald-50); font-size: .85rem; color: var(--emerald-800); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

/* ---------- tabs / pager ---------- */
.tabs { display: flex; gap: .35rem; flex-wrap: wrap; border-bottom: 2px solid var(--emerald-100); margin-bottom: 1.25rem; }
.tabs a { padding: .65rem 1rem; text-decoration: none; font-weight: 700; color: var(--emerald-800); border-bottom: 3px solid transparent; margin-bottom: -2px; min-height: 44px; }
.tabs a[aria-current="page"] { border-color: var(--gold-500); background: var(--emerald-50); }
.pager { display: flex; gap: .5rem; justify-content: center; align-items: center; margin: 1.5rem 0; flex-wrap: wrap; }

/* ---------- stepper ---------- */
.stepper { display: grid; grid-template-columns: repeat(5, 1fr); gap: .35rem; list-style: none; padding: 0; margin: 0 0 1rem; counter-reset: s; }
.stepper li { text-align: center; font-size: .78rem; font-weight: 700; padding: .5rem .25rem; border-radius: 6px; background: #eef1ef; color: #4b5753; counter-increment: s; }
.stepper li::before { content: counter(s); display: block; width: 24px; height: 24px; line-height: 24px; margin: 0 auto .2rem; border-radius: 50%; background: #cfd8d3; color: #26332f; font-size: .75rem; }
.stepper li.done { background: var(--ok-bg); color: var(--emerald-800); }
.stepper li.done::before { background: var(--emerald-600); color: #fff; }
.stepper li.current { background: var(--gold-100); color: var(--gold-700); outline: 2px solid var(--gold-500); }
.stepper li.current::before { background: var(--gold-500); color: #1d1a0e; }
.stepper li.bad { background: var(--danger-bg); color: var(--danger); }

/* ---------- misc ---------- */
.scorebar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--emerald-600), var(--gold-500)); }
.w10 { width: 10%; } .w20 { width: 20%; } .w30 { width: 30%; } .w40 { width: 40%; } .w50 { width: 50%; }
.w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; } .w90 { width: 90%; } .w100 { width: 100%; } .w0 { width: 0; }
.stat { text-align: center; padding: .85rem .5rem; }
.stat strong { display: block; font-family: var(--display); font-weight: 800; font-size: 1.8rem; color: var(--emerald-700); line-height: 1.1; }
.stat span { font-size: .85rem; color: var(--muted); }
.kpis { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.check-ok::before { content: "✓ "; color: var(--emerald-600); font-weight: 900; }
.check-no::before { content: "✗ "; color: var(--danger); font-weight: 900; }
.check-wait::before { content: "… "; color: var(--gold-700); font-weight: 900; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #142e26; color: #fff; padding: .7rem 1.1rem; border-radius: 6px; z-index: 300; max-width: calc(100vw - 32px); box-shadow: var(--shadow); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--emerald-100); border-top-color: var(--emerald-600); border-radius: 50%; animation: spin .8s linear infinite; margin: 3rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); background: #fff; }
.demoband { background: #2a2a2a; color: #fff; font-size: .85rem; text-align: center; padding: .4rem var(--gutter); }
.demoband strong { color: var(--gold-400); }
.mt { margin-top: .75rem; }
.mb0 { margin-bottom: 0; }

.icon { width: 1em; height: 1em; vertical-align: -.14em; flex: none; }
.lockrow { display: flex; align-items: center; gap: .6rem; padding: .6rem 0; border-top: 1px solid var(--line); color: var(--muted); }
.lockrow:first-child { border-top: 0; }
.lockrow strong { color: var(--ink); min-width: 9.5rem; }
.paywall { border: 1px solid var(--gold-500); background: linear-gradient(180deg, #fffaf0, var(--gold-100)); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.paywall h2 { border: 0; margin-bottom: .25rem; }
.scorebar { height: 8px; background: #e6ebe8; border-radius: 99px; overflow: hidden; }
