/* Franchise portal (owner: franchise agent). Gold accent on a warm dark sidebar. */
body.fr { background: var(--bg); }
.fr-side { position: fixed; inset: 0 auto 0 0; width: 256px; background: linear-gradient(180deg, #121929 0%, #0b0f1a 100%); color: #c8dbe9; display: flex; flex-direction: column; z-index: 40; overflow-y: auto; transition: transform .2s; }
.fr-brand { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 12px; }
.fr-logo { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none !important; }
.fr-logo img { width: 38px; height: 38px; border-radius: 10px; background: #fff; padding: 3px; }
.fr-logo b { display: block; font-family: var(--font-display); font-size: 1.15rem; letter-spacing: .01em; color: #fff; }
.fr-logo small { display: block; font-size: .7rem; color: var(--gold); text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
.fr-x { display: none; background: none; border: 0; color: #c8dbe9; cursor: pointer; }
.fr-me { margin: 4px 12px 10px; padding: 10px; border-radius: 12px; background: rgba(26,127,201,.12); border: 1px solid rgba(26,127,201,.25); display: flex; gap: 10px; align-items: center; }
.fr-me b { display: block; font-size: .85rem; color: #fff; line-height: 1.25; }
.fr-me small { color: #9cbfd8; font-size: .74rem; }
.fr-av { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: #121929; font-weight: 800; display: grid; place-items: center; }
.fr-nav { padding: 4px 10px 20px; display: flex; flex-direction: column; gap: 2px; }
.fr-grp { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: #9fbcff; font-weight: 700; padding: 12px 10px 4px; }
.fr-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: #c8dbe9; font-size: .9rem; font-weight: 500; text-decoration: none !important; }
.fr-nav a svg { width: 18px; height: 18px; opacity: .85; }
.fr-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.fr-nav a.on { background: linear-gradient(135deg, #0f6b3a, #0c5730); color: #fff; font-weight: 700; }
.fr-nav a.on svg { opacity: 1; }
.fr-nav a.fr-out { margin-top: 10px; color: #a3bfff; }
.fr-scrim { display: none; }
.fr-main { margin-left: 256px; min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }
.fr-body .grid > *, .fr-body > * { min-width: 0; }
.fr-top { position: sticky; top: 0; z-index: 20; background: rgba(250,250,252,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 12px 24px; }
.fr-burger { display: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px; cursor: pointer; color: var(--ink); }
.fr-burger svg { width: 20px; height: 20px; display: block; }
.fr-title { flex: 1; min-width: 0; }
.fr-title h1 { font-size: 1.25rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-title p { margin: 0; font-size: .82rem; color: var(--ink-2); }
.fr-wallets { display: flex; gap: 8px; }
.fr-pill { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 10px; background: var(--green-50); color: var(--green); text-decoration: none !important; border: 1px solid var(--green-100); }
.fr-pill svg { width: 18px; height: 18px; }
.fr-pill small { display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; opacity: .8; line-height: 1.1; }
.fr-pill b { display: block; font-size: .92rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.fr-pill.gold { background: var(--gold-50); color: #0e507f; border-color: #a8d4f3; }
.fr-body { padding: 22px 24px 32px; flex: 1; width: 100%; max-width: 1280px; }
.fr-foot { padding: 14px 24px; border-top: 1px solid var(--line-2); }

/* dashboard tiles */
.fr-hero { background: linear-gradient(120deg, #0c5730, #2f53a8 55%, #1569ad); color: #fff; border-radius: var(--radius-lg); padding: 20px 22px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 18px; box-shadow: var(--shadow-lg); }
.fr-hero h2 { color: #fff; font-family: var(--font-display); font-size: 1.45rem; margin: 0 0 4px; }
.fr-hero p { margin: 0; color: rgba(255,255,255,.88); font-size: .9rem; }
.fr-hero .row .btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.fr-hero .row .btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.tile { position: relative; overflow: hidden; }
.tile .ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--gold-50); color: #115e95; margin-bottom: 8px; }
.tile .ic svg { width: 20px; height: 20px; }
.tile.green .ic { background: var(--green-50); color: var(--green); }
.tile.orange .ic { background: var(--orange-50); color: var(--orange); }
.tile.blue .ic { background: var(--info-bg); color: var(--info); }
.tile .sub { font-size: .8rem; color: var(--ink-3); }
.qa { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.qa a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-2); color: var(--ink); font-weight: 600; font-size: .84rem; text-align: center; text-decoration: none !important; box-shadow: var(--shadow); }
.qa a:hover { border-color: var(--gold); }
.qa a svg { width: 22px; height: 22px; color: #115e95; }

/* member lookup + product picker */
.lookup { display: flex; gap: 8px; }
.lookup input { flex: 1; text-transform: uppercase; }
.mcard { margin-top: 10px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px dashed var(--line); background: var(--surface-2); font-size: .88rem; }
.mcard.ok { border-color: #b5c5e9; background: var(--green-50); }
.mcard.bad { border-color: #fecaca; background: var(--bad-bg); color: #7f1d1d; }
.mcard dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; }
.mcard dt { color: var(--ink-3); } .mcard dd { margin: 0; font-weight: 600; }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.opt { position: relative; display: block; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--surface); cursor: pointer; margin: 0; font-weight: 500; color: var(--ink); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt b { display: block; font-size: .98rem; }
.opt .amt { font-size: 1.15rem; font-weight: 800; color: var(--green); font-variant-numeric: tabular-nums; }
.opt small { color: var(--ink-3); display: block; }
.opt:has(input:checked) { border-color: var(--gold); background: var(--gold-50); box-shadow: 0 0 0 3px rgba(26,127,201,.18); }
.opt.disabled { opacity: .5; cursor: not-allowed; }
.sumbox { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; font-size: .9rem; }
.sumbox .row { justify-content: space-between; padding: 3px 0; }
.sumbox .tot { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; font-weight: 800; font-size: 1.05rem; }
.cart-line { display: grid; grid-template-columns: 1fr 92px auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-2); }
.cart-line input { padding: 6px 8px; text-align: center; }
.plist { max-height: 460px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.pitem { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); }
.pitem .meta { flex: 1; min-width: 0; font-size: .85rem; }
.pitem .meta b { display: block; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bankbox dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: .92rem; }
.bankbox dt { color: var(--ink-3); } .bankbox dd { margin: 0; font-weight: 600; word-break: break-word; }
.cred { font-family: ui-monospace, Consolas, monospace; background: var(--gold-50); border: 1px dashed var(--gold); padding: 10px 12px; border-radius: 8px; }

/* login */
.fr-login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--bg); }
.fr-login .art { background: radial-gradient(circle at 20% 20%, #10456b 0, #121929 55%, #0b0f1a 100%); color: #d5e8f5; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.fr-login .art h1 { color: #fff; font-family: var(--font-display); font-size: 2.3rem; margin: 18px 0 10px; }
.fr-login .art ul { padding: 0; list-style: none; margin: 18px 0 0; display: grid; gap: 10px; }
.fr-login .art li { display: flex; gap: 10px; align-items: center; }
.fr-login .art li svg { color: var(--gold); width: 20px; height: 20px; flex: 0 0 20px; }
.fr-login .pane { display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.fr-login .box { width: 100%; max-width: 400px; }
.fr-login .logo { height: 46px; width: auto; margin-bottom: 18px; }

@media (max-width: 980px) {
  .fr-side { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.side-open .fr-side { transform: none; }
  body.side-open .fr-scrim { display: block; position: fixed; inset: 0; background: rgba(11, 17, 30,.45); z-index: 30; }
  .fr-x, .fr-burger { display: block; }
  .fr-x { min-width: 40px; min-height: 40px; }
  .fr-main { margin-left: 0; }
  .fr-top { padding: 10px 16px; }
  .fr-body { padding: 16px 16px 28px; }
  .fr-login { grid-template-columns: 1fr; }
  .fr-login .art { display: none; }
}
@media (max-width: 560px) {
  .hide-sm { display: none !important; }
  .qa { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .fr-title h1 { font-size: 1rem; line-height: 1.25; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .fr-pill svg { display: none; }
  .fr-top { gap: 8px; }
  .fr-title p { display: none; }
  .fr-body .table td.small { white-space: nowrap; }
  .fr-pill { padding: 5px 9px; }
  .fr-hero { padding: 16px; }
  .fr-hero h2 { font-size: 1.2rem; }
  .cart-line { grid-template-columns: 1fr 70px auto; }
}

/* ---------- Design pass: polish + dark mode ---------- */
.fr-top { background: var(--glass); }
.fr-top .theme-tg { flex: none; }
.card { border-radius: 16px; transition: box-shadow .3s, transform .3s var(--ease); }
.fr-hero { box-shadow: 0 18px 36px -18px rgba(22, 35, 64,.6); position: relative; overflow: hidden; }
.fr-hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(196, 214, 255,.25), transparent 65%); pointer-events: none; }
html.is-dark .fr-pill.gold { color: #fde68a; border-color: #123e5e; }
html.is-dark .fr-pill { border-color: var(--line); }
html.is-dark .mcard.ok { border-color: #1b2f5e; }
html.is-dark .mcard.bad { border-color: #6b2222; color: #fecaca; }
@media (max-width: 640px) { .fr-top .theme-tg { width: 40px; height: 40px; } }
