/* ==========================================================================
   REACHIFY — legacy class bridge
   Maps the class names used by the pre-existing dashboard/public templates
   onto the REACHIFY design tokens, so every screen carries the brand without
   each template having to be rewritten.
   New work should use the .rf-* components in reachify.css instead.
   ========================================================================== */

:root {
  /* Old aliases, re-pointed at REACHIFY tokens.
     (--nav-h moved to reachify.css: pages on the app shell never load this
     file, and were resolving it to nothing.) */
  --app-bg:     var(--reachify-app-bg);
  --app-card:   var(--reachify-surface);
  --app-border: var(--reachify-border);
  --app-text:   var(--reachify-text);
  --app-muted:  var(--reachify-muted);
  --app-blue:   var(--reachify-blue);
}

/* ── Top navigation ───────────────────────────────────────────────────────
   Deliberately empty. The bar is defined once, in reachify.css, and rendered
   once, by base_shell.html — the `.topnav` / `.nav-links` markup this bridge
   used to style no longer exists in any template.
   ------------------------------------------------------------------------ */

/* ── Layout ─────────────────────────────────────────────────────────────── */
.page-wrapper {
  display: flex;
  min-height: calc(100vh - var(--nav-h));
  max-width: var(--reachify-shell-max);
  margin: 0 auto;
  background: var(--reachify-app-bg);
}
.main-content {
  flex: 1; padding: 1.5rem; min-width: 0;
  padding-bottom: calc(var(--reachify-bottomnav-h) + 24px);
}
.container {
  max-width: var(--reachify-shell-max); margin: 0 auto; padding: 1.5rem;
  padding-bottom: calc(var(--reachify-bottomnav-h) + 24px);
}

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  width: 232px; flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--reachify-border);
  padding: 1rem 0;
}
.sidebar a {
  display: block; padding: .6rem 1.25rem;
  color: #35597f; font-size: .875rem; font-weight: 600;
  border-left: 3px solid transparent;
}
.sidebar a:hover, .sidebar a.active {
  color: var(--reachify-blue);
  background: var(--reachify-tint);
  border-left-color: var(--reachify-blue);
}
.sidebar .section-label {
  padding: .5rem 1.25rem; font-size: .68rem; font-weight: 800;
  text-transform: uppercase; color: var(--reachify-muted);
  letter-spacing: .08em; margin-top: .75rem;
}
.sidebar .badge {
  background: var(--reachify-danger); color: #fff;
  border-radius: var(--reachify-radius-pill);
  font-size: .68rem; font-weight: 800; padding: .12rem .45rem; margin-left: .4rem;
}
/* A platform-admin queue with work in it. The count already says how much;
   this is so the eye finds it without reading every row. */
.sidebar a.has-work { color: var(--reachify-text); }
.sidebar a.has-work::before {
  content: ''; display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--reachify-danger);
  margin-right: .5rem; vertical-align: middle;
}
/* The dashboard sidebar header was written for a dark theme. */
.sidebar > div[style*="border-bottom"] { border-bottom-color: var(--reachify-border) !important; }
.sidebar > div[style*="border-bottom"] > div:first-child { color: var(--reachify-text) !important; }
.sidebar > div[style*="border-bottom"] > div:last-child { color: var(--reachify-muted) !important; }

/* ── Cards & grids ──────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--reachify-border);
  border-radius: var(--reachify-radius);
  padding: 1.25rem; margin-bottom: 1rem;
  box-shadow: var(--reachify-shadow-sm);
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }
.muted { color: var(--reachify-muted); font-size: .9rem; }

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge-status, .badge-verified, .badge-pending, .badge-suspended, .badge-vertical {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: var(--reachify-radius-pill);
  padding: 4px 10px; font-size: .72rem; font-weight: 800;
}
.badge-verified  { background: var(--reachify-success-bg); color: var(--reachify-success-ink); }
.badge-pending   { background: var(--reachify-warning-bg); color: var(--reachify-warning-ink); }
.badge-suspended { background: var(--reachify-danger-bg);  color: var(--reachify-danger-ink); }
.badge-vertical  { background: var(--reachify-info-bg);    color: var(--reachify-info-ink); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .6rem 1.15rem;
  border-radius: var(--reachify-radius-pill);
  font-size: .9rem; font-weight: 800;
  cursor: pointer; border: none; font-family: inherit;
  min-height: var(--reachify-tap);
}
.btn-primary { background: var(--reachify-grad-cta); color: #fff; box-shadow: 0 6px 16px rgba(0, 111, 214, .25); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-sm { padding: .35rem .8rem; font-size: .8rem; min-height: 34px; }
.btn-danger { background: var(--reachify-danger); color: #fff; }
.btn-outline { background: #fff; border: 1px solid var(--reachify-border); color: var(--reachify-text); }
.btn-outline:hover { background: var(--reachify-sky); }

/* ── Forms ──────────────────────────────────────────────────────────────── */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
select, textarea {
  border: 1px solid var(--reachify-border);
  border-radius: var(--reachify-radius-sm);
  padding: 11px 13px; background: #fff;
  color: var(--reachify-text); outline: none; font-family: inherit;
  max-width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--reachify-blue);
  box-shadow: 0 0 0 3px rgba(8, 124, 245, .15);
}
button[type="submit"]:not(.btn):not([class*="rf-"]) {
  background: var(--reachify-grad-cta); color: #fff;
  border: 0; border-radius: var(--reachify-radius-pill);
  padding: .7rem 1.3rem; font-weight: 800; font-family: inherit;
  cursor: pointer; min-height: var(--reachify-tap);
}
label { font-weight: 700; font-size: .88rem; }

/* ── Tables ─────────────────────────────────────────────────────────────── */
table { border-collapse: collapse; width: 100%; }
th {
  text-align: left; font-size: .74rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--reachify-muted);
  padding: .65rem .75rem; border-bottom: 2px solid var(--reachify-border);
}
td { padding: .7rem .75rem; border-bottom: 1px solid var(--reachify-hairline); font-size: .9rem; }
tbody tr:hover { background: var(--reachify-app-bg); }

/* ── Django messages ────────────────────────────────────────────────────── */
.messages { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.messages li {
  background: var(--reachify-success-bg); color: var(--reachify-success-ink);
  border-radius: var(--reachify-radius-sm); padding: .75rem 1rem; font-weight: 700;
}
.messages li.error { background: var(--reachify-danger-bg); color: var(--reachify-danger-ink); }

/* ── Headings & links ───────────────────────────────────────────────────── */
h1, h2, h3, h4 { color: var(--reachify-text); }
a { color: inherit; }
.main-content a:not(.btn):not(.badge-vertical):not([class*="rf-"]),
.container a:not(.btn):not(.badge-vertical):not([class*="rf-"]) { color: var(--reachify-blue); }

/* ── Glass utilities (kept for templates that use them) ─────────────────── */
.glass, .glass-sm, .glass-form {
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--reachify-radius);
  backdrop-filter: blur(12px);
}
.glass-muted { color: rgba(255, 255, 255, .72) !important; }
.glass-label { color: rgba(255, 255, 255, .85) !important; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .main-content, .container { padding: 1rem; padding-bottom: calc(var(--reachify-bottomnav-h) + 20px); }
}
