/* Reneural Portal Theme
 * Brand: Teal #36AB9C, Dark Teal #105049, Gold #DFB929
 * Inspired by the Zeta admin template, rebuilt clean for Reneural.
 */

:root {
  --rn-primary: #36AB9C;
  --rn-primary-600: #2a8d80;
  --rn-primary-700: #1f6b62;
  --rn-primary-50: #E0F2F1;
  --rn-primary-100: #c8e8e5;
  --rn-secondary: #105049;
  --rn-accent: #DFB929;
  --rn-accent-600: #c4a01d;

  --rn-bg: #f4f7f9;
  --rn-surface: #ffffff;
  --rn-surface-2: #f8fafb;
  --rn-border: #e5ebef;
  --rn-text: #1d2733;
  --rn-text-muted: #4a5563;
  --rn-text-subtle: #6b7785;

  --rn-success: #2e9b6e;
  --rn-warning: #e09422;
  --rn-danger: #d04545;
  --rn-info: #2b8fc3;

  --rn-sidebar-w: 260px;
  --rn-sidebar-collapsed-w: 76px;
  --rn-topbar-h: 64px;
  --rn-radius: 12px;
  --rn-radius-sm: 8px;
  --rn-shadow-sm: 0 1px 2px rgba(16, 80, 73, .04), 0 1px 3px rgba(16, 80, 73, .06);
  --rn-shadow-md: 0 2px 6px rgba(16, 80, 73, .06), 0 6px 18px rgba(16, 80, 73, .08);
  --rn-shadow-lg: 0 10px 30px rgba(16, 80, 73, .12);
  --rn-transition: 180ms cubic-bezier(.4,0,.2,1);
}

/* ---------- Bootstrap overrides ---------- */
.btn-primary { background: var(--rn-primary); border-color: var(--rn-primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--rn-primary-600); border-color: var(--rn-primary-600); }
.btn-outline-primary { color: var(--rn-primary); border-color: var(--rn-primary); }
.btn-outline-primary:hover { background: var(--rn-primary); border-color: var(--rn-primary); }
.btn-secondary { background: var(--rn-secondary); border-color: var(--rn-secondary); }
.btn-accent { background: var(--rn-accent); border-color: var(--rn-accent-600); color: var(--rn-secondary); font-weight: 600; }
.btn-accent:hover { background: var(--rn-accent-600); color: var(--rn-secondary); }
.text-primary { color: var(--rn-primary) !important; }
.bg-primary { background-color: var(--rn-primary) !important; }
.form-control:focus, .form-select:focus { border-color: var(--rn-primary); box-shadow: 0 0 0 .2rem rgba(54,171,156,.18); }
.form-check-input:checked { background-color: var(--rn-primary); border-color: var(--rn-primary); }
a { color: var(--rn-primary-700); text-decoration: none; }
a:hover { color: var(--rn-primary); }

/* ---------- Base ---------- */
html, body { height: 100%; }
body {
  font-family: 'Raleway', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: var(--rn-text);
  background: var(--rn-bg);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* Suppress the flash of un-wrapped page content (raw <main> showing
 * without the sidebar/topbar) while layout.js builds the app shell.
 * Pages with a data-page attribute opt in; login.html and error.html
 * don't have one, so they stay visible immediately. layout.js adds
 * .rn-mounted as soon as the shell is in place. */
body[data-page] { opacity: 0; transition: opacity 140ms ease-out; }
body[data-page].rn-mounted { opacity: 1; }

/* Loading curtain shown while the body is hidden. Lives on <html> so the
 * body's opacity:0 doesn't drag it invisible too. Layout-bearing pages
 * add .rn-ready to <html> when the shell is in place; login/error.html
 * add it on their own (they don't go through layout.mount). */
html::before {
  content: "";
  position: fixed; inset: 0;
  background: var(--rn-bg);
  z-index: 9000;
  pointer-events: none;
  transition: opacity 180ms ease-out;
}
html::after {
  content: "";
  position: fixed;
  top: 50%; left: 50%;
  width: 44px; height: 44px;
  margin: -22px 0 0 -22px;
  border: 4px solid var(--rn-border);
  border-top-color: var(--rn-primary);
  border-radius: 50%;
  z-index: 9001;
  pointer-events: none;
  animation: rn-spin 700ms linear infinite;
  transition: opacity 180ms ease-out;
}
html.rn-ready::before,
html.rn-ready::after { opacity: 0; }
h1, h2, h3, h4, h5, h6 { color: var(--rn-secondary); font-weight: 600; }
h1 { font-size: 1.625rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }

/* ---------- App shell ---------- */
.rn-app {
  display: grid;
  grid-template-columns: var(--rn-sidebar-w) 1fr;
  grid-template-rows: var(--rn-topbar-h) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
  min-height: 100vh;
  transition: grid-template-columns var(--rn-transition);
}
.rn-app.is-collapsed { grid-template-columns: var(--rn-sidebar-collapsed-w) 1fr; }

/* ---------- Sidebar ---------- */
.rn-sidebar {
  grid-area: sidebar;
  background: linear-gradient(180deg, var(--rn-secondary) 0%, #0c3e39 100%);
  color: #d9eae8;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  z-index: 50;
}
.rn-sidebar__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  min-height: var(--rn-topbar-h);
}
.rn-sidebar__logo img { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; background: #fff; padding: 4px; }
.rn-sidebar__brand { font-weight: 700; color: #fff; font-size: 1.05rem; letter-spacing: .2px; }
.rn-sidebar__brand small { display: block; font-weight: 400; color: var(--rn-accent); font-size: .7rem; letter-spacing: 1.5px; text-transform: uppercase; }
.is-collapsed .rn-sidebar__brand { display: none; }

.rn-sidebar__nav {
  list-style: none;
  margin: 0;
  padding: 18px 12px;
  flex: 1;
  overflow-y: auto;
}
.rn-sidebar__section {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,.4);
  margin: 18px 12px 8px;
}
.is-collapsed .rn-sidebar__section { visibility: hidden; height: 0; margin: 8px 0; }

.rn-sidebar__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin: 2px 0;
  color: rgba(255,255,255,.78);
  border-radius: var(--rn-radius-sm);
  font-weight: 500;
  font-size: .9rem;
  transition: all var(--rn-transition);
  white-space: nowrap;
}
.rn-sidebar__link:hover { background: rgba(255,255,255,.06); color: #fff; }
.rn-sidebar__link.is-active {
  background: rgba(54,171,156,.18);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--rn-primary);
}
.rn-sidebar__link svg { width: 18px; height: 18px; flex-shrink: 0; }
.is-collapsed .rn-sidebar__link span { display: none; }
.is-collapsed .rn-sidebar__link { justify-content: center; padding: 12px; }

/* ---------- Topbar ---------- */
.rn-topbar {
  grid-area: topbar;
  background: var(--rn-surface);
  border-bottom: 1px solid var(--rn-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--rn-shadow-sm);
}
.rn-topbar__left { display: flex; align-items: center; gap: 16px; }
.rn-topbar__toggle {
  background: transparent;
  border: 0;
  width: 38px;
  height: 38px;
  border-radius: var(--rn-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--rn-text-muted);
  cursor: pointer;
  transition: background var(--rn-transition);
}
.rn-topbar__toggle:hover { background: var(--rn-primary-50); color: var(--rn-primary); }
.rn-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--rn-text-muted);
  font-size: .875rem;
}
.rn-breadcrumb a { color: var(--rn-text-muted); }
.rn-breadcrumb a:hover { color: var(--rn-primary); }
.rn-breadcrumb__current { color: var(--rn-secondary); font-weight: 600; }
.rn-breadcrumb svg { width: 14px; height: 14px; opacity: .5; }

.rn-topbar__right { display: flex; align-items: center; gap: 8px; }
.rn-topbar__btn {
  width: 38px; height: 38px;
  border: 0; background: transparent;
  border-radius: var(--rn-radius-sm);
  color: var(--rn-text-muted);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background var(--rn-transition);
}
.rn-topbar__btn:hover { background: var(--rn-primary-50); color: var(--rn-primary); }
.rn-topbar__btn--dot::after {
  content: ""; position: absolute; top: 9px; right: 10px;
  width: 8px; height: 8px; background: var(--rn-accent); border-radius: 50%;
  border: 2px solid var(--rn-surface);
}
.rn-profile {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--rn-border);
  background: var(--rn-surface);
  cursor: pointer;
  transition: all var(--rn-transition);
}
.rn-profile:hover { border-color: var(--rn-primary); }
.rn-profile__avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--rn-primary), var(--rn-secondary));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: .8rem;
}
.rn-profile__name { font-weight: 600; font-size: .85rem; color: var(--rn-secondary); }
.rn-profile__role { font-size: .7rem; color: var(--rn-text-muted); }

/* ---------- Main ---------- */
.rn-main {
  grid-area: main;
  padding: 24px;
  display: flex; flex-direction: column;
  min-width: 0;
}
.rn-main > .container-fluid { padding: 0; }
.rn-page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin-bottom: 22px;
}
.rn-page-head__title h1 { margin: 0 0 4px; }
.rn-page-head__title p { margin: 0; color: var(--rn-text-muted); font-size: .9rem; }

/* ---------- Patient switcher ---------- */
/* The control that decides *whose* data the page is showing. It used to be a
 * plain .form-select sitting among the action buttons, where it read as one
 * more toolbar control; it now sits under the page title, tinted with the
 * brand teal so it is unmistakably the page's context selector. */
.rn-pswitch { position: relative; display: inline-block; margin: 8px 0 6px; }
.rn-pswitch__trigger {
  display: inline-flex; align-items: center; gap: 12px;
  min-width: 280px; max-width: 100%;
  padding: 7px 12px 7px 7px;
  border: 1.5px solid var(--rn-primary);
  border-radius: 999px;
  background: linear-gradient(180deg, #fff, var(--rn-primary-50));
  box-shadow: 0 1px 2px rgba(16,80,73,.06), 0 0 0 4px rgba(54,171,156,.10);
  cursor: pointer; text-align: left;
  transition: box-shadow var(--rn-transition), border-color var(--rn-transition), transform var(--rn-transition);
}
.rn-pswitch__trigger:hover { box-shadow: 0 2px 6px rgba(16,80,73,.10), 0 0 0 5px rgba(54,171,156,.16); }
.rn-pswitch__trigger:focus-visible { outline: 0; box-shadow: 0 0 0 4px rgba(54,171,156,.35); }
.rn-pswitch__trigger.is-static { cursor: default; box-shadow: none; background: var(--rn-primary-50); }
.rn-pswitch.is-open .rn-pswitch__trigger { border-color: var(--rn-primary-700); box-shadow: 0 0 0 5px rgba(54,171,156,.20); }
.rn-pswitch.is-open .rn-pswitch__caret { transform: rotate(180deg); }

.rn-pswitch__avatar {
  flex: 0 0 auto;
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--rn-primary), var(--rn-secondary));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .78rem; letter-spacing: .4px;
}
.rn-pswitch__avatar--sm { width: 28px; height: 28px; font-size: .7rem; }
.rn-pswitch__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.rn-pswitch__eyebrow {
  font-size: .62rem; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--rn-primary-700); line-height: 1.3;
}
.rn-pswitch__name {
  font-size: .98rem; font-weight: 700; color: var(--rn-secondary); line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rn-pswitch__action {
  flex: 0 0 auto;
  font-size: .68rem; font-weight: 700; letter-spacing: .3px; text-transform: uppercase;
  color: var(--rn-primary-700);
  background: rgba(54,171,156,.16); border-radius: 999px; padding: 3px 9px;
}
.rn-pswitch__caret {
  flex: 0 0 auto; display: inline-flex; color: var(--rn-primary-700);
  transition: transform var(--rn-transition);
}
.rn-pswitch__caret svg { width: 16px; height: 16px; }

.rn-pswitch__panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 50;
  width: max(320px, 100%); max-width: calc(100vw - 32px);
  background: var(--rn-surface);
  border: 1px solid var(--rn-border);
  border-radius: var(--rn-radius);
  box-shadow: var(--rn-shadow-lg);
  overflow: hidden;
}
.rn-pswitch__search { position: relative; padding: 10px 10px 6px; }
.rn-pswitch__search svg {
  position: absolute; left: 21px; top: 50%; transform: translateY(-40%);
  width: 15px; height: 15px; color: var(--rn-text-subtle); pointer-events: none;
}
.rn-pswitch__search input {
  width: 100%; padding: 8px 10px 8px 32px; font-size: .85rem;
  border: 1px solid var(--rn-border); border-radius: var(--rn-radius-sm);
  background: var(--rn-surface-2); color: var(--rn-text);
}
.rn-pswitch__search input:focus { outline: 0; border-color: var(--rn-primary); background: var(--rn-surface); }
.rn-pswitch__list { list-style: none; margin: 0; padding: 6px; max-height: 300px; overflow-y: auto; }
.rn-pswitch__list:focus { outline: 0; }
.rn-pswitch__opt {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: var(--rn-radius-sm); cursor: pointer;
}
.rn-pswitch__opt.is-active { background: var(--rn-primary-50); }
.rn-pswitch__opt.is-selected .rn-pswitch__opt-name { color: var(--rn-primary-700); }
.rn-pswitch__opt-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.rn-pswitch__opt-name {
  font-size: .88rem; font-weight: 600; color: var(--rn-secondary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rn-pswitch__opt-sub { font-size: .72rem; color: var(--rn-text-subtle); }
.rn-pswitch__tick { flex: 0 0 auto; color: var(--rn-primary); opacity: 0; }
.rn-pswitch__tick svg { width: 15px; height: 15px; }
.rn-pswitch__opt.is-selected .rn-pswitch__tick { opacity: 1; }
.rn-pswitch__none { margin: 0; padding: 16px; text-align: center; font-size: .82rem; color: var(--rn-text-muted); }
.rn-pswitch__footer {
  display: block; padding: 10px 14px; font-size: .78rem; font-weight: 600;
  border-top: 1px solid var(--rn-border); background: var(--rn-surface-2);
  color: var(--rn-primary-700);
}
.rn-pswitch__footer:hover { background: var(--rn-primary-50); }

/* ---------- Card ---------- */
.rn-card {
  background: var(--rn-surface);
  border: 1px solid var(--rn-border);
  border-radius: var(--rn-radius);
  box-shadow: var(--rn-shadow-sm);
  overflow: hidden;
}
.rn-card__header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--rn-border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.rn-card__header h3 { margin: 0; font-size: 1rem; }
.rn-card__header p { margin: 2px 0 0; font-size: .8rem; color: var(--rn-text-muted); }
.rn-card__body { padding: 20px; }
.rn-card__footer { padding: 14px 20px; border-top: 1px solid var(--rn-border); background: var(--rn-surface-2); }

/* ---------- Stat tiles ---------- */
.rn-stat {
  display: flex; align-items: center; gap: 16px;
  padding: 20px;
  background: var(--rn-surface);
  border: 1px solid var(--rn-border);
  border-radius: var(--rn-radius);
  box-shadow: var(--rn-shadow-sm);
  transition: transform var(--rn-transition), box-shadow var(--rn-transition);
}
.rn-stat:hover { transform: translateY(-2px); box-shadow: var(--rn-shadow-md); }
.rn-stat__icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--rn-primary-50); color: var(--rn-primary);
}
.rn-stat__icon svg { width: 24px; height: 24px; }
.rn-stat__icon--accent { background: rgba(223,185,41,.16); color: var(--rn-accent-600); }
.rn-stat__icon--secondary { background: rgba(16,80,73,.12); color: var(--rn-secondary); }
.rn-stat__icon--success { background: rgba(46,155,110,.14); color: var(--rn-success); }
.rn-stat__label { font-size: .75rem; color: var(--rn-text-muted); text-transform: uppercase; letter-spacing: .8px; margin: 0 0 4px; }
.rn-stat__value { font-size: 1.6rem; font-weight: 700; color: var(--rn-secondary); line-height: 1; margin: 0; }
.rn-stat__delta { font-size: .75rem; color: var(--rn-success); margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; }
.rn-stat__delta--down { color: var(--rn-danger); }

/* ---------- Table ---------- */
.rn-table-wrap { background: var(--rn-surface); border: 1px solid var(--rn-border); border-radius: var(--rn-radius); overflow: hidden; box-shadow: var(--rn-shadow-sm); }
.rn-table-toolbar {
  padding: 14px 18px; border-bottom: 1px solid var(--rn-border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.rn-table { width: 100%; border-collapse: collapse; }
.rn-table th, .rn-table td { padding: 12px 18px; text-align: left; vertical-align: middle; font-size: .875rem; }
.rn-table thead th {
  background: var(--rn-surface-2);
  color: var(--rn-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: .72rem;
  letter-spacing: .6px;
  border-bottom: 1px solid var(--rn-border);
}
.rn-table tbody tr { border-bottom: 1px solid var(--rn-border); transition: background var(--rn-transition); }
.rn-table tbody tr:hover { background: var(--rn-surface-2); }
.rn-table tbody tr:last-child { border-bottom: 0; }
.rn-table__actions { display: flex; gap: 6px; }
.rn-icon-btn {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--rn-border); background: var(--rn-surface);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--rn-text-muted); cursor: pointer;
  transition: all var(--rn-transition);
}
.rn-icon-btn:hover { border-color: var(--rn-primary); color: var(--rn-primary); background: var(--rn-primary-50); }
.rn-icon-btn--danger:hover { border-color: var(--rn-danger); color: var(--rn-danger); background: rgba(208,69,69,.08); }
.rn-icon-btn svg { width: 16px; height: 16px; }

/* ---------- Badge / pill ---------- */
.rn-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: .7rem; font-weight: 600;
  background: var(--rn-primary-50); color: var(--rn-primary-700);
}
.rn-pill--gold { background: rgba(223,185,41,.18); color: #8a6f15; }
.rn-pill--danger { background: rgba(208,69,69,.12); color: var(--rn-danger); }
.rn-pill--muted { background: #eef1f4; color: var(--rn-text-muted); }
.rn-pill--success { background: rgba(46,155,110,.14); color: var(--rn-success); }

/* ---------- Forms ---------- */
.rn-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.rn-form-grid--single { grid-template-columns: 1fr; }
.rn-form-grid .rn-full { grid-column: 1 / -1; }
.rn-label { display: block; font-weight: 600; font-size: .8rem; color: var(--rn-secondary); margin-bottom: 6px; }
.rn-label--required::after { content: " *"; color: var(--rn-danger); }
.form-control, .form-select { border-color: var(--rn-border); border-radius: var(--rn-radius-sm); padding: .55rem .85rem; font-size: .9rem; }
.form-control[readonly] { background: var(--rn-surface-2); }

.rn-section-title {
  display: flex; align-items: center; gap: 10px;
  margin: 24px 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--rn-border);
}
.rn-section-title h3 { margin: 0; font-size: 1rem; color: var(--rn-secondary); }
.rn-section-title svg { width: 18px; height: 18px; color: var(--rn-primary); }
.rn-section-title:first-child { margin-top: 0; }

/* ---------- Search input ---------- */
.rn-search {
  position: relative; display: inline-flex; flex: 1; max-width: 360px;
}
.rn-search input {
  width: 100%; padding: .55rem .85rem .55rem 2.25rem;
  border: 1px solid var(--rn-border); border-radius: var(--rn-radius-sm);
  background: var(--rn-surface-2); font-size: .875rem;
  transition: all var(--rn-transition);
}
.rn-search input:focus { outline: none; background: var(--rn-surface); border-color: var(--rn-primary); box-shadow: 0 0 0 .2rem rgba(54,171,156,.16); }
.rn-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--rn-text-muted); }

/* ---------- Empty / Loading ---------- */
.rn-empty { padding: 60px 20px; text-align: center; color: var(--rn-text-muted); }
.rn-empty svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: .4; }
.rn-loader { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--rn-border); border-top-color: var(--rn-primary); border-radius: 50%; animation: rn-spin 700ms linear infinite; }
.rn-loader--lg { width: 36px; height: 36px; border-width: 3px; }
@keyframes rn-spin { to { transform: rotate(360deg); } }
.rn-loading-overlay { position: fixed; inset: 0; background: rgba(255,255,255,.7); display: flex; align-items: center; justify-content: center; z-index: 1080; }

/* ---------- Footer ---------- */
.rn-footer {
  padding: 18px 24px;
  margin-top: auto;
  border-top: 1px solid var(--rn-border);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  color: var(--rn-text-muted); font-size: .8rem;
}
.rn-footer__links { display: flex; gap: 16px; }
.rn-footer__links a { color: var(--rn-text-muted); }
.rn-footer__links a:hover { color: var(--rn-primary); }
.rn-version { font-family: ui-monospace, "SF Mono", Menlo, monospace; padding: 2px 8px; background: var(--rn-primary-50); color: var(--rn-primary-700); border-radius: 999px; font-size: .7rem; }

/* ---------- Wizard / steps ---------- */
.rn-steps { display: flex; gap: 0; margin-bottom: 24px; }
.rn-step {
  flex: 1; padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  background: var(--rn-surface); border: 1px solid var(--rn-border);
  position: relative;
}
.rn-step:first-child { border-radius: var(--rn-radius) 0 0 var(--rn-radius); }
.rn-step:last-child { border-radius: 0 var(--rn-radius) var(--rn-radius) 0; }
.rn-step + .rn-step { border-left: 0; }
.rn-step__num {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--rn-surface-2); color: var(--rn-text-muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
  border: 2px solid var(--rn-border);
}
.rn-step.is-active .rn-step__num { background: var(--rn-primary); color: #fff; border-color: var(--rn-primary); }
.rn-step.is-done .rn-step__num { background: var(--rn-success); color: #fff; border-color: var(--rn-success); }
.rn-step__label { font-weight: 600; font-size: .85rem; color: var(--rn-secondary); }
.rn-step__sub { font-size: .7rem; color: var(--rn-text-muted); }

/* ---------- Exercise tile grid ---------- */
.rn-tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.rn-tile {
  background: var(--rn-surface); border: 1px solid var(--rn-border);
  border-radius: var(--rn-radius); padding: 16px;
  text-align: center; cursor: pointer;
  transition: all var(--rn-transition);
}
.rn-tile:hover { border-color: var(--rn-primary); transform: translateY(-2px); box-shadow: var(--rn-shadow-md); }
.rn-tile img { width: 100%; height: 110px; object-fit: contain; margin-bottom: 8px; }
.rn-tile h4 { font-size: .9rem; margin: 0; color: var(--rn-secondary); }
.rn-tile p { font-size: .72rem; margin: 4px 0 0; color: var(--rn-text-muted); }

/* ---------- Login page ---------- */
.rn-auth-page {
  min-height: 100vh;
  display: grid; grid-template-columns: 1.1fr 1fr;
  background: var(--rn-bg);
}
.rn-auth-page__aside {
  background: linear-gradient(160deg, var(--rn-secondary), var(--rn-primary-700));
  color: #fff; padding: 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.rn-auth-page__aside::before, .rn-auth-page__aside::after {
  content: ""; position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(223,185,41,.4), transparent 70%);
}
.rn-auth-page__aside::before { width: 360px; height: 360px; top: -120px; right: -90px; }
.rn-auth-page__aside::after { width: 260px; height: 260px; bottom: -80px; left: -60px; background: radial-gradient(circle, rgba(54,171,156,.5), transparent 70%); }
.rn-auth-page__brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.rn-auth-page__brand img { width: 48px; height: 48px; background: #fff; border-radius: 10px; padding: 6px; }
.rn-auth-page__pitch { position: relative; z-index: 1; }
.rn-auth-page__pitch h2 { color: #fff; font-size: 2.1rem; line-height: 1.2; margin: 0 0 14px; }
.rn-auth-page__pitch p { color: rgba(255,255,255,.8); font-size: 1rem; max-width: 440px; }
.rn-auth-page__form {
  display: flex; align-items: center; justify-content: center;
  padding: 56px;
}
.rn-auth-page__form-inner { width: 100%; max-width: 380px; }
@media (max-width: 900px) {
  .rn-auth-page { grid-template-columns: 1fr; }
  .rn-auth-page__aside { display: none; }
}

/* ---------- Modal tweak ---------- */
.modal-content { border: 0; border-radius: var(--rn-radius); box-shadow: var(--rn-shadow-lg); }
.modal-header { border-bottom-color: var(--rn-border); padding: 18px 22px; }
.modal-header h5 { color: var(--rn-secondary); font-weight: 600; margin: 0; }
.modal-body { padding: 22px; }
.modal-footer { border-top-color: var(--rn-border); padding: 16px 22px; }

/* ---------- Toast ---------- */
.rn-toast-stack { position: fixed; bottom: 24px; right: 24px; z-index: 1090; display: flex; flex-direction: column; gap: 10px; }
.rn-toast {
  min-width: 280px; max-width: 360px;
  padding: 12px 16px; border-radius: var(--rn-radius);
  background: var(--rn-surface); border-left: 4px solid var(--rn-primary);
  box-shadow: var(--rn-shadow-md);
  display: flex; align-items: flex-start; gap: 10px;
  animation: rn-toast-in 200ms ease-out;
}
.rn-toast--success { border-left-color: var(--rn-success); }
.rn-toast--error { border-left-color: var(--rn-danger); }
.rn-toast__title { font-weight: 600; font-size: .85rem; color: var(--rn-secondary); margin: 0; }
.rn-toast__body { font-size: .8rem; color: var(--rn-text-muted); margin: 2px 0 0; }
@keyframes rn-toast-in { from { transform: translateX(20px); opacity: 0; } }

/* ---------- Dual handle slider (kept from legacy app.css) ---------- */
.dual-slider-container { position: relative; padding: 14px 0 8px; }
.dual-slider-track { position: relative; height: 36px; }
.dual-slider-range {
  position: absolute; top: 14px; height: 6px;
  background: linear-gradient(to right, var(--rn-accent), var(--rn-primary));
  border-radius: 3px; pointer-events: none;
}
.dual-slider-input {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  -webkit-appearance: none; appearance: none;
  background: transparent; pointer-events: none; margin: 0;
}
.dual-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25);
  pointer-events: all; margin-top: -7px; cursor: pointer;
}
.dual-slider-closed::-webkit-slider-thumb { background: var(--rn-accent); }
.dual-slider-open::-webkit-slider-thumb { background: var(--rn-primary); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .rn-app { grid-template-columns: 0 1fr; }
  .rn-app.is-mobile-open { grid-template-columns: var(--rn-sidebar-w) 1fr; }
  .rn-app.is-mobile-open .rn-sidebar { box-shadow: var(--rn-shadow-lg); }
  .rn-form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .rn-main { padding: 16px; }
  .rn-topbar { padding: 0 14px; }
  .rn-profile__name, .rn-profile__role { display: none; }
  .rn-pswitch { display: block; }
  .rn-pswitch__trigger { display: flex; width: 100%; min-width: 0; }
}

/* ---------- Utilities ---------- */
.rn-mt-0 { margin-top: 0 !important; }
.rn-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.rn-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.rn-grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
