:root {
  color-scheme: dark;
  --bg: #101114;
  --sidebar: #151619;
  --card: #181a1f;
  --raised: #1e2026;
  --line: #2b2d34;
  --text: #f4f3f1;
  --muted: #aaadb7;
  --soft: #828692;
  --accent: #fe8658;
  --accent-text: #28150f;
  --green: #80d6ae;
  --purple: #ad9bfe;
  --blue: #83b8f9;
  --radius: 17px;
  font-family: 'Segoe UI',system-ui,sans-serif;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,input,select,textarea {
  font: inherit;
}

button,a,input,select,textarea {
  outline-offset: 4px;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,canvas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

button,a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: .55;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,h2,h3,p {
  margin: 0;
}

small {
  font-size: .83rem;
  color: var(--muted);
}

[hidden] {
  display: none!important;
}

.muted {
  color: var(--muted);
}

.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.icon {
  width: 19px;
  height: 19px;
  flex: none;
  color: inherit;
}

.brand .icon {
  width: 22px;
  height: 22px;
}

.brand strong {
  font-size: 1.23rem;
  letter-spacing: -.055em;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: max-content;
}

.brandmark {
  width: 39px;
  height: 39px;
  border-radius: 12px;
  background: #f98b60;
  display: grid;
  place-items: center;
  color: #301a13;
  box-shadow: 0 2px 16px #f5805228;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0,1fr);
}

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  height: 100dvh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 24px 16px 18px;
  z-index: 3;
}

.sidebar>.brand {
  margin-left: 10px;
}

.side-nav {
  display: grid;
  gap: 4px;
  overflow: auto;
  padding: 0 2px 4px;
}

.nav-label {
  display: block;
  margin: 4px 10px 6px;
  color: var(--soft);
  font-size: .72rem;
  letter-spacing: .1em;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-label:not(:first-child) {
  margin-top: 23px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid transparent;
  min-height: 41px;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 520;
}

.nav-item:hover {
  background: #202228;
  color: var(--text);
}

.nav-item[aria-current=page] {
  color: #ffa17d;
  border-color: #51382e;
  background: #33251f;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.demo-control {
  display: grid;
  gap: 6px;
  padding: 0 5px;
}

.demo-control label {
  color: var(--muted);
  font-size: .76rem;
}

.demo-control select {
  padding: 7px 30px 7px 9px;
  font-size: .82rem;
}

.profile {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 3px 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}

.profile>div {
  min-width: 0;
  flex: 1;
}

.profile strong,.profile small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile strong {
  font-size: .84rem;
}

.profile small {
  font-size: .75rem;
  margin-top: 2px;
}

.avatar {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #392c28;
  color: #ffb092;
  font-weight: 700;
  font-size: .77rem;
  letter-spacing: .015em;
}

.avatar.large {
  width: 53px;
  height: 53px;
  font-size: 1.03rem;
  border-radius: 14px;
}

.main-wrap {
  min-width: 0;
}

.topbar {
  height: 65px;
  padding: 0 clamp(20px,3vw,44px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: #131418;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .86rem;
  color: var(--muted);
}

.breadcrumb b {
  color: var(--text);
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 9px;
}

.today {
  font-size: .82rem;
  color: var(--muted);
  text-transform: capitalize;
  white-space: nowrap;
}

.topbar .icon {
  width: 16px;
  height: 16px;
}

.menu-btn {
  display: none!important;
}

.content {
  max-width: 1540px;
  margin: auto;
  padding: 31px clamp(20px,3vw,44px) 44px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.page-head h1 {
  font-weight: 700;
  font-size: clamp(1.9rem,3.05vw,3rem);
  letter-spacing: -.065em;
  line-height: 1.04;
}

.page-head p {
  margin-top: 9px;
  color: var(--muted);
  font-size: .93rem;
}

.page-title {
  display: flex;
  align-items: center;
  gap: 13px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.button,.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 39px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #202228;
  color: var(--text);
  padding: 8px 12px;
  font-size: .86rem;
  font-weight: 650;
  white-space: nowrap;
}

.button:hover,.icon-button:hover {
  background: #2a2d34;
}

.button.primary {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-text);
}

.button.primary:hover {
  background: #ffa17c;
}

.icon-button {
  width: 35px;
  padding: 0;
  min-height: 34px;
}

.icon-button .icon,.button .icon {
  width: 16px;
  height: 16px;
}

.icon-button.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.icon-button.quiet:hover {
  background: #262830;
  color: var(--text);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,180px),1fr));
  gap: 13px;
  margin-bottom: 17px;
}

.stat,.panel,.tile {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  min-width: 0;
}

.stat {
  min-height: 143px;
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
}

.stat.featured {
  border-color: #593b30;
  background: radial-gradient(ellipse at 100% 0,#392721 0%,#241c1c 50%,#1f1b1c 83%);
}

.stat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 600;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1px solid #363941;
  border-radius: 8px;
  background: #22242a;
  color: #b8bbc6;
}

.stat-icon .icon {
  width: 16px;
  height: 16px;
}

.featured .stat-icon {
  border-color: #604033;
  background: #382722;
  color: #ffa07a;
}

.stat-value {
  font-size: clamp(1.5rem,2.65vw,2.18rem);
  letter-spacing: -.05em;
  line-height: 1.15;
  font-weight: 690;
  white-space: nowrap;
  margin-top: 2px;
}

.stat-note {
  font-size: .77rem;
  font-weight: 550;
  color: var(--muted);
}

.stat-note.positive {
  color: var(--green);
}

.stat-note.negative {
  color: #f3ac9b;
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0,1.95fr) minmax(265px,1fr);
  gap: 15px;
  margin-bottom: 17px;
}

.panel {
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 18px 11px;
}

.panel-head h2 {
  font-size: 1.04rem;
  font-weight: 680;
  letter-spacing: -.024em;
  line-height: 1.3;
}

.panel-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: .82rem;
}

.chart-box {
  height: 242px;
  position: relative;
  margin: 0 14px 13px;
}

.chart-box canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-tip {
  position: absolute;
  top: 5px;
  pointer-events: none;
  z-index: 1;
  padding: 7px 9px;
  border-radius: 7px;
  background: #25272e;
  border: 1px solid #41434d;
  white-space: nowrap;
  color: var(--text);
  font-size: .79rem;
  box-shadow: 0 6px 16px #0005;
}

.chart-key {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .77rem;
  color: var(--muted);
  white-space: nowrap;
  margin-top: 3px;
}

.swatch {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.swatch.purple {
  background: var(--purple);
}

.swatch.green {
  background: var(--green);
}

.swatch.blue {
  background: var(--blue);
}

.swatch.gray {
  background: #727784;
}

.split-body {
  padding: 4px 18px 16px;
}

.ring-box {
  height: 131px;
  position: relative;
  margin: 0 auto 12px;
  width: 145px;
}

.ring-box canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
  gap: 1px;
}

.ring-label strong {
  font-size: 1.14rem;
  letter-spacing: -.04em;
}

.ring-label span {
  color: var(--muted);
  font-size: .73rem;
}

.legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}

.legend li {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  color: var(--muted);
}

.legend b {
  color: var(--text);
  font-weight: 600;
}

.stack {
  display: grid;
  gap: 16px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: .88rem;
}

thead {
  background: #1d1f25;
}

th {
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  font-size: .78rem;
}

th,td {
  padding: 10px 17px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

tbody tr:hover {
  background: #ffffff04;
}

td strong {
  font-weight: 620;
  display: block;
}

td small {
  font-size: .77rem;
  display: block;
  margin-top: 2px;
}

td.date {
  white-space: nowrap;
  color: var(--muted);
}

td.money,th.money {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

td.edit-cell {
  width: 1%;
  padding: 4px 12px 4px 0;
}

td .person-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

td .person-link:hover strong {
  color: var(--accent);
}

.status {
  border-radius: 6px;
  padding: 4px 7px;
  white-space: nowrap;
  font-size: .74rem;
  font-weight: 650;
  display: inline-block;
  color: #c6bdff;
  background: #302947;
}

.status.paid,.status.active {
  color: #92dfba;
  background: #21382e;
}

.status.pending {
  color: #ffd197;
  background: #3a3025;
}

.status.inactive {
  color: #c0c2cc;
  background: #303138;
}

.empty {
  padding: 24px 18px;
  color: var(--muted);
  font-size: .9rem;
}

.date-filter {
  min-width: 134px;
}

.table-foot {
  padding: 11px 17px;
  color: var(--muted);
  font-size: .8rem;
  border-top: 1px solid var(--line);
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(min(100%,265px),1fr));
  gap: 14px;
}

.tile {
  padding: 19px;
  display: flex;
  flex-direction: column;
  min-height: 173px;
  gap: 7px;
}

.tile-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 7px;
}

.tile h2 {
  font-size: 1.1rem;
  letter-spacing: -.024em;
}

.tile p {
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.45;
}

.tile a:hover {
  color: var(--accent);
}

.tile-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
}

.emblem {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-weight: 700;
  font-size: .84rem;
  color: #ffb096;
  background: #3b2a24;
}

.emblem.purple {
  color: #c3b7ff;
  background: #322745;
}

.emblem.green {
  color: #9de2bf;
  background: #23382e;
}

.emblem.blue {
  color: #a6c8ff;
  background: #233247;
}

.offer-code {
  border: 1px dashed #785343;
  padding: 6px 9px;
  border-radius: 7px;
  color: #ffa984;
  background: #2c211e;
  font: inherit;
  font-size: .81rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.offer-code:hover {
  background: #3c2a24;
}

.access-list {
  max-width: 850px;
}

input,select,textarea {
  width: 100%;
  min-width: 0;
  color: var(--text);
  border: 1px solid #373942;
  background: #1c1e24;
  border-radius: 8px;
  padding: 8px 10px;
}

select {
  appearance: none;
  padding-right: 29px;
  background-image: linear-gradient(45deg,transparent 50%,#a7a9b6 50%),linear-gradient(135deg,#a7a9b6 50%,transparent 50%);
  background-position: calc(100% - 15px) 50%,calc(100% - 10px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

textarea {
  resize: vertical;
  min-height: 78px;
}

.page-head select,.page-head input {
  font-size: .85rem;
  width: auto;
}

.field {
  display: grid;
  gap: 5px;
  align-content: start;
}

.field label,.field>span {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 600;
}

.field.full {
  grid-column: 1/-1;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-field input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

dialog {
  width: min(530px,calc(100% - 26px));
  max-height: calc(100dvh - 25px);
  padding: 0;
  background: var(--card);
  color: var(--text);
  border: 1px solid #3d404a;
  border-radius: 17px;
  box-shadow: 0 18px 75px #000a;
}

dialog::backdrop {
  background: #08090bbb;
  backdrop-filter: blur(4px);
}

.dialog-head,.dialog-foot {
  padding: 16px 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dialog-head {
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
  font-size: 1.16rem;
  letter-spacing: -.02em;
}

.dialog-foot {
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}

.fields {
  padding: 17px 19px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.form-error {
  color: #ffc0b4;
  padding: 0 19px 11px;
  font-size: .86rem;
}

.toast {
  position: fixed;
  z-index: 5;
  right: 20px;
  bottom: 20px;
  max-width: calc(100vw - 40px);
  background: #272931;
  border: 1px solid #424550;
  color: var(--text);
  border-radius: 10px;
  padding: 12px 15px;
  box-shadow: 0 10px 30px #0006;
  font-size: .92rem;
}

.toast.error {
  border-color: #805244;
}

.auth-shell {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  padding: 20px;
  background: radial-gradient(ellipse at 50% 15%,#322320,#101114 57%);
}

.auth-card {
  width: min(440px,calc(100vw - 40px));
  padding: 25px;
  background: #181a1f;
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 13px;
}

.auth-card h1 {
  font-size: 1.8rem;
  letter-spacing: -.045em;
}

.auth-card p {
  color: var(--muted);
  font-size: .91rem;
  line-height: 1.45;
}

.auth-card form {
  display: grid;
  gap: 12px;
}

.auth-card .brand {
  margin-bottom: 4px;
}

.auth-card .form-error {
  padding: 0;
}

.loading {
  padding: 24px;
  color: var(--muted);
}

@media(max-width:1140px) {
  .app-shell {
    grid-template-columns: 202px minmax(0,1fr);
  }
  .sidebar {
    padding-inline: 12px;
  }
  .content {
    padding-inline: 22px;
  }
  .topbar {
    padding-inline: 22px;
  }
  .stats {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .stat {
    min-height: 119px;
  }
  .dash-grid {
    grid-template-columns: minmax(0,1.8fr) minmax(236px,1fr);
  }
}

@media(max-width:850px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .ring-box {
    margin-left: 0;
    margin-bottom: 0;
  }
  .split-body {
    display: grid;
    grid-template-columns: 145px 1fr;
    align-items: center;
    gap: 15px;
  }
  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .page-head .actions {
    align-self: flex-start;
  }
}

@media(max-width:640px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    width: 232px;
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-102%);
    transition: transform .18s ease;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 20px 0 80px #000b;
  }
  .sidebar.open+.nav-overlay {
    display: block;
  }
  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: #0009;
    border: 0;
    z-index: 2;
    width: 100%;
  }
  .menu-btn {
    display: inline-flex!important;
  }
  .topbar {
    padding-inline: 12px;
    height: 57px;
  }
  .breadcrumb {
    gap: 6px;
  }
  .breadcrumb span {
    display: none;
  }
  .content {
    padding: 23px 13px 32px;
  }
  .stat {
    padding: 12px 10px;
    min-height: 111px;
  }
  .stat-value {
    font-size: clamp(1.3rem,6.6vw,1.85rem);
  }
  .stat-head {
    gap: 6px;
    font-size: .78rem;
  }
  .stat-icon {
    width: 24px;
    height: 24px;
  }
  .stat-icon .icon {
    width: 14px;
    height: 14px;
  }
  .stat-note {
    font-size: .7rem;
  }
  .stats {
    gap: 8px;
  }
  .chart-box {
    height: 210px;
  }
  .today {
    font-size: .72rem;
  }
  .fields {
    grid-template-columns: 1fr;
  }
  .panel-head {
    padding-inline: 13px;
  }
}

@media(min-width:641px) {
  .nav-overlay {
    display: none;
  }
}

.demo-tag {
  font-size: .74rem;
  color: #e4ac98;
  border: 1px solid #544039;
  border-radius: 6px;
  padding: 4px 7px;
  white-space: nowrap;
  margin-right: 4px;
}

.offer-code {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.offer-code .icon {
  width: 14px;
  height: 14px;
}

@media(min-width:1050px) and (max-width:1140px) {
  .stats {
    grid-template-columns: repeat(auto-fit,minmax(170px,1fr));
  }
}

@media(max-width:480px) {
  .topbar-right .today {
    display: none;
  }
}

@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    scroll-behavior: auto!important;
    transition: none!important;
  }
}

/* La couche sombre garde les chiffres lisibles lorsque le relief passe derrière les cartes. */
:root {
  --bg: #0c131d;
  --sidebar: #141c26e8;
  --card: #141d29e0;
  --line: #a3bed42a;
  --text: #f3f6fa;
  --muted: #bbc5d3;
  --soft: #a0adbd;
  --green: #85e5b4;
}

body { isolation: isolate; }

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(108deg, #0c131ded 4%, #0c152a33 72%), linear-gradient(0deg, #0c1421c7, transparent 66%),
    url('/montagne.webp') center 42% / cover;
  pointer-events: none;
}

.topbar { background: #101923d9; }
.sidebar { backdrop-filter: blur(15px); }
.panel, .tile, .stat { box-shadow: 0 9px 28px #03071224; }
.panel, .tile { backdrop-filter: blur(7px); }
.stat.featured {
  background: radial-gradient(ellipse at 100% 0, #51332edb, #292328e6 55%, #22212beb);
  border-color: #ca927754;
}
.brand strong { display: flex; gap: 4px; align-items: flex-start; flex-direction: column; line-height: .95; }
.brand small { color: #c8d4e1; font-size: .58rem; text-transform: uppercase; letter-spacing: .15em; font-weight: 700; }
.target-hit { color: var(--green); font-weight: 720; }
.grade { font-size: .82rem; font-weight: 650; }
.grade.leader { color: #ffb599; }
.member-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.invoice-draft { background: #283344; }
.invoice-draft td:first-child { min-width: 145px; }
.invoice-draft td:nth-child(2) { min-width: 175px; }
.invoice-draft td:nth-child(3) { min-width: 174px; }
.invoice-draft input, .invoice-draft select { font-size: .85rem; }
.invoice-draft select + select { margin-top: 6px; }
.invoice-actions { width: 1%; white-space: nowrap; }
.invoice-actions .button { min-height: 34px; }
#invoice-total { color: #ffc1a6; font-weight: 750; }
.counter { display: inline-flex; align-items: center; gap: 9px; }
.counter .num { min-width: 2ch; text-align: center; }
.counter .icon-button { background: #233145; border: 1px solid var(--line); }
.counter .icon-button:disabled { cursor: default; opacity: .4; }
.counter .icon-button:hover:not(:disabled) { background: #32475f; }
.reset-panel { max-width: 650px; }
.reset-form { display: grid; gap: 16px; padding: 7px 18px 20px; }
.reset-form p { color: var(--muted); max-width: 58ch; }
.reset-form .button { justify-self: start; }
.reset-form .form-error { color: #ffb5a4; padding: 0; }
.auth-shell { background: #0f18237a; }
.auth-card { background: #131e2bef; backdrop-filter: blur(10px); }

@media(max-width:640px) {
  body::before { background-position: center, center, 62% center; }
  .grade { white-space: normal; }
}

.weekly-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 0;
  margin: 4px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.weekly-summary > div {
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 13px 15px;
  border-inline-end: 1px solid var(--line);
}

.weekly-summary > div:last-child { border-inline-end: 0; }
.weekly-summary > div > span { color: var(--muted); font-size: .83rem; font-weight: 650; }
.weekly-summary strong { font-size: clamp(1.12rem, 2vw, 1.54rem); letter-spacing: -.035em; }
.weekly-up { color: var(--green); font-weight: 700; }
.weekly-down { color: var(--loss, #ffb2a0); font-weight: 700; }
.weekly-detail summary {
  padding: 12px 18px;
  cursor: pointer;
  border-top: 1px solid var(--line);
  font-size: .88rem;
  font-weight: 650;
}
.weekly-detail summary:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.weekly-detail td:last-child, .weekly-detail th:last-child { text-align: right; }

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,235px),1fr));
  gap: 15px;
}

.theme-choice { padding: 0; text-align: left; color: var(--text); overflow: hidden; }
.theme-choice:hover { border-color: var(--accent); }
.theme-choice[aria-pressed='true'] { outline: 1px solid var(--accent); }
.theme-choice-copy { display: grid; gap: 6px; padding: 16px; }
.theme-choice-copy strong { font-size: 1.1rem; }
.theme-action,.theme-active { margin-top: 7px; color: var(--muted); font-size: .83rem; font-weight: 750; }
.theme-active { color: var(--green); }
.theme-preview {
  --sample-side: #111b2a;
  --sample-main: #192635;
  --sample-card: #304056;
  --sample-line: #ff996b;
  display: grid;
  grid-template-columns: 23% repeat(2,1fr);
  grid-template-rows: 1fr 1fr;
  gap: 7px;
  height: 126px;
  padding: 14px;
  overflow: hidden;
  background: var(--sample-main);
  border-bottom: 1px solid var(--line);
}

.theme-preview > span { grid-row: span 2; background: var(--sample-side); border-radius: 7px; }
.theme-preview i { display: block; background: var(--sample-card); border-radius: 7px; }
.theme-preview i:first-of-type { border-block-start: 3px solid var(--sample-line); }
.theme-preview i:last-of-type { grid-column: span 2; }
.sample-alpin { background: linear-gradient(146deg,#293b55 29%,#18283a 64%,#35495f 65%,#62758e); }
.sample-atelier {
  --sample-side:#140e12; --sample-main:#231216; --sample-card:#321d24; --sample-line:#f75b66;
  background:repeating-linear-gradient(133deg,#f4516225 0 1px,transparent 1px 8px),#211116;
}
.sample-tokyo {
  --sample-side:#100e25; --sample-main:#1c153a; --sample-card:#201d3ccb; --sample-line:#5ce5f4;
  background:linear-gradient(100deg,#080b11b2,#17142d38),var(--tokyo-image) 70% 62% / cover;
}

:root[data-theme='atelier'] {
  --bg:#100c0f;
  --sidebar:#140f14ee;
  --card:#181217ee;
  --line:#59313c;
  --text:#fff1f4;
  --muted:#d9b9c3;
  --soft:#caa8b4;
  --accent:#ff6571;
  --accent-text:#2c070d;
}

[data-theme='atelier'] body::before {
  background:repeating-linear-gradient(133deg,#ff59651a 0 1px,transparent 1px 11px),
    repeating-linear-gradient(43deg,#ffffff04 0 1px,transparent 1px 11px),radial-gradient(ellipse at 90% 0,#421722,#100c0f 62%);
}
[data-theme='atelier'] .topbar, [data-theme='atelier'] .auth-card { background:#1b1018eb; }
[data-theme='atelier'] .brandmark, [data-theme='atelier'] .primary:hover { background:#ff8590; }
[data-theme='atelier'] .brandmark { color:#350911; box-shadow:0 2px 16px #ff586832; }
[data-theme='atelier'] .nav-item[aria-current=page] { background:#361921; border-color:#6d3443; color:#ffaab3; }
[data-theme='atelier'] .stat.featured { background:radial-gradient(ellipse at top right,#581e2b,#2a131c 76%); border-color:#82384b; }
[data-theme='atelier'] .invoice-draft,[data-theme='atelier'] thead { background:#291b23; }
[data-theme='atelier'] .counter .icon-button { background:#322029; }
[data-theme='atelier'] .counter .icon-button:hover:not(:disabled) { background:#512b39; }
[data-theme='atelier'] .brand small { color:var(--muted); }
[data-theme='atelier'] .auth-shell { background:transparent; }

:root { --tokyo-image:url('/tokyo.webp'); }

:root[data-theme='tokyo'] {
  --bg:#0a0d1b;
  --sidebar:#101325e8;
  --card:#12162ce3;
  --line:#4c496b;
  --text:#f7f5ff;
  --muted:#c6c5e1;
  --soft:#b5b4d2;
  --accent:#64e2ef;
  --accent-text:#081b25;
  --green:#80edc2;
  --loss:#ff9bb7;
}

[data-theme='tokyo'] body::before {
  background:linear-gradient(100deg,#0b0d1be0 5%,#0b0d1b50 92%),
    linear-gradient(0deg,#10132699,transparent 68%),var(--tokyo-image) 62% center / cover;
}
[data-theme='tokyo'] .topbar,[data-theme='tokyo'] .auth-card { background:#12162ddb; }
[data-theme='tokyo'] .auth-shell { background:transparent; }
[data-theme='tokyo'] .brandmark { background:linear-gradient(135deg,#6fe6f3,#d6a3ff); color:#10162b; box-shadow:0 0 18px #49cfe54c; }
[data-theme='tokyo'] .brand small { color:var(--muted); }
[data-theme='tokyo'] .nav-item:hover,[data-theme='tokyo'] .icon-button.quiet:hover { background:#252742; color:#f0eeff; }
[data-theme='tokyo'] .nav-item[aria-current=page] { background:#21334b; border-color:#43748e; color:#b5f5ff; }
[data-theme='tokyo'] .stat.featured { background:linear-gradient(135deg,#123140e6,#3a2048e8); border-color:#69628f; }
[data-theme='tokyo'] .stat-icon,[data-theme='tokyo'] .avatar { background:#2b2850; color:#d9c7ff; border-color:#57527d; }
[data-theme='tokyo'] .grade.leader,[data-theme='tokyo'] #invoice-total { color:#ffaedb; }
[data-theme='tokyo'] .button.primary:hover { background:#b0f4ff; }
[data-theme='tokyo'] input,[data-theme='tokyo'] select,[data-theme='tokyo'] textarea { background-color:#191d36; border-color:#514d71; }
[data-theme='tokyo'] thead,[data-theme='tokyo'] .invoice-draft,[data-theme='tokyo'] .counter .icon-button { background:#23223d; }
[data-theme='tokyo'] .counter .icon-button:hover:not(:disabled) { background:#333050; }

@media(max-width:640px) {
  .weekly-summary { margin-inline: 13px; }
  .weekly-panel .panel-head { flex-wrap: wrap; }
}

.whitelist-card { gap: 16px; }
.whitelist-mark {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  margin-top: 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--accent);
  background: color-mix(in srgb,var(--accent),transparent 89%);
}
.whitelist-mark .icon { width: 22px; height: 22px; }
.whitelist-card .whitelist-label {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: .76rem;
  font-weight: 730;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.whitelist-card .button { justify-self: start; }

.welcome-dialog { width: min(360px,calc(100% - 26px)); }
.welcome-body {
  display: grid;
  justify-items: center;
  gap: 13px;
  padding: 25px 22px 23px;
  text-align: center;
}
.welcome-body h2 { font-size: 1.35rem; letter-spacing: -.025em; overflow-wrap: anywhere; }
.welcome-emoji { font-size: 1.65rem; line-height: 1.2; }
.welcome-body .button { margin-top: 4px; min-width: 96px; }
