/* The Solutions Alliance: "Edit site" panel. Same tokens as the public page, quieter. */
:root {
  --spruce: #12403c;
  --spruce-deep: #0c2e2b;
  --spruce-soft: #e3ece8;
  --ink: #1c2726;
  --sage: #5d726d;
  --paper: #f5f7f4;
  --card: #ffffff;
  --mist: #d9e3de;
  --brass: #b5813a;
  --brass-light: #d9ae6a;
  --brass-text: #85591d;
  --error: #a3362a;
  --ok: #1f6b4f;
  --display: 'Bricolage Grotesque', 'Avenir Next', system-ui, sans-serif;
  --body: 'Schibsted Grotesk', 'Helvetica Neue', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
h1, h2 { font-family: var(--display); font-weight: 650; letter-spacing: -0.02em; color: var(--spruce); margin: 0; line-height: 1.1; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
small { color: var(--sage); font-weight: 400; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1.5px solid var(--spruce); background: var(--spruce); color: #fff;
  font: 600 15px/1 var(--body); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--spruce-deep); border-color: var(--spruce-deep); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-ghost { background: transparent; color: var(--spruce); }
.btn-ghost:hover { background: var(--spruce-soft); color: var(--spruce-deep); }
.btn-danger-ghost { background: transparent; color: var(--error); border-color: #e3c2bd; }
.btn-danger-ghost:hover { background: #fbeeec; border-color: var(--error); }
.btn-danger { background: var(--error); border-color: var(--error); color: #fff; }
.btn-danger:hover { background: #862b21; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--mist); background: var(--card); color: var(--spruce); display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--spruce-soft); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn[disabled] { opacity: .35; cursor: default; background: var(--card); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-weight: 600; font-size: 14px; }
.field input, .field textarea, .field select, .login input {
  font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--mist); border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%;
}
.field textarea { resize: vertical; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus, .login input:focus { outline: none; border-color: var(--spruce); box-shadow: 0 0 0 3px rgba(18, 64, 60, .15); }
.field-wide { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--spruce); }
.msg { margin: 0; min-height: 1.3em; font-size: 14px; }
.msg.err { color: var(--error); }
.msg.ok { color: var(--ok); }

/* ---------- Sign in ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 50% 0%, var(--spruce-soft), var(--paper) 60%); }
.login-card { width: min(400px, 100%); background: var(--card); border: 1px solid var(--mist); border-radius: 18px; padding: 32px 28px; display: flex; flex-direction: column; gap: 10px; }
.login-mark { width: 48px; height: 48px; margin-bottom: 6px; }
.login-card h1 { font-size: 30px; }
.login-card > p:not(.msg) { margin: 0 0 10px; color: var(--sage); }
.login-card label { font-weight: 600; font-size: 14px; }
.login-card .btn { margin-top: 4px; }
.back { text-align: center; color: var(--sage); font-size: 14px; margin-top: 6px; }

/* ---------- Shell ---------- */
.bar { position: sticky; top: 0; z-index: 10; background: var(--card); border-bottom: 1px solid var(--mist); }
.bar-inner, .tabs, .panels { max-width: 1040px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.bar-title { margin: 0; font-size: 15px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.bar-title strong { font: 650 18px/1.2 var(--display); color: var(--spruce); }
.bar-title span { font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--brass-text); }
.bar-actions { display: flex; gap: 6px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs button {
  font: 600 15px/1 var(--body); color: var(--sage); background: none; border: 0; border-bottom: 3px solid transparent;
  padding: 14px 14px 12px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px;
}
.tabs button:hover { color: var(--spruce); }
.tabs button[aria-selected='true'] { color: var(--spruce); border-bottom-color: var(--brass); }
.badge { background: var(--brass); color: #fff; font: 600 12px/1 var(--body); border-radius: 999px; padding: 4px 7px; }

.panels { padding-top: 28px; padding-bottom: 80px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.panel-head h2 { font-size: 28px; margin-bottom: 6px; }
.panel-head p { margin: 0; color: var(--sage); max-width: 46em; }
.head-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }

/* ---------- Rows ---------- */
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--mist); border-radius: 14px; padding: 10px 12px; }
.row.hidden-member { background: transparent; border-style: dashed; }
.row.hidden-member .row-main { opacity: .6; }
.thumb { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; flex: none; background: var(--spruce); display: grid; place-items: center; color: #fff; font: 600 17px/1 var(--display); }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.row-main { flex: 1; min-width: 0; }
.row-name { font-weight: 600; margin: 0; }
.row-sub { margin: 2px 0 0; color: var(--sage); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; border-radius: 999px; padding: 5px 8px; background: var(--spruce-soft); color: var(--spruce); white-space: nowrap; }
.pill.warn { background: #fbf1df; color: #7a531c; }
.pill.ok { background: #e2f1ea; color: var(--ok); }
.row-tools { display: flex; align-items: center; gap: 6px; }
.empty { color: var(--sage); padding: 24px; text-align: center; border: 1px dashed var(--mist); border-radius: 14px; }
@media (max-width: 600px) {
  .row { flex-wrap: wrap; }
  .row-main { flex: 1 1 calc(100% - 70px); }
  .row-tools { margin-left: auto; }
  .bar-title { flex-direction: column; gap: 2px; }
}

/* ---------- Site text ---------- */
.text-form { display: flex; flex-direction: column; gap: 22px; }
.text-group { background: var(--card); border: 1px solid var(--mist); border-radius: 16px; padding: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.text-group h3 { grid-column: 1 / -1; margin: 0; font: 500 12px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--brass-text); }
.save-bar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 14px 0; background: linear-gradient(transparent, var(--paper) 30%); }
@media (max-width: 640px) { .text-group { grid-template-columns: 1fr; } }

/* ---------- Requests ---------- */
.req { background: var(--card); border: 1px solid var(--mist); border-radius: 14px; padding: 16px 18px; display: grid; grid-template-columns: 1fr auto; gap: 8px 18px; margin-bottom: 10px; }
.req.is-new { background: #fffaf1; border-color: #ecd9b6; }
.req h3 { margin: 0; font: 650 19px/1.2 var(--display); color: var(--spruce); }
.req-meta { color: var(--sage); font-size: 14px; margin: 2px 0 0; }
.req-contact { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 6px 0 0; font-size: 15px; }
.req-contact a { color: var(--spruce); font-weight: 500; }
.req-note { grid-column: 1 / -1; margin: 4px 0 0; padding: 10px 12px; background: var(--paper); border-radius: 10px; white-space: pre-wrap; font-size: 15px; }
.req-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.req-tools select { font: inherit; font-size: 14px; border: 1.5px solid var(--mist); border-radius: 999px; padding: 6px 12px; min-height: 36px; background: #fff; }
@media (max-width: 600px) { .req { grid-template-columns: 1fr; } .req-tools { flex-direction: row; align-items: center; justify-content: space-between; } }

/* ---------- Notifications ---------- */
.inline-form { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 12px; align-items: end; margin: 18px 0 8px; background: var(--card); border: 1px solid var(--mist); border-radius: 14px; padding: 16px; }
@media (max-width: 640px) { .inline-form { grid-template-columns: 1fr; } }
.test-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 18px; }

/* ---------- Password ---------- */
.stack-form { max-width: 420px; display: flex; flex-direction: column; gap: 16px; background: var(--card); border: 1px solid var(--mist); border-radius: 16px; padding: 20px; }
.stack-form .btn { align-self: flex-start; }

/* ---------- Member editor ---------- */
.editor { border: 0; padding: 0; width: min(760px, 100%); max-width: 100%; max-height: min(92vh, 100%); border-radius: 18px; background: var(--card); color: var(--ink); box-shadow: 0 30px 80px -30px rgba(12, 46, 43, .6); }
.editor::backdrop { background: rgba(12, 46, 43, .45); }
.editor-form { display: flex; flex-direction: column; max-height: min(92vh, 100%); }
.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--mist); }
.editor-head h2 { font-size: 24px; }
.editor-body { padding: 20px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; }
.editor-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--mist); }
.editor-foot .msg { flex: 1; min-width: 160px; }
.danger { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.danger span { font-size: 14px; font-weight: 600; color: var(--error); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) {
  .grid2 { grid-template-columns: 1fr; }
  .editor { max-height: 100%; height: 100%; border-radius: 0; }
  .editor-form { max-height: 100%; height: 100%; }
}
.photo-edit { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.photo-preview { width: 104px; height: 104px; border-radius: 50%; overflow: hidden; background: var(--spruce); border: 3px solid var(--brass-light); display: grid; place-items: center; color: #fff; font: 600 32px/1 var(--display); flex: none; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.photo-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.photo-tools small { flex-basis: 100%; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 3px solid var(--brass); outline-offset: 2px; }
.links { border: 1px solid var(--mist); border-radius: 14px; padding: 14px 16px 16px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.links legend { font-weight: 600; font-size: 14px; padding: 0 6px; }
.link-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 8px; align-items: center; }
.link-row input { font: inherit; border: 1.5px solid var(--mist); border-radius: 10px; padding: 8px 10px; min-height: 40px; min-width: 0; }
.links .btn { align-self: flex-start; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--spruce-deep); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--error); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
