/* =============================================================================
   TRANSPARANSI KEUANGAN — standalone dashboard (scoped: .tk-*)
   Fresh, modern, clean redesign. Re-uses the theme design tokens from
   style.css (var(--navy), var(--gold), …). No theme navbar/footer here:
   the page ships its own fixed header (brand row + filter toolbar).
   ========================================================================== */

/* ---------------------------------------------------------------- layout -- */

body.tk-body {
  background:
    radial-gradient(1200px 400px at 85% -120px, rgba(232, 160, 32, 0.07), transparent 60%),
    radial-gradient(900px 420px at -10% -80px, rgba(11, 29, 58, 0.06), transparent 55%),
    var(--offwhite);
  /* Reserve space for the fixed header; JS keeps this var in sync. */
  padding-top: var(--tk-head-h, 152px);
}

.tk-container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 3vw, 2rem);
}

.tk-main { padding-block: clamp(1.6rem, 3.5vw, 2.8rem) clamp(2.5rem, 5vw, 4rem); }

/* ------------------------------------------------- fixed header (no-move) -- */

.tk-head {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.25s var(--ease);
}
.tk-head.is-scrolled { box-shadow: 0 12px 34px rgba(11, 29, 58, 0.12); }

.tk-head__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.65rem;
}

.tk-brand { display: inline-flex; align-items: center; gap: 0.7rem; min-width: 0; }
.tk-brand img { width: 40px; height: 40px; object-fit: contain; flex: 0 0 auto; }
.tk-brand__txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.tk-brand__txt b {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--navy);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tk-brand__txt small { font-size: 0.72rem; color: var(--muted); font-weight: 600; }

.tk-head__actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: nowrap; }

.tk-admin-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(13, 115, 119, 0.14), rgba(10, 112, 85, 0.10));
  border: 1px solid rgba(10, 112, 85, 0.30);
  color: #0A7055;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  white-space: nowrap;
}
.tk-admin-chip svg { width: 15px; height: 15px; }

/* Buttons */
.tk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.86rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
    border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}
.tk-btn svg { width: 16px; height: 16px; }
.tk-btn:active { transform: scale(0.97); }

.tk-btn--gold {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--navy-deep);
  box-shadow: 0 8px 22px rgba(232, 160, 32, 0.30);
}
.tk-btn--gold:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(232, 160, 32, 0.40); }

.tk-btn--ghost { background: var(--white); border-color: var(--line); color: var(--navy); }
.tk-btn--ghost:hover { border-color: var(--gold); transform: translateY(-2px); }

.tk-btn--navy { background: var(--navy); color: var(--white); }
.tk-btn--navy:hover { background: var(--navy-light); transform: translateY(-2px); }

.tk-btn--danger { background: #C0392B; color: var(--white); box-shadow: 0 8px 22px rgba(192, 57, 43, 0.28); }
.tk-btn--danger:hover { background: #A93226; transform: translateY(-2px); }

.tk-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

.tk-filter-toggle { display: none; }

/* Filter toolbar — part of the fixed header, so it never moves. */
.tk-head__filters { border-top: 1px solid var(--line); background: rgba(255, 255, 255, 0.65); }
.tk-head.filters-hidden .tk-head__filters { display: none; }

.tk-toolbar {
  display: grid;
  grid-template-columns: 1.7fr 0.9fr 1fr 1.1fr auto;
  gap: 0.6rem;
  padding-block: 0.65rem;
}

.tk-field { position: relative; display: flex; align-items: center; }
.tk-field svg {
  position: absolute;
  left: 0.8rem;
  width: 17px;
  height: 17px;
  color: var(--muted);
  pointer-events: none;
}

.tk-input,
.tk-select {
  width: 100%;
  padding: 0.62rem 0.85rem 0.62rem 2.35rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  outline: none;
  appearance: none;
}
.tk-select { cursor: pointer; }
.tk-input:focus,
.tk-select:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(232, 160, 32, 0.14); }

.tk-input--plain,
.tk-select--plain { padding-left: 0.85rem; }

.tk-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.62rem 1.05rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.88rem;
  font-family: var(--font-display);
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
  white-space: nowrap;
}
.tk-reset:hover { border-color: var(--navy); background: var(--offwhite); transform: translateY(-2px); }
.tk-reset svg { width: 15px; height: 15px; }

/* ---------------------------------------------------------------- intro -- */

.tk-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.2rem;
  margin-bottom: clamp(1.4rem, 3vw, 2rem);
}
.tk-intro__txt { max-width: 640px; }

.tk-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 0.55rem;
}
.tk-eyebrow svg { width: 15px; height: 15px; }

.tk-intro h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin-bottom: 0.55rem;
}
.tk-intro p { color: var(--muted); font-size: 0.97rem; line-height: 1.65; }

.tk-intro__meta { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-end; flex: 0 0 auto; }

.tk-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.tk-chip b { color: var(--navy); font-weight: 700; }
.tk-chip svg { width: 15px; height: 15px; }
.tk-chip--verified { color: #0A7055; border-color: rgba(10, 112, 85, 0.3); background: rgba(10, 112, 85, 0.07); }
.tk-chip--warn { color: #A46A00; border-color: rgba(232, 160, 32, 0.4); background: rgba(232, 160, 32, 0.10); }

/* ---------------------------------------------------------------- stats -- */

.tk-stats {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1fr;
  gap: clamp(0.8rem, 1.6vw, 1.2rem);
  margin-bottom: clamp(1.4rem, 3vw, 2.2rem);
}

.tk-stat {
  position: relative;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  padding: 1.3rem 1.4rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.tk-stat:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.tk-stat__icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(232, 160, 32, 0.16), rgba(232, 160, 32, 0.05));
  color: var(--gold);
  border: 1px solid rgba(232, 160, 32, 0.25);
}
.tk-stat__icon svg { width: 22px; height: 22px; }
.tk-stat__icon--in {
  background: linear-gradient(135deg, rgba(10, 112, 85, 0.14), rgba(10, 112, 85, 0.04));
  color: #0A7055;
  border-color: rgba(10, 112, 85, 0.28);
}
.tk-stat__icon--out {
  background: linear-gradient(135deg, rgba(192, 57, 43, 0.12), rgba(192, 57, 43, 0.04));
  color: #C0392B;
  border-color: rgba(192, 57, 43, 0.26);
}

.tk-stat__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tk-stat__label {
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.tk-stat__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  color: var(--navy);
  line-height: 1.15;
  letter-spacing: -0.02em;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}
.tk-stat__value--in { color: #0A7055; }
.tk-stat__value.is-negative { color: #C0392B; }
.tk-stat__sub { font-size: 0.78rem; color: var(--muted); }
.tk-stat__sub b { color: var(--navy); }

/* Featured saldo card — dark navy gradient */
.tk-stat--saldo {
  background: linear-gradient(150deg, var(--navy-deep) 0%, var(--navy) 62%, var(--navy-light) 100%);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-md);
}
.tk-stat--saldo .tk-stat__deco {
  position: absolute;
  inset: auto -60px -80px auto;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 160, 32, 0.30), transparent 65%);
  pointer-events: none;
}
.tk-stat--saldo .tk-stat__icon {
  background: linear-gradient(135deg, rgba(255, 202, 106, 0.25), rgba(232, 160, 32, 0.12));
  border-color: rgba(255, 202, 106, 0.35);
  color: var(--gold-light);
}
.tk-stat--saldo .tk-stat__label { color: rgba(255, 255, 255, 0.60); }
.tk-stat--saldo .tk-stat__value { color: var(--gold-light); font-size: clamp(1.35rem, 2.4vw, 1.8rem); }
.tk-stat--saldo .tk-stat__value.is-negative { color: #FF8E7A; }
.tk-stat--saldo .tk-stat__sub { color: rgba(255, 255, 255, 0.55); }

/* ---------------------------------------------------------------- chart -- */

.tk-chart-card {
  background: linear-gradient(160deg, var(--navy-deep), var(--navy));
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  padding: clamp(1.2rem, 2.6vw, 1.9rem);
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  margin-bottom: clamp(1.6rem, 3.2vw, 2.6rem);
}

.tk-chart-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}
.tk-chart-head h2 {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: var(--white);
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}
.tk-chart-head p { color: rgba(255, 255, 255, 0.55); font-size: 0.83rem; margin-top: 2px; }

.tk-chart-controls { display: flex; gap: 0.55rem; flex-wrap: wrap; align-items: center; }

/* Segmented control — the "ganti chart" module */
.tk-seg {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
}
.tk-seg button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.85rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
  white-space: nowrap;
}
.tk-seg button svg { width: 15px; height: 15px; }
.tk-seg button:hover { color: var(--white); }
.tk-seg button.is-active {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--navy-deep);
  box-shadow: 0 4px 14px rgba(232, 160, 32, 0.35);
}
.tk-seg--sm button { padding: 0.32rem 0.7rem; font-size: 0.74rem; }

.tk-legend { display: flex; flex-wrap: wrap; gap: 0.45rem 1rem; margin-bottom: 0.65rem; min-height: 1.2rem; }
.tk-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.8rem;
  font-weight: 600;
}
.tk-legend__dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.tk-legend__val { color: rgba(255, 255, 255, 0.5); font-weight: 500; }

.tk-chart-wrap { position: relative; width: 100%; }
.tk-chart-wrap canvas { display: block; width: 100%; }
.tk-chart-empty {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.95rem;
  text-align: center;
}
.tk-chart-tip {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  background: rgba(6, 14, 29, 0.96);
  border: 1px solid rgba(232, 160, 32, 0.45);
  border-radius: 12px;
  padding: 0.55rem 0.8rem;
  color: var(--white);
  font-size: 0.78rem;
  line-height: 1.5;
  opacity: 0;
  transform: translate(-50%, -114%);
  transition: opacity 0.12s var(--ease);
  white-space: nowrap;
  box-shadow: var(--shadow-md);
}
.tk-chart-tip b { color: var(--gold-light); display: block; font-family: var(--font-display); margin-bottom: 2px; }
.tk-chart-tip .tip-in { color: #5BD6A2; }
.tk-chart-tip .tip-out { color: #FFB4A6; }

/* ---------------------------------------------------------------- table -- */

.tk-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}
.tk-count { font-size: 0.88rem; color: var(--muted); font-weight: 600; }
.tk-count b { color: var(--navy); }

.tk-table-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.tk-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.tk-table { width: 100%; border-collapse: collapse; min-width: 1080px; }
.tk-table thead th {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.9rem 1rem;
  text-align: left;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}
.tk-table thead th.tk-sortable { cursor: pointer; user-select: none; }
.tk-table thead th.tk-sortable:hover { color: var(--gold-light); }
.tk-sort-ind { display: inline-flex; vertical-align: middle; margin-left: 0.3rem; opacity: 0.45; }
.tk-sort-ind svg { width: 14px; height: 14px; }
.tk-table th.is-sorted .tk-sort-ind { opacity: 1; color: var(--gold-light); }

.tk-table tbody td {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--text);
  vertical-align: middle;
}

.tk-row { cursor: pointer; transition: background 0.15s var(--ease); }
.tk-row:nth-child(even) { background: rgba(244, 247, 251, 0.6); }
.tk-row:hover { background: rgba(232, 160, 32, 0.07); }

/* Row numbering — CSS counters skip hidden (paginated/filtered) rows. */
.tk-table tbody { counter-reset: tkrow; }
.tk-row { counter-increment: tkrow; }
.tk-cell-num::before { content: counter(tkrow); }
.tk-num { color: var(--muted); font-variant-numeric: tabular-nums; }

/* Unverified rows (admin view only) */
.tk-row--unverified { background: repeating-linear-gradient(-45deg, rgba(232, 160, 32, 0.05), rgba(232, 160, 32, 0.05) 10px, transparent 10px, transparent 20px) !important; }
.tk-row--unverified td { opacity: 0.82; }
.tk-row--unverified td.tk-admin-cell { opacity: 1; }

.tk-id {
  font-family: Consolas, 'SF Mono', Monaco, monospace;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--navy);
  background: var(--offwhite);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.2rem 0.5rem;
  white-space: nowrap;
}

.tk-jenis {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.24rem 0.65rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}
.tk-jenis svg { width: 13px; height: 13px; }
.tk-jenis--pemasukan { color: #0A7055; background: rgba(10, 112, 85, 0.10); border-color: rgba(10, 112, 85, 0.28); }
.tk-jenis--pengeluaran { color: #C0392B; background: rgba(192, 57, 43, 0.08); border-color: rgba(192, 57, 43, 0.24); }

.tk-amount { font-weight: 700; color: var(--navy); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tk-amount--pemasukan { color: #0A7055; }

.tk-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.5;
  border: 1px solid transparent;
  white-space: nowrap;
}
.tk-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.9; }

.tk-desc-cell { max-width: 280px; }
.tk-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tk-desc.is-open { -webkit-line-clamp: unset; overflow: visible; }
.tk-readmore { color: var(--gold); font-weight: 600; font-size: 0.76rem; margin-top: 0.2rem; display: none; cursor: pointer; }
.tk-readmore:hover { text-decoration: underline; }

.tk-pj { display: inline-flex; align-items: center; gap: 0.55rem; white-space: nowrap; }
.tk-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  flex: 0 0 auto;
}

.tk-receipt-cell { white-space: nowrap; }
.tk-receipt { display: inline-flex; align-items: center; gap: 0.4rem; }
.tk-receipt__thumb {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
  cursor: zoom-in;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.tk-receipt__thumb:hover { transform: scale(1.06); box-shadow: var(--shadow-sm); }

.tk-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--navy);
  background: var(--white);
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.tk-icon-btn:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }
.tk-icon-btn svg { width: 15px; height: 15px; }
.tk-icon-btn--ok:hover { background: #0A7055; border-color: #0A7055; }
.tk-icon-btn--danger:hover { background: #C0392B; border-color: #C0392B; }

.tk-muted-cell { color: var(--muted); font-size: 0.82rem; font-style: italic; }

/* Admin cell: status pill + action buttons */
.tk-admin-cell { white-space: nowrap; }
.tk-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.72rem;
  font-weight: 700;
  margin-right: 0.45rem;
}
.tk-admin-actions { display: inline-flex; gap: 0.3rem; vertical-align: middle; }

/* -------------------------------------------------------------- empty ---- */

.tk-empty { display: none; padding: 4rem 1.5rem; text-align: center; }
.tk-empty.is-visible { display: block; }
.tk-empty__icon {
  width: 76px;
  height: 76px;
  margin: 0 auto 1.2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--offwhite);
  color: var(--muted);
  border: 1px solid var(--line);
}
.tk-empty__icon svg { width: 34px; height: 34px; }
.tk-empty h3 { font-size: 1.2rem; color: var(--navy); margin-bottom: 0.4rem; font-family: var(--font-display); }
.tk-empty p { color: var(--muted); max-width: 420px; margin: 0 auto; }

/* ---------------------------------------------------------- pagination --- */

.tk-pagination { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; margin-top: 1.5rem; }
.tk-page-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--navy);
  background: var(--white);
  cursor: pointer;
  transition: all 0.18s var(--ease);
}
.tk-page-btn:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-2px); }
.tk-page-btn.is-active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.tk-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.tk-page-btn svg { width: 16px; height: 16px; }
.tk-page-ellipsis { display: inline-flex; align-items: flex-end; padding: 0 0.3rem; color: var(--muted); }

/* -------------------------------------------------------------- footer --- */

.tk-foot { border-top: 1px solid var(--line); background: var(--white); padding-block: 1.1rem; }
.tk-foot__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.82rem;
}
.tk-foot__note { display: inline-flex; align-items: center; gap: 0.4rem; }
.tk-foot__note svg { width: 15px; height: 15px; color: #0A7055; }

/* -------------------------------------------------------------- modals --- */

.tk-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2rem);
  background: rgba(6, 14, 29, 0.82);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}
.tk-modal.is-open { display: flex; animation: tkFade 0.2s var(--ease); }
@keyframes tkFade { from { opacity: 0; } to { opacity: 1; } }

.tk-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.tk-modal__close:hover { background: rgba(255, 255, 255, 0.25); transform: rotate(90deg); }
.tk-modal__close svg { width: 22px; height: 22px; }
.tk-modal__close--inline {
  position: static;
  width: 36px;
  height: 36px;
  background: var(--offwhite);
  color: var(--navy);
  border-color: var(--line);
}
.tk-modal__close--inline:hover { background: var(--line); }

/* Lightbox */
.tk-lightbox__inner {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 0;
  max-width: 1100px;
  width: 100%;
  max-height: 88vh;
  background: var(--white);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.tk-lightbox__image { background: var(--navy-deep); display: grid; place-items: center; padding: 1rem; overflow: auto; }
.tk-lightbox__image img { max-width: 100%; max-height: 84vh; object-fit: contain; border-radius: 8px; }
.tk-lightbox__side { padding: 1.6rem; display: flex; flex-direction: column; gap: 0.9rem; overflow-y: auto; }
.tk-lightbox__side h3 { font-size: 1.1rem; color: var(--navy); font-family: var(--font-display); }

/* Detail modal */
.tk-detail__card {
  background: var(--white);
  border-radius: 22px;
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.tk-detail__head {
  background: linear-gradient(160deg, var(--navy-deep), var(--navy));
  padding: 1.6rem 1.8rem;
  color: var(--white);
}
.tk-detail__head .tk-id { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.2); color: var(--white); }
.tk-detail__amount {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--gold-light);
  margin-top: 0.6rem;
  font-variant-numeric: tabular-nums;
}
.tk-detail__amount.is-in { color: #5BD6A2; }
.tk-detail__jenis {
  display: inline-flex;
  margin-top: 0.4rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
}
.tk-detail__body { padding: 1.6rem 1.8rem; display: flex; flex-direction: column; }
.tk-detail__row { display: flex; gap: 1rem; padding: 0.72rem 0; border-bottom: 1px dashed var(--line); }
.tk-detail__row:last-child { border-bottom: none; }
.tk-detail__row dt {
  flex: 0 0 130px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.tk-detail__row dt svg { width: 15px; height: 15px; color: var(--gold); }
.tk-detail__row dd { flex: 1; color: var(--text); font-weight: 500; word-break: break-word; }
.tk-detail__receipt { margin-top: 1.2rem; }
.tk-detail__receipt img { width: 100%; border-radius: 14px; border: 1px solid var(--line); cursor: zoom-in; }

.tk-dl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--navy-deep);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: var(--shadow-gold);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.tk-dl-btn:hover { transform: translateY(-3px); box-shadow: 0 20px 44px rgba(232, 160, 32, 0.42); }
.tk-dl-btn svg { width: 18px; height: 18px; }
.tk-side-meta { display: flex; flex-direction: column; gap: 0.55rem; }
.tk-side-meta .tk-detail__row { padding: 0.55rem 0; }

/* ------------------------------------------------- live-edit editor ------ */

.tk-editor__card {
  background: var(--white);
  border-radius: 22px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.tk-editor__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.6rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 2;
}
.tk-editor__head h3 { font-family: var(--font-display); color: var(--navy); font-size: 1.15rem; }

#tkEditorForm { padding: 1.4rem 1.6rem 1.6rem; }

.tk-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.1rem; }
.tk-form-field { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.tk-form-field--full { grid-column: 1 / -1; }
.tk-form-field label { font-weight: 700; color: var(--navy); font-size: 0.82rem; }
.tk-form-field label em { color: #C0392B; font-style: normal; }
.tk-form-field textarea { resize: vertical; min-height: 60px; }
.tk-form-preview { font-weight: 700; color: #0D7377; font-size: 0.88rem; font-family: Consolas, Monaco, monospace; }
.tk-form-hint { color: var(--muted); font-size: 0.76rem; }
.tk-form-error {
  margin-top: 1rem;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  background: rgba(192, 57, 43, 0.08);
  border: 1px solid rgba(192, 57, 43, 0.30);
  color: #C0392B;
  font-weight: 600;
  font-size: 0.85rem;
}

.tk-jenis-radios { display: flex; gap: 0.5rem; }
.tk-jenis-radio {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 0.7rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--muted);
  transition: all 0.18s var(--ease);
}
.tk-jenis-radio input { position: absolute; opacity: 0; pointer-events: none; }
.tk-jenis-radio svg { width: 15px; height: 15px; }
.tk-jenis-radio--pengeluaran:has(input:checked) { border-color: #C0392B; color: #C0392B; background: rgba(192, 57, 43, 0.07); }
.tk-jenis-radio--pemasukan:has(input:checked) { border-color: #0A7055; color: #0A7055; background: rgba(10, 112, 85, 0.07); }

.tk-bukti { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.tk-bukti__preview {
  width: 96px;
  height: 96px;
  border-radius: 14px;
  border: 1.5px dashed var(--line);
  background: var(--offwhite);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  flex: 0 0 auto;
}
.tk-bukti__preview img { width: 100%; height: 100%; object-fit: cover; }
.tk-bukti__preview svg { width: 28px; height: 28px; }
.tk-bukti__preview:not(.is-empty) { border-style: solid; }
.tk-bukti__actions { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; }

.tk-editor__foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

/* Confirm dialog */
.tk-confirm__card {
  background: var(--white);
  border-radius: 22px;
  max-width: 420px;
  width: 100%;
  padding: 2rem 1.8rem 1.6rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.tk-confirm__icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(192, 57, 43, 0.10);
  color: #C0392B;
  border: 1px solid rgba(192, 57, 43, 0.25);
}
.tk-confirm__icon svg { width: 26px; height: 26px; }
.tk-confirm__card h3 { font-family: var(--font-display); color: var(--navy); font-size: 1.15rem; margin-bottom: 0.4rem; }
.tk-confirm__card p { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.3rem; }
.tk-confirm__card p b { color: var(--navy); }
.tk-confirm__foot { display: flex; justify-content: center; gap: 0.6rem; }

/* -------------------------------------------------------------- toasts --- */

.tk-toasts {
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-width: min(92vw, 380px);
}
.tk-toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.05rem;
  border-radius: 14px;
  background: var(--navy-deep);
  color: var(--white);
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.10);
  animation: tkToastIn 0.3s var(--ease);
}
.tk-toast svg { width: 18px; height: 18px; flex: 0 0 auto; }
.tk-toast--success svg { color: #5BD6A2; }
.tk-toast--error { border-color: rgba(255, 142, 122, 0.4); }
.tk-toast--error svg { color: #FF8E7A; }
.tk-toast.is-leaving { opacity: 0; transform: translateY(8px); transition: all 0.25s var(--ease); }
@keyframes tkToastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------- responsive --- */

@media (max-width: 1080px) {
  .tk-stats { grid-template-columns: 1fr 1fr; }
  .tk-stat--saldo { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .tk-filter-toggle { display: inline-flex; }
  .tk-btn--home span, .tk-admin-chip span { display: none; }
  .tk-toolbar { grid-template-columns: 1fr 1fr; }
  .tk-field--search { grid-column: 1 / -1; }
  .tk-reset { grid-column: 1 / -1; }
  .tk-intro { flex-direction: column; align-items: flex-start; }
  .tk-intro__meta { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .tk-lightbox__inner { grid-template-columns: 1fr; max-height: 90vh; }
  .tk-lightbox__side { max-height: 40vh; }
}

@media (max-width: 620px) {
  .tk-brand__txt small { display: none; }
  .tk-head__actions .tk-btn span { display: none; }
  .tk-head__actions .tk-btn { padding: 0.55rem 0.7rem; }
  .tk-toolbar { grid-template-columns: 1fr; }
  .tk-stats { grid-template-columns: 1fr; }
  .tk-seg button span { display: none; }
  .tk-seg button { padding: 0.42rem 0.65rem; }
  .tk-seg--sm button { padding: 0.32rem 0.6rem; font-size: 0.72rem; }
  .tk-form-grid { grid-template-columns: 1fr; }
  .tk-chart-controls { width: 100%; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  .tk-btn, .tk-stat, .tk-reset, .tk-page-btn, .tk-modal.is-open, .tk-toast { transition: none !important; animation: none !important; }
}
