/* ============================================================
   BikeBid — Settings page
   Builds on app.css (sidebar, .card, .btn, colours).
   Three cards: Appearance · Wholesaler Settings · Team Management.
   ============================================================ */

.main.settings{ max-width:920px; }

/* page header */
.set-page-head{ margin-bottom:26px; }
.set-page-head h1{ font-size:30px; font-weight:800; letter-spacing:-.025em; margin:0 0 7px; }
.set-page-head p{ margin:0; color:var(--ink-3); font-size:14.5px; }

/* ---------- card shell (mirrors account-settings) ---------- */
.set-card{ padding:0; margin-bottom:24px; overflow:hidden; }
.set-card .sc-head{ display:flex; align-items:center; gap:12px; padding:20px 26px; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.set-card .sc-head > div:not(.sc-head-right){ flex:1 1 220px; min-width:0; }
.set-card .sc-ico{ width:40px; height:40px; border-radius:11px; background:var(--blue-50); color:var(--blue);
  display:flex; align-items:center; justify-content:center; flex:none; }
.set-card .sc-ico i[data-lucide]{ width:20px; height:20px; }
.set-card .sc-title{ font-size:17px; font-weight:700; line-height:1.2; }
.set-card .sc-sub{ font-size:12.5px; color:var(--ink-3); margin-top:1px; }
.set-card .sc-head-right{ margin-left:auto; display:flex; align-items:center; gap:12px; flex:none; }
.set-card .sc-body{ padding:24px 26px; }
.set-card .sc-foot{ display:flex; align-items:center; justify-content:flex-end; gap:12px; padding:16px 26px;
  border-top:1px solid var(--line-2); background:#fcfcfd; }

/* "Managers only" note */
.mgr-note{ display:inline-flex; align-items:center; gap:6px; font-size:11.5px; font-weight:700; color:var(--ink-3);
  background:var(--bg); border:1px solid var(--line); padding:5px 11px; border-radius:999px; white-space:nowrap; }
.mgr-note i[data-lucide]{ width:13px; height:13px; color:var(--ink-4); }

/* ---------- buttons (local sizes, mirror app.css) ---------- */
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:9px; font-family:inherit;
  font-weight:700; font-size:14px; padding:11px 18px; border-radius:11px; cursor:pointer; border:1px solid transparent;
  transition:transform .08s ease, background .12s, border-color .12s; }
.btn:active{ transform:translateY(1px); }
.btn.primary{ background:var(--blue); color:#fff; box-shadow:0 6px 16px color-mix(in oklab,var(--blue) 26%,transparent); }
.btn.primary:hover{ background:var(--blue-d); }
.btn.soft{ background:var(--card); color:var(--ink-2); border:1px solid var(--line); }
.btn.soft:hover{ background:var(--bg); border-color:var(--ink-4); }
.btn.tiny{ font-size:13px; padding:8px 14px; border-radius:9px; }
.btn i[data-lucide]{ width:17px; height:17px; }

/* ---------- form fields ---------- */
.field-block{ display:flex; flex-direction:column; gap:7px; }
.field-block + .field-block{ margin-top:22px; }
.field-block label{ font-size:13px; font-weight:600; color:var(--ink-2); }
.field-block .fb-sub{ font-size:12px; color:var(--ink-4); margin-top:-3px; max-width:60ch; }
.inp, .sel{ font-family:inherit; font-size:14px; color:var(--ink); background:var(--card);
  border:1px solid var(--line); border-radius:10px; padding:11px 13px; width:100%;
  transition:border-color .12s, box-shadow .12s; }
.inp::placeholder{ color:var(--ink-4); }
.inp:focus, .sel:focus{ outline:none; border-color:var(--blue);
  box-shadow:0 0 0 3px color-mix(in oklab, var(--blue) 14%, transparent); }
textarea.inp{ min-height:104px; resize:vertical; line-height:1.55; }
.sel{ appearance:none; -webkit-appearance:none; cursor:pointer; padding-right:38px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 13px center; }

/* ---------- toggle switch ---------- */
.switch{ position:relative; display:inline-flex; flex:none; }
.switch input{ position:absolute; opacity:0; width:0; height:0; }
.switch .track{ width:46px; height:26px; border-radius:999px; background:var(--line); cursor:pointer;
  position:relative; transition:background .18s ease; }
.switch .track::after{ content:""; position:absolute; top:3px; left:3px; width:20px; height:20px; border-radius:50%;
  background:#fff; box-shadow:0 1px 3px rgba(16,24,40,.3); transition:transform .18s ease; }
.switch input:checked + .track{ background:var(--blue); }
.switch input:checked + .track::after{ transform:translateX(20px); }
.switch input:focus-visible + .track{ box-shadow:0 0 0 3px color-mix(in oklab,var(--blue) 22%, transparent); }

/* toggle row */
.toggle-row{ display:flex; align-items:flex-start; gap:18px; padding-bottom:22px; margin-bottom:22px;
  border-bottom:1px solid var(--line-2); }
.toggle-row .tr-text{ flex:1; min-width:0; }
.toggle-row .tr-t{ font-size:14px; font-weight:700; }
.toggle-row .tr-s{ font-size:12.5px; color:var(--ink-3); margin-top:3px; max-width:54ch; line-height:1.5; }

/* ---------- Appearance: theme option cards ---------- */
.theme-opts{ display:grid; grid-template-columns:1fr 1fr; gap:16px; max-width:540px; }
.theme-opt{ border:1.5px solid var(--line); border-radius:14px; padding:13px; cursor:pointer; background:var(--card);
  text-align:left; font-family:inherit; display:flex; flex-direction:column; gap:12px;
  transition:border-color .14s, box-shadow .14s; }
.theme-opt:hover{ border-color:var(--ink-4); }
.theme-opt.sel{ border-color:var(--blue); box-shadow:0 0 0 3px color-mix(in oklab,var(--blue) 16%, transparent); }
.theme-opt:focus-visible{ outline:none; border-color:var(--blue); }

/* mini preview */
.theme-prev{ height:78px; border-radius:10px; overflow:hidden; display:flex; gap:8px; padding:10px; }
.theme-prev .tp-side{ width:28px; border-radius:6px; align-self:stretch; }
.theme-prev .tp-lines{ flex:1; display:flex; flex-direction:column; gap:7px; justify-content:center; }
.theme-prev .tp-lines i{ height:7px; border-radius:4px; display:block; }
.theme-prev .tp-lines i:nth-child(1){ width:85%; }
.theme-prev .tp-lines i:nth-child(2){ width:60%; }
.theme-prev .tp-lines i:nth-child(3){ width:72%; }
.theme-prev.light{ background:#f5f6f8; border:1px solid #e8eaee; }
.theme-prev.light .tp-side{ background:#fff; border:1px solid #e8eaee; }
.theme-prev.light .tp-lines i{ background:#dde2e8; }
.theme-prev.light .tp-lines i:nth-child(1){ background:#015ae6; opacity:.85; }
.theme-prev.dark{ background:#0e1217; border:1px solid #262d37; }
.theme-prev.dark .tp-side{ background:#161b22; border:1px solid #262d37; }
.theme-prev.dark .tp-lines i{ background:#2a313b; }
.theme-prev.dark .tp-lines i:nth-child(1){ background:#3b82f6; }

.theme-opt .to-row{ display:flex; align-items:center; gap:10px; }
.theme-opt .to-ico{ width:30px; height:30px; border-radius:9px; flex:none; display:flex; align-items:center; justify-content:center;
  background:var(--bg); color:var(--ink-2); }
.theme-opt .to-ico i[data-lucide]{ width:17px; height:17px; }
.theme-opt.sel .to-ico{ background:var(--blue-50); color:var(--blue); }
.theme-opt .to-name{ font-size:14px; font-weight:700; }
.theme-opt .to-check{ margin-left:auto; width:20px; height:20px; border-radius:50%; flex:none;
  border:1.5px solid var(--line); display:flex; align-items:center; justify-content:center; color:#fff; }
.theme-opt .to-check i[data-lucide]{ width:13px; height:13px; opacity:0; }
.theme-opt.sel .to-check{ background:var(--blue); border-color:var(--blue); }
.theme-opt.sel .to-check i[data-lucide]{ opacity:1; }

/* ---------- Team Management table ---------- */
.tm-table{ border:1px solid var(--line); border-radius:14px; overflow:hidden; }
.tm-head, .tm-row{ display:grid; grid-template-columns:1.7fr 1.8fr .85fr 92px; gap:14px; align-items:center; }
.tm-head{ padding:12px 18px; background:var(--bg); font-size:11px; font-weight:700; letter-spacing:.045em;
  text-transform:uppercase; color:var(--ink-4); }
.tm-row{ padding:14px 18px; border-top:1px solid var(--line-2); }
.tm-person{ display:flex; align-items:center; gap:11px; min-width:0; }
.tm-ava{ width:38px; height:38px; border-radius:10px; background:var(--blue-50); color:var(--blue); font-weight:800;
  font-size:13px; display:flex; align-items:center; justify-content:center; flex:none; letter-spacing:-.02em; }
.tm-name{ font-weight:700; font-size:14px; line-height:1.2; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tm-you{ font-size:10.5px; font-weight:700; color:var(--blue); background:var(--blue-50); padding:1px 7px;
  border-radius:6px; margin-left:6px; }
.tm-email{ font-size:13.5px; color:var(--ink-3); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tm-rolepill{ display:inline-flex; align-items:center; font-size:12px; font-weight:700; padding:4px 11px; border-radius:999px; }
.tm-rolepill.manager{ background:var(--blue-50); color:var(--blue); }
.tm-rolepill.consultant{ background:#f1f5f9; color:var(--ink-3); }
.tm-acts{ display:flex; gap:7px; justify-content:flex-end; }
.tm-iconbtn{ width:32px; height:32px; border-radius:8px; border:1px solid var(--line); background:var(--card);
  color:var(--ink-3); cursor:pointer; display:flex; align-items:center; justify-content:center; transition:background .12s, color .12s, border-color .12s; }
.tm-iconbtn:hover{ background:var(--bg); color:var(--ink); }
.tm-iconbtn.danger:hover{ color:var(--red); border-color:#e0a0a0; background:#fef2f2; }
.tm-iconbtn i[data-lucide]{ width:15px; height:15px; }
.tm-empty{ padding:32px 10px; text-align:center; color:var(--ink-4); font-weight:600; font-size:13.5px; }

/* ---------- modals (mirror wholesalers) ---------- */
.overlay{ position:fixed; inset:0; background:rgba(15,23,42,.45); backdrop-filter:blur(2px);
  display:none; align-items:flex-start; justify-content:center; padding:44px 20px; z-index:1000; overflow:auto; }
.overlay.open{ display:flex; }
.modal{ background:var(--card); border-radius:20px; width:100%; max-width:520px; box-shadow:0 24px 60px rgba(16,24,40,.28); overflow:hidden; }
.modal-head{ display:flex; align-items:flex-start; justify-content:space-between; padding:22px 26px; border-bottom:1px solid var(--line); }
.modal-head h2{ font-size:20px; font-weight:800; margin:0; }
.modal-head p{ margin:4px 0 0; color:var(--ink-3); font-size:13px; }
.modal-head .x{ width:34px; height:34px; border-radius:9px; border:1px solid var(--line); background:var(--card);
  color:var(--ink-3); cursor:pointer; display:flex; align-items:center; justify-content:center; flex:none; }
.modal-head .x:hover{ background:var(--bg); }
.modal-body{ padding:22px 26px; max-height:64vh; overflow:auto; }
.modal-foot{ display:flex; align-items:center; justify-content:flex-end; gap:12px; padding:18px 26px; border-top:1px solid var(--line); background:#fcfcfd; }
.fgrid{ display:grid; grid-template-columns:1fr 1fr; gap:15px 18px; }
.fgrid .full{ grid-column:1 / -1; }
.fld{ display:flex; flex-direction:column; gap:6px; }
.fld label{ font-size:12.5px; font-weight:600; color:var(--ink-2); }
.fld input, .fld select{ font-family:inherit; font-size:14px; color:var(--ink); background:var(--card);
  border:1px solid var(--line); border-radius:10px; padding:10px 12px; width:100%; }
.fld select{ appearance:none; -webkit-appearance:none; cursor:pointer; padding-right:34px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 11px center; }
.fld input:focus, .fld select:focus{ outline:none; border-color:var(--blue); box-shadow:0 0 0 3px color-mix(in oklab,var(--blue) 14%,transparent); }

.err-text{ display:none; color:var(--red); font-size:12.5px; font-weight:600; margin-top:14px; }
.err-text.show{ display:block; }

/* ---------- toast ---------- */
.toast{ position:fixed; bottom:26px; left:50%; transform:translateX(-50%) translateY(20px); opacity:0;
  background:var(--ink); color:#fff; padding:13px 20px; border-radius:12px; font-size:13.5px; font-weight:600;
  display:flex; align-items:center; gap:10px; box-shadow:0 12px 30px rgba(0,0,0,.25); z-index:1200; pointer-events:none;
  transition:opacity .2s, transform .2s; }
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
.toast i[data-lucide]{ width:18px; height:18px; color:#4ade80; }

@media (max-width:680px){
  .theme-opts{ grid-template-columns:1fr; }
  .tm-head{ display:none; }
  .tm-row{ grid-template-columns:1fr auto; gap:10px 12px; }
  .tm-row .tm-email{ grid-column:1 / -1; }
  .fgrid{ grid-template-columns:1fr; }
}
