/* =========================================
   HAYYA ARCHERY — KEUANGAN KLUB
   CSS lengkap pengganti assets/app.css
   ========================================= */

:root {
  --bg: #f3f6f4;
  --surface: #ffffff;
  --ink: #183d31;
  --muted: #687c71;
  --green: #146c4e;
  --green-dark: #104d39;
  --line: #dfe8e2;
  --red: #b33c3c;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--green);
  text-underline-offset: 3px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid #cba458;
  outline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(27px, 3vw, 35px);
  line-height: 1.25;
  font-weight: 750;
  letter-spacing: -1px;
}

h2 {
  margin-bottom: 16px;
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: -.3px;
}

h3 {
  margin-bottom: 6px;
  font-size: 16px;
}

p {
  margin-bottom: 18px;
}

small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.lead {
  max-width: 760px;
  color: var(--muted);
  font-size: 14px;
}

/* HEADER DAN IDENTITAS */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  text-decoration: none;
  font-size: 17px;
  font-weight: 750;
  line-height: 1.35;
}

.brand > span:not(.mark) {
  min-width: 0;
}

.brand small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Tinggi otomatis mempertahankan rasio gambar asli. */
.brand-logo {
  display: block;
  width: 48px;
  height: auto;
  max-width: 100%;
  flex: 0 0 auto;
  object-fit: contain;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

/* Cadangan jika masih menggunakan huruf H. */
.mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 14px;
  background: var(--green);
  color: #fff;
  font-size: 23px;
}

.identity {
  padding-left: 18px;
  border-left: 1px solid var(--line);
  text-align: right;
  font-size: 13px;
  font-weight: 650;
}

.identity small {
  margin-top: 3px;
  font-weight: 400;
}

/* LAYOUT DAN NAVIGASI */

.shell {
  min-height: calc(100vh - 90px);
}

nav {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

nav a {
  flex: 0 0 auto;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  font-size: 13px;
}

nav a:hover {
  background: #f0f5f1;
}

nav a[aria-current="page"] {
  background: #e6f1e9;
  color: var(--green);
  font-weight: 700;
}

nav .logout {
  display: flex;
  flex: 0 0 auto;
  margin: 0;
}

nav .logout button {
  white-space: nowrap;
}

main {
  width: 100%;
  max-width: 1320px;
  min-width: 0;
  margin: 0 auto;
  padding: 28px 20px;
}

.page-heading {
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 1.3px;
}

footer {
  margin-top: 12px;
  padding: 16px 0 26px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

/* KARTU DAN RINGKASAN */

.card {
  margin-bottom: 22px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 5px 22px rgb(24 61 49 / 3%);
}

.narrow {
  max-width: 750px;
}

.stats {
  display: grid;
  gap: 16px;
  margin: 24px 0;
}

.stat {
  min-width: 0;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.stat > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.stat strong {
  display: block;
  margin: 16px 0 10px;
  font-size: clamp(25px, 2.6vw, 34px);
  line-height: 1.25;
  letter-spacing: -.8px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.stat.featured {
  border-color: #173e31;
  background:
    radial-gradient(
      circle at 100% 0,
      #377a5e 0,
      transparent 60%
    ),
    linear-gradient(135deg, #183f32, #102e25);
  color: #fff;
  box-shadow: 0 10px 25px rgb(24 61 49 / 12%);
}

.stat.featured > span {
  color: #d7e5dc;
}

.stat.featured strong {
  color: #fff;
}

.stat.featured small {
  color: #bfd1c5;
}

.positive {
  color: var(--green);
  font-weight: 650;
}

.negative {
  color: var(--red);
  font-weight: 650;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.section-title a {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 650;
}

.account-grid {
  display: grid;
  gap: 14px;
}

.account {
  min-width: 0;
  padding: 20px;
  border: 1px solid #e5ece7;
  border-radius: 14px;
  background: linear-gradient(135deg, #f7faf8, #fff);
}

.account > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.account strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* TOMBOL */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
}

.button,
button {
  display: inline-block;
  min-height: 44px;
  padding: 12px 18px;
  border: 1px solid var(--green);
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
  cursor: pointer;
  transition:
    background-color .15s ease,
    box-shadow .15s ease;
}

.button:hover,
button:hover {
  background: var(--green-dark);
  box-shadow: 0 4px 12px rgb(24 61 49 / 10%);
}

.secondary {
  border-color: #d8e3db;
  background: #fff;
  color: var(--green);
}

.secondary:hover {
  background: #f0f6f2;
}

.danger {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.danger:hover {
  background: #922f2f;
}

/* FORMULIR */

form {
  display: grid;
  gap: 18px;
}

form button {
  justify-self: start;
}

label {
  display: grid;
  gap: 8px;
  color: #304f40;
  font-size: 13px;
  font-weight: 650;
}

input,
select,
textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 12px 13px;
  border: 1px solid #d3dfd6;
  border-radius: 10px;
  background: #fcfdfc;
  color: var(--ink);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #428b6c;
  outline: 3px solid rgb(66 139 108 / 12%);
  background: #fff;
}

input::placeholder,
textarea::placeholder {
  color: #89998f;
}

input[type="file"] {
  padding: 10px;
  font-size: 13px;
}

input[type="hidden"] {
  display: none;
}

textarea {
  resize: vertical;
}

.form-grid {
  display: grid;
  gap: 18px;
}

.filter {
  align-items: end;
}

.inline {
  margin-top: 10px;
}

.inline button {
  padding: 8px 11px;
  font-size: 12px;
}

.compact {
  min-width: 210px;
}

/* TABEL TRANSAKSI */

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid #e9eeea;
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

th {
  padding: 14px 15px;
  background: #f6f9f7;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .7px;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  min-width: 100px;
  max-width: 300px;
  padding: 17px 15px;
  border-bottom: 1px solid #e9eeea;
  vertical-align: top;
  overflow-wrap: anywhere;
}

td small {
  margin-top: 5px;
}

td.positive,
td.negative {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fafcfb;
}

.badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 20px;
  background: #eaf2ec;
  color: #42664e;
  font-size: 11px;
  font-weight: 650;
}

/* LAPORAN, PESAN, DAN PENGGUNA */

.empty {
  padding: 32px 18px;
  border: 1px dashed #d8e2da;
  border-radius: 12px;
  background: #fafcfb;
  color: var(--muted);
  text-align: center;
}

.alert {
  margin-bottom: 20px;
  padding: 16px 18px;
  border: 1px solid #bedac6;
  border-radius: 12px;
  background: #eaf5ed;
  color: #2b5f3e;
  overflow-wrap: anywhere;
}

.alert.error {
  border-color: #e7c4b9;
  background: #fff1ec;
  color: #913a28;
}

.alert small {
  margin-top: 7px;
  color: inherit;
}

.totals {
  margin: 20px 0;
}

.totals > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

dt {
  font-size: 14px;
}

dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.totals .total {
  margin-top: 6px;
  border-bottom: 0;
  color: var(--green);
  font-size: 21px;
  font-weight: 750;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 15px;
  margin-top: 20px;
  font-size: 13px;
}

details summary {
  min-height: 36px;
  color: var(--green);
  cursor: pointer;
}

details form {
  margin: 14px 0;
}

.user-row {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.user-row:last-child {
  border-bottom: 0;
}

.user-row p {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

code {
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* =========================================
   LOGIN DAN SETUP
   Logo → Nama → Subjudul → Tanggal → Judul
   ========================================= */

main.auth {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 42px 20px 20px;
}

/* Identitas disusun vertikal dan dipusatkan. */
.auth > .brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  margin: 0 0 16px;
  text-align: center;
}

/* Tidak memakai tinggi tetap: rasio logo tetap asli. */
.auth > .brand .brand-logo {
  display: block;
  width: 92px;
  height: auto;
  max-width: 100%;
  flex: 0 0 auto;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
}

.auth > .brand > span:not(.mark) {
  display: block;
  color: var(--ink);
  font-size: 22px;
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: -.5px;
}

.auth > .brand small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.6;
  letter-spacing: 2.6px;
  text-transform: uppercase;
}

.auth .mark {
  width: 76px;
  height: 76px;
  flex-basis: 76px;
  border-radius: 22px;
  font-size: 36px;
}

/* Tanggal berada setelah identitas klub. */
.auth .page-heading {
  margin: 0 0 24px;
  text-align: center;
}

.auth .page-heading .eyebrow {
  display: block;
  margin: 0 0 24px;
  color: #7a8b81;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: .6px;
}

/* Judul Masuk dibuat lebih tenang dan seimbang. */
.auth .page-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: 27px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.6px;
}

.auth .card {
  margin-bottom: 16px;
  padding: 30px;
  border: 1px solid #dfe8e1;
  border-radius: 20px;
  background: #fff;
  box-shadow:
    0 14px 40px rgb(24 61 49 / 5%),
    0 2px 6px rgb(24 61 49 / 2%);
}

.auth .card > p:first-child {
  max-width: 320px;
  margin: 0 auto 24px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.8;
}

.auth form {
  gap: 19px;
}

.auth label {
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
}

.auth input {
  min-height: 49px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fcfdfc;
}

.auth form > button {
  width: 100%;
  min-height: 49px;
  justify-self: stretch;
  margin-top: 5px;
  padding: 13px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 650;
}

.auth .card > p:last-child:not(:first-child) {
  margin: 21px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  line-height: 1.8;
}

.auth footer {
  max-width: 360px;
  margin: 0 auto;
  padding: 13px 0 20px;
  color: #829086;
  text-align: center;
  font-size: 10px;
  line-height: 1.8;
}

.auth .alert {
  font-size: 13px;
}

/* TABLET */

@media (min-width: 650px) {
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter {
    grid-template-columns:
      minmax(0, 1fr)
      minmax(0, 1fr)
      minmax(0, 1fr)
      auto;
  }
}

/* DESKTOP */

@media (min-width: 1050px) {
  .shell {
    display: flex;
    align-items: stretch;
  }

  nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 0 0 220px;
    width: 220px;
    gap: 7px;
    overflow: visible;
    padding: 26px 14px;
    border: 0;
    background: #153c30;
  }

  nav a {
    padding: 13px 17px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #c7d7cd;
  }

  nav a:hover {
    background: rgb(255 255 255 / 6%);
    color: #fff;
  }

  nav a[aria-current="page"] {
    border-color: rgb(255 255 255 / 10%);
    background: rgb(255 255 255 / 9%);
    color: #fff;
    box-shadow: inset 3px 0 #d3b77b;
  }

  nav .logout {
    margin-top: auto;
    padding: 28px 8px 10px;
  }

  nav .logout button {
    width: 100%;
    border-color: rgb(255 255 255 / 20%);
    background: transparent;
    color: #d6e3db;
  }

  nav .logout button:hover {
    background: rgb(255 255 255 / 8%);
  }

  main {
    padding: 36px;
  }

  .account-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* PONSEL */

@media (max-width: 649px) {
  header {
    gap: 12px;
    padding: 15px;
  }

  header .brand {
    gap: 10px;
    font-size: 14px;
  }

  header .brand-logo {
    width: 38px;
    height: auto;
  }

  header .brand small {
    font-size: 8px;
    letter-spacing: 1.4px;
  }

  .identity {
    max-width: 115px;
    padding-left: 10px;
    font-size: 11px;
    overflow-wrap: anywhere;
  }

  .identity small {
    font-size: 10px;
  }

  nav {
    padding: 10px 12px;
  }

  nav a {
    padding: 10px 12px;
    font-size: 12px;
  }

  main {
    padding: 24px 15px;
  }

  .card {
    padding: 19px;
    border-radius: 16px;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat {
    padding: 17px;
  }

  .stat.featured {
    grid-column: 1 / -1;
    padding: 24px;
  }

  .stat strong {
    font-size: clamp(18px, 4.6vw, 25px);
  }

  .stat.featured strong {
    font-size: clamp(28px, 7vw, 36px);
  }

  .stat > span {
    font-size: 11px;
  }

  .stat small {
    font-size: 10px;
  }

  .actions > .button {
    flex: 1 1 140px;
  }

  .section-title {
    gap: 10px;
  }

  .section-title h2 {
    font-size: 15px;
  }

  .section-title a {
    font-size: 11px;
  }

  .totals > div {
    flex-wrap: wrap;
    gap: 7px;
  }

  .totals dd {
    margin-left: auto;
  }

  /* Login ponsel */
  main.auth {
    padding: 30px 18px 16px;
  }

  .auth > .brand {
    gap: 14px;
    margin-bottom: 14px;
  }

  .auth > .brand .brand-logo {
    width: 80px;
    height: auto;
  }

  .auth > .brand > span:not(.mark) {
    font-size: 21px;
  }

  .auth .page-heading .eyebrow {
    margin-bottom: 21px;
  }

  .auth .page-heading h1 {
    font-size: 25px;
  }

  .auth .card {
    padding: 25px 22px;
    border-radius: 18px;
  }
}

/* AKSESIBILITAS */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* CETAK LAPORAN */

@media print {
  header,
  nav,
  .actions,
  .filter,
  footer,
  details,
  form {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .shell {
    display: block;
  }

  main {
    max-width: none;
    padding: 0;
  }

  .card,
  .stat {
    break-inside: avoid;
    border: 0;
    box-shadow: none;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}