/* SandraCMS console — implements design/TOKENS.md.
   Deliberately its own stylesheet: the Studio implements the same language
   independently, because a shared one would couple two products (D23). */

:root {
  --brand: #246974; --brand-d: #1C535C;
  --lime: #C6F24E; --lime-on: #16240F;
  --ink: #1F2A2C; --muted: #6E7679;
  --paper: #f3f3f3; --surface: #ffffff; --surface-2: #F7F8F8;
  --line: #E4E5E6; --line-strong: #D4D6D7;
  --ok: #3B6D11; --ok-bg: #EAF3DE;
  --warn: #854F0B; --warn-bg: #FAEEDA;
  --danger: #A32D2D;
  --font: "Puritan", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--paper); line-height: 1.55; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.7rem; font-weight: 700; margin: 0 0 .2em; letter-spacing: -.01em; }
h2 { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 .5rem; }
h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 .3rem; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

/* ---------- shell ---------- */

.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 228px; flex: none; background: var(--brand); color: #B7D2D6;
  display: flex; flex-direction: column; padding: 18px 14px;
}
.sidebar__brand {
  display: flex; align-items: center; gap: 10px; color: #fff;
  font-weight: 700; font-size: 1.05rem; margin: 4px 6px 22px;
}
.sidebar__brand:hover { text-decoration: none; }
.sidebar__mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--lime); color: var(--lime-on);
  display: flex; align-items: center; justify-content: center; font-size: 1rem; flex: none;
}
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar__nav a { display: flex; align-items: center; gap: 10px; color: #B7D2D6; padding: 9px 11px; border-radius: 9px; font-size: .92rem; }
.sidebar__nav a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.sidebar__nav a.is-active { background: rgba(255,255,255,.13); color: #fff; }
.sidebar__foot { margin-top: auto; padding: 14px 6px 2px; border-top: 1px solid rgba(255,255,255,.12); font-size: .78rem; color: #8DB0B5; }
.sidebar__tagline { margin: 0 6px; font-size: .88rem; color: #8DB0B5; line-height: 1.5; }

.app__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.appbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--surface); border-bottom: 1px solid var(--line); padding: .7rem 1.5rem;
}
.appbar__title { font-weight: 700; }
.appbar__right { display: flex; align-items: center; gap: .9rem; font-size: .88rem; }
.appbar__avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: .74rem; font-weight: 700;
}
.appbar__email { color: var(--muted); }
main { padding: 1.6rem 1.5rem 4rem; max-width: 1080px; width: 100%; }

@media (max-width: 860px) {
  .sidebar { width: 100%; flex-direction: row; align-items: center; gap: 14px; padding: 10px 14px; overflow-x: auto; }
  .app { flex-direction: column; }
  .sidebar__brand { margin: 0; }
  .sidebar__nav { flex-direction: row; }
  .sidebar__foot { display: none; }
}

/* ---------- surfaces: flat boxes ---------- */

.panel { background: var(--surface); border: 1px solid var(--line); padding: 1.15rem 1.3rem; margin: 0 0 1.2rem; }
.panel > :last-child { margin-bottom: 0; }
.narrow { max-width: 430px; margin: 12vh auto 0; }
.lede { color: var(--muted); font-size: .92rem; margin: 0 0 1rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: .9rem; margin-top: 1rem; }
.card {
  display: block; background: var(--surface); border: 1px solid var(--line); padding: 1.05rem 1.1rem;
  color: var(--ink); transition: border-color .12s;
}
.card:hover { border-color: var(--brand); text-decoration: none; }
.card p { margin: .25rem 0; }

/* ---------- controls ---------- */

button, .btn-secondary, .btn-accent {
  font: inherit; cursor: pointer; border: 1px solid transparent; border-radius: 9px;
  padding: .55em .95em; font-weight: 500; display: inline-flex; align-items: center; gap: .4em;
  background: var(--brand); color: #fff; text-decoration: none;
}
button:hover { background: var(--brand-d); }
.btn-accent { background: var(--lime); color: var(--lime-on); border-color: var(--lime); }
.btn-accent:hover { filter: brightness(.96); }
button.link {
  background: none; border: 0; padding: 0; color: var(--danger);
  font-weight: 400; text-decoration: underline; border-radius: 0;
}
button.link:hover { background: none; filter: none; }
form.inline { display: inline; }
form.row { display: flex; gap: .6rem; align-items: center; margin: .7rem 0 1rem; }
form.row input[type=text] { flex: 1; margin: 0; }

label { display: block; margin: 0 0 .85rem; font-size: .9rem; font-weight: 500; }
input[type=text], input[type=email], input[type=password] {
  width: 100%; margin-top: .3rem; padding: .55em .7em; font: inherit;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 0; color: var(--ink);
}
fieldset { border: 1px solid var(--line); border-radius: 0; padding: .9rem 1rem; margin: 0 0 1rem; }
legend { color: var(--muted); font-size: .82rem; padding: 0 .4rem; }
label.check { display: flex; align-items: baseline; gap: .5rem; margin: 0 0 .45rem; font-weight: 400; }

/* ---------- data ---------- */

table { width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: .5rem; }
th {
  text-align: left; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); padding: .45rem .7rem .45rem 0; border-bottom: 1px solid var(--line-strong);
}
td { padding: .6rem .7rem .6rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.dim { opacity: .5; }
.page { margin-bottom: 1.4rem; }

.badge, .pill {
  display: inline-block; padding: .12em .6em; border-radius: 99px; font-size: .74rem;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); margin-right: .25rem;
}
.pill.ok, .badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }

.notice { padding: .8rem 1.1rem; border: 1px solid var(--line); background: var(--surface); margin: 0 0 1.2rem; }
.notice.ok { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.notice.error { border-color: var(--danger); color: var(--danger); background: #FBF1F0; }
.key { word-break: break-all; background: var(--surface); border: 1px solid var(--line); padding: .6rem .7rem; margin: .5rem 0 0; }

.mono, code { font-family: var(--mono); font-size: .84rem; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }

pre.config {
  background: var(--surface-2); border: 1px solid var(--line); padding: .9rem 1rem;
  overflow-x: auto; font-family: var(--mono); font-size: .8rem; line-height: 1.55; margin: 0;
}

.caps { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.caps li { display: flex; align-items: center; gap: .6rem; font-size: .9rem; }
.dot { width: 8px; height: 8px; border-radius: 99px; background: var(--line-strong); flex: none; }
.dot.on { background: var(--ok); }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: .7rem; margin-top: .6rem; }
.media { margin: 0; background: var(--surface-2); border: 1px solid var(--line); }
.media img { display: block; width: 100%; height: 92px; object-fit: cover; background: var(--line); }
.media figcaption { padding: .45rem .5rem; display: grid; gap: .1rem; }

.preview-link { font-size: .78rem; font-weight: 400; margin-left: .5rem; }

/* ---------- The theme picker (P17) ----------
   Each candidate states what a switch would cost before you make it (D34), so
   the report is part of the option rather than a separate screen. */
.theme-option { padding: 1rem 0; border-top: 1px solid var(--line); }
.theme-option:first-of-type { border-top: 0; }
.theme-option h3 { margin: 0 0 .2rem; font-size: 1.05rem; }
.theme-option p { margin: 0 0 .6rem; }
.theme-option details { margin: 0 0 .8rem; }
.theme-option summary { cursor: pointer; font-size: .9rem; }
.theme-option table { margin-top: .5rem; }

.warn { color: #8a5a00; }
.panel-sub { margin: 1.6rem 0 .4rem; font-size: 1rem; }
