:root {
  --cashbox-green: #16805d;
  --cashbox-green-dark: #0f6047;
  --cashbox-blue: #2563eb;
  --cashbox-amber: #d97706;
  --cashbox-red: #dc2626;
  --cashbox-ink: #17211d;
  --cashbox-muted: #64736e;
  --cashbox-line: #dce6e2;
  --cashbox-soft: #f4f7f6;
  --cashbox-panel: #ffffff;
  --cashbox-shadow: 0 10px 28px rgba(23, 33, 29, .07);
}

* {
  letter-spacing: 0;
}

body {
  background:
    linear-gradient(180deg, #edf5f1 0, var(--cashbox-soft) 260px),
    var(--cashbox-soft);
  color: var(--cashbox-ink);
  font-feature-settings: "tnum";
}

a {
  color: var(--cashbox-green-dark);
}

a:hover {
  color: var(--cashbox-blue);
}

.app-navbar {
  border-bottom: 1px solid rgba(22, 128, 93, .15);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(23, 33, 29, .04);
}

.app-navbar .container-fluid {
  gap: 1rem;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--cashbox-ink);
  font-weight: 750;
}

.app-brand:hover {
  color: var(--cashbox-green-dark);
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--cashbox-green);
  color: #fff;
  box-shadow: 0 8px 18px rgba(22, 128, 93, .22);
}

.brand-mark svg {
  width: 19px;
  height: 19px;
}

.app-navlinks {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: .25rem;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.app-navlinks a {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  flex: 0 0 auto;
  padding: .45rem .65rem;
  border-radius: 8px;
  color: #41514c;
  font-size: .93rem;
  font-weight: 600;
  text-decoration: none;
}

.app-navlinks a:hover {
  background: #eef6f2;
  color: var(--cashbox-green-dark);
}

.app-userbar {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  max-width: 280px;
  padding: .35rem .6rem;
  border: 1px solid var(--cashbox-line);
  border-radius: 999px;
  background: #fff;
  color: var(--cashbox-muted);
  font-size: .86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-main {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .42rem;
  border-radius: 8px;
  font-weight: 650;
  box-shadow: none;
}

.btn svg,
.app-navlinks svg,
.user-pill svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  stroke-width: 2.15;
}

.btn-primary {
  border-color: var(--cashbox-green);
  background: var(--cashbox-green);
}

.btn-primary:hover,
.btn-primary:focus {
  border-color: var(--cashbox-green-dark);
  background: var(--cashbox-green-dark);
}

.btn-outline-primary {
  border-color: rgba(22, 128, 93, .45);
  color: var(--cashbox-green-dark);
}

.btn-outline-primary:hover {
  border-color: var(--cashbox-green);
  background: var(--cashbox-green);
}

.btn-outline-secondary {
  border-color: var(--cashbox-line);
  color: #485a54;
  background: #fff;
}

.btn-outline-secondary:hover {
  border-color: #cbd8d3;
  background: #eef3f1;
  color: var(--cashbox-ink);
}

.btn-link {
  color: var(--cashbox-green-dark);
  font-weight: 650;
  text-decoration: none;
}

.btn-link:hover {
  color: var(--cashbox-blue);
}

.page-heading,
.d-flex.flex-wrap.justify-content-between.align-items-center.gap-3.mb-4 {
  padding: 1rem 1.15rem;
  border: 1px solid rgba(22, 128, 93, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 8px 24px rgba(23, 33, 29, .045);
}

.card,
.panel,
.login-card,
.student-card {
  border: 1px solid var(--cashbox-line);
  border-radius: 8px;
  background: var(--cashbox-panel);
  box-shadow: var(--cashbox-shadow);
}

.panel {
  padding: 1rem;
}

.card {
  overflow: hidden;
}

.card-body {
  padding: 1rem;
}

.card .text-muted.small,
.panel .text-muted.small {
  color: var(--cashbox-muted) !important;
}

.stat-card {
  position: relative;
}

.stat-card::before,
.fund-card::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--cashbox-green), var(--cashbox-blue));
}

.fund-card .card-body {
  display: grid;
  min-height: 180px;
}

.fund-card-icon,
.empty-state-icon {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: #eef6f2;
  color: var(--cashbox-green-dark);
}

.fund-card-icon svg,
.empty-state-icon svg {
  width: 20px;
  height: 20px;
}

.money {
  color: var(--cashbox-green-dark);
  font-weight: 800;
}

.h5 svg,
h2 svg {
  width: 18px;
  height: 18px;
  margin-right: .3rem;
  vertical-align: -3px;
  color: var(--cashbox-green-dark);
}

.table {
  margin-bottom: 0;
}

.table thead th {
  border-bottom: 1px solid var(--cashbox-line);
  color: #53645f;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.table tbody tr:hover {
  background: #f8fbfa;
}

.table td,
.table th {
  padding: .82rem .75rem;
}

.badge {
  border-radius: 999px;
  padding: .35rem .55rem;
  font-weight: 750;
}

.status-confirmed {
  background: #157347;
}

.status-pending {
  background: #facc15;
  color: #382f0d;
}

.status-rejected,
.status-canceled {
  background: var(--cashbox-red);
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--cashbox-line);
}

.list-row:last-child {
  border-bottom: 0;
}

.empty-state {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: 1rem;
  border: 1px dashed #cbd8d3;
  border-radius: 8px;
  background: #f9fbfa;
  color: var(--cashbox-muted);
}

.workbench-panel {
  background:
    linear-gradient(180deg, #ffffff 0, #fbfdfc 100%);
}

.workbench-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.workbench-tile {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 84px;
  padding: .85rem;
  border: 1px solid var(--cashbox-line);
  border-radius: 8px;
  background: #fff;
  color: var(--cashbox-ink);
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.workbench-tile:hover {
  transform: translateY(-1px);
  border-color: rgba(22, 128, 93, .36);
  box-shadow: 0 10px 24px rgba(23, 33, 29, .08);
  color: var(--cashbox-ink);
}

.workbench-icon {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: #eef6f2;
  color: var(--cashbox-green-dark);
}

.workbench-icon svg {
  width: 20px;
  height: 20px;
}

.workbench-tile strong,
.workbench-tile small {
  display: block;
}

.workbench-tile strong {
  font-size: 1.35rem;
  line-height: 1.1;
}

.workbench-tile small {
  margin-top: .15rem;
  color: var(--cashbox-muted);
  font-weight: 650;
}

.messages {
  max-width: 960px;
}

.alert {
  border-radius: 8px;
  border-color: transparent;
  box-shadow: var(--cashbox-shadow);
}

.form-control,
.form-select {
  border-color: var(--cashbox-line);
  border-radius: 8px;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(22, 128, 93, .55);
  box-shadow: 0 0 0 .2rem rgba(22, 128, 93, .12);
}

.panel form p {
  margin-bottom: .75rem;
}

.panel label,
.modal-body label,
.modal-body .form-label {
  margin-bottom: .25rem;
  color: #52605c;
  font-size: .875rem;
  font-weight: 650;
}

.modal-content {
  border: 1px solid var(--cashbox-line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(23, 33, 29, .18);
}

.modal-header,
.modal-footer {
  border-color: var(--cashbox-line);
}

.modal-check {
  padding-left: 2rem;
}

.modal-dialog-scrollable .modal-content > form {
  display: flex;
  flex-direction: column;
  max-height: 100%;
  min-height: 0;
}

.modal-dialog-scrollable .modal-content > form .modal-body {
  overflow-y: auto;
}

.modal-dialog-scrollable .modal-content > form .modal-header,
.modal-dialog-scrollable .modal-content > form .modal-footer {
  flex-shrink: 0;
}

.panel ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: .75rem;
}

.panel li {
  margin-bottom: .35rem;
}

.panel input[type="checkbox"],
.panel input[type="radio"] {
  margin-right: .4rem;
}

.choice-box {
  border: 1px solid var(--cashbox-line);
  border-radius: 8px;
  padding: .6rem .75rem;
  background: #fff;
}

.choice-box ul {
  margin: 0;
}

.choice-box label {
  display: flex;
  align-items: center;
  gap: .35rem;
  color: var(--cashbox-ink);
  font-size: .95rem;
}

.choice-list {
  padding: 0;
}

.student-choice-box {
  max-height: min(52vh, 520px);
  overflow: auto;
  border: 1px solid var(--cashbox-line);
  border-radius: 8px;
  background: #fff;
}

.student-choice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  align-items: center;
  gap: .75rem;
  padding: .55rem .75rem;
  border-bottom: 1px solid var(--cashbox-line);
  color: var(--cashbox-ink);
}

.student-choice-row:last-child {
  border-bottom: 0;
}

.student-choice-main {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
}

.student-choice-main span {
  overflow-wrap: anywhere;
}

.student-choice-amount {
  display: none;
}

.amount-mode-individual .student-choice-amount {
  display: block;
}

.amount-mode-individual #id_amount_per_student {
  background: #f8faf9;
}

.login-shell {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(420px, 100%);
  padding: 1.5rem;
}

.login-card input {
  display: block;
  width: 100%;
  padding: .625rem .75rem;
  border: 1px solid var(--cashbox-line);
  border-radius: 8px;
}

.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.student-card {
  padding: 1rem;
}

.student-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.student-money-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .5rem;
  margin-bottom: 1rem;
}

.student-money-row div {
  border: 1px solid var(--cashbox-line);
  border-radius: 8px;
  padding: .55rem;
  background: #f8faf9;
}

.student-money-row span {
  display: block;
  color: #52605c;
  font-size: .78rem;
}

.student-money-row strong {
  display: block;
  overflow-wrap: anywhere;
}

.student-card-section {
  padding-top: .75rem;
  border-top: 1px solid var(--cashbox-line);
}

.student-card-section + .student-card-section {
  margin-top: .75rem;
}

.student-mini-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  padding: .45rem 0;
}

.student-mini-row span:last-child {
  white-space: nowrap;
}

.management-table th,
.management-table td {
  vertical-align: middle;
}

.management-table td:last-child {
  white-space: nowrap;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .25rem;
}

.attachment-link {
  display: inline-flex;
  max-width: 100%;
  padding: .15rem .45rem;
  border: 1px solid var(--cashbox-line);
  border-radius: 999px;
  background: #f8faf9;
  color: var(--cashbox-green);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.attachment-link:hover {
  background: #eef6f2;
  color: #145f44;
}

@media (max-width: 991.98px) {
  .app-navbar .container-fluid {
    align-items: flex-start;
  }

  .app-navlinks {
    order: 3;
    width: 100%;
  }

  .user-pill {
    max-width: 190px;
  }
}

@media (max-width: 575.98px) {
  .app-userbar {
    gap: .4rem;
  }

  .app-userbar .user-pill {
    display: none;
  }

  .student-choice-row {
    grid-template-columns: 1fr;
    gap: .35rem;
  }

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

  .student-money-row {
    grid-template-columns: 1fr;
  }

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

  .page-heading,
  .d-flex.flex-wrap.justify-content-between.align-items-center.gap-3.mb-4 {
    padding: .85rem;
  }
}
