:root {
  --bg: #090b0f;
  --surface: #101319;
  --surface-2: #151922;
  --surface-3: #1b202a;
  --border: #252b36;
  --border-soft: rgba(255,255,255,.07);
  --text: #f5f7fb;
  --muted: #8d96a5;
  --accent: #8b5cf6;
  --accent-2: #6d4ae4;
  --accent-soft: rgba(139, 92, 246, .14);
  --green: #2fd07f;
  --red: #ff5d6c;
  --blue: #5ca9ff;
  --orange: #f5a942;
  --shadow: 0 24px 60px rgba(0,0,0,.34);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% 0%, rgba(139,92,246,.10), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  color: inherit;
}

button,
select {
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  outline: none;
  background: #0d1015;
  color: var(--text);
  border-radius: 12px;
  padding: 12px 13px;
  transition: .18s ease;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(139, 92, 246, .75);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .12);
}

.app-shell {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 255px;
  padding: 22px 16px;
  background: rgba(13, 16, 21, .96);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  z-index: 20;
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 7px 25px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  font-weight: 800;
  font-size: 20px;
  background: linear-gradient(145deg, var(--accent), #b189ff);
  box-shadow: 0 8px 24px rgba(139, 92, 246, .28);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 17px;
}

.brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  border: 0;
  background: transparent;
  padding: 11px 12px;
  border-radius: 12px;
  color: #a3acba;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  transition: .18s ease;
}

.nav-item:hover {
  background: rgba(255,255,255,.04);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-soft);
  color: #d9ccff;
}

.nav-icon {
  width: 22px;
  text-align: center;
  font-size: 18px;
}

.sidebar-footer {
  margin-top: auto;
}

.workspace-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px;
  background: rgba(255,255,255,.025);
}

.workspace-card strong,
.workspace-card span {
  display: block;
}

.workspace-card strong {
  margin: 3px 0 4px;
}

.workspace-card > span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.main {
  margin-left: 255px;
  width: calc(100% - 255px);
  min-height: 100vh;
}

.topbar {
  min-height: 82px;
  padding: 16px clamp(18px, 3vw, 38px);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(9, 11, 15, .86);
  backdrop-filter: blur(18px);
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: 20px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.date-chip {
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 12px;
}

.avatar {
  width: 39px;
  height: 39px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #1c2028;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
}

.page {
  display: none;
  padding: 30px clamp(18px, 3vw, 38px) 45px;
}

.page.active {
  display: block;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--muted);
}

.eyebrow.accent {
  color: #b49cff;
}

.hero {
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid rgba(139, 92, 246, .22);
  border-radius: 24px;
  background:
    linear-gradient(110deg, rgba(139, 92, 246, .14), rgba(255,255,255,.015) 55%),
    var(--surface);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  box-shadow: var(--shadow);
}

.hero h2 {
  max-width: 720px;
  margin: 8px 0 10px;
  font-size: clamp(29px, 4vw, 48px);
  line-height: 1.04;
  letter-spacing: -.04em;
}

.hero-copy {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button {
  border: 0;
  border-radius: 11px;
  transition: .18s ease;
}

.primary-button {
  padding: 11px 15px;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  font-weight: 700;
  box-shadow: 0 9px 24px rgba(139, 92, 246, .22);
  white-space: nowrap;
}

.primary-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.secondary-button {
  padding: 11px 15px;
  background: var(--surface-3);
  border: 1px solid var(--border);
}

.ghost-button {
  padding: 8px 9px;
  background: transparent;
  color: #b6becc;
}

.ghost-button:hover,
.icon-button:hover {
  background: rgba(255,255,255,.05);
}

.icon-button {
  width: 38px;
  height: 38px;
  background: transparent;
  font-size: 22px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.kpi-card {
  padding: 20px;
  min-height: 152px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.kpi-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  box-shadow: 0 0 16px currentColor;
}

.status-dot.purple { background: var(--accent); color: var(--accent); }
.status-dot.green { background: var(--green); color: var(--green); }
.status-dot.red { background: var(--red); color: var(--red); }
.status-dot.blue { background: var(--blue); color: var(--blue); }

.kpi-value {
  display: block;
  margin: 22px 0 8px;
  font-size: 28px;
  letter-spacing: -.035em;
}

.kpi-card small {
  color: var(--muted);
}

.positive {
  color: var(--green) !important;
}

.negative {
  color: var(--red) !important;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
}

.panel,
.table-card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.panel {
  padding: 20px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 15px;
}

.panel-heading h3 {
  margin: 3px 0 0;
  font-size: 17px;
}

.activity-list,
.mini-order-list {
  display: grid;
}

.activity-item,
.mini-order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 13px 0;
  border-top: 1px solid var(--border-soft);
}

.activity-main,
.order-main {
  min-width: 0;
}

.activity-main strong,
.order-main strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}

.activity-main span,
.order-main span {
  color: var(--muted);
  font-size: 12px;
}

.activity-amount {
  white-space: nowrap;
  font-weight: 700;
  font-size: 13px;
}

.muted-placeholder {
  color: var(--muted);
  padding: 25px 0 10px;
  text-align: center;
  font-size: 13px;
}

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

.section-head h2 {
  margin: 5px 0 7px;
  font-size: 28px;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.toolbar {
  margin-bottom: 13px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.toolbar select {
  max-width: 205px;
}

.search-wrap {
  max-width: 430px;
  width: 100%;
  position: relative;
}

.search-wrap span {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  z-index: 1;
}

.search-wrap input {
  padding-left: 36px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
}

th {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
}

td {
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

.table-title {
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 700;
}

.badge.open {
  color: #d5c9ff;
  background: rgba(139, 92, 246, .13);
}

.badge.done,
.badge.income {
  color: #9cf0c2;
  background: rgba(47, 208, 127, .11);
}

.badge.cancelled,
.badge.expense {
  color: #ffadb6;
  background: rgba(255, 93, 108, .11);
}

.delete-button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 9px;
  padding: 6px 8px;
}

.delete-button:hover {
  color: #fff;
  border-color: rgba(255, 93, 108, .45);
  background: rgba(255, 93, 108, .08);
}

.finance-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  margin-bottom: 14px;
}

.finance-summary > div {
  padding: 18px 20px;
}

.finance-summary > div + div {
  border-left: 1px solid var(--border-soft);
}

.finance-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 7px;
}

.finance-summary strong {
  font-size: 22px;
}

.empty-state {
  padding: 52px 20px;
  text-align: center;
  color: var(--muted);
}

.empty-state h3 {
  color: var(--text);
  margin: 10px 0 5px;
}

.empty-state p {
  margin: 0;
}

.empty-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--accent-soft);
  color: #c5b3ff;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.62);
  backdrop-filter: blur(5px);
  z-index: 50;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-card {
  width: min(620px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #11151b;
  box-shadow: var(--shadow);
  padding: 22px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-head h3 {
  margin: 4px 0 0;
  font-size: 22px;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #c4cad3;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 5px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  background: #171c24;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 15px;
  box-shadow: var(--shadow);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.mobile-only {
  display: none;
}

@media (max-width: 1050px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 25px 0 70px rgba(0,0,0,.45);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
    width: 100%;
  }

  .mobile-only {
    display: inline-grid;
    place-items: center;
  }

  .topbar {
    justify-content: flex-start;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .date-chip {
    display: none;
  }

  .hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar {
    flex-direction: column;
  }

  .toolbar select,
  .search-wrap {
    max-width: none;
  }

  .finance-summary {
    grid-template-columns: 1fr;
  }

  .finance-summary > div + div {
    border-left: 0;
    border-top: 1px solid var(--border-soft);
  }
}

@media (max-width: 520px) {
  .page {
    padding-left: 14px;
    padding-right: 14px;
  }

  .topbar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    border-radius: 18px;
  }
}


/* Activity list */

.activity-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.activity-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card.compact {
  min-height: 135px;
}

.activity-card {
  overflow: hidden;
}

.activity-table-scroll {
  overflow: auto;
  max-width: 100%;
}

.activity-table {
  min-width: 1180px;
}

.activity-table th,
.activity-table td {
  text-align: center;
  white-space: nowrap;
}

.activity-table th:first-child,
.activity-table td:first-child {
  text-align: left;
}

.activity-table .sticky-member {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #11151b;
  min-width: 210px;
  box-shadow: 1px 0 0 var(--border-soft);
}

.activity-table tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--border-soft);
}

.activity-member {
  display: flex;
  align-items: center;
  gap: 10px;
}

.member-dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: #4b5563;
  flex: 0 0 auto;
}

.member-dot.active {
  background: var(--green);
  box-shadow: 0 0 14px rgba(47, 208, 127, .5);
}

.activity-checkbox {
  appearance: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1px solid #596271;
  border-radius: 5px;
  background: #0d1015;
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
  cursor: pointer;
  transition: .16s ease;
}

.activity-checkbox:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.activity-checkbox:checked::after {
  content: "✓";
  color: white;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.activity-checkbox:hover {
  border-color: #8d96a5;
}

.strike-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #0d1015;
}

.strike-control button {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
}

.strike-control button:hover {
  background: rgba(255,255,255,.05);
  color: white;
}

.strike-control strong {
  min-width: 28px;
  text-align: center;
  font-size: 12px;
}

.strike-control.has-strikes strong {
  color: var(--red);
}

.activity-note-input {
  min-width: 210px;
  padding: 8px 10px;
  border-radius: 9px;
}

.note-column {
  min-width: 230px;
}

.active-switch {
  appearance: none;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #2a303a;
  border: 1px solid #39414d;
  position: relative;
  transition: .18s ease;
  cursor: pointer;
  margin: 0;
}

.active-switch::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background: #9aa3b0;
  transition: .18s ease;
}

.active-switch:checked {
  background: rgba(47, 208, 127, .20);
  border-color: rgba(47, 208, 127, .5);
}

.active-switch:checked::after {
  left: 18px;
  background: var(--green);
}

.activity-toolbar {
  margin-top: 2px;
}

@media (max-width: 1050px) {
  .activity-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .activity-overview-grid {
    grid-template-columns: 1fr;
  }

  .activity-actions {
    width: 100%;
  }

  .activity-actions button {
    flex: 1;
  }
}


/* Contributions / payouts */

.contribution-table {
  min-width: 980px;
}

.actions-column {
  min-width: 280px;
}

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

.row-action {
  border: 1px solid var(--border);
  background: #0d1015;
  color: #c8ced8;
  border-radius: 9px;
  padding: 7px 9px;
  font-size: 11px;
  font-weight: 700;
  transition: .16s ease;
}

.row-action:hover {
  border-color: #525b69;
  color: #fff;
  background: #171b22;
}

.row-action.add {
  color: #a8f1ca;
  border-color: rgba(47, 208, 127, .24);
  background: rgba(47, 208, 127, .06);
}

.row-action.remove {
  color: #ffd39a;
  border-color: rgba(245, 169, 66, .24);
  background: rgba(245, 169, 66, .06);
}

.row-action.pay {
  color: #d7caff;
  border-color: rgba(139, 92, 246, .35);
  background: rgba(139, 92, 246, .10);
}

.inline-rate {
  width: 130px;
  min-width: 130px;
  padding: 8px 10px;
  border-radius: 9px;
}

.quantity-number {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.calculated-total {
  font-weight: 800;
  color: #a8f1ca;
  font-variant-numeric: tabular-nums;
}

.calculation-preview {
  border: 1px solid var(--border);
  background: rgba(139, 92, 246, .07);
  border-radius: 13px;
  padding: 13px 14px;
}

.calculation-preview span,
.calculation-preview small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.calculation-preview strong {
  display: block;
  margin: 4px 0;
  font-size: 15px;
}

.quantity-person-card {
  border: 1px solid var(--border-soft);
  background: rgba(255,255,255,.025);
  border-radius: 13px;
  padding: 13px 14px;
}

.quantity-person-card span,
.quantity-person-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.quantity-person-card strong {
  display: block;
  margin: 4px 0;
  font-size: 16px;
}

.small-modal {
  width: min(470px, 100%);
}

.payout-status {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 8px;
  color: #d7caff;
  background: rgba(139, 92, 246, .12);
  font-size: 11px;
  font-weight: 700;
}


/* Administration */

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, .8fr);
  gap: 18px;
}

.settings-panel {
  min-height: 100%;
}

.settings-description {
  margin: 0 0 20px;
  max-width: 650px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}

.settings-form {
  max-width: 520px;
}

.money-input-wrap {
  position: relative;
}

.money-input-wrap input {
  padding-right: 46px;
  font-size: 18px;
  font-weight: 700;
}

.money-input-wrap > span {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 700;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
}

.admin-example {
  display: grid;
  gap: 0;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  overflow: hidden;
}

.admin-example > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 15px;
  background: rgba(255,255,255,.02);
}

.admin-example > div + div {
  border-top: 1px solid var(--border-soft);
}

.admin-example span {
  color: var(--muted);
  font-size: 12px;
}

.admin-example strong {
  font-size: 13px;
}

.admin-example-total {
  background: rgba(139, 92, 246, .09) !important;
}

.admin-example-total strong {
  color: #c7b8ff;
  font-size: 17px;
}

.central-price {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}

.central-price small {
  color: var(--muted);
  font-weight: 500;
}

@media (max-width: 900px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}


/* Audit log */

.audit-table {
  min-width: 1000px;
}

.audit-table td {
  vertical-align: top;
}

.audit-module-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 700;
  color: #d8ceff;
  background: rgba(139, 92, 246, .11);
  border: 1px solid rgba(139, 92, 246, .15);
}

.audit-action {
  font-weight: 700;
}

.audit-details {
  color: #a9b1bd;
  max-width: 470px;
  white-space: normal;
  line-height: 1.5;
}

.audit-user {
  font-weight: 600;
}

.audit-time {
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.audit-note {
  margin: 14px 2px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.audit-user-kpi,
.audit-last-kpi {
  font-size: 18px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* Payout workflow */

.payout-status.open {
  color: #ffd39a;
  background: rgba(245, 169, 66, .10);
  border: 1px solid rgba(245, 169, 66, .20);
}

.payout-status.paid {
  color: #9cf0c2;
  background: rgba(47, 208, 127, .10);
  border: 1px solid rgba(47, 208, 127, .20);
}

.payout-paid-time {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.payout-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.row-action.mark-paid {
  color: #9cf0c2;
  border-color: rgba(47, 208, 127, .28);
  background: rgba(47, 208, 127, .08);
}

.row-action.mark-paid:hover {
  border-color: rgba(47, 208, 127, .55);
  background: rgba(47, 208, 127, .14);
}

.row-action.paid-complete {
  color: #9cf0c2;
  border-color: rgba(47, 208, 127, .18);
  background: rgba(47, 208, 127, .06);
  cursor: default;
  opacity: .72;
}


/* Authentication */

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 10%, rgba(139,92,246,.20), transparent 28rem),
    radial-gradient(circle at 90% 90%, rgba(92,169,255,.10), transparent 28rem),
    var(--bg);
}

.auth-glow {
  position: absolute;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: rgba(139,92,246,.09);
  filter: blur(100px);
  pointer-events: none;
}

.auth-card {
  position: relative;
  z-index: 2;
  width: min(440px, 100%);
  padding: 30px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 24px;
  background: rgba(16,19,25,.92);
  box-shadow: 0 35px 90px rgba(0,0,0,.48);
  backdrop-filter: blur(20px);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}

.auth-brand strong,
.auth-brand span {
  display: block;
}

.auth-brand strong {
  font-size: 18px;
}

.auth-brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.auth-card h1 {
  margin: 7px 0 9px;
  font-size: 32px;
  letter-spacing: -.04em;
}

.auth-copy {
  color: var(--muted);
  line-height: 1.65;
  font-size: 13px;
  margin: 0 0 22px;
}

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

.auth-submit {
  width: 100%;
  margin-top: 4px;
  padding-top: 13px;
  padding-bottom: 13px;
}

.auth-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255,93,108,.25);
  border-radius: 10px;
  color: #ffb0b8;
  background: rgba(255,93,108,.08);
  font-size: 12px;
}

.auth-footnote {
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  color: #697282;
  font-size: 10px;
  line-height: 1.55;
}

.session-user {
  display: flex;
  align-items: center;
  gap: 9px;
}

.session-user-copy strong,
.session-user-copy span {
  display: block;
}

.session-user-copy strong {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.session-user-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.logout-button {
  padding: 9px 11px;
  font-size: 11px;
}

/* Account management */

.account-management-panel {
  margin-top: 18px;
}

.account-panel-heading {
  padding-bottom: 8px;
}

.account-count-badge {
  padding: 6px 9px;
  border-radius: 999px;
  color: #d8ceff;
  background: rgba(139,92,246,.10);
  border: 1px solid rgba(139,92,246,.15);
  font-size: 10px;
  font-weight: 700;
}

.account-management-grid {
  display: grid;
  grid-template-columns: minmax(300px, .65fr) minmax(0, 1.35fr);
  gap: 24px;
  align-items: start;
}

.account-create-form {
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: rgba(255,255,255,.018);
}

.account-list-wrap {
  min-width: 0;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  overflow: hidden;
}

.account-table {
  min-width: 660px;
}

.role-badge {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.role-badge.admin {
  color: #d8ceff;
  background: rgba(139,92,246,.12);
}

.role-badge.user {
  color: #a9d7ff;
  background: rgba(92,169,255,.10);
}

.current-account-tag {
  margin-left: 6px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}

@media (max-width: 940px) {
  .account-management-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .session-user-copy {
    display: none;
  }

  .logout-button {
    padding: 8px 9px;
  }
}


.role-badge.management {
  color: #ffd9a6;
  background: rgba(245, 169, 66, .11);
}

.role-badge.accountant {
  color: #9cf0c2;
  background: rgba(47, 208, 127, .10);
}


.permission-overview {
  margin-top: 18px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.permission-card {
  min-height: 122px;
  padding: 15px;
  border: 1px solid var(--border-soft);
  border-radius: 13px;
  background: rgba(255,255,255,.018);
}

.permission-card strong,
.permission-card span {
  display: block;
}

.permission-card strong {
  margin-bottom: 8px;
  font-size: 13px;
}

.permission-card span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

@media (max-width: 1050px) {
  .permission-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .permission-grid {
    grid-template-columns: 1fr;
  }
}


/* Order details */

.order-total-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 15px;
  border: 1px solid rgba(139, 92, 246, .20);
  border-radius: 13px;
  background: rgba(139, 92, 246, .07);
}

.order-total-preview > span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
}

.order-total-preview > strong {
  margin-left: auto;
  font-size: 20px;
  color: #c9bcff;
}

.order-total-preview > small {
  width: 100%;
  color: var(--muted);
  text-align: right;
  font-size: 10px;
}


.table-subline {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* Route calculator */

.route-calculator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: 18px;
  margin-bottom: 18px;
}

.route-input-panel,
.route-explanation-panel {
  min-height: 100%;
}

.route-info-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 18px;
}

.route-info-strip > div {
  padding: 14px 15px;
  background: rgba(255,255,255,.018);
}

.route-info-strip > div + div {
  border-left: 1px solid var(--border-soft);
}

.route-info-strip span,
.route-info-strip small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.route-info-strip strong {
  display: block;
  margin: 4px 0;
  font-size: 18px;
}

.route-form {
  display: grid;
  gap: 14px;
}

.field-help {
  color: var(--muted);
  font-weight: 400;
  line-height: 1.5;
}

.route-duration-summary {
  border: 1px solid rgba(139,92,246,.20);
  border-radius: 14px;
  background: rgba(139,92,246,.07);
  padding: 14px 15px;
}

.route-duration-summary span,
.route-duration-summary small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.route-duration-summary strong {
  display: block;
  margin: 4px 0;
  font-size: 18px;
}

.formula-stack {
  display: grid;
}

.formula-stack > div {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 0;
  border-top: 1px solid var(--border-soft);
}

.formula-stack > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.formula-stack > div > span {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: #d7cbff;
  font-size: 11px;
  font-weight: 800;
}

.formula-stack p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.formula-stack strong {
  color: var(--text);
}

.route-note {
  margin: 4px 0 0;
  padding: 12px 13px;
  border-radius: 12px;
  background: rgba(255,255,255,.025);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.route-results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.route-result-card {
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: var(--surface);
  padding: 18px;
  overflow: hidden;
  position: relative;
}

.route-result-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  opacity: .8;
}

.route-result-card.min::after { background: var(--orange); }
.route-result-card.avg::after { background: var(--accent); }
.route-result-card.max::after { background: var(--green); }

.route-result-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.route-result-head h3 {
  margin: 4px 0 0;
  font-size: 15px;
}

.route-scenario-badge {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.route-result-main {
  padding: 23px 0 19px;
  text-align: center;
}

.route-result-main span,
.route-result-main small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.route-result-main strong {
  display: block;
  margin: 5px 0 2px;
  font-size: 38px;
  letter-spacing: -.04em;
}

.route-result-card.min .route-result-main strong { color: #ffd39a; }
.route-result-card.avg .route-result-main strong { color: #c9bcff; }
.route-result-card.max .route-result-main strong { color: #9cf0c2; }

.route-result-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border-soft);
  padding-top: 14px;
}

.route-result-details > div {
  text-align: center;
  padding: 0 8px;
}

.route-result-details > div + div {
  border-left: 1px solid var(--border-soft);
}

.route-result-details span {
  display: block;
  min-height: 26px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.route-result-details strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
}

.route-comparison-panel {
  overflow: hidden;
}

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

.route-comparison-table {
  min-width: 820px;
}

.route-scenario-name {
  font-weight: 700;
}

@media (max-width: 1000px) {
  .route-calculator-grid,
  .route-results-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .route-info-strip {
    grid-template-columns: 1fr;
  }

  .route-info-strip > div + div {
    border-left: 0;
    border-top: 1px solid var(--border-soft);
  }

  .route-result-details {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .route-result-details > div + div {
    border-left: 0;
    border-top: 1px solid var(--border-soft);
    padding-top: 10px;
  }
}


.route-processing-summary {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(139,92,246,.16);
}

.route-processing-summary span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.route-processing-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--text);
}


.route-time-split {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 520px) {
  .route-time-split {
    flex-direction: column;
  }
}


/* Daily activity status */

.daily-activity-table {
  min-width: 980px;
}

.daily-status-control {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--border);
  background: #0d1015;
  border-radius: 11px;
}

.daily-status-button {
  border: 0;
  border-radius: 8px;
  padding: 7px 9px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  transition: .16s ease;
}

.daily-status-button:hover {
  color: var(--text);
  background: rgba(255,255,255,.04);
}

.daily-status-button.active[data-status="active"] {
  color: #a5efc5;
  background: rgba(47,208,127,.13);
}

.daily-status-button.active[data-status="inactive"] {
  color: #ffadb6;
  background: rgba(255,93,108,.12);
}

.daily-status-button.active[data-status="excused"] {
  color: #d6c9ff;
  background: rgba(139,92,246,.14);
}

.daily-status-button.active[data-status="unset"] {
  color: #d4d8df;
  background: rgba(255,255,255,.07);
}

.activity-last-active {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.history-button {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #0d1015;
  color: #c8ced8;
  padding: 7px 9px;
  font-size: 10px;
  font-weight: 700;
}

.history-button:hover {
  background: #171b22;
  border-color: #4d5664;
  color: #fff;
}

.activity-reset-note {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.activity-history-modal {
  width: min(720px, 100%);
}

.history-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.history-summary-card {
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: rgba(255,255,255,.02);
}

.history-summary-card span,
.history-summary-card strong {
  display: block;
}

.history-summary-card span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.history-summary-card strong {
  margin-top: 5px;
  font-size: 18px;
}

.daily-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 700;
}

.daily-status-badge.active {
  color: #a5efc5;
  background: rgba(47,208,127,.11);
}

.daily-status-badge.inactive {
  color: #ffadb6;
  background: rgba(255,93,108,.11);
}

.daily-status-badge.excused {
  color: #d6c9ff;
  background: rgba(139,92,246,.12);
}

.daily-status-badge.unset {
  color: #b0b7c2;
  background: rgba(255,255,255,.05);
}

.history-list {
  display: grid;
  gap: 8px;
  max-height: 470px;
  overflow-y: auto;
}

.history-entry {
  display: grid;
  grid-template-columns: 110px 130px 1fr;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  background: rgba(255,255,255,.018);
}

.history-entry-date,
.history-entry-note {
  color: var(--muted);
  font-size: 11px;
}

.history-entry-note {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-empty {
  padding: 28px 15px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 680px) {
  .history-summary {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .history-entry {
    grid-template-columns: 1fr;
    gap: 7px;
  }
}


/* ERP expansion: charts, inventory, payout workflow, Discord, contribution history */

.dashboard-chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.chart-panel {
  min-height: 300px;
}

.native-chart {
  min-height: 220px;
}

.chart-empty {
  height: 190px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.chart-bars {
  height: 190px;
  display: grid;
  grid-template-columns: repeat(7, minmax(30px, 1fr));
  gap: 8px;
  align-items: end;
  padding-top: 8px;
}

.chart-day {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
  min-width: 0;
}

.chart-day-bars {
  display: flex;
  gap: 4px;
  align-items: end;
  height: 150px;
}

.chart-bar {
  flex: 1;
  min-height: 2px;
  border-radius: 6px 6px 2px 2px;
  background: rgba(139,92,246,.72);
}

.chart-bar.expense {
  background: rgba(255,93,108,.70);
}

.chart-day-label {
  text-align: center;
  color: var(--muted);
  font-size: 9px;
}

.chart-legend {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 9px;
}

.chart-legend span::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 2px;
  background: rgba(139,92,246,.72);
}

.chart-legend span.expense::before {
  background: rgba(255,93,108,.70);
}

.metric-bars {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.metric-row {
  display: grid;
  grid-template-columns: minmax(80px, 120px) 1fr auto;
  gap: 9px;
  align-items: center;
}

.metric-label,
.metric-value {
  font-size: 10px;
}

.metric-label {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-value {
  color: var(--text);
  font-weight: 700;
}

.metric-track {
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.05);
}

.metric-fill {
  height: 100%;
  border-radius: inherit;
  background: rgba(139,92,246,.75);
}

.metric-fill.recorded {
  background: rgba(255,177,74,.72);
}

.metric-fill.approved {
  background: rgba(139,92,246,.75);
}

.metric-fill.paid {
  background: rgba(47,208,127,.72);
}

.inventory-table {
  min-width: 1060px;
}

.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 700;
}

.stock-badge.ok {
  color: #a5efc5;
  background: rgba(47,208,127,.10);
}

.stock-badge.low {
  color: #ffd39a;
  background: rgba(255,177,74,.10);
}

.stock-badge.empty {
  color: #ffadb6;
  background: rgba(255,93,108,.10);
}

.inventory-actions,
.payout-actions,
.contribution-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inventory-note {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.payout-summary {
  grid-template-columns: repeat(4, minmax(0,1fr));
}

.payout-secondary-summary {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 10px 2px 18px;
  color: var(--muted);
  font-size: 10px;
}

.payout-secondary-summary strong {
  color: var(--text);
}

.payout-status {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 800;
}

.payout-status.recorded {
  color: #ffd39a;
  background: rgba(255,177,74,.12);
}

.payout-status.approved {
  color: #d6c9ff;
  background: rgba(139,92,246,.14);
}

.payout-status.paid {
  color: #a5efc5;
  background: rgba(47,208,127,.11);
}

.payout-paid-time {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.row-action.approve-payout {
  color: #d6c9ff;
  border-color: rgba(139,92,246,.25);
}

.row-action.mark-paid {
  color: #a5efc5;
  border-color: rgba(47,208,127,.25);
}

.row-action.waiting {
  opacity: .55;
  cursor: not-allowed;
}

.discord-settings-panel {
  margin: 18px 0;
}

.integration-status {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.integration-status.active {
  color: #a5efc5;
  border-color: rgba(47,208,127,.22);
  background: rgba(47,208,127,.07);
}

.toggle-setting {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 9px;
}

.toggle-setting input {
  width: auto;
}

.discord-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contribution-history-list {
  display: grid;
  gap: 8px;
  max-height: 470px;
  overflow-y: auto;
}

.contribution-history-entry {
  display: grid;
  grid-template-columns: 150px 120px 90px 1fr;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  background: rgba(255,255,255,.018);
}

.contribution-history-entry span,
.contribution-history-entry small {
  font-size: 10px;
}

.contribution-history-entry .history-time,
.contribution-history-entry .history-detail {
  color: var(--muted);
}

.contribution-history-entry .history-delta {
  font-weight: 800;
}

.contribution-history-entry .history-delta.add {
  color: #a5efc5;
}

.contribution-history-entry .history-delta.remove,
.contribution-history-entry .history-delta.payout {
  color: #ffd39a;
}

@media (max-width: 1100px) {
  .dashboard-chart-grid {
    grid-template-columns: 1fr;
  }

  .chart-panel {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .payout-summary {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .contribution-history-entry {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}


/* =========================================================
   CALI PREMIUM REDESIGN
   Palette:
   Light Parchment #FEF4D5
   Light Gold      #F1E49A
   Muted Ochre     #E6D17B
   Dark Espresso   #2C1810
   ========================================================= */

:root {
  --bg: #FEF4D5;
  --surface: rgba(255, 250, 232, .72);
  --surface-2: rgba(241, 228, 154, .48);
  --surface-3: rgba(230, 209, 123, .32);
  --border: rgba(44, 24, 16, .13);
  --border-soft: rgba(44, 24, 16, .085);
  --text: #2C1810;
  --muted: rgba(44, 24, 16, .62);
  --accent: #E6D17B;
  --accent-2: #F1E49A;
  --accent-soft: rgba(230, 209, 123, .24);
  --green: #5f6d3f;
  --red: #8a4d35;
  --blue: #756444;
  --orange: #b78645;
  --shadow:
    0 1px 1px rgba(44,24,16,.04),
    0 8px 22px rgba(44,24,16,.08),
    0 24px 70px rgba(44,24,16,.08);
  --shadow-1: 0 5px 16px rgba(44,24,16,.07);
  --shadow-2: 0 14px 34px rgba(44,24,16,.10);
  --shadow-3: 0 28px 80px rgba(44,24,16,.16);
  --glass: rgba(255, 250, 232, .68);
  --glass-strong: rgba(254, 244, 213, .88);
  --espresso: #2C1810;
  --parchment: #FEF4D5;
  --gold: #F1E49A;
  --ochre: #E6D17B;
  --radius: 20px;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at 88% 7%, rgba(230,209,123,.38), transparent 28rem),
    radial-gradient(circle at 18% 75%, rgba(241,228,154,.34), transparent 34rem),
    linear-gradient(135deg, #fff8df 0%, #FEF4D5 48%, #f8ecc9 100%);
  color: var(--text);
}

button,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button:active {
  transform: translateY(1px) scale(.985);
}

/* Auth */

.auth-screen {
  background:
    radial-gradient(circle at 20% 20%, rgba(230,209,123,.44), transparent 30rem),
    radial-gradient(circle at 80% 80%, rgba(241,228,154,.55), transparent 32rem),
    #FEF4D5;
}

.auth-glow {
  background: rgba(230,209,123,.34);
  filter: blur(95px);
}

.auth-card {
  color: var(--espresso);
  border: 1px solid rgba(44,24,16,.11);
  background: rgba(255,250,232,.72);
  box-shadow: var(--shadow-3);
  backdrop-filter: blur(28px) saturate(125%);
  -webkit-backdrop-filter: blur(28px) saturate(125%);
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 23px;
  border: 1px solid rgba(255,255,255,.55);
  pointer-events: none;
}

.auth-copy,
.auth-brand span,
.auth-footnote {
  color: var(--muted);
}

.auth-error {
  border-color: rgba(138,77,53,.20);
  color: #6b3625;
  background: rgba(138,77,53,.08);
}

/* Shell + navigation */

.sidebar {
  width: 276px;
  padding: 24px 18px;
  background:
    radial-gradient(circle at 30% 5%, rgba(230,209,123,.14), transparent 18rem),
    linear-gradient(180deg, rgba(44,24,16,.98), rgba(35,18,12,.98));
  border-right: 1px solid rgba(254,244,213,.10);
  box-shadow: 14px 0 45px rgba(44,24,16,.12);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.main {
  margin-left: 276px;
  width: calc(100% - 276px);
}

.brand {
  padding: 2px 8px 24px;
}

.brand-mark {
  color: var(--espresso);
  background:
    linear-gradient(145deg, #fff6ce, #E6D17B);
  box-shadow:
    0 0 0 1px rgba(254,244,213,.18),
    0 10px 32px rgba(230,209,123,.22),
    0 0 38px rgba(230,209,123,.12);
}

.brand strong {
  color: #fff4d1;
}

.brand span {
  color: rgba(254,244,213,.56);
}

.ux-nav {
  display: grid;
  gap: 19px;
  overflow-y: auto;
  padding-right: 2px;
}

.nav-group {
  display: grid;
  gap: 5px;
}

.nav-group-label {
  padding: 0 11px 5px;
  color: rgba(254,244,213,.36);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 8px;
  font-weight: 800;
}

.nav-item {
  position: relative;
  min-height: 42px;
  padding: 10px 11px;
  border-radius: 13px;
  color: rgba(254,244,213,.63);
  background: transparent;
  transition:
    transform .18s ease,
    background .18s ease,
    color .18s ease,
    box-shadow .18s ease;
}

.nav-item:hover {
  color: #fff6d7;
  background: rgba(254,244,213,.07);
  transform: translateX(3px);
}

.nav-item.active {
  color: var(--espresso);
  background:
    linear-gradient(135deg, rgba(241,228,154,.98), rgba(230,209,123,.93));
  box-shadow:
    0 8px 26px rgba(230,209,123,.14),
    inset 0 1px 0 rgba(255,255,255,.38);
}

.nav-item.active::after {
  content: "";
  position: absolute;
  right: 7px;
  width: 5px;
  height: 5px;
  border-radius: 99px;
  background: var(--espresso);
  box-shadow: 0 0 12px rgba(44,24,16,.30);
}

.nav-icon {
  font-size: 16px;
}

.workspace-card {
  color: #fff4d1;
  border-color: rgba(254,244,213,.10);
  background: rgba(254,244,213,.045);
  backdrop-filter: blur(12px);
}

.workspace-card > span:last-child,
.workspace-card .eyebrow {
  color: rgba(254,244,213,.44);
}

/* Topbar */

.topbar {
  min-height: 86px;
  padding: 17px clamp(22px, 3vw, 42px);
  border-bottom: 1px solid rgba(44,24,16,.08);
  background: rgba(254,244,213,.72);
  backdrop-filter: blur(26px) saturate(135%);
  -webkit-backdrop-filter: blur(26px) saturate(135%);
  box-shadow: 0 10px 35px rgba(44,24,16,.035);
}

.topbar h1 {
  font-size: 21px;
  color: var(--espresso);
}

.topbar-actions {
  gap: 10px;
}

.date-chip,
.session-user {
  border: 1px solid rgba(44,24,16,.10);
  background: rgba(255,250,232,.52);
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(12px);
}

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

.session-user {
  border-radius: 14px;
  padding: 5px 9px 5px 6px;
}

.session-user-copy strong {
  color: var(--espresso);
}

.session-user-copy span {
  color: var(--muted);
}

.avatar {
  background: linear-gradient(145deg, #E6D17B, #F1E49A);
  border-color: rgba(44,24,16,.08);
  color: var(--espresso);
  box-shadow: 0 6px 18px rgba(44,24,16,.08);
}

/* Quick action UX menu */

.quick-actions-wrap {
  position: relative;
}

.quick-actions-button {
  border: 1px solid rgba(44,24,16,.12);
  border-radius: 13px;
  padding: 10px 13px;
  background: rgba(255,250,232,.66);
  color: var(--espresso);
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 750;
  font-size: 11px;
  box-shadow: var(--shadow-1);
  transition: .18s ease;
}

.quick-actions-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  background: rgba(255,250,232,.92);
}

.quick-actions-button > span:first-child {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--ochre);
}

.quick-actions-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 310px;
  z-index: 60;
  padding: 10px;
  border: 1px solid rgba(44,24,16,.12);
  border-radius: 19px;
  background: rgba(255,250,232,.92);
  box-shadow: var(--shadow-3);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  transform-origin: top right;
  animation: quickMenuIn .18s ease both;
}

@keyframes quickMenuIn {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.quick-menu-head {
  padding: 9px 10px 11px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 5px;
}

.quick-menu-head strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
}

.quick-actions-menu > button {
  width: 100%;
  border: 0;
  border-radius: 13px;
  background: transparent;
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  color: var(--espresso);
  transition: .16s ease;
}

.quick-actions-menu > button:hover {
  background: rgba(230,209,123,.22);
  transform: translateX(3px);
}

.quick-actions-menu button > span:last-child {
  display: grid;
  gap: 2px;
}

.quick-actions-menu button strong {
  font-size: 11px;
}

.quick-actions-menu button small {
  color: var(--muted);
  font-size: 9px;
}

.quick-menu-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(241,228,154,.72), rgba(230,209,123,.48));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
}

/* Page spacing */

.page {
  padding: 34px clamp(22px, 3.2vw, 46px) 58px;
}

.dashboard-shell,
.page > .section-head,
.page > .activity-overview-grid,
.page > .finance-summary,
.page > .payout-secondary-summary,
.page > .toolbar,
.page > .table-card,
.page > .settings-grid,
.page > .panel,
.page > .route-calculator-grid,
.page > .route-results-grid {
  max-width: 1540px;
  margin-left: auto;
  margin-right: auto;
}

.section-head {
  margin-bottom: 22px;
}

.section-head h2 {
  font-size: clamp(25px, 3vw, 34px);
  letter-spacing: -.035em;
}

.section-head p {
  max-width: 760px;
}

/* Shared glass card system */

.panel,
.table-card,
.kpi-card,
.settings-panel,
.route-result-card {
  position: relative;
  border: 1px solid rgba(44,24,16,.105);
  background:
    linear-gradient(135deg, rgba(255,255,255,.30), rgba(255,255,255,.08)),
    rgba(255,250,232,.63);
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
}

.panel::before,
.table-card::before,
.kpi-card::before,
.route-result-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  pointer-events: none;
  border-radius: inherit;
  border: 1px solid rgba(255,255,255,.34);
  opacity: .8;
}

.panel,
.kpi-card,
.table-card,
.route-result-card {
  transition:
    transform .22s cubic-bezier(.2,.8,.2,1),
    box-shadow .22s ease,
    border-color .22s ease;
}

.panel:hover,
.kpi-card:hover,
.route-result-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
  border-color: rgba(44,24,16,.15);
}

.consistent-card {
  min-height: 100%;
}

.panel-heading h3,
.dashboard-section-head h3 {
  color: var(--espresso);
}

/* Buttons */

.primary-button {
  color: var(--espresso);
  background:
    linear-gradient(145deg, #F1E49A 0%, #E6D17B 100%);
  box-shadow:
    0 9px 22px rgba(44,24,16,.10),
    0 0 0 1px rgba(44,24,16,.05),
    0 0 28px rgba(230,209,123,.25);
}

.primary-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.025);
  box-shadow:
    0 14px 30px rgba(44,24,16,.13),
    0 0 34px rgba(230,209,123,.34);
}

.secondary-button,
.ghost-button,
.icon-button {
  color: var(--espresso);
  border-color: rgba(44,24,16,.11);
  background: rgba(255,250,232,.50);
}

.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover {
  background: rgba(241,228,154,.48);
  transform: translateY(-1px);
}

.logout-button {
  border: 1px solid rgba(44,24,16,.11);
}

/* Inputs */

input,
select,
textarea {
  color: var(--espresso);
  border-color: rgba(44,24,16,.13);
  background: rgba(255,250,232,.60);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.38);
}

input::placeholder,
textarea::placeholder {
  color: rgba(44,24,16,.42);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(44,24,16,.24);
  background: rgba(255,250,232,.88);
  box-shadow:
    0 0 0 4px rgba(230,209,123,.25),
    0 8px 20px rgba(44,24,16,.05);
}

label {
  color: rgba(44,24,16,.76);
}

/* Dashboard hero */

.premium-hero {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  padding: clamp(30px, 4vw, 52px);
  border: 1px solid rgba(44,24,16,.10);
  background:
    radial-gradient(circle at 92% 18%, rgba(241,228,154,.90), transparent 21rem),
    radial-gradient(circle at 74% 84%, rgba(230,209,123,.42), transparent 24rem),
    linear-gradient(120deg, rgba(255,250,232,.88), rgba(254,244,213,.72));
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(28px);
}

.premium-hero::before {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: 10%;
  top: -38%;
  border-radius: 50%;
  border: 1px solid rgba(44,24,16,.07);
  box-shadow:
    0 0 0 34px rgba(230,209,123,.08),
    0 0 0 70px rgba(230,209,123,.05);
  pointer-events: none;
}

.premium-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(44,24,16,.18), transparent);
}

.hero-content,
.hero-actions {
  position: relative;
  z-index: 2;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 19px;
  padding: 7px 10px;
  border: 1px solid rgba(44,24,16,.09);
  border-radius: 999px;
  background: rgba(255,255,255,.22);
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.hero-dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--espresso);
  box-shadow: 0 0 0 4px rgba(44,24,16,.08);
}

.eyebrow.accent {
  color: rgba(44,24,16,.58);
}

.premium-hero h2 {
  max-width: 820px;
  color: var(--espresso);
  font-size: clamp(34px, 5vw, 62px);
  line-height: .99;
  letter-spacing: -.055em;
}

.hero-copy {
  max-width: 720px;
  color: rgba(44,24,16,.64);
}

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

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.hero-meta span {
  padding: 8px 10px;
  border: 1px solid rgba(44,24,16,.08);
  border-radius: 999px;
  background: rgba(255,255,255,.23);
  color: var(--muted);
  font-size: 9px;
}

.hero-meta strong {
  color: var(--espresso);
  font-size: 10px;
}

/* Dashboard grouping */

.dashboard-section {
  margin-top: 30px;
}

.dashboard-section + .dashboard-section {
  margin-top: 34px;
}

.dashboard-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 0 3px;
}

.dashboard-section-head h3 {
  margin: 5px 0 0;
  font-size: 20px;
  letter-spacing: -.025em;
}

.section-hint {
  color: var(--muted);
  font-size: 9px;
}

.premium-kpi-grid {
  grid-template-columns: repeat(6, minmax(0,1fr));
  gap: 12px;
}

.premium-kpi-grid .kpi-card {
  min-height: 135px;
  padding: 17px;
}

.premium-kpi-grid .kpi-value {
  margin: 18px 0 6px;
  font-size: clamp(22px, 2.4vw, 31px);
}

.premium-kpi-grid .kpi-header {
  font-size: 10px;
}

.premium-kpi-grid small {
  font-size: 9px;
  line-height: 1.45;
}

.accent-card {
  background:
    linear-gradient(135deg, rgba(241,228,154,.68), rgba(255,250,232,.70));
}

.balance-card {
  background:
    linear-gradient(135deg, rgba(230,209,123,.43), rgba(255,250,232,.66));
}

.status-dot.purple,
.status-dot.green,
.status-dot.red,
.status-dot.blue {
  color: var(--ochre);
  background: var(--ochre);
  box-shadow:
    0 0 0 4px rgba(230,209,123,.20),
    0 0 18px rgba(230,209,123,.55);
}

.positive {
  color: #5e4d1f !important;
}

.negative {
  color: #6c3d2c !important;
}

/* Insights */

.insight-zone {
  padding: 23px;
  border: 1px solid rgba(44,24,16,.09);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(230,209,123,.28), transparent 22rem),
    rgba(255,250,232,.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.34);
}

.insight-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(44,24,16,.05);
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.insight-live-badge > span {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--ochre);
  box-shadow: 0 0 0 4px rgba(230,209,123,.18), 0 0 16px rgba(230,209,123,.55);
  animation: insightPulse 2s ease-in-out infinite;
}

@keyframes insightPulse {
  0%, 100% { transform: scale(1); opacity: .9; }
  50% { transform: scale(1.28); opacity: 1; }
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px;
}

.insight-card {
  position: relative;
  min-height: 150px;
  padding: 17px;
  border-radius: 18px;
  border: 1px solid rgba(44,24,16,.09);
  background: rgba(255,250,232,.64);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition: .2s ease;
}

.insight-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
}

.insight-card::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(230,209,123,.22);
  filter: blur(2px);
}

.insight-card.warning {
  background:
    linear-gradient(135deg, rgba(230,209,123,.36), rgba(255,250,232,.72));
}

.insight-card.action {
  border-color: rgba(44,24,16,.15);
}

.insight-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(230,209,123,.40);
  color: var(--espresso);
  margin-bottom: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.52);
}

.insight-card h4 {
  margin: 0 0 6px;
  font-size: 13px;
}

.insight-card p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.insight-card .insight-link {
  display: inline-flex;
  margin-top: 12px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--espresso);
  font-size: 9px;
  font-weight: 800;
}

/* Charts */

.premium-chart-grid {
  grid-template-columns: 1.35fr .82fr .83fr;
  gap: 12px;
}

.chart-panel {
  min-height: 315px;
}

.feature-chart-card {
  background:
    linear-gradient(135deg, rgba(241,228,154,.34), rgba(255,250,232,.66));
}

.chart-bar {
  background: linear-gradient(180deg, #2C1810, #725f47);
  box-shadow: 0 0 16px rgba(44,24,16,.12);
}

.chart-bar.expense {
  background: linear-gradient(180deg, #E6D17B, #b79a4d);
  box-shadow: 0 0 18px rgba(230,209,123,.28);
}

.chart-legend span::before {
  background: var(--espresso);
}

.chart-legend span.expense::before {
  background: var(--ochre);
}

.metric-track {
  background: rgba(44,24,16,.07);
}

.metric-fill,
.metric-fill.approved {
  background: linear-gradient(90deg, #2C1810, #66503d);
}

.metric-fill.recorded {
  background: linear-gradient(90deg, #E6D17B, #c7ae59);
}

.metric-fill.paid {
  background: linear-gradient(90deg, #F1E49A, #d8c46c);
}

/* Tables / toolbars */

.toolbar {
  margin-bottom: 14px;
  padding: 9px;
  border: 1px solid rgba(44,24,16,.08);
  border-radius: 17px;
  background: rgba(255,250,232,.38);
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(14px);
}

.table-card {
  border-radius: 20px;
  box-shadow: var(--shadow-1);
}

thead {
  background: rgba(230,209,123,.12);
}

th {
  color: rgba(44,24,16,.53);
  font-size: 9px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

th,
td {
  border-bottom-color: rgba(44,24,16,.075);
}

tbody tr {
  transition: background .15s ease;
}

tbody tr:hover {
  background: rgba(241,228,154,.12);
}

.table-title,
td strong {
  color: var(--espresso);
}

/* Badges and row actions */

.badge,
.role-badge,
.stock-badge,
.payout-status,
.daily-status-badge,
.route-scenario-badge {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.26);
}

.row-action,
.history-button,
.delete-button {
  transition: .16s ease;
}

.row-action:hover,
.history-button:hover,
.delete-button:hover {
  transform: translateY(-1px);
}

/* Modals */

.overlay {
  background: rgba(44,24,16,.28);
  backdrop-filter: blur(10px);
}

.modal-card {
  color: var(--espresso);
  border-color: rgba(44,24,16,.12);
  background:
    linear-gradient(135deg, rgba(255,255,255,.26), rgba(255,255,255,.04)),
    rgba(254,244,213,.93);
  box-shadow: var(--shadow-3);
  backdrop-filter: blur(30px) saturate(130%);
  -webkit-backdrop-filter: blur(30px) saturate(130%);
  animation: modalIn .2s cubic-bezier(.2,.8,.2,1) both;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Toast */

.toast {
  color: #fff3d2;
  background: rgba(44,24,16,.94);
  border-color: rgba(254,244,213,.10);
  box-shadow: var(--shadow-3);
  backdrop-filter: blur(16px);
}

/* Route calculator + settings */

.route-info-strip,
.route-duration-summary,
.calculation-preview,
.admin-example,
.recovery-account-info {
  background: rgba(255,250,232,.44);
  border-color: rgba(44,24,16,.09);
}

.route-result-card.min::after,
.route-result-card.avg::after,
.route-result-card.max::after {
  background: var(--ochre);
}

.route-result-card.min .route-result-main strong,
.route-result-card.avg .route-result-main strong,
.route-result-card.max .route-result-main strong {
  color: var(--espresso);
}

.integration-status.active {
  color: var(--espresso);
  border-color: rgba(44,24,16,.14);
  background: rgba(230,209,123,.32);
}

/* Scrollbars */

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(44,24,16,.24) transparent;
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-thumb {
  background: rgba(44,24,16,.20);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* Responsive */

@media (max-width: 1320px) {
  .premium-kpi-grid {
    grid-template-columns: repeat(3, minmax(0,1fr));
  }

  .insight-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .premium-chart-grid {
    grid-template-columns: 1fr 1fr;
  }

  .feature-chart-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1050px) {
  .sidebar {
    width: 276px;
  }

  .main {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 780px) {
  .page {
    padding: 24px 15px 44px;
  }

  .premium-kpi-grid,
  .insight-grid,
  .premium-chart-grid {
    grid-template-columns: 1fr;
  }

  .feature-chart-card {
    grid-column: auto;
  }

  .dashboard-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .premium-hero {
    min-height: auto;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions > button {
    flex: 1;
  }

  .quick-actions-button > span:last-child,
  .session-user-copy {
    display: none;
  }

  .quick-actions-menu {
    position: fixed;
    right: 12px;
    left: 12px;
    top: 76px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}


/* =========================================================
   CALI THEME A — PETROL / ANTHRAZIT / EISBLAU
   ========================================================= */

:root {
  --bg: #0B1114;
  --surface: rgba(17, 27, 31, .72);
  --surface-2: rgba(20, 45, 51, .58);
  --surface-3: rgba(24, 58, 64, .40);
  --border: rgba(185, 225, 235, .15);
  --border-soft: rgba(185, 225, 235, .09);
  --text: #EAF7FA;
  --muted: rgba(210, 235, 240, .62);
  --accent: #49A7B8;
  --accent-2: #8DD8E5;
  --accent-soft: rgba(73, 167, 184, .16);
  --green: #76C9B5;
  --red: #E77C89;
  --blue: #9EDFEB;
  --orange: #E4B56A;
  --shadow: 0 1px 1px rgba(0,0,0,.14), 0 10px 28px rgba(0,0,0,.28), 0 26px 80px rgba(0,0,0,.24);
  --shadow-1: 0 8px 22px rgba(0,0,0,.20);
  --shadow-2: 0 16px 42px rgba(0,0,0,.28);
  --shadow-3: 0 30px 90px rgba(0,0,0,.42);
  --glass: rgba(17, 27, 31, .68);
  --glass-strong: rgba(16, 28, 33, .90);
  --espresso: #EAF7FA;
  --parchment: #0B1114;
  --gold: #8DD8E5;
  --ochre: #49A7B8;
}

body {
  background:
    radial-gradient(circle at 88% 7%, rgba(73,167,184,.18), transparent 28rem),
    radial-gradient(circle at 12% 78%, rgba(141,216,229,.10), transparent 34rem),
    linear-gradient(135deg, #081013 0%, #0B1114 45%, #102127 100%);
  color: var(--text);
}

.auth-screen {
  background:
    radial-gradient(circle at 18% 18%, rgba(73,167,184,.18), transparent 30rem),
    radial-gradient(circle at 82% 82%, rgba(141,216,229,.10), transparent 34rem),
    #0B1114;
}

.auth-glow {
  background: rgba(73,167,184,.20);
}

.auth-card {
  color: var(--text);
  border-color: rgba(158,223,235,.16);
  background: rgba(14, 26, 31, .76);
  box-shadow: var(--shadow-3);
}

.auth-card::before {
  border-color: rgba(255,255,255,.07);
}

.auth-copy,
.auth-brand span,
.auth-footnote {
  color: var(--muted);
}

.sidebar {
  background:
    radial-gradient(circle at 30% 5%, rgba(73,167,184,.12), transparent 18rem),
    linear-gradient(180deg, rgba(10,17,20,.99), rgba(7,12,14,.99));
  border-right-color: rgba(158,223,235,.10);
  box-shadow: 16px 0 48px rgba(0,0,0,.28);
}

.brand-mark {
  color: #071013;
  background: linear-gradient(145deg, #A9E7F1, #49A7B8);
  box-shadow: 0 0 0 1px rgba(158,223,235,.14), 0 10px 32px rgba(73,167,184,.22), 0 0 38px rgba(73,167,184,.12);
}

.brand strong { color: #EAF7FA; }
.brand span,
.nav-group-label,
.workspace-card > span:last-child,
.workspace-card .eyebrow { color: rgba(210,235,240,.48); }

.nav-item { color: rgba(220,241,245,.68); }
.nav-item:hover {
  color: #F2FBFC;
  background: rgba(141,216,229,.06);
}
.nav-item.active {
  color: #071013;
  background: linear-gradient(135deg, rgba(141,216,229,.97), rgba(73,167,184,.94));
  box-shadow: 0 10px 28px rgba(73,167,184,.16), inset 0 1px 0 rgba(255,255,255,.28);
}
.nav-item.active::after {
  background: #071013;
  box-shadow: 0 0 14px rgba(7,16,19,.34);
}

.workspace-card {
  color: #EAF7FA;
  border-color: rgba(158,223,235,.10);
  background: rgba(141,216,229,.035);
}

.topbar {
  border-bottom-color: rgba(158,223,235,.08);
  background: rgba(11,17,20,.72);
  box-shadow: 0 10px 35px rgba(0,0,0,.10);
}

.topbar h1,
.session-user-copy strong { color: #EAF7FA; }

.date-chip,
.session-user,
.quick-actions-button {
  border-color: rgba(158,223,235,.12);
  background: rgba(17,29,34,.62);
  color: #EAF7FA;
  box-shadow: var(--shadow-1);
}

.avatar {
  color: #071013;
  background: linear-gradient(145deg, #8DD8E5, #49A7B8);
}

.quick-actions-button:hover { background: rgba(24,43,49,.90); }
.quick-actions-button > span:first-child {
  background: #49A7B8;
  color: #071013;
}

.quick-actions-menu {
  border-color: rgba(158,223,235,.14);
  background: rgba(13,24,29,.94);
  box-shadow: var(--shadow-3);
}
.quick-actions-menu > button { color: #EAF7FA; }
.quick-actions-menu > button:hover { background: rgba(73,167,184,.14); }
.quick-menu-icon {
  color: #DFF6FA;
  background: linear-gradient(145deg, rgba(141,216,229,.24), rgba(73,167,184,.16));
}

.panel,
.table-card,
.kpi-card,
.settings-panel,
.route-result-card {
  border-color: rgba(158,223,235,.11);
  background: linear-gradient(135deg, rgba(255,255,255,.035), rgba(255,255,255,.01)), rgba(15,26,31,.72);
  box-shadow: var(--shadow-1);
}

.panel::before,
.table-card::before,
.kpi-card::before,
.route-result-card::before {
  border-color: rgba(255,255,255,.055);
}

.panel:hover,
.kpi-card:hover,
.route-result-card:hover {
  border-color: rgba(141,216,229,.18);
}

.panel-heading h3,
.dashboard-section-head h3,
.table-title,
td strong { color: #EAF7FA; }

.primary-button {
  color: #071013;
  background: linear-gradient(145deg, #8DD8E5 0%, #49A7B8 100%);
  box-shadow: 0 10px 24px rgba(0,0,0,.20), 0 0 0 1px rgba(141,216,229,.08), 0 0 30px rgba(73,167,184,.22);
}
.primary-button:hover {
  box-shadow: 0 14px 34px rgba(0,0,0,.26), 0 0 38px rgba(73,167,184,.30);
}

.secondary-button,
.ghost-button,
.icon-button {
  color: #DFF6FA;
  border-color: rgba(158,223,235,.12);
  background: rgba(18,31,36,.58);
}
.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover { background: rgba(73,167,184,.13); }

input,
select,
textarea {
  color: #EAF7FA;
  border-color: rgba(158,223,235,.13);
  background: rgba(8,18,22,.62);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
input::placeholder,
textarea::placeholder { color: rgba(210,235,240,.38); }
input:focus,
select:focus,
textarea:focus {
  border-color: rgba(141,216,229,.32);
  background: rgba(12,24,29,.90);
  box-shadow: 0 0 0 4px rgba(73,167,184,.15), 0 10px 22px rgba(0,0,0,.12);
}
label { color: rgba(224,243,247,.78); }

.premium-hero {
  border-color: rgba(158,223,235,.11);
  background:
    radial-gradient(circle at 92% 18%, rgba(73,167,184,.20), transparent 21rem),
    radial-gradient(circle at 74% 84%, rgba(141,216,229,.08), transparent 24rem),
    linear-gradient(120deg, rgba(15,27,32,.92), rgba(9,18,22,.82));
  box-shadow: var(--shadow-2);
}
.premium-hero::before {
  border-color: rgba(141,216,229,.10);
  box-shadow: 0 0 0 34px rgba(73,167,184,.05), 0 0 0 70px rgba(73,167,184,.025);
}
.premium-hero::after {
  background: linear-gradient(90deg, transparent, rgba(141,216,229,.18), transparent);
}

.hero-dot {
  background: #8DD8E5;
  box-shadow: 0 0 0 4px rgba(73,167,184,.10), 0 0 16px rgba(73,167,184,.28);
}
.hero-kicker,
.hero-meta span {
  border-color: rgba(158,223,235,.10);
  background: rgba(141,216,229,.035);
}
.premium-hero h2,
.hero-meta strong { color: #EAF7FA; }
.hero-copy,
.eyebrow.accent { color: rgba(210,235,240,.66); }

.accent-card {
  background: linear-gradient(135deg, rgba(73,167,184,.18), rgba(15,27,32,.76));
}
.balance-card {
  background: linear-gradient(135deg, rgba(141,216,229,.12), rgba(15,27,32,.74));
}

.status-dot.purple,
.status-dot.green,
.status-dot.red,
.status-dot.blue {
  color: #8DD8E5;
  background: #8DD8E5;
  box-shadow: 0 0 0 4px rgba(73,167,184,.14), 0 0 18px rgba(73,167,184,.38);
}

.positive { color: #92DFC9 !important; }
.negative { color: #F0A0AA !important; }

.insight-zone {
  border-color: rgba(158,223,235,.10);
  background: radial-gradient(circle at 100% 0%, rgba(73,167,184,.14), transparent 22rem), rgba(11,22,27,.34);
}
.insight-live-badge {
  background: rgba(141,216,229,.055);
  color: var(--muted);
}
.insight-live-badge > span {
  background: #8DD8E5;
  box-shadow: 0 0 0 4px rgba(73,167,184,.14), 0 0 16px rgba(73,167,184,.34);
}
.insight-card {
  border-color: rgba(158,223,235,.09);
  background: rgba(14,26,31,.72);
}
.insight-card.warning {
  background: linear-gradient(135deg, rgba(73,167,184,.15), rgba(14,26,31,.78));
}
.insight-card::after { background: rgba(73,167,184,.12); }
.insight-icon {
  color: #DFF6FA;
  background: rgba(73,167,184,.18);
}
.insight-card .insight-link { color: #9EDFEB; }

.feature-chart-card {
  background: linear-gradient(135deg, rgba(73,167,184,.12), rgba(15,26,31,.72));
}
.chart-bar {
  background: linear-gradient(180deg, #8DD8E5, #3C8290);
  box-shadow: 0 0 16px rgba(73,167,184,.18);
}
.chart-bar.expense {
  background: linear-gradient(180deg, #2A5360, #17323A);
  box-shadow: 0 0 18px rgba(0,0,0,.20);
}
.chart-legend span::before { background: #8DD8E5; }
.chart-legend span.expense::before { background: #2A5360; }
.metric-track { background: rgba(141,216,229,.07); }
.metric-fill,
.metric-fill.approved { background: linear-gradient(90deg, #49A7B8, #8DD8E5); }
.metric-fill.recorded { background: linear-gradient(90deg, #6D8790, #9BBCC3); }
.metric-fill.paid { background: linear-gradient(90deg, #76C9B5, #A5E8D7); }

.toolbar {
  border-color: rgba(158,223,235,.08);
  background: rgba(14,26,31,.42);
}
thead { background: rgba(73,167,184,.08); }
th { color: rgba(210,235,240,.48); }
th,
td { border-bottom-color: rgba(158,223,235,.07); }
tbody tr:hover { background: rgba(73,167,184,.07); }

.overlay { background: rgba(0,0,0,.46); }
.modal-card {
  color: #EAF7FA;
  border-color: rgba(158,223,235,.13);
  background: linear-gradient(135deg, rgba(255,255,255,.035), rgba(255,255,255,.008)), rgba(12,23,28,.96);
}

.toast {
  color: #EAF7FA;
  background: rgba(8,16,20,.96);
  border-color: rgba(158,223,235,.10);
}

.route-info-strip,
.route-duration-summary,
.calculation-preview,
.admin-example,
.recovery-account-info {
  background: rgba(15,27,32,.56);
  border-color: rgba(158,223,235,.09);
}

.route-result-card.min::after,
.route-result-card.avg::after,
.route-result-card.max::after { background: #49A7B8; }

.route-result-card.min .route-result-main strong,
.route-result-card.avg .route-result-main strong,
.route-result-card.max .route-result-main strong { color: #EAF7FA; }

.integration-status.active {
  color: #DFF6FA;
  border-color: rgba(141,216,229,.16);
  background: rgba(73,167,184,.13);
}

* { scrollbar-color: rgba(141,216,229,.24) transparent; }
*::-webkit-scrollbar-thumb { background: rgba(141,216,229,.18); }


/* VIP route boost */

.route-vip-card {
  padding: 14px;
  border: 1px solid rgba(141,216,229,.12);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(73,167,184,.10), rgba(141,216,229,.035)),
    rgba(10,22,27,.42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}

.vip-toggle-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.vip-toggle-row > span {
  display: grid;
  gap: 3px;
}

.vip-toggle-row strong {
  color: var(--text);
  font-size: 12px;
}

.vip-toggle-row small {
  color: var(--muted);
  font-size: 9px;
}

.vip-toggle-row input {
  appearance: none;
  width: 42px;
  height: 23px;
  border-radius: 999px;
  position: relative;
  background: rgba(141,216,229,.10);
  border: 1px solid rgba(141,216,229,.14);
  cursor: pointer;
  transition: .18s ease;
}

.vip-toggle-row input::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 17px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: rgba(234,247,250,.74);
  box-shadow: 0 3px 10px rgba(0,0,0,.28);
  transition: .18s ease;
}

.vip-toggle-row input:checked {
  background: linear-gradient(90deg, #49A7B8, #8DD8E5);
  box-shadow: 0 0 22px rgba(73,167,184,.18);
}

.vip-toggle-row input:checked::after {
  transform: translateX(19px);
  background: #071013;
}

.vip-speed-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 8px;
  margin-top: 12px;
}

.vip-speed-preview > div {
  padding: 10px 11px;
  border-radius: 12px;
  background: rgba(141,216,229,.035);
  border: 1px solid rgba(141,216,229,.07);
}

.vip-speed-preview span,
.vip-speed-preview strong {
  display: block;
}

.vip-speed-preview span {
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.vip-speed-preview strong {
  margin-top: 4px;
  color: var(--text);
  font-size: 14px;
}

.vip-formula {
  margin: 9px 0 0;
  color: #9EDFEB;
  font-size: 10px;
  line-height: 1.5;
}

@media (max-width: 520px) {
  .vip-speed-preview {
    grid-template-columns: 1fr;
  }
}


/* Route owners */

.route-owner-table {
  min-width: 1120px;
}

.route-owner-kpis {
  margin-bottom: 18px;
}

.route-name-chip {
  display: inline-flex;
  max-width: 220px;
  padding: 6px 9px;
  border: 1px solid rgba(141,216,229,.10);
  border-radius: 10px;
  background: rgba(73,167,184,.07);
  color: var(--text);
  font-size: 10px;
  font-weight: 700;
}

.money-type-badge,
.route-owner-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.money-type-badge.green {
  color: #A6E7D7;
  border: 1px solid rgba(118,201,181,.18);
  background: rgba(118,201,181,.10);
  box-shadow: 0 0 18px rgba(118,201,181,.06);
}

.money-type-badge.black {
  color: #D6E7EA;
  border: 1px solid rgba(180,205,212,.12);
  background: rgba(4,9,11,.42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}

.route-owner-status.active {
  color: #9EDFEB;
  background: rgba(73,167,184,.12);
}

.route-owner-status.inactive {
  color: rgba(210,235,240,.48);
  background: rgba(210,235,240,.055);
}

.route-owner-note {
  max-width: 240px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.route-owner-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}


/* Sanction catalog + department */

.sanction-table,
.sanction-case-table {
  min-width: 1120px;
}

.sanction-kpis {
  margin-bottom: 18px;
}

.sanction-severity,
.sanction-case-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.sanction-severity.minor {
  color: #A6E7D7;
  background: rgba(118,201,181,.10);
  border: 1px solid rgba(118,201,181,.14);
}

.sanction-severity.medium {
  color: #CDEFF5;
  background: rgba(73,167,184,.12);
  border: 1px solid rgba(141,216,229,.13);
}

.sanction-severity.severe {
  color: #F0A0AA;
  background: rgba(231,124,137,.11);
  border: 1px solid rgba(231,124,137,.15);
  box-shadow: 0 0 18px rgba(231,124,137,.05);
}

.sanction-action {
  display: inline-flex;
  max-width: 260px;
  padding: 6px 9px;
  border-radius: 10px;
  border: 1px solid rgba(141,216,229,.10);
  background: rgba(73,167,184,.07);
  color: var(--text);
  font-size: 10px;
  font-weight: 700;
}

.sanction-description {
  max-width: 280px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.sanction-case-status.open {
  color: #F0A0AA;
  background: rgba(231,124,137,.10);
}

.sanction-case-status.resolved {
  color: #A6E7D7;
  background: rgba(118,201,181,.10);
}

.sanction-rule-preview {
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid rgba(141,216,229,.10);
  background: rgba(73,167,184,.06);
}

.sanction-rule-preview span,
.sanction-rule-preview strong,
.sanction-rule-preview small {
  display: block;
}

.sanction-rule-preview span {
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.sanction-rule-preview strong {
  margin-top: 5px;
  color: var(--text);
  font-size: 13px;
}

.sanction-rule-preview small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}


/* Article prices + equipment calculator */

.article-price-table {
  min-width: 980px;
}

.equipment-kpis {
  margin-bottom: 18px;
}

.article-price-value {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 10px;
  color: #CFF4FA;
  background: rgba(73,167,184,.10);
  border: 1px solid rgba(141,216,229,.12);
  font-weight: 800;
  font-size: 10px;
}

.article-price-note {
  max-width: 280px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.equipment-calculator-layout {
  max-width: 1540px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.equipment-summary-panel {
  position: sticky;
  top: 104px;
}

.equipment-cost-summary {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.equipment-cost-summary > div {
  padding: 13px;
  border-radius: 14px;
  border: 1px solid rgba(141,216,229,.08);
  background: rgba(73,167,184,.045);
}

.equipment-cost-summary span,
.equipment-cost-summary strong {
  display: block;
}

.equipment-cost-summary span {
  color: var(--muted);
  font-size: 9px;
}

.equipment-cost-summary strong {
  margin-top: 5px;
  color: var(--text);
  font-size: 19px;
}

.equipment-total-card {
  background: linear-gradient(135deg, rgba(73,167,184,.16), rgba(141,216,229,.06)) !important;
  border-color: rgba(141,216,229,.13) !important;
  box-shadow: 0 0 28px rgba(73,167,184,.05);
}

.equipment-total-card strong {
  font-size: 24px;
  color: #9EDFEB;
}

.equipment-selection-meta {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
}

.equipment-selection-meta strong {
  color: var(--text);
}

.equipment-search-wrap {
  max-width: none;
  margin-bottom: 14px;
}

.equipment-item-list {
  display: grid;
  gap: 8px;
}

.equipment-item-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 120px 140px 120px;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border-radius: 15px;
  border: 1px solid rgba(141,216,229,.08);
  background: rgba(8,18,22,.34);
  transition: .16s ease;
}

.equipment-item-row:hover {
  transform: translateY(-1px);
  border-color: rgba(141,216,229,.14);
  background: rgba(73,167,184,.055);
}

.equipment-item-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.equipment-item-main strong {
  color: var(--text);
  font-size: 12px;
}

.equipment-item-main small {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.equipment-category {
  color: #8DD8E5;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.equipment-item-price,
.equipment-item-total {
  display: grid;
  gap: 4px;
}

.equipment-item-price span,
.equipment-item-total span,
.equipment-quantity-control span {
  color: var(--muted);
  font-size: 8px;
}

.equipment-item-price strong,
.equipment-item-total strong {
  color: var(--text);
  font-size: 11px;
}

.equipment-item-total strong {
  color: #9EDFEB;
}

.equipment-quantity-control {
  gap: 5px;
}

.equipment-quantity-control input {
  padding: 8px 9px;
}

@media (max-width: 1050px) {
  .equipment-calculator-layout {
    grid-template-columns: 1fr;
  }

  .equipment-summary-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .equipment-item-row {
    grid-template-columns: 1fr 1fr;
  }

  .equipment-item-main {
    grid-column: 1 / -1;
  }
}


/* Minimum contribution allocation */

.contribution-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.contribution-allocation-note {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(141,216,229,.10);
  border-radius: 14px;
  background: rgba(73,167,184,.055);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.contribution-allocation-note strong {
  color: var(--text);
}

.contribution-table {
  min-width: 1420px;
}

.contribution-status {
  display: inline-flex;
  margin-top: 5px;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
}

.contribution-status.met {
  color: #A6E7D7;
  background: rgba(118,201,181,.10);
}

.contribution-status.excess {
  color: #9EDFEB;
  background: rgba(73,167,184,.12);
}

.contribution-status.shortfall {
  color: #F0A0AA;
  background: rgba(231,124,137,.11);
}

.faction-card {
  background:
    linear-gradient(135deg, rgba(118,201,181,.10), rgba(15,26,31,.72));
}

.sanction-summary-card {
  background:
    linear-gradient(135deg, rgba(231,124,137,.08), rgba(15,26,31,.72));
}

.contribution-actions button:disabled {
  opacity: .42;
  cursor: not-allowed;
  transform: none !important;
}

@media (max-width: 1200px) {
  .contribution-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .contribution-overview-grid {
    grid-template-columns: 1fr;
  }
}


/* Central family / Hermanos directory */

.family-kpis {
  margin-bottom: 18px;
}

.family-table {
  min-width: 1120px;
}

.family-link-badge {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(210,235,240,.055);
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.family-link-badge.linked {
  color: #9EDFEB;
  background: rgba(73,167,184,.12);
  border: 1px solid rgba(141,216,229,.10);
}

.family-note {
  max-width: 240px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

#activityFamilyMemberSelect:disabled,
#contributionFamilyMemberSelect:disabled {
  opacity: .55;
  cursor: not-allowed;
}


/* Contribution → sanctions workflow */

.row-action.sanction-transfer {
  color: #F0C6CC;
  border-color: rgba(231,124,137,.18);
  background: rgba(231,124,137,.09);
}

.row-action.sanction-transfer:hover:not(:disabled) {
  border-color: rgba(231,124,137,.30);
  background: rgba(231,124,137,.14);
}

.row-action.sanction-linked {
  color: #A6E7D7;
  border-color: rgba(118,201,181,.15);
  background: rgba(118,201,181,.08);
  opacity: .78;
}


/* Family Command Center */

.family-alerts-panel {
  margin: 0 0 16px;
}

.family-alert-list {
  display: grid;
  gap: 8px;
}

.family-alert-item {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid rgba(141,216,229,.08);
  border-radius: 13px;
  background: rgba(10,18,22,.32);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.family-alert-item strong,
.family-alert-item small {
  display: block;
}

.family-alert-item small {
  color: var(--muted);
  margin-top: 2px;
  font-size: 9px;
}

.family-alert-item.danger {
  border-color: rgba(231,124,137,.16);
  background: rgba(231,124,137,.055);
}

.family-alert-item.warning {
  border-color: rgba(228,181,106,.16);
  background: rgba(228,181,106,.05);
}

.family-alert-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.family-alert-open {
  color: #9EDFEB;
  font-size: 9px;
  font-weight: 800;
}

.family-alert-empty {
  padding: 14px;
  color: var(--muted);
  font-size: 10px;
}

.family-status {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
}

.family-status.active {
  color: #A6E7D7;
  background: rgba(118,201,181,.10);
}

.family-status.inactive {
  color: #F0C98D;
  background: rgba(228,181,106,.10);
}

.family-status.archived {
  color: #B6C3C7;
  background: rgba(170,190,196,.08);
}

.family-risk-line {
  display: block;
  margin-top: 5px;
  color: #F0A0AA;
}

.row-action.archive {
  color: #F0C98D;
}

.row-action.profile {
  color: #9EDFEB;
}

.family-profile-modal-card {
  width: min(980px, calc(100vw - 28px));
  max-height: min(860px, calc(100vh - 28px));
  overflow-y: auto;
}

.profile-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(73,167,184,.10), rgba(141,216,229,.035));
  border: 1px solid rgba(141,216,229,.10);
}

.profile-hero h4 {
  margin: 8px 0 4px;
  font-size: 22px;
}

.profile-hero p {
  margin: 0;
  color: var(--muted);
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.profile-tags span {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(73,167,184,.10);
  color: #9EDFEB;
  font-size: 8px;
  font-weight: 800;
}

.profile-last-active {
  text-align: right;
}

.profile-last-active span,
.profile-last-active strong {
  display: block;
}

.profile-last-active span {
  color: var(--muted);
  font-size: 9px;
}

.profile-last-active strong {
  margin-top: 5px;
  font-size: 14px;
}

.profile-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.profile-kpi-grid > div {
  padding: 12px;
  border-radius: 13px;
  border: 1px solid rgba(141,216,229,.08);
  background: rgba(10,18,22,.30);
}

.profile-kpi-grid span,
.profile-kpi-grid strong {
  display: block;
}

.profile-kpi-grid span {
  color: var(--muted);
  font-size: 8px;
}

.profile-kpi-grid strong {
  margin-top: 4px;
  font-size: 13px;
}

.profile-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.profile-sections section {
  padding: 13px;
  border-radius: 14px;
  border: 1px solid rgba(141,216,229,.08);
  background: rgba(10,18,22,.24);
}

.profile-sections h4 {
  margin: 0 0 10px;
  font-size: 12px;
}

.profile-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.profile-facts span {
  padding: 8px;
  border-radius: 10px;
  background: rgba(73,167,184,.05);
  color: var(--muted);
  font-size: 9px;
}

.profile-facts strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
}

.profile-history-list {
  display: grid;
  gap: 7px;
}

.profile-history-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}

.profile-history-list span strong,
.profile-history-list span small {
  display: block;
}

.profile-history-list span small {
  color: var(--muted);
  margin-top: 2px;
  font-size: 8px;
}

.profile-empty,
.profile-note {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.debt-table {
  min-width: 980px;
}

.debt-status {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
}

.debt-status.open {
  color: #F0A0AA;
  background: rgba(231,124,137,.10);
}

.debt-status.paid {
  color: #A6E7D7;
  background: rgba(118,201,181,.10);
}

.contribution-period-panel {
  margin-bottom: 16px;
}

.contribution-period-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.contribution-period-head h3 {
  margin: 2px 0 3px;
}

.contribution-period-head small {
  color: var(--muted);
}

.contribution-period-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.contribution-period-actions input {
  width: 220px;
}

.period-archive-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--border-soft);
}

.period-archive-row > span {
  color: var(--muted);
  font-size: 9px;
  margin-right: auto;
}

.danger-soft {
  border-color: rgba(231,124,137,.16) !important;
  background: rgba(231,124,137,.10) !important;
}

.archive-member-list {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.archive-member-list > div {
  display: grid;
  grid-template-columns: 1fr 140px 140px;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(141,216,229,.08);
  border-radius: 12px;
  background: rgba(10,18,22,.28);
}

.archive-member-list span strong,
.archive-member-list span small {
  display: block;
}

.archive-member-list span small {
  color: var(--muted);
  margin-top: 2px;
  font-size: 8px;
}

@media (max-width: 850px) {
  .profile-kpi-grid,
  .profile-sections {
    grid-template-columns: 1fr;
  }

  .contribution-period-head {
    align-items: stretch;
    flex-direction: column;
  }

  .contribution-period-actions {
    justify-content: stretch;
  }

  .contribution-period-actions > * {
    flex: 1 1 180px;
  }

  .period-archive-row {
    align-items: stretch;
    flex-direction: column;
  }

  .archive-member-list > div {
    grid-template-columns: 1fr;
  }
}


/* Weekly close */

.archive-lock-banner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 13px;
  border: 1px solid rgba(118,201,181,.15);
  background: rgba(118,201,181,.07);
}

.archive-lock-banner strong {
  color: #A6E7D7;
}

.archive-lock-banner span {
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.archive-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 18px 0 8px;
}

.archive-section-head h4 {
  margin: 0;
}

.archive-section-head span {
  color: var(--muted);
  font-size: 9px;
}

.archive-member-list-wide > div {
  grid-template-columns: minmax(180px, 1fr) 120px 120px 120px;
}

@media (max-width: 850px) {
  .archive-lock-banner {
    flex-direction: column;
  }

  .archive-lock-banner span {
    text-align: left;
  }

  .archive-member-list-wide > div {
    grid-template-columns: 1fr;
  }
}


/* Rank payout rates */

.rank-rate-section {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(141,216,229,.08);
  background: rgba(10,18,22,.28);
}

.rank-rate-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.rank-rate-head strong,
.rank-rate-head small {
  display: block;
}

.rank-rate-head small {
  color: var(--muted);
  font-size: 9px;
  max-width: 300px;
  text-align: right;
}

#rankPayoutRates {
  display: grid;
  gap: 8px;
}

.rank-rate-row {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 12px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 11px;
  background: rgba(73,167,184,.045);
}

.rank-rate-row > span strong,
.rank-rate-row > span small {
  display: block;
}

.rank-rate-row > span small {
  color: var(--muted);
  margin-top: 2px;
  font-size: 8px;
}

.rank-rate-empty {
  color: var(--muted);
  font-size: 9px;
  padding: 10px 0;
}

@media (max-width: 700px) {
  .rank-rate-row {
    grid-template-columns: 1fr;
  }

  .rank-rate-head {
    flex-direction: column;
  }

  .rank-rate-head small {
    text-align: left;
  }
}


/* Benutzerverwaltung & Sessionlogger */
.account-table { min-width: 1280px; }
.account-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.compact-button { padding: .45rem .65rem; font-size: .82rem; }
.account-meta { display: block; margin-top: .2rem; opacity: .72; white-space: nowrap; }
.account-table code { font-size: .82rem; white-space: nowrap; }
.checkbox-row { display: flex !important; align-items: center; gap: .6rem; }
.checkbox-row input { width: auto; margin: 0; }
