/* =====================================================================
   TFS Design v2 - "Night" (default) and "Day", client + admin pages.
   A layer on top of tfs-ui.css: every rule starts with html:root so it wins
   over the base file whatever order the two are loaded in. Same colour family
   as the partner portal (partners.css), so the whole site reads as one product.
   Day / Night is switched with the moon / sun button and remembered
   (localStorage "tfs-theme", shared with the partner portal).
   ===================================================================== */

/* ---------------- tokens: Night ---------------- */
html:root{
  --bg:#050913;
  --bg-2:#0e1527;
  --bg-3:#131c33;
  --panel-bg:rgba(9,14,28,.62);
  --text:#e9eefb;
  --muted:#8c98b5;
  --border:rgba(148,170,215,.13);
  --border-2:rgba(148,170,215,.24);
  --radius:18px;
  --shadow:0 1px 0 rgba(255,255,255,.04) inset, 0 18px 40px -18px rgba(0,0,0,.7);

  --glass:rgba(255,255,255,.03);
  --glass-2:rgba(255,255,255,.055);
  --glass-border:rgba(148,170,215,.14);

  --accent:#4f8bff; --accent-2:#7aa8ff; --violet:#7c5cff;
  --gold:#4f8bff; --gold-2:#7c9dff;
  --green:#34d399; --orange:#fbbf24; --red:#fb7185;

  --brand-grad:linear-gradient(135deg,#3f7cff 0%,#7a5cff 100%);
  --brand-soft:rgba(79,139,255,.14);
  --surface:linear-gradient(180deg,rgba(21,31,56,.88),rgba(14,21,40,.9));
  --field:#0b1224;

  --chrome-bg-2:#0c1326; --chrome-bg-3:#111a31;
  --chrome-text:#e9eefb; --chrome-muted:#8c98b5;
  --chrome-border:rgba(148,170,215,.14);
  --chrome-tint-04:rgba(255,255,255,.04); --chrome-tint-05:rgba(255,255,255,.05);
  --chrome-tint-08:rgba(255,255,255,.08); --chrome-tint-10:rgba(255,255,255,.10); --chrome-tint-14:rgba(255,255,255,.14);
  color-scheme:dark;
}

/* ---------------- tokens: Day ---------------- */
html:root[data-theme="light"]{
  --bg:#edf1f9;
  --bg-2:#ffffff;
  --bg-3:#f3f6fc;
  --panel-bg:rgba(255,255,255,.55);
  --text:#0d1830;
  --muted:#5f6e8c;
  --border:rgba(30,50,100,.11);
  --border-2:rgba(30,50,100,.2);
  --shadow:0 1px 2px rgba(20,40,90,.06), 0 16px 34px -18px rgba(20,40,90,.28);

  --glass:rgba(255,255,255,.7);
  --glass-2:rgba(255,255,255,.85);
  --glass-border:rgba(30,50,100,.12);

  --accent:#2f6bff; --accent-2:#4f86ff; --violet:#6a4dff;
  --gold:#2f6bff; --gold-2:#5a7dff;
  --green:#0f9d6a; --orange:#b87400; --red:#d93a58;

  --brand-soft:rgba(47,107,255,.10);
  --surface:#ffffff;
  --field:#ffffff;

  --chrome-bg-2:#ffffff; --chrome-bg-3:#f3f6fc;
  --chrome-text:#0d1830; --chrome-muted:#5f6e8c;
  --chrome-border:rgba(30,50,100,.12);
  --chrome-tint-04:rgba(20,40,90,.04); --chrome-tint-05:rgba(20,40,90,.05);
  --chrome-tint-08:rgba(20,40,90,.08); --chrome-tint-10:rgba(20,40,90,.10); --chrome-tint-14:rgba(20,40,90,.14);
  color-scheme:light;
}

/* ---------------- page canvas ---------------- */
html:root body{
  font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  background:var(--bg);
  font-feature-settings:"cv11","ss01";
}
html:root body::before{
  background:
    radial-gradient(1000px 640px at 6% -10%, rgba(63,124,255,.26), transparent 60%),
    radial-gradient(860px 560px at 96% 4%, rgba(122,92,255,.20), transparent 60%),
    radial-gradient(900px 640px at 50% 120%, rgba(34,211,238,.08), transparent 60%);
}
html:root[data-theme="light"] body::before{
  background:
    radial-gradient(1000px 640px at 6% -10%, rgba(63,124,255,.16), transparent 60%),
    radial-gradient(860px 560px at 96% 4%, rgba(122,92,255,.12), transparent 60%);
}
html:root body::after{ opacity:.045; }
html:root .tech-lines{ opacity:.22; }
html:root[data-theme="light"] .tech-lines{ opacity:.12; }

html:root .main, html:root .page, html:root .bc .bc-page{
  background-color:var(--panel-bg);
  background-image:radial-gradient(var(--tint-08) 1px, transparent 1.4px);
  background-size:26px 26px;
  border:1px solid var(--border);
  border-radius:26px;
  box-shadow:none;
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
}
html:root[data-theme="light"] .main, html:root[data-theme="light"] .page{
  background-image:radial-gradient(rgba(30,50,100,.08) 1px, transparent 1.4px);
}

/* ---------------- top navigation (client pages) ---------------- */
html:root .topnav{
  background:rgba(7,11,22,.78);
  backdrop-filter:blur(16px) saturate(140%);
  -webkit-backdrop-filter:blur(16px) saturate(140%);
  border-bottom:1px solid var(--border);
  box-shadow:0 12px 34px -18px rgba(0,0,0,.7);
}
html:root .topnav-statusbar{ background:transparent; border-bottom:1px solid var(--border); }
html:root .topnav-brand-badge{ background:var(--brand-grad); color:#fff; box-shadow:0 8px 20px -8px #4f8bff; }
html:root .topnav-brand-text b{ background:var(--brand-grad); -webkit-background-clip:text; background-clip:text; color:transparent; }
html:root .topnav-tab{
  border:1px solid transparent; background:transparent; color:var(--chrome-muted);
  text-transform:none; letter-spacing:0; font-size:13.5px; font-weight:650; padding:10px 15px; border-radius:12px;
}
html:root .topnav-tab:hover{ background:var(--chrome-tint-05); border-color:var(--chrome-border); color:var(--chrome-text); transform:none; }
html:root .topnav-tab.active{
  background:var(--brand-grad); border-color:transparent; color:#fff;
  box-shadow:0 10px 24px -10px rgba(79,139,255,.8);
}
html:root .topnav-tab.topnav-wa{ color:#22c55e; background:rgba(34,197,94,.08); border-color:rgba(34,197,94,.3); }
html:root .topnav-pill{ background:var(--chrome-tint-04); border-color:var(--chrome-border); color:var(--chrome-text); }
html:root .topnav-pill-gold{ background:var(--brand-soft); border-color:rgba(79,139,255,.35); color:var(--accent-2); }
html:root .topnav-icon-btn{ background:var(--chrome-tint-04); border:1px solid var(--chrome-border); color:var(--chrome-text); }
html:root .topnav-icon-btn:hover{ background:var(--chrome-tint-08); }
html:root .topnav-avatar{ background:var(--brand-grad); color:#fff; border-color:transparent; }
html:root .topnav-dropdown-menu, html:root .topnav-avatar-menu{
  background:var(--chrome-bg-2); border:1px solid var(--chrome-border); box-shadow:0 24px 50px -20px rgba(0,0,0,.6); border-radius:14px;
}
html:root .topnav-mobile{ background:var(--chrome-bg-2); border-color:var(--chrome-border); }
html:root .topnav-mobile a, html:root .topnav-mobile button{ color:var(--chrome-text); }
html:root .topnav-burger{ color:var(--chrome-text); background:var(--chrome-tint-04); border-color:var(--chrome-border); }

html:root[data-theme="light"] .topnav{ background:rgba(255,255,255,.82); box-shadow:0 10px 30px -20px rgba(20,40,90,.35); }
html:root[data-theme="light"] .topnav-tab.active{ color:#fff; }
html:root[data-theme="light"] .topnav-dropdown-menu, html:root[data-theme="light"] .topnav-avatar-menu{ box-shadow:0 24px 50px -24px rgba(20,40,90,.4); }

/* ---------------- admin sidebar ---------------- */
html:root .sidebar{
  background:linear-gradient(180deg, rgba(14,21,40,.94), rgba(8,13,26,.96));
  border:1px solid var(--border);
  box-shadow:0 24px 60px -24px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.04);
}
html:root .sb-badge{ background:var(--brand-grad); color:#fff; }
html:root .sb-link, html:root .sb-button{ color:var(--muted); border-radius:11px; font-weight:600; }
html:root .sb-link:hover, html:root .sb-button:hover{ background:var(--tint-05); color:var(--text); }
html:root .sb-link.active{ background:var(--brand-soft); color:var(--text); }
html:root .sb-link.active i{ color:var(--accent); }
html:root .sb-section{ color:var(--muted); }
html:root[data-theme="light"] .sidebar{ background:rgba(255,255,255,.92); box-shadow:0 20px 50px -26px rgba(20,40,90,.45); }
html:root[data-theme="light"] .sb-link:hover{ background:rgba(20,40,90,.05); }
html:root .sb-theme{
  display:flex; align-items:center; gap:10px; width:100%; margin-top:6px; padding:9px 12px; border-radius:11px;
  background:var(--tint-04); border:1px solid var(--border); color:var(--text); font:inherit; font-weight:650; cursor:pointer;
}
html:root .sb-theme .day{ display:none; }
html:root[data-theme="light"] .sb-theme .day{ display:inline; }
html:root[data-theme="light"] .sb-theme .night{ display:none; }

/* ---------------- surfaces ---------------- */
html:root .hero, html:root .panel, html:root .card, html:root .info-card, html:root .wallet, html:root .form-card,
html:root .bento-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  backdrop-filter:none; -webkit-backdrop-filter:none;
}
html:root .hero{
  position:relative;
  background:
    radial-gradient(600px 220px at 0% 0%, rgba(79,139,255,.22), transparent 70%),
    radial-gradient(500px 220px at 100% 0%, rgba(124,92,255,.16), transparent 70%),
    var(--surface);
}
html:root[data-theme="light"] .hero{
  background:
    radial-gradient(600px 220px at 0% 0%, rgba(79,139,255,.12), transparent 70%),
    radial-gradient(500px 220px at 100% 0%, rgba(124,92,255,.08), transparent 70%),
    #fff;
}
html:root .bento-card:hover{ border-color:var(--border-2); transform:translateY(-2px); }
html:root .panel-head, html:root .card-top{ border-bottom:1px solid var(--border); background:transparent; }
html:root .h2{ font-size:26px; font-weight:800; letter-spacing:-.02em; }
html:root .pill{ background:var(--brand-soft); border:1px solid rgba(79,139,255,.28); color:var(--accent-2); font-weight:700; font-size:12px; letter-spacing:.02em; }
html:root[data-theme="light"] .pill{ color:var(--accent); }
html:root .bento-title i{ color:var(--accent); }

/* ---------------- buttons ---------------- */
html:root .btn, html:root .btn-primary, html:root .btn-outline, html:root .btn-success, html:root .btn-danger, html:root .btn-warning, html:root .btn-ghost, html:root .btn-gold{
  border-radius:12px; font-weight:700; letter-spacing:.005em;
}
html:root .btn-primary, html:root .btn-gold{
  color:#fff; background:var(--brand-grad); border:1px solid transparent;
  box-shadow:0 10px 22px -12px rgba(79,139,255,.9);
}
html:root .btn-primary:hover, html:root .btn-gold:hover{ filter:brightness(1.08); transform:translateY(-1px); box-shadow:0 14px 28px -12px rgba(79,139,255,.95); }
html:root .btn-outline, html:root .btn-ghost{ color:var(--text); background:var(--tint-03); border:1px solid var(--border-2); }
html:root .btn-outline:hover, html:root .btn-ghost:hover{ background:var(--tint-06); border-color:var(--border-2); }
html:root .btn-success{ color:var(--green); background:rgba(52,211,153,.10); border:1px solid rgba(52,211,153,.3); }
html:root .btn-danger{ color:var(--red); background:rgba(251,113,133,.10); border:1px solid rgba(251,113,133,.3); }
html:root .btn-warning{ color:#1b1300; background:linear-gradient(135deg,#fde68a,#f59e0b); border:1px solid transparent; }
html:root .btn:disabled, html:root button:disabled{ opacity:.55; cursor:not-allowed; }

/* ---------------- forms ---------------- */
html:root input[type="text"], html:root input[type="password"], html:root input[type="email"], html:root input[type="number"],
html:root input[type="tel"], html:root input[type="date"], html:root input[type="search"], html:root select, html:root textarea{
  background:var(--field); border:1px solid var(--border-2); color:var(--text); border-radius:12px;
}
html:root input:focus, html:root select:focus, html:root textarea:focus{
  border-color:var(--accent); box-shadow:0 0 0 3px var(--brand-soft); outline:none;
}
html:root input::placeholder, html:root textarea::placeholder{ color:var(--muted); opacity:.85; }
html:root:not([data-theme="light"]) select option{ background:#0e1527; color:var(--text); }
html:root input[type="checkbox"], html:root input[type="radio"]{ accent-color:var(--accent); }

/* ---------------- tables ---------------- */
html:root thead th{
  color:var(--muted); font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.07em;
  background:var(--tint-03); border-bottom:1px solid var(--border);
}
html:root tbody td{ border-bottom:1px solid var(--border); }
html:root tbody tr:hover{ background:var(--brand-soft); }

/* ---------------- status chips & small bits ---------------- */
html:root .tag{ border-radius:999px; font-weight:700; letter-spacing:.02em; }
html:root .tag-done{ background:rgba(52,211,153,.12); color:var(--green); border:1px solid rgba(52,211,153,.3); }
html:root .tag-progress{ background:rgba(251,191,36,.12); color:var(--orange); border:1px solid rgba(251,191,36,.3); }
html:root .badge{ border-radius:999px; font-weight:700; }
html:root hr{ border:none; border-top:1px solid var(--border); }
html:root ::selection{ background:rgba(79,139,255,.35); }
html:root *{ scrollbar-color:var(--border-2) transparent; }

/* numbers line up in stat tiles and tables */
html:root .tiles b, html:root .bento-card b, html:root td{ font-variant-numeric:tabular-nums; }

/* smooth switch between Day and Night (not on page load) */
html.theme-anim, html.theme-anim *{ transition:background-color .25s ease, border-color .25s ease, color .2s ease !important; }

/* ---------------- Day: hard-coded dark bits in older pages ---------------- */
html:root[data-theme="light"] .alert, html:root[data-theme="light"] .ib-m, html:root[data-theme="light"] .cp-hex{ color:var(--text); }
html:root[data-theme="light"] code.snip{ background:var(--bg-3); }

/* ---------------- notification bell (client top bar) ---------------- */
html:root .bell-wrap{ position:relative; }
html:root .bell-wrap .topnav-icon-btn{ position:relative; }
html:root .bell-count{ position:absolute; top:-4px; right:-4px; min-width:18px; height:18px; padding:0 5px; border-radius:999px;
  background:#ef4444; color:#fff; font-size:11px; font-weight:800; display:grid; place-items:center; border:2px solid var(--chrome-bg-2); }
html:root .bell-count[hidden]{ display:none; }
html:root .bell-menu{ position:absolute; right:0; top:calc(100% + 10px); width:360px; max-width:92vw; z-index:70;
  background:var(--chrome-bg-2); border:1px solid var(--chrome-border); border-radius:16px; box-shadow:0 24px 50px -20px rgba(0,0,0,.6); overflow:hidden; }
html:root .bell-menu[hidden]{ display:none; }
html:root .bell-head{ display:flex; justify-content:space-between; align-items:center; padding:12px 14px; border-bottom:1px solid var(--chrome-border); color:var(--chrome-text); }
html:root .bell-head button{ background:none; border:none; color:var(--accent); font:inherit; font-size:12.5px; font-weight:600; cursor:pointer; }
html:root .bell-list{ max-height:420px; overflow:auto; }
html:root .bell-item{ display:flex; gap:11px; padding:11px 14px; text-decoration:none; color:var(--chrome-text); border-bottom:1px solid var(--chrome-border); }
html:root .bell-item:hover{ background:var(--chrome-tint-05); }
html:root .bell-item.unread{ background:var(--brand-soft); }
html:root .bell-item b{ display:block; font-size:13.5px; font-weight:650; }
html:root .bell-item small{ display:block; color:var(--chrome-muted); font-size:12.5px; margin-top:2px; line-height:1.4; }
html:root .bell-item em{ display:block; color:var(--chrome-muted); font-size:11.5px; font-style:normal; margin-top:3px; }
html:root .bell-ico{ width:32px; height:32px; border-radius:10px; flex:none; display:grid; place-items:center; background:var(--brand-grad); color:#fff; }
html:root .bell-empty{ padding:22px 14px; color:var(--chrome-muted); text-align:center; font-size:13px; }

/* ---------------- free files banner ---------------- */
html:root .ff-banner{ display:flex; align-items:center; gap:14px; margin:0 0 16px; padding:14px 16px; border-radius:16px;
  background:linear-gradient(135deg, rgba(34,197,94,.16), rgba(79,139,255,.14)); border:1px solid rgba(34,197,94,.35); }
html:root .ff-banner b{ display:block; font-size:15.5px; }
html:root .ff-banner small{ display:block; color:var(--muted); font-size:12.5px; margin-top:2px; }
html:root .ff-banner > div{ flex:1; min-width:0; }
html:root .ff-ico{ width:42px; height:42px; border-radius:12px; display:grid; place-items:center; flex:none; background:linear-gradient(135deg,#22c55e,#16a34a); color:#fff; font-size:20px; }
html:root .ff-x{ background:none; border:none; color:var(--muted); font-size:22px; cursor:pointer; line-height:1; }
