/* ============================================================
   BuildWithFridberg – Unified Theme (Light + Dark Modes)
   v18 – CLEAN + deterministic (no duplicate wars)
   Fixes: coach-mode pills (Röd/Gul/Grön), inputs/labels visibility
   ============================================================ */

/* =========================
   1) ROOT TOKENS (LIGHT)
   ========================= */
:root{
  --bg: #ffffff;
  --panelBg: rgba(255,255,255,0.992);
  --card: #ffffff;

  --text: #111111;
  --muted: rgba(0,0,0,0.78);

  --border: rgba(0,0,0,0.12);
  --shadow: 0 10px 26px rgba(0,0,0,0.08);
  --radius: 14px;

  --btn: #111111;
  --btnText: #ffffff;

  --btnSecondaryBg: #ffffff;
  --btnSecondaryText: #111111;
  --btnSecondaryBorder: rgba(0,0,0,0.18);

  --focusRing: 0 0 0 3px rgba(0,0,0,0.10);

  /* layout */
  --panelW: 760px;
  --sideGap: 12px;

  /* accent */
  --accent: #8b5cf6;
  --accentText: #0b0b0b;

  /* forms */
  --inputBg: #ffffff;
  --inputBorder: rgba(0,0,0,0.22);
  --inputText: var(--text);
  --placeholder: rgba(0,0,0,0.45);
  --labelText: rgba(0,0,0,0.74);

  /* glass (dark) */
  --glassBg: rgba(10,10,12,0.86);
  --glassBorder: rgba(255,255,255,0.12);
  --glassShadow: 0 22px 60px rgba(0,0,0,0.55);
}

/* =========================
   2) BASE
   ========================= */
*{ box-sizing:border-box; }
html, body{ height:100%; }

body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a{ color: inherit; }
.muted{ color: var(--muted); }

h1{ margin:0 0 12px 0; font-size:24px; letter-spacing:-0.2px; }
h2{ margin:0 0 10px 0; font-size:18px; }
h3{ margin:0 0 8px 0; font-size:16px; }

.hr{
  height:1px;
  background: var(--border);
  margin:14px 0;
}

.small-muted{
  font-size:12px;
  color: var(--labelText);
  font-weight:650;
}

/* =========================
   3) A11Y SKIP
   ========================= */
.skip-link{
  position:absolute;
  left:-9999px;
  top:auto;
  width:1px;
  height:1px;
  overflow:hidden;
}
.skip-link:focus{
  left:12px;
  top:12px;
  width:auto;
  height:auto;
  padding:10px 12px;
  background:#fff;
  border:1px solid rgba(0,0,0,0.18);
  border-radius:12px;
  box-shadow:0 10px 26px rgba(0,0,0,0.10);
  z-index:99999;
}

/* =========================
   4) BACKGROUND ROTATOR
   ========================= */
.bg-rotator{
  position:fixed;
  inset:0;
  z-index:-3;
  pointer-events:none;

  --bg-left: url("/static/images/bg1.jpg");
  --bg-right: url("/static/images/bg2.jpg");

  background-color:#ffffff;
  background-image: var(--bg-left), var(--bg-right);
  background-repeat:no-repeat,no-repeat;
  background-position:left center, right center;
  background-size:
    calc((100% - var(--panelW)) / 2 - var(--sideGap)) auto,
    calc((100% - var(--panelW)) / 2 - var(--sideGap)) auto;

  opacity:1;
  filter:saturate(1.7) contrast(1.30) brightness(1.06);
}
.bg-rotator::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background: linear-gradient(
    to right,
    rgba(255,255,255,0.00) 0%,
    rgba(255,255,255,0.985) 27%,
    rgba(255,255,255,0.985) 73%,
    rgba(255,255,255,0.00) 100%
  );
}

/* =========================
   5) LAYOUT
   ========================= */
.container{
  max-width: var(--panelW);
  margin:0 auto;
  padding:16px;
}

main.container{
  position:relative;
  z-index:1;
  background: var(--panelBg);
  border:1px solid rgba(0,0,0,0.10);
  border-radius:16px;
  box-shadow: var(--shadow);
  margin-top:12px;
  margin-bottom:18px;
}

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
@media (max-width: 900px){
  .grid2{ grid-template-columns: 1fr; }
}

/* =========================
   6) NAVBAR
   ========================= */
header.nav{
  background: rgba(255,255,255,0.98);
  border-bottom:1px solid var(--border);
  position:sticky;
  top:0;
  z-index:2147483647;
  isolation:isolate;
  box-shadow:0 8px 18px rgba(0,0,0,0.06);
  backdrop-filter: blur(6px);
}

.nav-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}

.brand a{ text-decoration:none; }

.brand-logo{
  display:inline-flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  color: var(--text);
  font-weight:900;
}

.brand-img{ height:50px; width:auto; display:inline-block; }

.brand-text{ font-size:20px; letter-spacing:0.3px; line-height:1; }
.brand-text span{ opacity:0.75; font-weight:800; }

.links{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}
.links a{
  text-decoration:none;
  color: var(--text);
  opacity:0.92;
  padding:7px 10px;
  border-radius:10px;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.links a:hover{
  background: rgba(0,0,0,0.05);
  opacity:1;
}

.pill{
  display:inline-block;
  background: var(--btn);
  color: var(--btnText) !important;
  border-radius:999px;
  padding:8px 12px !important;
  border:1px solid rgba(0,0,0,0.20);
}
.pill:hover{ background:#000; }

.nav-msg-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
}

.nav-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:20px;
  height:18px;
  padding:0 7px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
  background:#111;
  color:#fff;
  line-height:1;
}

/* =========================
   7) BUTTONS / ROWS
   ========================= */
.row{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.btn{
  display:inline-block;
  border:1px solid rgba(0,0,0,0.18);
  background: var(--btn);
  color: var(--btnText);
  padding:10px 14px;
  border-radius:12px;
  text-decoration:none;
  font-weight:750;
  cursor:pointer;
  transition: transform 0.05s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover{ background:#000; }
.btn:active{ transform: translateY(1px); }

.btn.secondary{
  background: var(--btnSecondaryBg);
  color: var(--btnSecondaryText);
  border-color: var(--btnSecondaryBorder);
}
.btn.secondary:hover{ background: rgba(0,0,0,0.03); }

.btn.accent{
  background: var(--accent);
  color: var(--accentText) !important;
  border-color: rgba(139,92,246,0.55);
}
.btn.accent:hover{ filter: brightness(0.98); }

/* =========================
   8) FORMS
   ========================= */
input, textarea, select, button{ font: inherit; }

label, .field label{
  color: var(--labelText);
  font-weight:800;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--inputBorder);
  background: var(--inputBg);
  color: var(--inputText);
  line-height:1.4;
  font-size:14px;
}
input::placeholder,
textarea::placeholder{ color: var(--placeholder); }

textarea{ resize:vertical; }

input:focus,
textarea:focus,
select:focus{
  outline:none;
  border-color: rgba(0,0,0,0.45);
  box-shadow: var(--focusRing);
}
input, textarea{ caret-color: var(--inputText); }

/* =========================
   9) CARDS / TAGS / LISTS
   ========================= */
.card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow:0 6px 16px rgba(0,0,0,0.06);
  padding:12px;
}

.tag{
  display:inline-block;
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(0,0,0,0.06);
  color: var(--text);
  border:1px solid rgba(0,0,0,0.06);
}

.meta{
  margin:10px 0 0 0;
  padding-left:18px;
  color: var(--muted);
}
.meta li{ margin:2px 0; }

.alert{
  border-radius:12px;
  padding:10px 12px;
  border:1px solid rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.03);
  font-weight:750;
}
.alert.success{
  background: rgba(46,125,50,0.10);
  border-color: rgba(46,125,50,0.25);
}
.alert.warn{
  background: rgba(255,193,7,0.18);
  border-color: rgba(255,193,7,0.40);
}

/* =========================
   10) RECIPES
   ========================= */
.recipe-card .recipe-title{ margin:0; }

.recipe-image{
  width:100%;
  max-width:520px;
  height:auto;
  display:block;
  border-radius:12px;
  border:1px solid var(--border);
  margin:10px 0 6px 0;
}
.recipe-label{
  font-weight:900;
  font-size:12px;
  letter-spacing:0.2px;
  margin:10px 0 6px 0;
  color: var(--text);
}
.recipe-pre{
  margin:0;
  white-space:pre-wrap;
  color: rgba(0,0,0,0.92);
  background: rgba(0,0,0,0.03);
  border:1px solid rgba(0,0,0,0.10);
  border-radius:12px;
  padding:10px 12px;
  line-height:1.6;
  font-size:14px;
}

/* =========================
   11) MESSAGES
   ========================= */
.messages-layout{
  display:grid;
  grid-template-columns: 330px 1fr;
  gap:14px;
  align-items:start;
}

.messages-sidebar{ padding:12px; }
.messages-sidebar-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:6px;
}
.messages-title{ margin:0; font-size:16px; font-weight:950; }
.messages-new{ margin-top:6px; }

.messages-new-row{
  display:flex;
  gap:8px;
  align-items:center;
  margin-top:6px;
}
.messages-new-row select{ flex:1; }

.messages-threads{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:10px;
}

.thread-item{
  display:block;
  text-decoration:none;
  border:1px solid rgba(0,0,0,0.10);
  border-radius:14px;
  padding:10px;
  background: rgba(255,255,255,0.98);
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}
.thread-item:hover{
  background: rgba(0,0,0,0.02);
  border-color: rgba(0,0,0,0.16);
}
.thread-item:active{ transform: translateY(1px); }
.thread-item.active{
  border-color: rgba(0,0,0,0.22);
  background: rgba(0,0,0,0.03);
}

.thread-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.thread-name{ font-weight:900; font-size:13.5px; line-height:1.2; }

.thread-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:22px;
  height:20px;
  padding:0 7px;
  border-radius:999px;
  background:#111;
  color:#fff;
  font-size:12px;
  font-weight:900;
}

.thread-preview{
  margin-top:6px;
  font-size:12.5px;
  color: rgba(0,0,0,0.74);
  line-height:1.3;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.messages-main{
  padding:12px;
  display:flex;
  flex-direction:column;
  min-height:420px;
}

.messages-header{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
}

.messages-list{
  flex:1;
  display:flex;
  flex-direction:column;
  gap:10px;
  max-height:420px;
  overflow:auto;
  padding-right:6px;
}

.msg{ display:flex; }
.msg.mine{ justify-content:flex-end; }
.msg.theirs{ justify-content:flex-start; }

.msg-bubble{
  max-width:78%;
  border:1px solid rgba(0,0,0,0.10);
  border-radius:16px;
  padding:10px 12px;
  background:#fff;
  box-shadow:0 6px 16px rgba(0,0,0,0.05);
}
.msg.mine .msg-bubble{
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.14);
}

.msg-text{ white-space:pre-wrap; line-height:1.55; word-wrap:break-word; }
.msg-meta{ font-size:12px; margin-top:6px; color: rgba(0,0,0,0.62); font-weight:750; }

.messages-compose textarea{
  width:100%;
  margin-top:8px;
  min-height:52px;
}

/* =========================
   12) STATUS PILL (BASE)
   ========================= */
.status-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
  border:1px solid rgba(0,0,0,0.12);
  line-height:1;
}
.status-red{
  background: rgba(176,0,32,0.10);
  color:#b00020;
  border-color: rgba(176,0,32,0.25);
}
.status-yellow{
  background: rgba(255,193,7,0.18);
  color: rgba(0,0,0,0.86);
  border-color: rgba(255,193,7,0.40);
}
.status-green{
  background: rgba(46,125,50,0.12);
  color:#1b5e20;
  border-color: rgba(46,125,50,0.25);
}

/* =========================
   13) RESPONSIVE
   ========================= */
@media (max-width:900px){
  .messages-layout{ grid-template-columns: 1fr; }
  .msg-bubble{ max-width:92%; }
  .messages-list{ max-height:360px; }
}

@media (max-width:640px){
  .container{ max-width:100%; padding:12px; }

  .links{
    flex-wrap:nowrap;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
  }
  .links::-webkit-scrollbar{ display:none; }
  .links a{ padding:6px 8px; white-space:nowrap; }

  .btn{ width:100%; text-align:center; }

  .bg-rotator{
    background-size:240px auto, 240px auto;
    filter:saturate(1.35) contrast(1.15) brightness(1.06);
  }

  .brand-img{ height:44px; }
  .brand-text{ font-size:18px; }
  main.container{ border-radius:14px; }

  .messages-new-row{ flex-direction:column; align-items:stretch; }
  .messages-new-row .btn{ width:100%; }
}

/* ============================================================
   14) DARK MODES (Landing / Auth / Coach) – TOKENS
   ============================================================ */
body.landing-mode,
body.auth-mode,
body.coach-mode{
  --bg: #070707;
  --panelBg: transparent;
  --card: rgba(255,255,255,0.04);

  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.72);
  --border: rgba(255,255,255,0.12);

  --btn: var(--accent);
  --btnText: var(--accentText);

  --btnSecondaryBg: rgba(255,255,255,0.08);
  --btnSecondaryText: #ffffff;
  --btnSecondaryBorder: rgba(255,255,255,0.18);

  --shadow: 0 22px 70px rgba(0,0,0,0.55);

  --inputBg: rgba(255,255,255,0.06);
  --inputBorder: rgba(255,255,255,0.14);
  --inputText: rgba(255,255,255,0.92);
  --placeholder: rgba(255,255,255,0.55);
  --labelText: rgba(255,255,255,0.78);
}

/* Dark navbar */
body.landing-mode header.nav,
body.auth-mode header.nav,
body.coach-mode header.nav{
  background: rgba(7,7,7,0.92);
  border-bottom-color: rgba(255,255,255,0.12);
  box-shadow: 0 10px 30px rgba(0,0,0,0.55);
}
body.landing-mode .brand-logo,
body.auth-mode .brand-logo,
body.coach-mode .brand-logo{ color: rgba(255,255,255,0.92); }

body.landing-mode .links a,
body.auth-mode .links a,
body.coach-mode .links a{ color: rgba(255,255,255,0.88); }

body.landing-mode .links a:hover,
body.auth-mode .links a:hover,
body.coach-mode .links a:hover{ background: rgba(255,255,255,0.08); }

/* Dark bg rotator */
body.landing-mode .bg-rotator,
body.auth-mode .bg-rotator,
body.coach-mode .bg-rotator{
  background-color: #070707;
  filter: saturate(1.45) contrast(1.22) brightness(1.02);
}
body.landing-mode .bg-rotator::after,
body.auth-mode .bg-rotator::after,
body.coach-mode .bg-rotator::after{
  background: linear-gradient(
    to right,
    rgba(7,7,7,0.00) 0%,
    rgba(7,7,7,0.72) 27%,
    rgba(7,7,7,0.72) 73%,
    rgba(7,7,7,0.00) 100%
  );
}

/* Remove white main panel in dark */
body.landing-mode main.container,
body.auth-mode main.container,
body.coach-mode main.container{
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Dark: hr/tag/meta */
body.landing-mode .hr,
body.auth-mode .hr,
body.coach-mode .hr{ background: rgba(255,255,255,0.12); }

body.landing-mode .tag,
body.auth-mode .tag,
body.coach-mode .tag{
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.88);
}
body.landing-mode .meta,
body.auth-mode .meta,
body.coach-mode .meta{ color: rgba(255,255,255,0.74); }
body.landing-mode .meta li,
body.auth-mode .meta li,
body.coach-mode .meta li{ color: rgba(255,255,255,0.74); }

/* Inputs in dark */
body.landing-mode input,
body.landing-mode textarea,
body.landing-mode select,
body.auth-mode input,
body.auth-mode textarea,
body.auth-mode select,
body.coach-mode input,
body.coach-mode textarea,
body.coach-mode select{
  background: var(--inputBg);
  border-color: var(--inputBorder);
  color: var(--inputText);
  caret-color: var(--inputText);
}
body.landing-mode input::placeholder,
body.landing-mode textarea::placeholder,
body.auth-mode input::placeholder,
body.auth-mode textarea::placeholder,
body.coach-mode input::placeholder,
body.coach-mode textarea::placeholder{
  color: var(--placeholder);
}
body.landing-mode input:focus,
body.landing-mode textarea:focus,
body.landing-mode select:focus,
body.auth-mode input:focus,
body.auth-mode textarea:focus,
body.auth-mode select:focus,
body.coach-mode input:focus,
body.coach-mode textarea:focus,
body.coach-mode select:focus{
  border-color: rgba(139,92,246,0.55);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.18);
}

/* Labels */
body.landing-mode label,
body.auth-mode label,
body.coach-mode label,
body.landing-mode .small-muted,
body.auth-mode .small-muted,
body.coach-mode .small-muted,
body.landing-mode .field label,
body.auth-mode .field label,
body.coach-mode .field label{
  color: var(--labelText);
}

/* ============================================================
   15) COACH MODE – GLASS CARDS + FIXES
   ============================================================ */
body.coach-mode a{ color: rgba(255,255,255,0.88); }
body.coach-mode a:hover{ color: rgba(139,92,246,0.95); }

/* Glass background for common boxes in coach-mode */
body.coach-mode .card,
body.coach-mode .thread-item,
body.coach-mode .msg-bubble,
body.coach-mode .alert,
body.coach-mode .toast,
body.coach-mode .create-client-card,
body.coach-mode .panel,
body.coach-mode .client-card,
body.coach-mode .stat-card,
body.coach-mode .checkin-item,
body.coach-mode .action-tile{
  background:
    radial-gradient(1000px 520px at 10% 0%, rgba(139,92,246,0.18), transparent 40%),
    var(--glassBg);
  border: 1px solid var(--glassBorder);
  box-shadow: var(--glassShadow);
  backdrop-filter: blur(10px);
  color: rgba(255,255,255,0.92);
}

/* Muted text in coach */
body.coach-mode .muted,
body.coach-mode .thread-preview,
body.coach-mode .msg-meta,
body.coach-mode .time{
  color: rgba(255,255,255,0.70) !important;
}

/* Small metric boxes on dashboard */
body.coach-mode .metric{
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.92);
}
body.coach-mode .metric .k{ color: rgba(255,255,255,0.65); }
body.coach-mode .metric .v{ color: rgba(255,255,255,0.95); }

/* Buttons in coach-mode */
body.coach-mode .btn.secondary{
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.92);
}
body.coach-mode .btn.secondary:hover{ background: rgba(255,255,255,0.14); }

/* Chips/badges/tags in coach-mode (BUT NOT status-colored pills) */
body.coach-mode .tag,
body.coach-mode .badge,
body.coach-mode .chip,
body.coach-mode .pill,
body.coach-mode .status-pill:not(.status-red):not(.status-yellow):not(.status-green){
  background: rgba(255,255,255,0.08) !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
  color: rgba(255,255,255,0.88) !important;
}

/* ============================================================
   16) COACH MODE – STATUS COLORS (FINAL, wins)
   ============================================================ */
body.coach-mode .status-pill.status-red{
  background: rgba(239, 68, 68, 0.22) !important;
  border: 1px solid rgba(239, 68, 68, 0.55) !important;
  color: rgba(255,255,255,0.95) !important;
}
body.coach-mode .status-pill.status-yellow{
  background: rgba(245, 158, 11, 0.22) !important;
  border: 1px solid rgba(245, 158, 11, 0.55) !important;
  color: rgba(255,255,255,0.95) !important;
}
body.coach-mode .status-pill.status-green{
  background: rgba(34, 197, 94, 0.22) !important;
  border: 1px solid rgba(34, 197, 94, 0.55) !important;
  color: rgba(255,255,255,0.95) !important;
}
/* ============================================================
   v18.1 – COACH MODE: fix dark text inside glass cards
   (force readable text, even if templates use hardcoded #111)
   Lägg längst ner i style.css
   ============================================================ */

/* 1) Force light text inside all common dashboard boxes */
body.coach-mode .stat-card,
body.coach-mode .client-card,
body.coach-mode .card,
body.coach-mode .checkin-item,
body.coach-mode .action-tile,
body.coach-mode .messages-sidebar,
body.coach-mode .messages-main,
body.coach-mode .thread-item,
body.coach-mode .msg-bubble{
  color: rgba(255,255,255,0.92) !important;
}

/* 2) Force headings/labels/paragraphs inside those boxes */
body.coach-mode .stat-card h1,
body.coach-mode .stat-card h2,
body.coach-mode .stat-card h3,
body.coach-mode .stat-card p,
body.coach-mode .stat-card span,
body.coach-mode .stat-card div,
body.coach-mode .stat-card small,
body.coach-mode .stat-card strong,

body.coach-mode .client-card h1,
body.coach-mode .client-card h2,
body.coach-mode .client-card h3,
body.coach-mode .client-card p,
body.coach-mode .client-card span,
body.coach-mode .client-card div,
body.coach-mode .client-card small,
body.coach-mode .client-card strong,

body.coach-mode .checkin-item p,
body.coach-mode .checkin-item span,
body.coach-mode .checkin-item div,
body.coach-mode .action-tile p,
body.coach-mode .action-tile span,
body.coach-mode .action-tile div{
  color: rgba(255,255,255,0.90) !important;
}

/* 3) Muted text inside boxes (still readable) */
body.coach-mode .stat-card .muted,
body.coach-mode .client-card .muted,
body.coach-mode .checkin-item .muted,
body.coach-mode .action-tile .muted,
body.coach-mode .stat-label,
body.coach-mode .stat-foot,
body.coach-mode .small-muted{
  color: rgba(255,255,255,0.72) !important;
}

/* 4) Catch inline styles that set dark text (common culprit) */
body.coach-mode [style*="color:#111"],
body.coach-mode [style*="color: #111"],
body.coach-mode [style*="color:#000"],
body.coach-mode [style*="color: #000"],
body.coach-mode [style*="color:rgb(0,0,0)"],
body.coach-mode [style*="color: rgb(0, 0, 0)"]{
  color: rgba(255,255,255,0.90) !important;
}

/* 5) Inputs/values inside metric boxes */
body.coach-mode .metric .k{ color: rgba(255,255,255,0.70) !important; }
body.coach-mode .metric .v{ color: rgba(255,255,255,0.95) !important; }
select{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  font-weight:600;
  background: rgba(25,25,25,0.95);
  color:#fff;
}

select option{
  background:#111;
  color:#fff;
}
/* =========================
   Coach form / SaaS layout
   ========================= */
.form-shell{
  max-width: 980px;
  margin: 0 auto;
}

.card.saas{
  background: rgba(18,18,18,0.72);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 18px 60px rgba(0,0,0,0.45);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  padding: 18px;
}

.form-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 900px){
  .form-grid{
    grid-template-columns: 1.05fr 0.95fr; /* vänster lite större */
    gap: 16px;
    align-items: start;
  }
}

.field{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label{
  font-weight: 900;
  color: rgba(255,255,255,0.92);
  letter-spacing: 0.2px;
}

.help{
  margin-top: -2px;
  font-size: 13px;
  color: rgba(255,255,255,0.68);
  line-height: 1.5;
}

/* Inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(12,12,12,0.72);
  color: rgba(255,255,255,0.94);
  outline: none;
  font-weight: 700;
}

textarea{ min-height: 220px; resize: vertical; }

input:focus,
textarea:focus,
select:focus{
  border-color: rgba(160,120,255,0.65);
  box-shadow: 0 0 0 4px rgba(160,120,255,0.16);
}

/* ✅ Fix: dropdown list text */
select option{
  background: #111;
  color: #fff;
}

/* Actions */
.form-actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* Optional: “sticky” submit på desktop */
@media (min-width: 900px){
  .sticky-actions{
    position: sticky;
    top: 86px; /* under navbar */
  }
}
/* ============================================================
   v19 – CLIENT MODE + client dashboard matches coach dashboard
   Lägg längst ner i static/style.css
   ============================================================ */

/* =========================
   CLIENT MODE TOKENS
   ========================= */
body.client-mode{
  --bg: #070707;
  --panelBg: transparent;
  --card: rgba(255,255,255,0.04);

  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.72);
  --border: rgba(255,255,255,0.12);

  --btn: var(--accent);
  --btnText: var(--accentText);

  --btnSecondaryBg: rgba(255,255,255,0.10);
  --btnSecondaryText: #ffffff;
  --btnSecondaryBorder: rgba(255,255,255,0.18);

  --shadow: 0 22px 70px rgba(0,0,0,0.55);

  --inputBg: rgba(255,255,255,0.06);
  --inputBorder: rgba(255,255,255,0.14);
  --inputText: rgba(255,255,255,0.92);
  --placeholder: rgba(255,255,255,0.55);
  --labelText: rgba(255,255,255,0.78);
}

/* Dark navbar */
body.client-mode header.nav{
  background: rgba(7,7,7,0.92);
  border-bottom-color: rgba(255,255,255,0.12);
  box-shadow: 0 10px 30px rgba(0,0,0,0.55);
}
body.client-mode .brand-logo{ color: rgba(255,255,255,0.92); }

body.client-mode .links a{ color: rgba(255,255,255,0.88); }
body.client-mode .links a:hover{ background: rgba(255,255,255,0.08); }

/* Dark bg rotator */
body.client-mode .bg-rotator{
  background-color: #070707;
  filter: saturate(1.45) contrast(1.22) brightness(1.02);
}
body.client-mode .bg-rotator::after{
  background: linear-gradient(
    to right,
    rgba(7,7,7,0.00) 0%,
    rgba(7,7,7,0.72) 27%,
    rgba(7,7,7,0.72) 73%,
    rgba(7,7,7,0.00) 100%
  );
}

/* Remove white main panel in client dark mode */
body.client-mode main.container{
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Generic dark helpers */
body.client-mode .hr{ background: rgba(255,255,255,0.12); }

body.client-mode .tag{
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.88);
}

body.client-mode .meta,
body.client-mode .meta li,
body.client-mode .muted,
body.client-mode .small-muted{
  color: rgba(255,255,255,0.72);
}

/* Inputs in client mode */
body.client-mode input,
body.client-mode textarea,
body.client-mode select{
  background: var(--inputBg);
  border-color: var(--inputBorder);
  color: var(--inputText);
  caret-color: var(--inputText);
}
body.client-mode input::placeholder,
body.client-mode textarea::placeholder{
  color: var(--placeholder);
}
body.client-mode input:focus,
body.client-mode textarea:focus,
body.client-mode select:focus{
  border-color: rgba(139,92,246,0.55);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.18);
}
body.client-mode label,
body.client-mode .field label{
  color: var(--labelText);
}

/* Buttons in client-mode */
body.client-mode .btn.secondary{
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.92);
}
body.client-mode .btn.secondary:hover{
  background: rgba(255,255,255,0.14);
}

/* Common glass panels */
body.client-mode .card,
body.client-mode .panel,
body.client-mode .client-panel,
body.client-mode .client-stat-card,
body.client-mode .client-list-card,
body.client-mode .client-workout-item,
body.client-mode .client-mini-card{
  background:
    radial-gradient(1000px 520px at 10% 0%, rgba(139,92,246,0.18), transparent 40%),
    rgba(10,10,12,0.86);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 22px 60px rgba(0,0,0,0.55);
  backdrop-filter: blur(10px);
  color: rgba(255,255,255,0.92);
}

/* =========================
   CLIENT DASHBOARD
   ========================= */
.client-dash{
  color:#f5f5f5;
}

.client-dash__top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom:18px;
  flex-wrap:wrap;
}

.client-dash__title{
  margin:0;
  font-size: clamp(34px, 5vw, 56px);
  line-height:1;
  font-weight:1000;
  letter-spacing:-0.03em;
  color:#fff;
}

.client-dash__subtitle{
  margin:10px 0 0 0;
  color:rgba(255,255,255,0.82);
  font-size:16px;
  font-weight:700;
}

.client-panel{
  background:
    radial-gradient(circle at top left, rgba(126, 58, 242, 0.16), transparent 45%),
    linear-gradient(180deg, rgba(24,18,43,0.96), rgba(10,10,18,0.96));
  border:1px solid rgba(255,255,255,0.10);
  border-radius:28px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.28);
  padding:18px;
  margin-bottom:18px;
}

.client-hero{
  display:grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap:18px;
  align-items:start;
}

.client-pill{
  display:inline-flex;
  align-items:center;
  padding:10px 16px;
  border-radius:999px;
  font-size:14px;
  font-weight:900;
  color:rgba(255,255,255,0.92);
  border:1px solid rgba(255,255,255,0.14);
  background:rgba(255,255,255,0.06);
}

.client-hero__name{
  margin:14px 0 8px 0;
  font-size:36px;
  line-height:1.05;
  font-weight:1000;
  color:#fff;
  letter-spacing:-0.03em;
}

.client-hero__text{
  margin:0;
  color:rgba(255,255,255,0.78);
  line-height:1.7;
  font-size:15px;
  max-width:720px;
  font-weight:650;
}

.client-hero__buttons{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top:16px;
}

.client-hero__avatar{
  width:96px;
  height:96px;
  border-radius:22px;
  object-fit:cover;
  border:1px solid rgba(255,255,255,0.16);
  background:rgba(255,255,255,0.05);
  box-shadow:0 10px 24px rgba(0,0,0,0.24);
}

.client-hero__grid{
  grid-column:1 / -1;
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
  margin-top:4px;
}

.client-mini-card{
  background:rgba(255,255,255,0.05);
  border:1px solid rgba(255,255,255,0.10);
  border-radius:18px;
  padding:14px;
}

.client-mini-card__label{
  font-size:12px;
  font-weight:900;
  color:rgba(255,255,255,0.62);
}

.client-mini-card__value{
  margin-top:6px;
  font-size:18px;
  font-weight:950;
  color:#fff;
  line-height:1.2;
}

.client-hero__footer{
  grid-column:1 / -1;
  padding-top:2px;
}

.client-hero__footer-text{
  margin:0 0 14px 0;
  color:rgba(255,255,255,0.82);
  line-height:1.7;
  font-size:15px;
  font-weight:650;
}

.client-tags{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.client-stats{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:14px;
  margin-bottom:18px;
}

.client-stat-card{
  min-height:160px;
  padding:18px;
  border-radius:24px;
  border:1px solid rgba(154, 92, 255, 0.24);
  background:
    radial-gradient(circle at top left, rgba(126, 58, 242, 0.18), transparent 44%),
    linear-gradient(180deg, rgba(27,17,51,0.98), rgba(12,10,24,0.98));
  box-shadow: 0 16px 40px rgba(0,0,0,0.24);
}

.client-stat-card__head{
  display:flex;
  justify-content:space-between;
  gap:8px;
  align-items:center;
  font-size:15px;
  font-weight:950;
  color:#fff;
}

.client-stat-card__num{
  margin-top:18px;
  font-size:64px;
  line-height:1;
  font-weight:1000;
  color:#fff;
  letter-spacing:-0.05em;
}

.client-stat-card__text{
  margin-top:10px;
  font-size:14px;
  line-height:1.5;
  color:rgba(255,255,255,0.78);
  font-weight:750;
  max-width:220px;
}

.client-main-grid{
  display:grid;
  grid-template-columns: 1.1fr 1fr;
  gap:18px;
  margin-bottom:18px;
}

.client-section-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  margin-bottom:14px;
  flex-wrap:wrap;
}

.client-section-head h2{
  margin:0;
  color:#fff;
  font-size:22px;
  font-weight:1000;
  letter-spacing:-0.02em;
}

.client-quick-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
}

.client-quick-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:74px;
  padding:16px;
  text-align:center;
  text-decoration:none;
  color:#fff !important;
  font-weight:950;
  font-size:18px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.05);
  transition:transform .18s ease, border-color .18s ease, background .18s ease;
}

.client-quick-btn:hover{
  transform:translateY(-2px);
  border-color:rgba(154,92,255,0.42);
  background:rgba(255,255,255,0.08);
  color:#fff !important;
}

.client-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.client-list-card{
  border-radius:22px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.05);
  padding:14px;
}

.client-list-card__top{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  flex-wrap:wrap;
}

.client-list-card__title{
  color:#fff;
  font-size:18px;
  font-weight:950;
  line-height:1.2;
}

.client-list-card__meta{
  margin-top:6px;
  color:rgba(255,255,255,0.75);
  font-size:14px;
  font-weight:700;
}

.client-metric-row{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:10px;
  margin-top:12px;
}

.client-metric-box{
  border-radius:16px;
  padding:12px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.08);
  display:flex;
  flex-direction:column;
  gap:6px;
}

.client-metric-box__label{
  font-size:12px;
  font-weight:900;
  color:rgba(255,255,255,0.62);
}

.client-metric-box__value{
  font-size:22px;
  line-height:1;
  font-weight:1000;
  color:#fff;
}

.client-workout-list{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
}

.client-workout-item{
  display:block;
  padding:16px;
  border-radius:20px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.05);
  text-decoration:none;
  transition:transform .18s ease, border-color .18s ease, background .18s ease;
}

.client-workout-item:hover{
  transform:translateY(-2px);
  border-color:rgba(154,92,255,0.42);
  background:rgba(255,255,255,0.08);
}

.client-workout-item__title{
  color:#fff;
  font-size:17px;
  font-weight:950;
  line-height:1.3;
}

.client-workout-item__meta{
  margin-top:8px;
  color:rgba(255,255,255,0.70);
  font-size:13px;
  font-weight:700;
}

@media (max-width: 980px){
  .client-stats{
    grid-template-columns:1fr;
  }

  .client-main-grid{
    grid-template-columns:1fr;
  }

  .client-workout-list{
    grid-template-columns:1fr;
  }
}

@media (max-width: 760px){
  .client-hero{
    grid-template-columns:1fr;
  }

  .client-hero__right{
    order:-1;
  }

  .client-hero__grid{
    grid-template-columns:1fr;
  }

  .client-quick-grid{
    grid-template-columns:1fr;
  }

  .client-metric-row{
    grid-template-columns:1fr;
  }

  .client-dash__title{
    font-size:40px;
  }

  .client-stat-card__num{
    font-size:48px;
  }
}