/* Tatami Lugano · BJJ Academy */
:root {
  --bg: #0a0908;
  --bg-raised: #100e0c;
  --card: #14110e;
  --card-2: #181410;
  --border: #2b2620;
  --border-soft: #1e1a15;
  --gold: #d3a94f;
  --gold-dim: #8a7340;
  --gold-soft: rgba(211, 169, 79, 0.12);
  --text: #f0ece3;
  --muted: #8d8579;
  --faint: #5d574d;
  --green: #6fbf73;
  --red: #cf6f5f;
  --violet: #8a6fd8;
  --belt-blu: #1e56d6;
  --belt-viola: #7c53c4;
  --belt-marrone: #6d4426;
  --belt-bianca: #ece8dd;
  --belt-nera: #131313;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --sans: 'Archivo', -apple-system, 'Helvetica Neue', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: #050403;
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
}
@media (min-width: 470px) {
  #app { border-left: 1px solid #171410; border-right: 1px solid #171410; }
}

.view { padding-bottom: 96px; min-height: 100dvh; }
.view.no-tabs { padding-bottom: 24px; }

.hidden { display: none !important; }

/* ------------------------------------------------ typography helpers */
.mono { font-family: var(--mono); }
.label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.label.gold { color: var(--gold); }

h1.page-title {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* ------------------------------------------------ logo */
.logo { display: flex; align-items: center; gap: 10px; }
.logo .kanji {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.05;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.logo .wordmark {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
}

/* ------------------------------------------------ header */
.page-head {
  padding: 22px 20px 18px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border-soft);
}
.page-head .head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
}
.page-head h1 { margin-top: 10px; }

.icon-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
}
.icon-btn:active { background: var(--card-2); }

/* ------------------------------------------------ content sections */
.content { padding: 20px; display: flex; flex-direction: column; gap: 22px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.section-head .num { font-family: var(--mono); font-size: 10px; color: var(--gold); letter-spacing: 0.15em; }
.section-head .title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex-shrink: 1;
}
.section-head .line { flex: 1 0 12px; height: 1px; background: var(--border-soft); }
.section-head .action { flex-shrink: 0; }
.section-head .end { font-family: var(--mono); font-size: 10px; color: var(--faint); }
.section-head .action { font-family: var(--mono); font-size: 10px; letter-spacing: .15em; color: var(--gold); cursor: pointer; background:none; border:none; }

/* ------------------------------------------------ cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.card.pad { padding: 16px; }
.card.dashed {
  border-style: dashed;
  background: transparent;
}
.card.tappable { cursor: pointer; }
.card.tappable:active { background: var(--card-2); }

.empty-card {
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 22px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--faint);
}

/* ------------------------------------------------ chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 8px;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 3px;
  white-space: nowrap;
}
.chip.gold { border-color: var(--gold-dim); color: var(--gold); }
.chip.fill { background: var(--gold); border-color: var(--gold); color: #171204; font-weight: 700; }
.chip.tu { color: var(--text); border-color: var(--muted); }
.chip.green { border-color: rgba(107, 176, 122, 0.5); color: var(--green); }
.chip.red { border-color: rgba(199, 94, 94, 0.5); color: var(--red); }

/* filter row */
.filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter-btn {
  flex: 1;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.filter-btn.active { background: var(--gold); border-color: var(--gold); color: #171204; font-weight: 700; }

/* ------------------------------------------------ buttons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn:active { background: var(--card-2); }
.btn.gold { border-color: var(--gold-dim); color: var(--gold); background: transparent; }
.btn.solid { background: var(--gold); border-color: var(--gold); color: #171204; }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* ------------------------------------------------ avatar */
.avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  color: rgba(10, 8, 5, 0.85);
  border: 3px solid rgba(240, 236, 227, 0.25);
  box-shadow: 0 0 0 1px rgba(240, 236, 227, 0.22);
  flex-shrink: 0;
  position: relative;
}
.avatar.sm { width: 36px; height: 36px; font-size: 12px; }
.avatar.md { width: 44px; height: 44px; font-size: 14px; }
.avatar.lg { width: 72px; height: 72px; font-size: 24px; border-width: 4px; }
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
/* ------------------------------------------------ belt bar */
.belt {
  display: flex;
  height: 26px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.belt.thin { height: 14px; }
.belt .body { flex: 1; position: relative; }
.belt .body.bianca { background: linear-gradient(180deg, #f4f1e8, #dcd7ca); }
.belt .body.blu { background: linear-gradient(180deg, #2a63e8, #1848b8); }
.belt .body.viola { background: linear-gradient(180deg, #8a5fd6, #6a43ab); }
.belt .body.marrone { background: linear-gradient(180deg, #7d5130, #59391f); }
.belt .body.nera { background: linear-gradient(180deg, #262626, #0e0e0e); }
.belt .rank-bar {
  width: 26%;
  background: #111;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 4px;
  padding: 3px 4px;
}
.belt .rank-bar.red { background: #8f1f1f; }
.belt .stripe { width: 5px; background: #f4f1e8; border-radius: 1px; }
.belt .tail { width: 6%; }
.belt .tail.bianca { background: #e8e4d9; }
.belt .tail.blu { background: #1f55cc; }
.belt .tail.viola { background: #7a4fc4; }
.belt .tail.marrone { background: #6b4226; }
.belt .tail.nera { background: #181818; }

/* ------------------------------------------------ progress bar */
.progress {
  height: 4px;
  border-radius: 2px;
  background: var(--border-soft);
  overflow: hidden;
}
.progress > div { height: 100%; background: var(--gold); border-radius: 2px; }
.progress.gray > div { background: var(--faint); }

/* ------------------------------------------------ stat blocks */
.stats-row { display: flex; }
.stats-row .stat { flex: 1; padding: 4px 0; }
.stats-row .stat + .stat { border-left: 1px solid var(--border-soft); padding-left: 16px; }
.stat .value { font-family: var(--mono); font-size: 30px; font-weight: 500; letter-spacing: -0.02em; }
.stat .value.sm { font-size: 24px; }
.stat .name {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ------------------------------------------------ bar charts */
.week-chart { display: flex; gap: 8px; align-items: flex-end; margin-top: 16px; }
.week-chart .col { flex: 1; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.week-chart .bar-area { width: 100%; height: 44px; display: flex; align-items: flex-end; }
.week-chart .bar { width: 100%; background: var(--gold); border-radius: 2px 2px 0 0; min-height: 2px; opacity: .9; }
.week-chart .bar.zero { background: var(--border); height: 2px; }
.week-chart .day { font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; color: var(--faint); }
.week-chart .day.today { color: var(--gold); }

/* 12-month variant: tighter columns, smaller labels */
.week-chart.months { gap: 5px; }
.week-chart.months .day { font-size: 7.5px; letter-spacing: 0.03em; }

/* ------------------------------------------------ list rows */
.row-list { display: flex; flex-direction: column; }
.row-list .row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
}
.row-list .row:last-child { border-bottom: none; }
.row-list .row:active { background: var(--card-2); }
.row .grow { flex: 1; min-width: 0; }
.row .name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 3px; letter-spacing: 0.05em; }
.row .chev { color: var(--faint); font-size: 16px; }

/* ------------------------------------------------ schedule cards */
.day-sep {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 6px 0 12px;
}
.day-sep .dname {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.day-sep .line { flex: 1; height: 1px; background: var(--border-soft); }
.day-sep.today .dname { color: var(--gold); }
.day-sep.today .line { background: var(--gold); opacity: 0.4; }
.day-past .lesson-card { opacity: 0.5; }
.day-past .day-sep .dname { color: var(--faint); }
.past-toggle { display: flex; gap: 18px; margin: -6px 0 -4px; }
.past-btn {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--gold);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.past-btn.dim { color: var(--muted); }
.lesson-card {
  display: flex;
  align-items: stretch;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  margin-bottom: 10px;
}
.lesson-card:active { background: var(--card-2); }
.lesson-card .time {
  width: 86px;
  padding: 14px 0 14px 16px;
  flex-shrink: 0;
}
.lesson-card .time .start { font-family: var(--mono); font-size: 21px; font-weight: 500; }
.lesson-card .time .end { font-family: var(--mono); font-size: 10.5px; color: var(--faint); margin-top: 3px; }
.lesson-card .info { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.lesson-card .info .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.lesson-card .info .coach { font-size: 13.5px; color: var(--muted); }
.lesson-card .accent { width: 3px; flex-shrink: 0; }
.lesson-card .accent.gold { background: var(--gold); }
.lesson-card .accent.violet { background: var(--violet); }

/* ------------------------------------------------ photo lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(6, 5, 4, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: fadeIn 0.18s ease;
}
.lightbox img {
  width: min(82vw, 380px);
  height: min(82vw, 380px);
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

/* ------------------------------------------------ tabbar */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  display: flex;
  background: rgba(13, 11, 9, 0.96);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-soft);
  padding: 8px 6px calc(env(safe-area-inset-bottom, 0px) + 10px);
  z-index: 50;
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--faint);
  text-decoration: none;
  padding: 4px 0;
}
.tab svg { width: 21px; height: 21px; }
.tab span {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.tab.active { color: var(--gold); }

/* ------------------------------------------------ login */
.login-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 26px;
  gap: 26px;
}
.login-wrap .brand { font-family: var(--mono); font-size: 12px; letter-spacing: 0.3em; color: var(--gold); }
.login-wrap h1 { font-size: 40px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.08; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field input, .field select { width: 100%; min-width: 0; box-sizing: border-box; }
.field label { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.field input {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 14px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  outline: none;
}
.field input:focus { border-color: var(--gold-dim); }
.field input, .field select { color-scheme: dark; }
.form-error { color: var(--red); font-size: 13px; font-family: var(--mono); min-height: 16px; }
.login-toggle { text-align: center; color: var(--muted); font-size: 13.5px; cursor: pointer; }
.login-toggle b { color: var(--gold); font-weight: 600; }
.demo-box { font-family: var(--mono); font-size: 11px; line-height: 1.9; color: var(--muted); }
.demo-box b { color: var(--text); font-weight: 500; }

/* ------------------------------------------------ misc */
.kv-card .kv {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.kv-card .kv:last-child { border-bottom: none; }
.kv .k { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.kv .v { font-size: 15px; }
.kv .edit { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; color: var(--gold); cursor: pointer; white-space: nowrap; background:none; border:none; }

.credit-card {
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(211, 169, 79, 0.10), rgba(211, 169, 79, 0.02) 55%, transparent);
}
.credit-card .amount { display: flex; align-items: baseline; gap: 8px; margin: 10px 0; }
.credit-card .cur { font-size: 30px; font-weight: 700; color: var(--text); }
.credit-card .num { font-family: var(--mono); font-size: 46px; font-weight: 500; color: var(--gold); letter-spacing: -0.03em; }
.credit-card .dec { font-family: var(--mono); font-size: 15px; color: var(--gold-dim); }
.credit-card .desc { font-family: var(--mono); font-size: 10.5px; line-height: 1.7; color: var(--muted); }

.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.plan-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
}
.plan-card.best { border-color: var(--gold-dim); background: var(--gold-soft); }
.plan-card .plname { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.15em; color: var(--muted); text-transform: uppercase; }
.plan-card .plprice { font-size: 21px; font-weight: 700; margin-top: 7px; }
.plan-card .plprice small { font-size: 11px; font-weight: 500; color: var(--muted); }
.plan-card .plnote { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; color: var(--faint); margin-top: 6px; text-transform: uppercase; line-height: 1.6; }
.plan-card .badge {
  position: absolute; top: -9px; right: 10px;
  background: var(--gold); color: #171204;
  font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  padding: 3px 7px; border-radius: 4px;
}

.note-box {
  border: 1px dashed var(--border);
  border-radius: 5px;
  padding: 13px 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 12px;
}

/* podium */
.podium { display: flex; align-items: flex-end; gap: 10px; padding: 10px 0 4px; }
.podium .place { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.podium .place .pname { font-size: 13px; font-weight: 600; }
.podium .place .pscore { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.podium .block {
  width: 100%;
  border-radius: 4px 4px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10px;
  font-family: var(--mono);
  font-size: 20px;
  background: var(--card-2);
  color: var(--faint);
  border: 1px solid var(--border-soft);
  border-bottom: none;
}
.podium .p1 .block { height: 96px; background: var(--gold); color: #171204; font-weight: 700; border-color: var(--gold); }
.podium .p2 .block { height: 64px; }
.podium .p3 .block { height: 46px; }

.rank-row .pos { font-family: var(--mono); font-size: 11px; color: var(--faint); width: 22px; }
.rank-row .pos.top { color: var(--gold); }
.rank-row .score { font-family: var(--mono); font-size: 19px; }
.rank-row .bar-wrap { margin-top: 7px; }

/* curriculum */
.level-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
}
.level-row:active { background: var(--card-2); }
.level-row.current { border-color: var(--gold-dim); box-shadow: 0 0 0 1px var(--gold-dim); }
.level-row .lnum { font-family: var(--mono); font-size: 11px; color: var(--muted); width: 22px; }
.level-row.current .lnum { color: var(--gold); }
.level-row .lmain { flex: 1; }
.level-row .lmeta { display: flex; justify-content: space-between; margin-top: 8px; align-items: baseline; }
.level-row .lname { font-size: 13.5px; font-weight: 600; }
.level-row .lcount { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 0.08em; }
.level-row .lstatus { width: 18px; text-align: center; }
.level-row .check { color: var(--gold); font-size: 14px; }
.level-row .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }

.tech-row {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 13px 15px;
  margin-bottom: 9px;
}
.tech-row .box {
  width: 22px; height: 22px;
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.tech-row .box.done { background: var(--gold); border-color: var(--gold); color: #171204; font-weight: 700; }
.tech-row .box.tickable { cursor: pointer; }
.tech-row .box.tickable:not(.done):hover { border-color: var(--gold); }
.tech-row .tmain { flex: 1; }
.tech-row .tname { font-size: 14.5px; font-weight: 600; }

/* shop */
.shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.product .img {
  aspect-ratio: 0.92;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: repeating-linear-gradient(45deg, #16130f 0px, #16130f 7px, #120f0c 7px, #120f0c 14px);
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 10px;
}
.product .img .tag { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.2em; color: var(--muted); position: relative; z-index: 1; }
.product .img .photo {
  position: absolute;
  inset: 12px 8px 26px;
  width: calc(100% - 16px);
  height: calc(100% - 38px);
  object-fit: contain;
}
.product .img.flippable { cursor: pointer; }
.product .img .flip-hint {
  position: absolute;
  top: 8px; right: 10px;
  font-size: 12px;
  color: var(--muted);
}
.product .pname { font-size: 13.5px; font-weight: 600; margin-top: 9px; }
.product .pprice { font-family: var(--mono); font-size: 12px; color: var(--gold); margin-top: 4px; }
.product .pnote { font-size: 11px; color: var(--faint); margin-top: 3px; }

/* rules */
.rule-row {
  display: flex;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 10px;
  align-items: baseline;
}
.rule-row .rnum { font-family: var(--mono); font-size: 19px; color: var(--gold); }
.rule-row .rtext { font-size: 14.5px; line-height: 1.5; }

/* toast */
.toast {
  position: fixed;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%);
  background: #1d1913;
  border: 1px solid var(--gold-dim);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  padding: 11px 18px;
  border-radius: 6px;
  z-index: 100;
  max-width: 85%;
  text-align: center;
}

/* transactions */
.tx-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }
.tx-row:last-child { border-bottom: none; }
.tx-row .tlabel { font-size: 13.5px; font-weight: 500; }
.tx-row .tdate { font-family: var(--mono); font-size: 10px; color: var(--faint); margin-top: 3px; }
.tx-row .tamt { font-family: var(--mono); font-size: 14px; }
.tx-row .tamt.pos { color: var(--green); }
.tx-row .tamt.neg { color: var(--muted); }

select.inline-select,
input.inline-select {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 12px;
  font-family: var(--mono);
  font-size: 13px;
  width: 100%;
}

.combo { position: relative; }
.combo-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 244px; overflow-y: auto;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 6px; z-index: 40;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
}
.combo-opt {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 11px 12px; cursor: pointer; font-size: 13px;
  border-bottom: 1px solid var(--border-soft);
}
.combo-opt:last-child { border-bottom: none; }
.combo-opt:hover { background: var(--card-2); }
.combo-belt { color: var(--muted); font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.combo-empty { padding: 12px; color: var(--muted); font-size: 13px; }

.fade-in { animation: fadeIn 0.18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ================================================================ desktop (≥900px)
   Mobile keeps the app-frame layout; desktop gets a left sidebar + multi-column grids. */
@media (min-width: 900px) {
  body { background: #050403; }

  #app {
    max-width: none;
    box-shadow: none;
    padding-left: 232px; /* sidebar */
    border: none !important;
  }
  #app:has(.tabbar.hidden) { padding-left: 0; } /* login screen: no sidebar */

  .view { padding-bottom: 40px; }

  /* --- tabbar becomes a fixed left sidebar */
  .tabbar {
    left: 0;
    top: 0;
    bottom: 0;
    transform: none;
    width: 232px;
    max-width: none;
    flex-direction: column;
    justify-content: flex-start;
    gap: 2px;
    padding: 88px 14px 24px;
    border-top: none;
    border-right: 1px solid var(--border-soft);
    background: var(--bg-raised);
  }
  .tabbar::before {
    content: 'JIU JITSU SCHOOL';
    position: absolute;
    top: 34px;
    left: 28px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.28em;
    color: var(--gold);
  }
  .tab {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 6px;
  }
  .tab:hover { background: var(--card); color: var(--muted); }
  .tab.active { background: var(--gold-soft); }
  .tab.active:hover { color: var(--gold); }
  .tab svg { width: 19px; height: 19px; }
  .tab span { font-size: 10px; }

  /* --- page structure */
  .page-head {
    background: transparent;
    border-bottom: none;
    max-width: 1080px;
    margin: 0 auto;
    padding: 44px 40px 10px;
  }
  h1.page-title { font-size: 44px; }

  .content {
    max-width: 1080px;
    margin: 0 auto;
    padding: 24px 40px 60px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
    align-items: start;
  }
  .content > .filters { grid-column: 1 / -1; }
  .content > .filters .filter-btn { flex: none; padding: 10px 26px; }

  /* single-column views, centered */
  [data-view='lezioni'] .content,
  [data-view='rank'] .content,
  [data-view='altro'] .content,
  [data-view='tecniche'] .content,
  [data-view='livello'] .content,
  [data-view='regole'] .content {
    grid-template-columns: 1fr;
    max-width: 720px;
  }
  [data-view='lezioni'] .page-head,
  [data-view='rank'] .page-head,
  [data-view='altro'] .page-head,
  [data-view='tecniche'] .page-head,
  [data-view='livello'] .page-head,
  [data-view='regole'] .page-head { max-width: 720px; }

  /* full-width rows inside 2-col views */
  [data-view='profilo'] .content > div:first-child,
  [data-view='studente'] .content > div:first-child,
  [data-view='coach'] .content > div:nth-child(3),
  [data-view='shop'] .content > * { grid-column: 1 / -1; }

  [data-view='shop'] .shop-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }

  /* hover affordances on pointer devices */
  .card.tappable:hover, .lesson-card:hover, .row-list .row:hover, .level-row:hover { background: var(--card-2); }
  .btn { max-width: 100%; }

  /* login centered card */
  .login-wrap { max-width: 460px; margin: 0 auto; }

  .toast { left: calc(50% + 116px); }

  .week-chart .bar-area { height: 64px; }
}

@media (min-width: 1280px) {
  .content { gap: 32px; }
}
