@font-face { font-family: "Syne"; src: url("/assets/fonts/syne-400.ttf") format("truetype"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "Syne"; src: url("/assets/fonts/syne-600.ttf") format("truetype"); font-style: normal; font-weight: 600; font-display: swap; }
@font-face { font-family: "Syne"; src: url("/assets/fonts/syne-700.ttf") format("truetype"); font-style: normal; font-weight: 700; font-display: swap; }
@font-face { font-family: "Syne"; src: url("/assets/fonts/syne-800.ttf") format("truetype"); font-style: normal; font-weight: 800; font-display: swap; }

:root {
  --ink: #222222;
  --muted: #737373;
  --line: #e4e4e2;
  --surface: #ffffff;
  --canvas: #f4f4f2;
  --green: #e77747;
  --green-dark: #c85f34;
  --green-soft: #fbeae3;
  --lime: #e77747;
  --amber: #9a6410;
  --amber-soft: #fff4d7;
  --danger: #a33b38;
  --danger-soft: #fae7e5;
  --shadow: 0 18px 45px rgba(34, 34, 34, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); font: 15px/1.55 "Syne", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell { padding-left: 268px; }
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; width: 268px; display: flex; flex-direction: column; padding: 26px 20px 22px; color: var(--ink); background: #fff; border-right: 1px solid var(--line); }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px; }
.brand-logo { width: 48px; height: 45px; object-fit: contain; }
.brand span:last-child { display: grid; line-height: 1.15; }
.brand strong { letter-spacing: .01em; font-size: 15px; text-transform: uppercase; }
.brand small { margin-top: 4px; color: #8c8c8c; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.sidebar-nav { display: grid; gap: 7px; margin-top: 50px; }
.sidebar-nav a { display: flex; gap: 12px; align-items: center; padding: 12px 14px; color: #686868; border-radius: 8px; font-weight: 600; }
.sidebar-nav a span { width: 18px; color: #a0a0a0; font-size: 19px; text-align: center; }
.sidebar-nav a:hover { color: #111; background: #f3f3f1; }
.sidebar-nav a.active { color: #fff; background: #222; }
.sidebar-nav a.active span { color: var(--lime); }
.sidebar-footer { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.user-card { display: flex; gap: 10px; align-items: center; padding: 7px; }
.user-card > span:last-child { display: grid; min-width: 0; line-height: 1.25; }
.user-card strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.user-card small { margin-top: 3px; color: #929292; font-size: 11px; }
.avatar { display: grid; flex: 0 0 36px; place-items: center; height: 36px; color: #fff; background: #222; border-radius: 50%; font-weight: 800; }
.logout-button { width: 100%; margin-top: 8px; padding: 9px; color: #858585; background: transparent; border: 0; cursor: pointer; text-align: left; }
.logout-button:hover { color: #111; }

.main-content { min-height: 100vh; padding: 0 38px 60px; }
.topbar { display: flex; height: 78px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.eyebrow, .kicker { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.environment-pill { padding: 5px 9px; color: var(--green); background: var(--green-soft); border: 1px solid #c8ddd4; border-radius: 99px; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.menu-toggle { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding: 42px 0 28px; }
.page-head h1 { margin: 5px 0 3px; font: 700 34px/1.15 "Syne", sans-serif; letter-spacing: -.035em; }
.page-head p { margin: 0; color: var(--muted); }
.back-link { display: inline-block; margin-bottom: 8px; color: var(--green); font-size: 13px; font-weight: 700; }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 10px 17px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-weight: 700; transition: .16s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--green); box-shadow: 0 8px 22px rgba(231,119,71,.2); }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { color: var(--green-dark); background: #fff; border-color: #b9c9c2; }
.button-ghost { color: var(--muted); background: transparent; }
.button-wide { width: 100%; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.metric-card { position: relative; overflow: hidden; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 9px 30px rgba(34,34,34,.035); }
.metric-card::after { content: ""; position: absolute; right: -15px; bottom: -28px; width: 82px; height: 82px; background: var(--green-soft); border-radius: 50%; }
.metric-card span, .metric-card small { display: block; color: var(--muted); }
.metric-card strong { display: block; margin: 8px 0 2px; font: 700 35px/1 "Syne", sans-serif; }
.metric-card small { font-size: 12px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 23px 26px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font: 700 21px/1.25 "Syne", sans-serif; }
.panel-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.panel-head > a { color: var(--green); font-size: 13px; font-weight: 800; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 20px; color: #728079; background: #f7f8f6; border-bottom: 1px solid var(--line); font-size: 10px; letter-spacing: .09em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 16px 20px; border-bottom: 1px solid #edf0ee; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfa; }
td strong, td small { display: block; }
td small { max-width: 380px; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.address-cell { max-width: 370px; color: #4d5c55; font-size: 13px; }
.table-action { color: var(--green); font-size: 13px; font-weight: 800; }
.status { display: inline-flex; padding: 5px 9px; border-radius: 99px; color: #56635d; background: #edf0ee; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.status-active, .status-published { color: var(--green); background: var(--green-soft); }
.status-draft { color: var(--amber); background: var(--amber-soft); }
.status-inactive, .status-archived { color: #7a8280; background: #eceeed; }
.empty-state { display: grid; justify-items: center; padding: 58px 30px; color: var(--muted); text-align: center; }
.empty-state > span { color: #a9bbb3; font-size: 38px; }
.empty-state h3 { margin: 10px 0 2px; color: var(--ink); font: 700 20px/1.3 "Syne", sans-serif; }
.empty-state p { margin: 0 0 18px; }
.empty-inline { padding: 25px; color: var(--muted); text-align: center; }
.campaign-head { padding-bottom: 20px; }
.title-line { display: flex; align-items: center; gap: 12px; }
.campaign-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.summary-card { display: grid; padding: 19px 21px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.summary-card span, .summary-card small { color: var(--muted); font-size: 11px; }
.summary-card strong { margin: 5px 0 1px; font-size: 18px; }
.campaign-section { margin-bottom: 18px; }
.inline-values-form { display: grid; grid-template-columns: 132px 105px 78px 82px 128px auto; gap: 7px; align-items: end; }
.inline-values-form label { display: grid; gap: 3px; }
.inline-values-form small { color: var(--muted); font-size: 8px; font-weight: 700; white-space: nowrap; }
.inline-values-form input { height: 36px; }
.mini-button { height: 36px; padding: 0 10px; color: #fff; background: #222; border: 0; border-radius: 7px; cursor: pointer; font-size: 11px; font-weight: 700; }
.variable-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 22px 26px; }
.variable-list code { padding: 7px 9px; color: #943f1d; background: var(--green-soft); border-radius: 6px; font: 600 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }
.regulation-editor-panel { overflow: hidden; }
.regulation-editor-head { gap: 24px; }
.regulation-editor-head .kicker { display: block; margin-bottom: 5px; }
.regulation-editor-toolbar { position: sticky; z-index: 5; top: 0; display: flex; min-height: 48px; align-items: center; gap: 6px; padding: 8px 14px; background: #f6f6f4; border-bottom: 1px solid var(--line); }
.regulation-editor-toolbar button { min-width: 34px; height: 32px; padding: 0 10px; color: #444; background: #fff; border: 1px solid #d7d7d4; border-radius: 6px; cursor: pointer; font-size: 11px; }
.regulation-editor-toolbar button:hover { color: var(--green-dark); border-color: #e6a98e; }
.regulation-editor-toolbar > span:not(.editor-help) { width: 1px; height: 24px; margin: 0 3px; background: #dcdcd9; }
.editor-help { margin-left: auto; color: var(--muted); font-size: 10px; }
.regulation-editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; min-height: 820px; background: #ececea; }
.regulation-content-editor { overflow: auto; min-width: 0; height: 820px; margin: 24px; padding: 62px 68px 80px; color: #111; background: #fff; border: 1px solid #dadad6; outline: 0; box-shadow: 0 12px 35px rgba(0,0,0,.07); font: 14px/1.5 "Times New Roman", Times, serif; }
.regulation-content-editor:focus { border-color: #d88a69; box-shadow: 0 0 0 3px rgba(231,119,71,.12), 0 12px 35px rgba(0,0,0,.07); }
.regulation-content-editor .regulation-title { margin-bottom: 48px; text-align: center; }
.regulation-content-editor .regulation-number { color: #111; font-size: 12px; text-align: right; }
.regulation-content-editor .regulation-title > p:nth-child(2) { margin: 20px 0 12px; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.regulation-content-editor .regulation-title h1 { margin: 0; font: 700 25px/1.25 "Times New Roman", Times, serif; text-transform: uppercase; }
.regulation-content-editor .regulation-period { display: inline-block; padding-bottom: 5px; border-bottom: 3px solid var(--green); font-weight: 700; }
.regulation-content-editor .legal-section { margin: 34px 0; }
.regulation-content-editor h2 { margin: 0 0 15px; font: 700 16px/1.35 "Times New Roman", Times, serif; }
.regulation-content-editor h3 { margin: 24px 0 8px; font-size: 14px; }
.regulation-content-editor p { margin: 0 0 13px; text-align: justify; }
.regulation-content-editor .legal-list { margin: 8px 0 18px; padding-left: 23px; }
.regulation-content-editor .legal-list li { margin: 0 0 7px; }
.regulation-content-editor .template-variable { display: inline; padding: 1px 3px; color: #923d1c; background: #fde4d9; border-radius: 3px; box-shadow: 0 0 0 1px #f3b89f; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em; }
.regulation-content-editor .regulation-signature { margin-bottom: 2px; font-weight: 700; text-align: left; }
.regulation-content-editor .legal-clause { position: relative; padding-left: 47px; }
.regulation-content-editor .legal-clause-number { position: absolute; top: 0; left: 0; width: 42px; font-weight: 400; }
.regulation-content-editor h3.legal-clause .legal-clause-number { font-weight: 700; }
.regulation-content-editor .legal-primary-bullet, .regulation-content-editor .legal-bullet-paragraph { position: relative; padding-left: 30px; }
.regulation-content-editor .legal-primary-bullet::before, .regulation-content-editor .legal-bullet-paragraph::before { position: absolute; left: 11px; content: "•"; }
.regulation-content-editor .legal-primary-bullet { font-weight: 700; }
.regulation-content-editor .legal-alpha-list, .regulation-content-editor .legal-number-list { list-style: none; counter-reset: legal-list; }
.regulation-content-editor .legal-alpha-list > li, .regulation-content-editor .legal-number-list > li { position: relative; padding-left: 26px; counter-increment: legal-list; }
.regulation-content-editor .legal-alpha-list > li::before, .regulation-content-editor .legal-number-list > li::before { position: absolute; left: 0; }
.regulation-content-editor .legal-alpha-list > li::before { content: counter(legal-list, lower-alpha) ")"; }
.regulation-content-editor .legal-number-list > li::before { content: counter(legal-list) ")"; }
.regulation-variable-sidebar { overflow: auto; height: 820px; padding: 20px; background: #fff; border-left: 1px solid var(--line); }
.regulation-variable-sidebar h3 { margin: 0 0 4px; font-size: 14px; }
.regulation-variable-sidebar > p { margin: 0 0 16px; color: var(--muted); font-size: 11px; }
.campaign-variable-fields { display: grid; gap: 11px; margin-bottom: 28px; }
.campaign-variable-fields label { display: grid; gap: 4px; }
.campaign-variable-fields label > span { color: #4d4d4d; font-size: 11px; font-weight: 700; }
.campaign-variable-fields input { height: 36px; font-size: 12px; }
.campaign-variable-fields code { color: #a55230; font-size: 9px; }
.editor-variable-list { display: grid; gap: 5px; }
.editor-variable-list button { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 9px; color: #383838; background: #f7f7f5; border: 1px solid #e8e8e5; border-radius: 6px; cursor: pointer; text-align: left; }
.editor-variable-list button:hover { color: #923d1c; background: var(--green-soft); border-color: #f0bba5; }
.editor-variable-list button span { font-size: 10px; font-weight: 700; }
.editor-variable-list button small { color: #8b8b86; font-size: 8px; text-transform: uppercase; }
.regulation-editor-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 20px; border-top: 1px solid var(--line); }
.regulation-editor-actions > div { display: grid; }
.regulation-editor-actions small { color: var(--muted); font-size: 10px; }
.version-history { padding: 0 22px 18px; border-top: 1px solid var(--line); }
.version-history summary { padding: 15px 0 0; cursor: pointer; font-size: 11px; font-weight: 700; }
.version-history ul { display: grid; gap: 5px; margin: 12px 0 0; padding: 0; list-style: none; }
.version-history li { display: flex; justify-content: space-between; padding: 7px 9px; background: #f7f7f5; border-radius: 6px; font-size: 10px; }
.version-history li span { color: var(--muted); }

.filter-bar { display: flex; gap: 10px; margin-bottom: 14px; }
.filter-bar label { margin: 0; }
.filter-bar .search-field { flex: 1; }
.acknowledgement-filters select { min-width: 210px; }
input, select, textarea { width: 100%; color: var(--ink); background: #fff; border: 1px solid #cfd8d3; border-radius: 9px; outline: 0; transition: border .15s, box-shadow .15s; }
input, select { height: 43px; padding: 0 12px; }
textarea { padding: 11px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #5e9a82; box-shadow: 0 0 0 3px rgba(13,91,67,.1); }
.form-panel { max-width: 980px; }
.form-section { display: grid; grid-template-columns: 220px 1fr; gap: 30px; padding: 30px; border-bottom: 1px solid var(--line); }
.form-section-head { display: flex; gap: 12px; align-items: flex-start; }
.form-section-head > span { display: grid; flex: 0 0 31px; place-items: center; height: 31px; color: var(--green); background: var(--green-soft); border-radius: 8px; font-size: 11px; font-weight: 900; }
.form-section-head h2 { margin: 1px 0 4px; font: 700 18px/1.25 "Syne", sans-serif; }
.form-section-head p { margin: 0; color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid label, .login-form label { display: grid; gap: 7px; color: #425047; font-size: 12px; font-weight: 800; }
.form-grid label > span { color: var(--danger); }
.field-wide { grid-column: 1 / -1; }
.toggle-label { display: flex !important; align-items: center; align-self: end; min-height: 43px; }
.toggle-label input { width: 18px; height: 18px; }
.toggle-label span { color: var(--ink) !important; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 20px 30px; }

.flash-stack { position: fixed; z-index: 40; top: 18px; right: 24px; display: grid; gap: 8px; width: min(400px, calc(100vw - 40px)); }
.flash { padding: 13px 16px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 10px; box-shadow: var(--shadow); font-weight: 650; }
.flash-error { border-left-color: var(--danger); }

.guest-shell { background: #f2f1ed; }
.guest-content { min-height: 100vh; }
.login-wrap { display: grid; min-height: 100vh; grid-template-columns: minmax(360px, .9fr) minmax(480px, 1.1fr); }
.login-panel { padding: clamp(42px, 7vw, 100px); }
.login-copy { display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; color: #fff; background: #222; }
.login-brand { display: flex; gap: 13px; align-items: center; width: max-content; padding: 8px 13px 8px 9px; background: rgba(12,12,12,.62); border: 1px solid rgba(255,255,255,.18); border-radius: 12px; backdrop-filter: blur(8px); font-size: 18px; }
.login-brand img { width: 64px; height: 60px; object-fit: contain; filter: invert(1); }
.login-brand strong { text-transform: uppercase; letter-spacing: .05em; }
.login-visual { display: block; width: 100%; overflow: hidden; background: #000; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; }
.login-visual img { display: block; width: 100%; height: auto; }
.login-copy .kicker { color: #ff9a6f; }
.login-copy h1 { max-width: 620px; margin: 15px 0 18px; font: 700 clamp(38px, 4.3vw, 64px)/1.03 "Syne", sans-serif; letter-spacing: -.055em; text-wrap: balance; }
.login-copy p { max-width: 550px; margin-bottom: 0; color: #e7e5df; font-size: 17px; }
.login-copy small { color: #d2d0ca; text-shadow: 0 1px 4px #000; }
.login-form-panel { display: grid; place-items: center; background: #f2f1ed; }
.login-form { width: min(420px, 100%); padding: 38px; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.login-form h2 { margin: 5px 0 3px; font: 700 32px/1.2 "Syne", sans-serif; }
.login-form > p { margin: 0 0 28px; color: var(--muted); }
.login-form label { margin-bottom: 16px; }
.login-form .button { margin-top: 7px; }

.error-page { display: grid; min-height: 70vh; place-content: center; justify-items: center; padding: 50px; text-align: center; }
.error-page > span { color: #bcbcbc; font: 700 80px/1 "Syne", sans-serif; }
.error-page h1 { margin: 12px 0 0; font: 700 30px/1.2 "Syne", sans-serif; }
.campaign-link:hover strong { color: var(--green); }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 42px -38px -60px; padding: 24px 38px; color: #a9a9a9; background: #1f1f1f; font-size: 10px; letter-spacing: .04em; }
.site-footer strong { color: #fff; font-size: 10px; font-weight: 600; }
.error-page p { color: var(--muted); }
.sr-only { position: absolute; overflow: hidden; width: 1px; height: 1px; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 1080px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .form-section { grid-template-columns: 1fr; }
  .regulation-editor-layout { grid-template-columns: 1fr; }
  .regulation-variable-sidebar { height: auto; max-height: 620px; border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 760px) {
  .app-shell { padding-left: 0; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .menu-open .sidebar { transform: translateX(0); }
  .main-content { padding: 0 18px 40px; }
  .site-footer { margin: 35px -18px -40px; padding: 20px 18px; }
  .topbar { height: 64px; }
  .menu-toggle { display: inline-grid; place-items: center; width: 39px; height: 39px; background: #fff; border: 1px solid var(--line); border-radius: 9px; }
  .page-head { align-items: flex-start; flex-direction: column; padding-top: 30px; }
  .metric-grid { grid-template-columns: 1fr; }
  .campaign-summary-grid { grid-template-columns: 1fr; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .form-actions { align-items: stretch; flex-direction: column-reverse; }
  .regulation-editor-head { align-items: flex-start; flex-direction: column; }
  .regulation-editor-toolbar { overflow-x: auto; }
  .editor-help { display: none; }
  .regulation-content-editor { height: 680px; margin: 10px; padding: 36px 24px 50px; }
  .inline-values-form { grid-template-columns: 125px 96px 72px 78px 120px auto; }
  .regulation-editor-actions { align-items: stretch; flex-direction: column; }
  .login-wrap { grid-template-columns: 1fr; grid-template-rows: auto auto; }
  .login-copy { min-height: 0; gap: 18px; padding: 22px 20px 45px; }
  .login-brand { gap: 9px; padding: 5px 10px 5px 7px; font-size: 13px; }
  .login-brand img { width: 45px; height: 42px; }
  .login-visual { border-radius: 12px; }
  .login-copy h1 { margin: 8px 0 0; font-size: clamp(27px, 8vw, 35px); line-height: 1.04; }
  .login-copy p, .login-copy > small { display: none; }
  .login-form-panel { position: relative; z-index: 2; margin-top: -24px; padding: 20px 16px 32px; border-radius: 24px 24px 0 0; }
  .login-form { padding: 24px 22px; border-radius: 18px; box-shadow: 0 16px 42px rgba(34,34,34,.12); }
  .login-form h2 { font-size: 28px; }
  .login-form > p { margin-bottom: 22px; font-size: 13px; }
  .login-form input { height: 48px; }
  .login-form .button { min-height: 48px; }
}
