:root {
  --green-900: #0E5A48;
  --green-700: #1B7A63;
  --mint: #E6F2EE;
  --navy: #17385A;
  --ink: #1A2430;
  --muted: #4E5B66;
  --line: #D5E2DD;
  --bg: #F4F7F6;
  --danger: #B42318;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Figtree', 'Segoe UI', Arial, sans-serif; font-size: 15px; color: var(--ink); background: var(--bg); line-height: 1.45; }
h1, h2 { font-family: 'Outfit', 'Figtree', Arial, sans-serif; }
h1 { font-size: 26px; font-weight: 800; color: var(--green-900); margin: 0; }
h2 { font-size: 18px; font-weight: 600; margin: 0 0 14px; }
a { color: var(--green-900); }
code { background: var(--mint); padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.topbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 10px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-weight: 600; }
.topnav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.topnav > a:not(.btn) { text-decoration: none; font-weight: 500; }
.inline { display: inline; margin: 0; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 16px 120px; }
.page-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.head-actions { display: flex; gap: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 1px solid #B9CCC5; border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--green-700); color: var(--green-900); }
.btn-primary { background: var(--green-900); border-color: var(--green-900); color: #fff; }
.btn-primary:hover { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.linkbtn { background: none; border: 0; padding: 8px 0; font: inherit; color: var(--green-900); cursor: pointer; text-decoration: underline; }
.linkbtn.danger, .iconbtn.danger { color: var(--danger); }
.iconbtn { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 15px; cursor: pointer; color: var(--muted); }
.iconbtn:hover:not(:disabled) { border-color: var(--green-700); color: var(--green-900); }
.iconbtn:disabled { opacity: .35; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #7FC2AE; outline-offset: 2px; }

.alert { padding: 12px 16px; border-radius: 10px; background: #FFF6E5; border: 1px solid #F2D49B; }
.alert-ok { background: var(--mint); border-color: #B5D9CC; }
.alert-error { background: #FDECEA; border-color: #F3B8B2; }

.offer-form { max-width: 940px; margin: 0 auto; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; }
.muted, .hint, small { color: var(--muted); }
.hint { font-size: 13px; margin: -4px 0 12px; }
small { font-weight: 400; font-size: 12.5px; }

.offer-form label, .stack label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; margin-bottom: 14px; }
input, textarea, select { font: inherit; font-weight: 400; color: var(--ink); padding: 10px 12px; border: 1px solid #C3D3CD; border-radius: 9px; background: #fff; width: 100%; min-height: 44px; }
textarea { resize: vertical; line-height: 1.45; }
.input-lg { font-size: 18px; font-weight: 600; }
.grid-2, .grid-3, .grid-2-1 { display: grid; gap: 0 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); }
@media (max-width: 700px) { .grid-2, .grid-3, .grid-2-1 { grid-template-columns: 1fr; } }

.block-card { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 2px; margin: 0 0 12px; background: #F8FBFA; }
.block-card legend { padding: 0 8px; margin-left: -8px; font-family: 'Outfit', sans-serif; font-weight: 600; color: var(--green-900); }
.block-tools { position: absolute; top: -14px; right: 12px; display: flex; gap: 6px; }

.form-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 30%); }
.danger-zone { margin-top: 24px; text-align: right; }

.search { display: flex; gap: 8px; }
.search input { width: 280px; min-height: 36px; padding: 6px 10px; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.list { width: 100%; border-collapse: collapse; font-size: 14px; }
.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); }
.list td { padding: 12px 14px; border-bottom: 1px solid #E8EFEC; vertical-align: middle; }
.list tr:last-child td { border-bottom: 0; }
.list td a { font-weight: 600; text-decoration: none; }
.list .num { text-align: right; }
.list .nowrap { white-space: nowrap; }
.list .expired { color: var(--danger); }
.list .actions { white-space: nowrap; text-align: right; }
.list .actions .btn { margin-left: 4px; }
.empty { text-align: center; padding: 48px 16px; background: #fff; border: 1px dashed #B9CCC5; border-radius: 14px; }

.login-card { max-width: 380px; margin: 60px auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.login-card h1 { margin-bottom: 18px; }

.grid-contact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid-contact label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; margin-bottom: 14px; }
.row-actions { display: flex; align-items: center; gap: 16px; }
@media (max-width: 700px) { .grid-contact { grid-template-columns: 1fr; } }

.presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 8px; }
.subtitle-input { text-transform: uppercase; letter-spacing: 2px; font-weight: 600; font-size: 14px; margin-bottom: 16px; }
.themes { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.themes legend { font-weight: 600; font-size: 14px; margin-bottom: 8px; padding: 0; }
.offer-form .theme-opt { flex-direction: row; align-items: center; gap: 10px; margin: 0; padding: 10px 14px; min-height: 44px; border: 1px solid #C3D3CD; border-radius: 10px; cursor: pointer; }
.theme-opt input { width: auto; min-height: 0; accent-color: var(--green-900); }
.theme-opt:has(input:checked) { border-color: var(--green-900); box-shadow: 0 0 0 2px #B5D9CC; }
.swatches { display: inline-flex; }
.swatches i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; margin-left: -4px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.offer-form label[for="cover_subtitle"] { margin-bottom: 0; }
