/* Console admin: quello che serve in più rispetto a base.css (lo stile dell'area agency). Stessi colori dei soldi:
   verde quello che resta, rosso quello che esce. I costi hanno ognuno la sua tinta, sempre la stessa in ogni vista. */

:root {
  --c-withdrawal: #818cf8;
  --c-transfer: #c084fc;
  --c-topup: #f59e0b;
  --c-wire: #fb7185;
  --seg-a: #818cf8;
  --seg-t: #c084fc;
  --seg-b: var(--green);
}

:root[data-theme="light"] {
  --c-withdrawal: #4f46e5;
  --c-transfer: #9333ea;
  --c-topup: #d97706;
  --c-wire: #e11d48;
  --seg-a: #4f46e5;
  --seg-t: #9333ea;
}

/* "admin" sotto bsdhq: cinque lettere invece delle sei di "agency", quindi più spazio tra una e l'altra per arrivare
   alla stessa larghezza, poco prima della coda della q. "agency" non ha lettere alte; "admin" sì (d, i), e alla
   grandezza di "agency" la d toccava il fondo della s (Vincent, 5 Dic 2026): la parola è più piccola e poggia alla
   stessa altezza del fondo della q, così sopra la d resta aria. */
.lockup-admin .lockup-word {
  top: 3.545em;
  font-size: 0.22em;
  letter-spacing: 2.15em;
}

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

.period {
  margin-top: -6px;
}

.nav-count {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--yellow-bg);
  color: var(--yellow);
  font-size: 11px;
  font-weight: 700;
}

/* --- Panoramica ------------------------------------------------------------------ */

.net-card {
  min-height: 250px;
}

.net-line {
  position: relative;
  font-size: 13px;
  opacity: 0.85;
}

.net-line strong {
  font-weight: 700;
}

.stage-note {
  min-height: 16px;
  color: var(--muted);
}

.stage-step.step-in {
  background: var(--green-bg);
  color: var(--green);
}

.stage-step.step-out {
  background: var(--red-bg);
  color: var(--red);
}

.stage-step.step-flat {
  background: var(--blue-bg);
  color: var(--blue);
}

.stage-step svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.6;
}

.cost-bar {
  display: flex;
  gap: 3px;
  height: 6px;
  margin-top: 4px;
}

.cost-seg {
  min-width: 4px;
  border-radius: 999px;
}

.cost-withdrawal {
  background: var(--c-withdrawal);
}

.cost-transfer {
  background: var(--c-transfer);
}

.cost-topup {
  background: var(--c-topup);
}

.cost-wire {
  background: var(--c-wire);
}

.columns-admin {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 20px;
}

/* --- Tabelle: una riga per agenzia, creator o prelievo -------------------------------- */

.atable {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.arow {
  display: grid;
  grid-template-columns: minmax(180px, 1.6fr) repeat(5, minmax(0, 1fr));
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 14px;
  text-decoration: none;
}

.arow-creator,
.arow-draw {
  grid-template-columns: minmax(180px, 1.6fr) repeat(4, minmax(0, 1fr));
}

.arow-cash {
  grid-template-columns: minmax(180px, 1.6fr) repeat(3, minmax(0, 1fr));
}

.arow-head {
  padding-top: 0;
  padding-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.aname {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.aname > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.aname strong {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aname small {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arow .net {
  font-weight: 700;
}

.is-in {
  color: var(--green);
}

.is-out,
.cost {
  color: var(--red);
}

.arow.is-quiet .aname strong,
.arow.is-quiet .num {
  color: var(--faint);
}

.tag-talent {
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 10px;
  font-weight: 600;
  vertical-align: 1px;
}

.empty {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--muted);
}

/* --- Mese per mese ----------------------------------------------------------------- */

.mchart {
  display: flex;
  align-items: stretch;
  gap: 10px;
  height: 220px;
}

.mcol {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.mcol:hover,
.mcol:focus-visible {
  background: var(--surface-2);
}

.mcol.is-active {
  background: var(--surface-2);
}

.mvalue {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mtrack {
  flex: 1;
  width: 100%;
  max-width: 56px;
  display: flex;
  align-items: flex-end;
}

.mbar {
  width: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  min-height: 4px;
}

.mcost {
  flex-shrink: 0;
  background: color-mix(in srgb, var(--red) 42%, var(--surface));
}

.mkeep {
  flex: 1;
  background: var(--green);
}

.mlabel {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.mcol.is-active .mlabel {
  color: var(--text);
}

/* --- Costi ----------------------------------------------------------------------- */

.cost-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cline {
  display: grid;
  grid-template-columns: 10px minmax(0, 1.4fr) minmax(60px, 1fr) minmax(96px, auto);
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  font-size: 14px;
}

.cdot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.cname {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-weight: 500;
}

.cname small {
  font-size: 12px;
  font-weight: 400;
}

.ctrack {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.ctrack span {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.cline .num {
  font-weight: 600;
}

.cline.is-quiet .cname,
.cline.is-quiet .num {
  color: var(--faint);
}

.cline.is-quiet .cdot {
  opacity: 0.35;
}

.ctotal {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.ctotal .cname,
.ctotal .num {
  font-weight: 700;
}

/* --- Pagina di un'agenzia -------------------------------------------------------------- */

#agency-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.agency-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.agency-name {
  flex: 1;
  min-width: 0;
}

.agency-name h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.agency-name p {
  font-size: 13px;
}

.back {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--muted);
}

.back:hover {
  color: var(--text);
  background: var(--surface);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.btn-ghost:hover {
  background: var(--surface);
}

.btn-ghost svg {
  width: 15px;
  height: 15px;
}

#agency-page .stat-row {
  margin-bottom: 0;
}

.stat strong.net.is-in {
  color: var(--green);
}

.now-rows {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.now-rows > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  font-size: 14px;
}

.now-rows > div + div {
  border-top: 1px solid var(--line);
}

.now-rows dt {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.now-rows dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* --- Cassa -------------------------------------------------------------------------- */

.cash {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.wallet-amount {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.wallet-amount .cents {
  margin-left: 2px;
  font-size: 20px;
  font-weight: 700;
  color: var(--muted);
}

.wsplit {
  display: flex;
  gap: 4px;
  height: 10px;
}

.wsplit span {
  min-width: 4px;
  border-radius: 999px;
}

.seg-a {
  background: var(--seg-a);
}

.seg-t {
  background: var(--seg-t);
}

.seg-b {
  background: var(--seg-b);
}

.wsplit-legend {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.wsplit-legend dt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.wsplit-legend dd {
  margin: 4px 0 0;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* --- Da fare ------------------------------------------------------------------------- */

.todo-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.todo {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 14px;
  padding: 12px 14px;
  border-radius: 18px;
}

.todo-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--yellow-bg);
  color: var(--yellow);
  flex-shrink: 0;
}

.todo-warn .todo-icon {
  background: var(--red-bg);
  color: var(--red);
}

.todo-send .todo-icon,
.todo-user .todo-icon {
  background: var(--blue-bg);
  color: var(--blue);
}

.todo-icon.todo-done {
  background: var(--green-bg);
  color: var(--green);
}

.todo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.todo-text strong {
  font-size: 14px;
  font-weight: 600;
}

.todo-text small {
  font-size: 12px;
  color: var(--muted);
}

.todo-amount {
  font-size: 14px;
  font-weight: 700;
}

.todo-sub {
  grid-column: 2 / -1;
  margin-top: 10px !important;
  padding: 4px 14px !important;
  border-radius: 14px;
  background: var(--surface-2);
  gap: 0 !important;
}

.todo-sub li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  font-size: 13px;
  color: var(--muted);
}

.todo-sub li + li {
  border-top: 1px solid var(--line);
}

.todo-sub .num {
  color: var(--text);
  font-weight: 600;
}

/* --- Schermi stretti ------------------------------------------------------------------ */

@media (max-width: 1100px) {
  .columns-admin {
    grid-template-columns: minmax(0, 1fr);
  }

  .col-wide {
    display: none;
  }

  .view[data-view="home"] .stages {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .arow {
    grid-template-columns: minmax(150px, 1.6fr) repeat(3, minmax(0, 1fr));
  }

  .arow-creator {
    grid-template-columns: minmax(150px, 1.6fr) repeat(3, minmax(0, 1fr));
  }

  .arow-draw {
    grid-template-columns: minmax(150px, 1.6fr) repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .tabbar.tabbar-five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .tabbar a {
    position: relative;
  }

  .tabbar .nav-count {
    position: absolute;
    top: 2px;
    right: calc(50% - 22px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
  }

  .period {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 -16px;
    padding: 0 16px;
    scrollbar-width: none;
  }

  .period .chip {
    flex-shrink: 0;
  }

  .stages,
  .view[data-view="home"] .stages {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .col-mid {
    display: none;
  }

  .arow,
  .arow-creator,
  .arow-draw,
  .arow-cash {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px 6px;
  }

  .panel {
    padding: 18px 14px;
  }

  .cline {
    grid-template-columns: 10px minmax(0, 1fr) auto;
    padding: 10px 6px;
  }

  .ctrack {
    display: none;
  }

  .agency-head {
    flex-wrap: wrap;
  }

  .btn-ghost {
    width: 100%;
    justify-content: center;
  }

  #agency-page .stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wallet-amount {
    font-size: 34px;
  }

  .wsplit-legend dd {
    font-size: 14px;
  }

  .todo {
    padding: 12px 6px;
  }

  .mchart {
    height: 190px;
    gap: 4px;
  }
}

/* ---- Linee di business: etichette del menu, colori delle linee, servizi ---- */
.nav-label {
  margin: 14px 14px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.avatar.line-agencies { background: #818cf8; color: #0b0b12; }
.avatar.line-mgmt { background: #f472b6; color: #0b0b12; }
.avatar.line-tax { background: #34d399; color: #0b0b12; }
.avatar.line-circle { background: #fbbf24; color: #0b0b12; }
.avatar.line-partners { background: #38bdf8; color: #0b0b12; }

.svc-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.svc {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

#line-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
