/* =====================================================================
   เก็บเงิน ม.5/6 — style.css
   Modern Minimal · Clean Dashboard · Mobile First
   ===================================================================== */

/* ------------------------------ 1. TOKENS --------------------------- */
:root {
  /* แบรนด์ */
  --brand-50:  #eef2ff;
  --brand-100: #e0e7ff;
  --brand-200: #c7d2fe;
  --brand-400: #818cf8;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;

  /* สถานะ */
  --success-50:  #ecfdf5;
  --success-100: #d1fae5;
  --success-500: #10b981;
  --success-600: #059669;
  --success-700: #047857;

  --danger-50:  #fef2f2;
  --danger-100: #fee2e2;
  --danger-500: #ef4444;
  --danger-600: #dc2626;
  --danger-700: #b91c1c;

  --warning-50:  #fffbeb;
  --warning-100: #fef3c7;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --warning-700: #b45309;

  /* กลาง */
  --ink-900: #0f172a;
  --ink-800: #1e293b;
  --ink-700: #334155;
  --ink-600: #475569;
  --ink-500: #64748b;
  --ink-400: #94a3b8;
  --ink-300: #cbd5e1;
  --ink-200: #e2e8f0;
  --ink-100: #f1f5f9;
  --ink-50:  #f8fafc;

  --bg:      #f6f7fb;
  --surface: #ffffff;

  --text:      var(--ink-900);
  --text-soft: var(--ink-600);
  --muted:     var(--ink-500);
  --border:    var(--ink-200);
  --border-soft: #eef1f6;

  /* ขนาด */
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius:    14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, .07), 0 2px 4px rgba(15, 23, 42, .04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .10), 0 4px 8px rgba(15, 23, 42, .04);
  --shadow-xl: 0 24px 64px rgba(15, 23, 42, .16);

  --ring: 0 0 0 3px rgba(99, 102, 241, .22);

  --header-h: 68px;
  --sidebar-w: 272px;

  --font-sans: "Noto Sans Thai", "Inter", -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;

  --tr: 180ms cubic-bezier(.4, 0, .2, 1);
}

/* ------------------------------ 2. RESET ---------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.no-scroll { overflow: hidden; }

h1, h2, h3, h4, h5, h6 { margin: 0; line-height: 1.35; font-weight: 700; color: var(--ink-900); }
h1 { font-size: 1.65rem; letter-spacing: -.02em; }
h2 { font-size: 1.2rem;  letter-spacing: -.01em; }
h3 { font-size: 1.05rem; }
p  { margin: 0; }
a  { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }
img { max-width: 100%; display: block; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: var(--brand-200); color: var(--ink-900); }

/* --------------------------- 3. UTILITIES --------------------------- */
.container {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: 18px;
}

.section { margin-bottom: 26px; }
.muted { color: var(--muted); font-weight: 500; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--brand-600);
  color: #fff;
  border-radius: var(--radius-sm);
}
.skip-link:focus { left: 16px; color: #fff; }

[hidden] { display: none !important; }

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

/* ----------------------------- 4. BUTTONS --------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--ink-100);
  color: var(--ink-700);
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  transition: background var(--tr), color var(--tr), border-color var(--tr),
              box-shadow var(--tr), transform var(--tr);
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-busy="true"] { opacity: .6; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--brand-600); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-700); color: #fff; }

.btn-secondary { background: var(--surface); color: var(--ink-700); border-color: var(--border); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { background: var(--ink-50); border-color: var(--ink-300); color: var(--ink-900); }

.btn-ghost { background: transparent; color: var(--ink-600); }
.btn-ghost:hover { background: var(--ink-100); color: var(--ink-900); }

.btn-success { background: var(--success-600); color: #fff; }
.btn-success:hover { background: var(--success-700); color: #fff; }

.btn-danger { background: var(--danger-600); color: #fff; }
.btn-danger:hover { background: var(--danger-700); color: #fff; }

.btn-danger-soft { background: var(--danger-50); color: var(--danger-700); border-color: var(--danger-100); }
.btn-danger-soft:hover { background: var(--danger-100); color: var(--danger-700); }

.btn-warning-soft { background: var(--warning-50); color: var(--warning-700); border-color: var(--warning-100); }
.btn-warning-soft:hover { background: var(--warning-100); }

.btn-lg { padding: 13px 22px; font-size: 1rem; border-radius: var(--radius); }
.btn-sm { padding: 7px 12px; font-size: .82rem; gap: 6px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-block { width: 100%; }

.btn-icon { padding: 10px; }
.btn-icon svg { width: 18px; height: 18px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--ink-600);
  transition: background var(--tr), color var(--tr), border-color var(--tr);
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--ink-50); color: var(--ink-900); border-color: var(--ink-300); }
.icon-btn.is-danger { color: var(--danger-600); border-color: var(--danger-100); background: var(--danger-50); }
.icon-btn.is-danger:hover { background: var(--danger-100); color: var(--danger-700); }
.icon-btn.is-success { color: var(--success-700); border-color: var(--success-100); background: var(--success-50); }
.icon-btn.is-success:hover { background: var(--success-100); }

/* แสดงจุดเล็ก ๆ แทนไอคอนที่โหลดไม่สำเร็จ ไม่ให้เห็นกล่องว่าง */
.icon-fallback {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex: none;
  vertical-align: -2px;
}

.link-button {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; padding: 0;
  color: var(--brand-600); font-weight: 600; font-size: .875rem;
}
.link-button:hover { color: var(--brand-700); text-decoration: underline; }
.link-button svg { width: 15px; height: 15px; }

/* ---------------------------- 5. HEADER ----------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--header-h);
}

.brand { display: flex; align-items: center; gap: 12px; color: inherit; }
.brand:hover { color: inherit; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  flex: none;
  border-radius: 13px;
  background: linear-gradient(140deg, var(--brand-500), var(--brand-700));
  color: #fff;
  box-shadow: 0 6px 16px rgba(79, 70, 229, .28);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-mark-lg { width: 56px; height: 56px; border-radius: 18px; }
.brand-mark-lg svg { width: 28px; height: 28px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 1rem; font-weight: 700; letter-spacing: -.01em; }
.brand-text small { font-size: .74rem; color: var(--muted); font-weight: 500; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  color: var(--ink-600);
  transition: background var(--tr), color var(--tr);
}
.nav-link svg { width: 17px; height: 17px; }
.nav-link:hover { background: var(--ink-100); color: var(--ink-900); }
.nav-link.is-active { background: var(--brand-50); color: var(--brand-700); }
.nav-link-cta {
  background: var(--brand-600);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.nav-link-cta:hover { background: var(--brand-700); color: #fff; }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-700);
}
.nav-toggle svg { width: 20px; height: 20px; }

/* --------------------------- 6. PAGE HEAD --------------------------- */
.page-head {
  padding: 30px 0 22px;
  background:
    radial-gradient(900px 300px at 12% -40%, rgba(99, 102, 241, .13), transparent 65%),
    radial-gradient(700px 260px at 92% -30%, rgba(16, 185, 129, .10), transparent 60%);
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 26px;
}
.page-head-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  flex-wrap: wrap;
}
.page-head-main { max-width: 660px; }
.page-head-main h1 { margin: 10px 0 6px; font-size: clamp(1.45rem, 3.2vw, 2rem); }
.page-head-main .lead { color: var(--text-soft); font-size: .95rem; }
.page-head-side { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.page-head-actions { display: flex; align-items: center; gap: 8px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--brand-100);
  color: var(--brand-700);
  font-size: .78rem;
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}
.pill svg { width: 15px; height: 15px; }

.meta-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--muted);
  font-weight: 500;
}
.meta-line svg { width: 14px; height: 14px; }

.filter-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ----------------------------- 7. CARDS ----------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}
.card + .card { margin-top: 18px; }

.card-title { font-size: 1.06rem; font-weight: 700; }
.card-sub { margin-top: 4px; font-size: .84rem; color: var(--muted); font-weight: 500; }

.card-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.panel-title {
  margin: 20px 0 14px;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink-800);
}
.panel-subtitle {
  margin: 24px 0 14px;
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink-800);
}

/* Stat cards ---------------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}
.stat-grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.stat-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--tr), transform var(--tr);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-label { font-size: .8rem; font-weight: 600; color: var(--muted); letter-spacing: .01em; }

.stat-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: none;
  border-radius: 11px;
  background: var(--brand-50);
  color: var(--brand-600);
}
.stat-icon svg { width: 18px; height: 18px; }

.stat-value {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.stat-value .unit { font-size: .82rem; font-weight: 600; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.stat-hint { font-size: .76rem; color: var(--muted); font-weight: 500; }

.stat-card.tone-primary .stat-icon { background: var(--brand-50); color: var(--brand-600); }
.stat-card.tone-success .stat-icon { background: var(--success-50); color: var(--success-600); }
.stat-card.tone-danger  .stat-icon { background: var(--danger-50);  color: var(--danger-600); }
.stat-card.tone-warning .stat-icon { background: var(--warning-50); color: var(--warning-600); }
.stat-card.tone-neutral .stat-icon { background: var(--ink-100);    color: var(--ink-600); }

.stat-card.tone-success .stat-value { color: var(--success-700); }
.stat-card.tone-danger  .stat-value { color: var(--danger-700); }
.stat-card.tone-warning .stat-value { color: var(--warning-700); }
.stat-card.tone-primary .stat-value { color: var(--brand-700); }

.stat-card.is-skeleton .stat-value { color: var(--ink-300); }

/* --------------------------- 8. PROGRESS ---------------------------- */
.progress-card { padding: 24px; }
.progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.progress-percent {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--brand-700);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.progress-track {
  position: relative;
  height: 14px;
  border-radius: var(--radius-pill);
  background: var(--ink-100);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--brand-500), var(--success-500));
  transition: width 520ms cubic-bezier(.4, 0, .2, 1);
}
.progress-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  font-size: .82rem;
  color: var(--text-soft);
}
.progress-legend li { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.progress-legend strong { color: var(--ink-900); font-weight: 700; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.legend-paid { background: var(--success-500); }
.legend-unpaid { background: var(--ink-300); }
.legend-target { background: var(--brand-500); }

.mini-progress { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.mini-progress .mini-track {
  flex: 1; height: 7px; border-radius: var(--radius-pill);
  background: var(--ink-100); overflow: hidden;
}
.mini-progress .mini-bar { height: 100%; border-radius: var(--radius-pill); background: var(--brand-500); }
.mini-progress span { font-size: .75rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------------------------- 9. TABLES ----------------------------- */
.table-card { padding: 0; overflow: hidden; }

.table-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border-soft);
}
.toolbar-left { min-width: 220px; }
.toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  min-width: 680px;
}
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 16px;
  background: var(--ink-50);
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--ink-500);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
  color: var(--ink-700);
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: rgba(99, 102, 241, .035); }
.data-table tbody tr.is-row-paid { background: rgba(16, 185, 129, .05); }
.data-table tbody tr.is-row-paid:hover { background: rgba(16, 185, 129, .09); }
.data-table tbody tr.is-updating { opacity: .55; pointer-events: none; }

.data-table .col-no { width: 68px; text-align: center; }
.data-table tbody .col-no { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; text-align: center; }
.data-table .col-amount { text-align: right; white-space: nowrap; }
.data-table tbody .col-amount { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.data-table .col-mini { text-align: center; white-space: nowrap; }
.data-table tbody .col-mini { text-align: center; font-variant-numeric: tabular-nums; }
.data-table .col-status { width: 130px; }
.data-table .col-time { width: 168px; white-space: nowrap; }
.data-table .col-receipt { width: 118px; }
.data-table .col-actions { width: 150px; text-align: right; }
.data-table .col-note { max-width: 220px; }
.data-table .col-progress { width: 160px; }

.cell-name { font-weight: 600; color: var(--ink-900); }
.cell-sub { display: block; font-size: .76rem; color: var(--muted); font-weight: 500; }
.cell-actions { display: inline-flex; gap: 6px; justify-content: flex-end; }

.thumb {
  width: 46px; height: 46px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--ink-100);
  cursor: pointer;
  transition: transform var(--tr), box-shadow var(--tr);
}
.thumb:hover { transform: scale(1.05); box-shadow: var(--shadow-md); }

.table-footer {
  padding: 13px 22px;
  border-top: 1px solid var(--border-soft);
  background: var(--ink-50);
  font-size: .8rem;
  color: var(--muted);
  font-weight: 500;
}

/* ---------------------------- 10. BADGES ---------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: .76rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge svg { width: 13px; height: 13px; }
.badge-paid    { background: var(--success-50);  color: var(--success-700);  border-color: var(--success-100); }
.badge-unpaid  { background: var(--ink-100);     color: var(--ink-600);      border-color: var(--ink-200); }
.badge-open    { background: var(--brand-50);    color: var(--brand-700);    border-color: var(--brand-100); }
.badge-closed  { background: var(--warning-50);  color: var(--warning-700);  border-color: var(--warning-100); }
.badge-danger  { background: var(--danger-50);   color: var(--danger-700);   border-color: var(--danger-100); }
.badge-neutral { background: var(--ink-100);     color: var(--ink-600);      border-color: var(--ink-200); }

/* ---------------------------- 11. FORMS ----------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: .8rem; font-weight: 600; color: var(--ink-600); }
.field-help { font-size: .74rem; color: var(--muted); }
.field-error { font-size: .76rem; color: var(--danger-600); font-weight: 600; }

input[type="text"], input[type="search"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="datetime-local"], select, textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-900);
  font-size: .9rem;
  transition: border-color var(--tr), box-shadow var(--tr), background var(--tr);
}
input::placeholder, textarea::placeholder { color: var(--ink-400); }
input:hover, select:hover, textarea:hover { border-color: var(--ink-300); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: var(--ring);
}
input:disabled, select:disabled, textarea:disabled { background: var(--ink-50); color: var(--ink-400); cursor: not-allowed; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--danger-500);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .16);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 34px;
  cursor: pointer;
}

textarea { resize: vertical; min-height: 84px; line-height: 1.55; }

.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }

.field-compact select { min-width: 210px; }

.search-field { position: relative; min-width: 220px; }
.search-field > svg {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--ink-400);
  pointer-events: none;
}
.search-field input { padding-left: 36px; }

.input-icon { position: relative; }
.input-icon > svg {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  width: 17px; height: 17px;
  color: var(--ink-400);
  pointer-events: none;
}
.input-icon input { padding-left: 40px; padding-right: 42px; }
.input-suffix {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border: 0; border-radius: var(--radius-xs);
  background: transparent; color: var(--ink-500);
}
.input-suffix:hover { background: var(--ink-100); color: var(--ink-800); }
.input-suffix svg { width: 17px; height: 17px; }

.checkbox-row { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-row input[type="checkbox"] {
  width: 18px; height: 18px; margin-top: 2px;
  accent-color: var(--brand-600);
  flex: none;
  cursor: pointer;
}
.checkbox-row label { font-size: .875rem; font-weight: 500; color: var(--ink-700); cursor: pointer; }

/* ---------------------------- 12. ALERTS ---------------------------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  margin: 16px 0;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: .86rem;
  font-weight: 500;
  line-height: 1.55;
}
.alert svg { width: 17px; height: 17px; flex: none; margin-top: 2px; }
.alert-error   { background: var(--danger-50);  color: var(--danger-700);  border-color: var(--danger-100); }
.alert-warning { background: var(--warning-50); color: var(--warning-700); border-color: var(--warning-100); }
.alert-success { background: var(--success-50); color: var(--success-700); border-color: var(--success-100); }
.alert-info    { background: var(--brand-50);   color: var(--brand-700);   border-color: var(--brand-100); }
.alert code {
  font-family: var(--font-mono);
  font-size: .8rem;
  background: rgba(15, 23, 42, .06);
  padding: 1px 5px;
  border-radius: 5px;
}

/* ------------------------- 13. EMPTY / LOADING ---------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 52px 24px;
  text-align: center;
  color: var(--muted);
}
.empty-state > svg { width: 44px; height: 44px; color: var(--ink-300); }
.empty-state h3 { color: var(--ink-700); font-size: 1rem; }
.empty-state p { font-size: .86rem; max-width: 460px; }
.empty-state .btn { margin-top: 8px; }

.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--brand-100);
  border-top-color: var(--brand-600);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex: none;
}
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--ink-100) 25%, var(--ink-50) 50%, var(--ink-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 6px;
  color: transparent;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(246, 247, 251, .82);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.loading-text { font-size: .88rem; color: var(--ink-600); font-weight: 600; }

.row-spinner { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; color: var(--muted); }

/* ---------------------------- 14. TOAST ----------------------------- */
.toast-root {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--ink-300);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 260ms cubic-bezier(.2, .9, .3, 1.2);
}
.toast.is-leaving { animation: toast-out 200ms ease-in forwards; }
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast-content { flex: 1; min-width: 0; }
.toast-title { font-size: .86rem; font-weight: 700; color: var(--ink-900); }
.toast-message { font-size: .8rem; color: var(--ink-600); line-height: 1.5; word-break: break-word; }
.toast-close {
  border: 0; background: transparent; color: var(--ink-400);
  width: 22px; height: 22px; border-radius: 6px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.toast-close:hover { background: var(--ink-100); color: var(--ink-700); }
.toast-close svg { width: 14px; height: 14px; margin: 0; }
.toast.is-success { border-left-color: var(--success-500); }
.toast.is-success svg.toast-icon { color: var(--success-600); }
.toast.is-error   { border-left-color: var(--danger-500); }
.toast.is-error svg.toast-icon { color: var(--danger-600); }
.toast.is-warning { border-left-color: var(--warning-500); }
.toast.is-warning svg.toast-icon { color: var(--warning-600); }
.toast.is-info    { border-left-color: var(--brand-500); }
.toast.is-info svg.toast-icon { color: var(--brand-600); }

@keyframes toast-in  { from { opacity: 0; transform: translateX(24px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px) scale(.97); } }

/* ---------------------------- 15. MODAL ----------------------------- */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 350;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fade-in 180ms ease-out;
}
.modal {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  animation: modal-in 220ms cubic-bezier(.2, .9, .3, 1.1);
  overflow: hidden;
}
.modal.modal-sm { max-width: 420px; }
.modal.modal-lg { max-width: 720px; }
.modal.modal-xl { max-width: 960px; }

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.modal-head-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: none;
  border-radius: 12px;
  background: var(--brand-50); color: var(--brand-600);
}
.modal-head-icon.is-danger  { background: var(--danger-50);  color: var(--danger-600); }
.modal-head-icon.is-success { background: var(--success-50); color: var(--success-600); }
.modal-head-icon.is-warning { background: var(--warning-50); color: var(--warning-600); }
.modal-head-icon svg { width: 20px; height: 20px; }
.modal-head-text { flex: 1; min-width: 0; }
.modal-head-text h3 { font-size: 1.05rem; }
.modal-head-text p { font-size: .84rem; color: var(--muted); margin-top: 3px; }
.modal-close {
  border: 0; background: transparent; color: var(--ink-400);
  width: 32px; height: 32px; border-radius: var(--radius-xs); flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--ink-100); color: var(--ink-800); }
.modal-close svg { width: 18px; height: 18px; }

.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--border-soft);
  background: var(--ink-50);
  flex-wrap: wrap;
}
.modal-foot .spacer { margin-right: auto; }

.modal-message {
  font-size: .92rem;
  line-height: 1.65;
  color: var(--ink-700);
  white-space: pre-line;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* lightbox */
.lightbox-figure { margin: 0; text-align: center; }
.lightbox-figure img {
  max-width: 100%;
  max-height: 66vh;
  margin-inline: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  background: var(--ink-100);
}
.lightbox-caption { margin-top: 12px; font-size: .84rem; color: var(--muted); }

/* ---------------------------- 16. FOOTER ---------------------------- */
.site-footer {
  margin-top: 34px;
  border-top: 1px solid var(--border-soft);
  background: var(--surface);
  padding: 22px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--text-soft);
}

/* --------------------------- 17. CTA CARD --------------------------- */
.cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, var(--brand-50), var(--surface) 62%);
  border-color: var(--brand-100);
}

/* -------------------------- 18. SESSION LIST ------------------------ */
.session-list { display: grid; gap: 14px; }

.session-item {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--tr), border-color var(--tr);
  overflow: hidden;
}
.session-item:hover { box-shadow: var(--shadow-md); border-color: var(--brand-100); }
.session-item.is-current { border-color: var(--brand-400); box-shadow: 0 0 0 3px var(--brand-50); }

.session-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) repeat(3, minmax(104px, .8fr)) minmax(140px, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
}
.session-date { display: flex; align-items: center; gap: 12px; min-width: 0; }
.session-date-badge {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 46px; height: 46px; flex: none;
  border-radius: 12px;
  background: var(--brand-50);
  color: var(--brand-700);
  line-height: 1.05;
}
.session-date-badge .d { font-size: 1.05rem; font-weight: 700; }
.session-date-badge .m { font-size: .62rem; font-weight: 600; letter-spacing: .04em; }
.session-date-text strong { display: block; font-size: .92rem; }
.session-date-text small { font-size: .76rem; color: var(--muted); font-weight: 500; }

.session-metric .label { font-size: .72rem; font-weight: 600; color: var(--muted); letter-spacing: .03em; }
.session-metric .value { font-size: .98rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.session-actions { display: inline-flex; gap: 8px; justify-content: flex-end; }

.session-detail {
  padding: 0 20px 18px;
  border-top: 1px dashed var(--border);
}
.session-detail h4 { margin: 14px 0 10px; font-size: .88rem; color: var(--ink-700); }
.session-detail .data-table { min-width: 560px; }

.gallery-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.gallery-strip img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--ink-100);
  cursor: pointer;
  transition: transform var(--tr), box-shadow var(--tr);
}
.gallery-strip img:hover { transform: scale(1.04); box-shadow: var(--shadow-md); }

/* =====================================================================
   19. PAY PAGE — หน้า "จ่ายเงินของฉัน" (pay.html)
   ===================================================================== */

/* ---- หัวการ์ดแบบมีลำดับขั้น ---- */
.pay-step-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }

.pay-step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  flex: none;
  border-radius: 11px;
  background: linear-gradient(140deg, var(--brand-500), var(--brand-700));
  color: #fff;
  font-size: .95rem;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(79, 70, 229, .26);
}

/* ---- ช่องค้นหาชื่อ ---- */
.pay-search-card { padding: 24px; }
.pay-search-field { max-width: 620px; }
.pay-search-field .search-field { min-width: 0; }
.pay-search-field .search-field input { padding-right: 46px; }

.pay-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border: 0;
  border-radius: var(--radius-xs);
  background: var(--ink-100);
  color: var(--ink-600);
  transition: background var(--tr), color var(--tr);
}
.pay-search-clear svg { width: 15px; height: 15px; }
.pay-search-clear:hover { background: var(--ink-200); color: var(--ink-900); }

.pay-search-state {
  margin-top: 14px;
  padding: 12px 15px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--ink-50);
  font-size: .84rem;
  font-weight: 500;
  color: var(--text-soft);
}
.pay-search-state.is-empty {
  border-color: var(--warning-100);
  background: var(--warning-50);
  color: var(--warning-700);
}

/* ---- การ์ดเลือกชื่อนักเรียน ---- */
.student-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.student-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  transition: border-color var(--tr), background var(--tr),
              box-shadow var(--tr), transform var(--tr);
}
.student-pick:hover {
  border-color: var(--brand-400);
  background: var(--brand-50);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.student-pick.is-selected {
  border-color: var(--brand-500);
  background: var(--brand-50);
  box-shadow: 0 0 0 3px var(--brand-100);
}

.student-pick-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px; height: 34px;
  flex: none;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--ink-100);
  color: var(--ink-600);
  font-size: .78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.student-pick.is-selected .student-pick-no { background: var(--brand-100); color: var(--brand-700); }

.student-pick-text { min-width: 0; }
.student-pick-text strong,
.student-pick-text small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.student-pick-text strong { font-size: .88rem; color: var(--ink-900); font-weight: 600; }
.student-pick-text small { font-size: .74rem; color: var(--muted); font-weight: 500; }

/* ---- แถบชื่อนักเรียนที่เลือก ---- */
.pay-student-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-soft);
}

.pay-student-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  flex: none;
  border-radius: 16px;
  background: linear-gradient(140deg, var(--brand-500), var(--brand-700));
  color: #fff;
  box-shadow: 0 6px 16px rgba(79, 70, 229, .26);
}
.pay-student-avatar svg { width: 24px; height: 24px; }

.pay-student-info { min-width: 0; flex: 1; }
.pay-student-bar > .btn { margin-left: auto; }

/* ---- สรุปยอดของนักเรียน ---- */
.pay-summary { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }

.pay-summary-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 10px 15px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--ink-50);
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-soft);
}
.pay-summary-chip strong {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
}
.pay-summary-chip.is-success { border-color: var(--success-100); background: var(--success-50); color: var(--success-700); }
.pay-summary-chip.is-success strong { color: var(--success-700); }
.pay-summary-chip.is-danger { border-color: var(--danger-100); background: var(--danger-50); color: var(--danger-700); }
.pay-summary-chip.is-danger strong { color: var(--danger-700); }
.pay-summary-chip.is-brand { border-color: var(--brand-100); background: var(--brand-50); color: var(--brand-700); }
.pay-summary-chip.is-brand strong { color: var(--brand-700); }

/* ---- แถบเครื่องมือ + ตัวกรอง ---- */
.pay-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.pay-filter {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: var(--ink-100);
}

.pay-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-600);
  font-size: .82rem;
  font-weight: 600;
  transition: background var(--tr), color var(--tr), box-shadow var(--tr);
}
.pay-filter-btn svg { width: 15px; height: 15px; }
.pay-filter-btn:hover { color: var(--ink-900); }
.pay-filter-btn.is-active {
  background: var(--surface);
  color: var(--brand-700);
  box-shadow: var(--shadow-xs);
}

/* ---- รายการรอบเก็บเงิน ---- */
.pay-list { display: grid; gap: 10px; }

.pay-item {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color var(--tr), box-shadow var(--tr);
}
.pay-item:hover { border-color: var(--brand-100); box-shadow: var(--shadow-sm); }
.pay-item.is-paid { border-color: var(--success-100); background: rgba(16, 185, 129, .045); }

.pay-item-main { display: flex; align-items: center; gap: 13px; min-width: 0; flex: 1; }

.pay-item-date {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 50px; height: 50px;
  flex: none;
  border-radius: 13px;
  background: var(--ink-100);
  color: var(--ink-700);
  line-height: 1.05;
}
.pay-item-date .d { font-size: 1.1rem; font-weight: 700; }
.pay-item-date .m { font-size: .63rem; font-weight: 700; letter-spacing: .04em; }
.pay-item.is-unpaid .pay-item-date { background: var(--danger-50); color: var(--danger-700); }
.pay-item.is-paid .pay-item-date { background: var(--success-50); color: var(--success-700); }

.pay-item-text { min-width: 0; }
.pay-item-text strong { display: block; font-size: .9rem; }
.pay-item-text small { display: block; font-size: .76rem; color: var(--muted); font-weight: 500; }

.pay-item-side {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
}

.pay-item-slip {
  width: 40px; height: 40px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--ink-100);
  cursor: pointer;
  transition: transform var(--tr), box-shadow var(--tr);
}
.pay-item-slip:hover { transform: scale(1.06); box-shadow: var(--shadow-md); }

/* ป้ายบอกว่านักเรียนส่งสลิปเอง */
.badge-self { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-100); }

/* ---- เนื้อหาใน Modal ส่งสลิป ---- */
.pay-slip { display: grid; gap: 18px; }

.pay-amount-box {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px;
  border: 1px solid var(--brand-100);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-50), var(--success-50));
  text-align: center;
}
.pay-amount-label { width: 100%; font-size: .8rem; font-weight: 600; color: var(--text-soft); }
.pay-amount-value {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--brand-700);
  font-variant-numeric: tabular-nums;
}
.pay-amount-unit { font-size: .9rem; font-weight: 700; color: var(--text-soft); }

.pay-slip-grid {
  display: grid;
  grid-template-columns: minmax(0, 250px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.pay-qr { margin: 0; text-align: center; }
.pay-qr img {
  width: 100%;
  max-width: 250px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  margin: 0 auto;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
.pay-qr figcaption { display: grid; gap: 2px; margin-top: 10px; }
.pay-qr figcaption strong { font-size: .86rem; }
.pay-qr figcaption span { font-size: .76rem; color: var(--muted); font-weight: 500; }

/* กรณีไฟล์รูป QR หาย — แสดงคำแนะนำแทนรูปที่โหลดไม่สำเร็จ */
.pay-qr-missing {
  display: grid;
  gap: 7px;
  justify-items: center;
  padding: 26px 16px;
  border: 1.5px dashed var(--warning-100);
  border-radius: var(--radius);
  background: var(--warning-50);
  color: var(--warning-700);
  text-align: center;
}
.pay-qr-missing svg { width: 30px; height: 30px; }
.pay-qr-missing strong { font-size: .88rem; }
.pay-qr-missing small { font-size: .74rem; font-weight: 500; }
.pay-qr-missing code {
  font-family: var(--font-mono);
  font-size: .72rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(180, 83, 9, .12);
}

.pay-slip-form { display: grid; gap: 14px; min-width: 0; }
.pay-slip-steps {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
  font-size: .83rem;
  color: var(--text-soft);
}

/* ---- พื้นที่เลือกไฟล์สลิป ---- */
.slip-drop {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 20px 16px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  background: var(--ink-50);
  cursor: pointer;
  transition: border-color var(--tr), background var(--tr);
}
.slip-drop:hover,
.slip-drop.is-dragover { border-color: var(--brand-500); background: var(--brand-50); }

.slip-drop-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  flex: none;
  border-radius: 13px;
  background: var(--brand-50);
  color: var(--brand-600);
}
.slip-drop-icon svg { width: 20px; height: 20px; }

.slip-drop-text { display: grid; gap: 2px; min-width: 0; }
.slip-drop-text strong { font-size: .87rem; color: var(--ink-900); }
.slip-drop-text small { font-size: .75rem; color: var(--muted); font-weight: 500; }

/* ---- ตัวอย่างรูปที่เลือก ---- */
.slip-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.slip-preview img {
  width: 62px; height: 62px;
  flex: none;
  border-radius: var(--radius-xs);
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--ink-100);
}
.slip-preview-info { min-width: 0; flex: 1; }
.slip-preview-info strong {
  display: block;
  font-size: .84rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.slip-preview-info small { display: block; font-size: .74rem; color: var(--muted); font-weight: 500; }

/* ---- สรุปผลหลังจ่ายสำเร็จ ---- */
.pay-done-list { display: grid; gap: 8px; list-style: none; margin: 16px 0 0; padding: 0; }
.pay-done-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border-radius: var(--radius-xs);
  background: var(--ink-50);
  font-size: .84rem;
  font-weight: 500;
  color: var(--text-soft);
}
.pay-done-list li strong { color: var(--ink-900); font-weight: 700; text-align: right; }
