/* =========================================================
   myfyio — dashboard (app shell). Loads styles.css for
   tokens/fonts, then overrides for the product UI.
   Dark stadium theme, clean modern left menu, NO marketing nav.
   ========================================================= */

body { overflow-x: hidden; }
body::before { opacity: 0.7; }

.app {
  display: grid;
  grid-template-columns: 252px 1fr;
  min-height: 100vh;
  position: relative; z-index: 1;
}

/* ---------------- SIDEBAR ---------------- */
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: rgba(6, 18, 11, 0.94);
  border-right: 1px solid var(--line);
}
.side-brand {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.side-brand .brand { font-size: 19px; }
.side-wallet {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  color: var(--gold); background: rgba(255, 209, 102, 0.08);
  border: 1px solid rgba(255, 209, 102, 0.22); padding: 4px 9px; border-radius: 8px;
}
.side-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
.nav-group { margin-bottom: 16px; }
.nav-group .glabel {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.14em;
  color: var(--muted-2); text-transform: uppercase; padding: 4px 12px 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border-radius: 11px; cursor: pointer;
  color: var(--muted); font-size: 14px; font-weight: 600; font-family: inherit;
  background: none; border: none; text-align: left;
  transition: background 0.16s, color 0.16s;
  position: relative;
}
.nav-item:hover { background: rgba(242, 255, 247, 0.04); color: var(--white); }
.nav-item .ic { width: 18px; height: 18px; flex: none; color: currentColor; opacity: 0.9; }
.nav-item .badge-num {
  margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  color: var(--muted); background: rgba(242, 255, 247, 0.06); padding: 2px 7px; border-radius: 999px;
}
.nav-item.active {
  background: rgba(34, 229, 132, 0.10); color: var(--green);
  box-shadow: inset 2px 0 0 var(--green);
}
.nav-item.active .badge-num { color: var(--green); background: rgba(34, 229, 132, 0.14); }

.side-user {
  display: flex; align-items: center; gap: 11px; padding: 14px 16px;
  border-top: 1px solid var(--line);
}
.avatar {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 14px; color: var(--ink);
  background: linear-gradient(135deg, var(--green), var(--gold));
}
.side-user .meta { min-width: 0; flex: 1; }
.side-user .nm { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .pl { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.side-user a.out { color: var(--muted); font-size: 16px; transition: color 0.16s; }
.side-user a.out:hover { color: var(--red); }

/* ---------------- TOPBAR ---------------- */
.main {
  display: flex; flex-direction: column; min-width: 0;
  background:
    radial-gradient(900px 480px at 72% -12%, rgba(34, 229, 132, 0.05), transparent 60%),
    var(--ink);
}
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 14px clamp(18px, 3vw, 34px);
  background: rgba(6, 20, 12, 0.96);
  border-bottom: 1px solid var(--line);
}
.hamburger { display: none; background: none; border: 1px solid var(--line); color: var(--white); border-radius: 9px; width: 38px; height: 34px; cursor: pointer; font-size: 15px; }
.topbar h1 { font-size: clamp(17px, 2.4vw, 22px); font-weight: 900; letter-spacing: -0.02em; font-stretch: 110%; white-space: nowrap; }
.topbar .spacer { flex: 1; }
.searchbox {
  display: flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 10px;
  background: rgba(5, 16, 10, 0.6); border: 1px solid var(--line); color: var(--muted);
  font-size: 13px; min-width: 200px;
}
.searchbox input { background: none; border: none; color: var(--white); font-family: inherit; font-size: 13px; width: 100%; outline: none; }
.searchbox input::placeholder { color: var(--muted-2); }
.credits-pill {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--gold);
  background: rgba(255, 209, 102, 0.08); border: 1px solid rgba(255, 209, 102, 0.22);
  padding: 7px 13px; border-radius: 10px;
}
.credits-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }

/* ---------------- VIEW / CONTENT ---------------- */
.view { padding: clamp(20px, 3vw, 34px); max-width: 1180px; width: 100%; }
.view-head { margin-bottom: 22px; }
.view-head h2 { font-size: clamp(22px, 3.2vw, 30px); font-weight: 900; letter-spacing: -0.025em; font-stretch: 112%; }
.view-head p { color: var(--muted); font-size: 14.5px; margin-top: 5px; }

.grid { display: grid; gap: 16px; }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }

.panel {
  background: linear-gradient(180deg, rgba(14, 46, 26, 0.42), rgba(8, 25, 15, 0.6));
  border: 1px solid var(--line); border-radius: 16px; padding: 20px;
}
.panel.tight { padding: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-head h3 { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.panel-head .more { font-family: var(--font-mono); font-size: 12px; color: var(--green); cursor: pointer; }

/* stat tiles */
.stat-tile { display: flex; flex-direction: column; gap: 6px; }
.stat-tile .k { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.stat-tile .v { font-size: 30px; font-weight: 900; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat-tile .sub { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted-2); }
.stat-tile .sub b.up { color: var(--green); }
.stat-tile .sub b.down { color: var(--red); }
.stat-tile.accent-green .v { color: var(--green); }
.stat-tile.accent-gold .v { color: var(--gold); }

/* app chips / cards */
.app-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.app-card {
  --accent: var(--green);
  display: flex; flex-direction: column; gap: 12px; padding: 18px;
  border: 1px solid var(--line); border-radius: 15px; background: rgba(8, 25, 15, 0.5);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.app-card:hover { transform: translateY(-3px); border-color: color-mix(in oklab, var(--accent) 50%, var(--line)); box-shadow: 0 20px 44px -26px color-mix(in oklab, var(--accent) 60%, transparent); }
.app-card .top { display: flex; align-items: center; gap: 11px; }
.app-ic { width: 38px; height: 38px; border-radius: 11px; flex: none; display: grid; place-items: center; font-family: var(--font-mono); font-weight: 800; font-size: 13px; color: var(--ink); background: var(--accent); }
.app-card .nm { font-weight: 800; font-size: 15.5px; }
.app-card .nm span { color: var(--accent); }
.app-card .role { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.app-card .stat-row { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; font-weight: 700; }
.status i { width: 7px; height: 7px; border-radius: 50%; }
.status.live { color: var(--green); } .status.live i { background: var(--green); box-shadow: 0 0 8px var(--green); }
.status.idle { color: var(--muted); } .status.idle i { background: var(--muted-2); }
.app-card .btn-sm { margin-top: 2px; }

.btn-sm {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 9px; font-weight: 700; font-size: 13px; cursor: pointer;
  border: 1px solid var(--line-2); background: rgba(242, 255, 247, 0.03); color: var(--white);
  transition: border-color 0.16s, transform 0.16s, background 0.16s; text-decoration: none;
}
.btn-sm:hover { border-color: var(--green); color: var(--green); transform: translateY(-1px); }
.btn-sm.solid { background: var(--green); color: var(--ink); border-color: var(--green); }
.btn-sm.solid:hover { color: var(--ink); filter: brightness(1.05); }

/* lists / activity */
.list { display: grid; gap: 2px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: none; }
.list-row .dotic { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; font-size: 13px; background: rgba(242, 255, 247, 0.05); }
.list-row .lr-main { flex: 1; min-width: 0; }
.list-row .lr-t { font-size: 13.5px; font-weight: 600; }
.list-row .lr-s { font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); }
.list-row .lr-time { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted-2); }

/* tables */
.dtable { width: 100%; border-collapse: collapse; }
.dtable th { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.dtable td { padding: 13px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.dtable tr:last-child td { border-bottom: none; }
.dtable .amt { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.pill { font-family: var(--font-mono); font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.pill.green { color: var(--green); background: rgba(34, 229, 132, 0.12); }
.pill.gold { color: var(--gold); background: rgba(255, 209, 102, 0.12); }
.pill.muted { color: var(--muted); background: rgba(127, 168, 146, 0.12); }

/* progress / bars */
.bar { height: 8px; border-radius: 999px; background: rgba(242, 255, 247, 0.07); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--green); }
.usage-row { display: grid; grid-template-columns: 120px 1fr 70px; align-items: center; gap: 14px; padding: 9px 0; }
.usage-row .nm { font-weight: 700; font-size: 13.5px; }
.usage-row .nm span { color: var(--green); }
.usage-row .val { font-family: var(--font-mono); font-size: 12px; color: var(--muted); text-align: right; }

/* monthly chart */
.chart { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 10px; }
.chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; height: 100%; }
.chart .col .b { width: 100%; max-width: 26px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, var(--green), var(--green-d)); transition: height 0.6s cubic-bezier(0.2,0.7,0.2,1); }
.chart .col .lbl { font-family: var(--font-mono); font-size: 10px; color: var(--muted-2); }

/* academy course cards */
.course-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: rgba(8, 25, 15, 0.5); transition: transform 0.2s, border-color 0.2s; }
.course-card:hover { transform: translateY(-3px); border-color: var(--line-2); }
.course-card .lvl { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; color: var(--gold); text-transform: uppercase; }
.course-card h4 { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; }
.course-card .desc { color: var(--muted); font-size: 13px; line-height: 1.5; flex: 1; }
.course-card .prog { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.course-card .prog .bar { flex: 1; }

/* docs hub */
.docs-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.doc-card { display: flex; align-items: center; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: rgba(8, 25, 15, 0.5); transition: border-color 0.18s, transform 0.18s; cursor: pointer; }
.doc-card:hover { border-color: var(--green); transform: translateX(3px); }
.doc-card .nm { font-weight: 800; font-size: 14.5px; }
.doc-card .nm span { color: var(--green); }
.doc-card .ct { font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); }

/* marketplace */
.mk-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: rgba(8, 25, 15, 0.5); }
.mk-card .top { display: flex; align-items: center; gap: 12px; }
.mk-card .nm { font-weight: 800; font-size: 15px; }
.mk-card .by { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.mk-card .desc { color: var(--muted); font-size: 13px; line-height: 1.5; }

/* toggles / settings */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: none; }
.setting-row .st { font-weight: 700; font-size: 14px; }
.setting-row .sd { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.toggle { width: 44px; height: 25px; border-radius: 999px; background: rgba(242,255,247,0.1); border: 1px solid var(--line-2); position: relative; cursor: pointer; flex: none; transition: background 0.2s; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: var(--muted); transition: transform 0.2s, background 0.2s; }
.toggle.on { background: rgba(34,229,132,0.25); border-color: var(--green); }
.toggle.on::after { transform: translateX(19px); background: var(--green); }
.dfield { margin-bottom: 14px; }
.dfield label { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.dfield input, .dfield select { width: 100%; padding: 11px 13px; border-radius: 10px; background: rgba(5,16,10,0.6); border: 1px solid var(--line-2); color: var(--white); font-family: inherit; font-size: 14px; }
.dfield input:focus { outline: none; border-color: var(--green); }

.topup-row { display: flex; gap: 10px; flex-wrap: wrap; }
.topup-row .chip { font-family: var(--font-mono); font-weight: 700; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line-2); cursor: pointer; transition: border-color 0.16s, color 0.16s; }
.topup-row .chip:hover, .topup-row .chip.sel { border-color: var(--green); color: var(--green); }

.view { animation: viewIn 0.35s ease; }
@keyframes viewIn { from { transform: translateY(10px); } to { transform: none; } }

/* sidebar overlay (mobile) */
.scrim { display: none; }

@media (max-width: 900px) {
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .cols-3 { grid-template-columns: 1fr; }
  .cols-2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 60; width: 256px;
    transform: translateX(-100%); transition: transform 0.28s cubic-bezier(0.2,0.7,0.2,1);
  }
  .app.menu-open .sidebar { transform: none; }
  .hamburger { display: block; }
  .searchbox { display: none; }
  .scrim.show { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.55); }
}
@media (prefers-reduced-motion: reduce) {
  .view, .sidebar { animation: none; transition: none; }
}
