/* The Well app console. Colors follow the prototype and the app. */
:root {
  --navy: #0F3C66;
  --blue: #1673B5;
  --blue-soft: #E3F1FB;
  --ground: #F3F7FA;
  --card: #FFFFFF;
  --ink: #10212F;
  --muted: #4A5D6E;
  --line: #CBD7E1;
  --line-soft: #EEF3F7;
  --green-bg: #DDF3E6; --green: #1D6B3F;
  --gray-bg: #EEF1F4;
  --amber-bg: #FCEFD7; --amber: #7A4A00;
  --red: #B42318; --red-bg: #FDECEA;
  --radius: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 15px/1.5 Figtree, system-ui, -apple-system, "Segoe UI", sans-serif;
}
h1 { margin: 0; font-size: 28px; font-weight: 800; line-height: 1.2; }
h2 { margin: 0 0 12px; font-size: 18px; font-weight: 800; }
p { margin: 0; }
a { color: var(--blue); }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; }
.loading { padding: 40px; color: var(--muted); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 10; }
:focus-visible { outline: 3px solid #5AA9E6; outline-offset: 2px; }

/* Layout */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.sidebar {
  flex: 1 1 240px; max-width: 100%; background: var(--navy); color: #fff;
  padding: 24px 16px; display: flex; flex-direction: column; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand img { width: 38px; height: 38px; border-radius: 9px; }
.brand div { display: flex; flex-direction: column; line-height: 1.25; }
.brand span { font-size: 12px; color: #A9CBE6; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px;
  padding: 0 12px; border-radius: 10px; color: #E3F1FB; font-weight: 700; font-size: 14px; text-decoration: none;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.08); }
.nav-item[aria-current="page"] { background: #fff; color: var(--navy); }
.nav-item.soon { color: #8FB3D1; font-weight: 600; cursor: default; }
.nav-item.soon:hover { background: none; }
.nav-item small { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; }
.who {
  margin-top: auto; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.08);
  font-size: 13px; color: #CFE6F7; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere;
}
.who strong { color: #fff; }
.link-btn { background: none; border: 0; padding: 4px 0 0; color: #fff; text-decoration: underline; font: inherit; cursor: pointer; text-align: left; }
.content {
  flex: 999 1 560px; min-width: 0; padding: 32px 40px 56px;
  display: flex; flex-direction: column; gap: 20px; max-width: 1180px; outline: none;
}
@media (max-width: 700px) {
  .content { padding: 20px 16px 40px; }
  .sidebar { padding: 16px; gap: 12px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-item.soon { display: none; }
  .who { margin-top: 0; }
}

.page-header { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; }
.page-header p { margin-top: 4px; max-width: 640px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.card { background: var(--card); border-radius: var(--radius); padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.card.flush { padding: 0; overflow: hidden; }
.card > h2 { margin: 0; }
.notice { background: var(--blue-soft); color: var(--navy); padding: 12px 16px; border-radius: 12px; }
.notice.error { background: var(--red-bg); color: var(--red); }
.empty { padding: 28px 24px; color: var(--muted); }

.row { display: flex; gap: 10px; align-items: center; }
.row.tight { gap: 4px; }
.row.wrap { flex-wrap: wrap; }
.row.bottom { align-items: flex-end; }
.row.end { justify-content: flex-end; flex-wrap: wrap; }
.row.two > * { flex: 1 1 0; min-width: 0; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
ul.plain { margin: 0; padding-left: 20px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }

/* Controls */
.btn {
  min-height: 44px; padding: 0 18px; border-radius: 22px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--blue); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 800; }
.btn.primary:hover { background: #125f96; }
.btn.quiet { border-color: transparent; background: transparent; color: var(--blue); padding: 0 10px; min-height: 36px; }
.btn.quiet:hover { background: var(--blue-soft); }
.btn.danger { color: var(--red); border-color: #F1B8B2; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: wait; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field[hidden] { display: none; }
.field-label { font-size: 13px; font-weight: 700; color: var(--muted); }
input, select {
  font: inherit; color: var(--ink); min-height: 44px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; width: 100%; min-width: 0;
}
input:disabled { background: var(--ground); color: var(--muted); }
input.invalid { border-color: var(--red); background: var(--red-bg); }

/* Images & links */
.art-row { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.art-preview { width: 160px; height: 160px; border-radius: 18px; object-fit: cover; background: var(--ground); flex: none; }
.art-row .stack { flex: 1 1 280px; }
.link-row {
  display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 6px 0; border-top: 1px solid var(--line-soft);
}
@media (max-width: 700px) {
  .link-row { grid-template-columns: 1fr; gap: 6px; }
}

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px; padding: 14px 12px; font-weight: 700; }
td { padding: 12px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 20px; }
td.num { font-variant-numeric: tabular-nums; }
.thumb { width: 96px; height: 32px; object-fit: cover; border-radius: 6px; display: block; background: var(--ground); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.live { background: var(--green-bg); color: var(--green); }
.pill.scheduled { background: var(--blue-soft); color: var(--navy); }
.pill.paused { background: var(--amber-bg); color: var(--amber); }
.pill.ended { background: var(--gray-bg); color: var(--muted); }

/* Dialogs */
.modal { border: 0; border-radius: 20px; padding: 0; width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
.modal::backdrop { background: rgba(16, 33, 47, 0.45); }
.editor { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; }
@media (max-width: 760px) { .editor-grid { grid-template-columns: 1fr; } }

.phone-preview { background: #F6F8FB; border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.banner-preview { position: relative; aspect-ratio: 3 / 1; border-radius: 12px; overflow: hidden; background: var(--line-soft); }
.banner-preview img { width: 100%; height: 100%; object-fit: cover; display: none; }
.banner-preview .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.phone-preview.has-image img { display: block; }
.phone-preview.has-image .placeholder { display: none; }
.banner-label { font-size: 12px; color: var(--muted); min-height: 18px; }

/* Sign-in */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.signin-card { background: #fff; border-radius: 20px; padding: 32px; width: min(420px, 100%); display: flex; flex-direction: column; gap: 14px; }
.signin-logo { width: 56px; height: 56px; border-radius: 12px; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: min(560px, calc(100vw - 32px));
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; z-index: 20;
  box-shadow: 0 8px 24px rgba(16, 33, 47, 0.25);
}
#toast[data-kind="error"] { background: var(--red); }

/* Home cards preview (matches the app's card) */
.card-preview { background: #fff; border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card-preview-top { display: flex; gap: 12px; align-items: flex-start; }
.card-preview-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.card-preview-label { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: #0F5A92; }
.card-preview-title { font-size: 16px; line-height: 1.2; }
.card-preview-body { font-size: 13px; line-height: 1.4; color: var(--muted); }
.card-preview-top img { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; flex: none; }
.card-preview-actions { display: flex; gap: 6px; align-items: center; }
.card-preview-button { height: 36px; padding: 0 16px; border-radius: 18px; background: #1673B5; color: #fff; font-weight: 800; font-size: 14px; display: inline-flex; align-items: center; }
.card-preview-dismiss { height: 36px; padding: 0 10px; color: var(--muted); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; }
.card-preview-under { height: 70px; border-radius: 14px; background: var(--navy); color: #CFE6F7; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
[hidden] { display: none !important; }
