:root {
  /* Premium Dark Slate / Midnight Blue Palette */
  --bg-dark:     #050507;
  --bg-body:     #09090b;
  --bg-card:     rgba(24, 24, 27, 0.6);
  --bg-card2:    rgba(39, 39, 42, 0.5);
  
  --border:      rgba(255, 255, 255, 0.08);
  --border-hover:rgba(255, 255, 255, 0.15);
  
  --text-main:   #f8fafc;
  --text-muted:  #94a3b8;
  
  --accent:      #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.4);
  --accent2:     #6366f1;

  /* Vibrant Neon Traffic Light Colors */
  --green:       #10b981;
  --green-bg:    rgba(16, 185, 129, 0.15);
  --green-glow:  0 0 12px rgba(16, 185, 129, 0.5);
  
  --yellow:      #f59e0b;
  --yellow-bg:   rgba(245, 158, 11, 0.15);
  --yellow-glow: 0 0 12px rgba(245, 158, 11, 0.5);
  
  --red:         #ef4444;
  --red-bg:      rgba(239, 68, 68, 0.15);
  --red-glow:    0 0 12px rgba(239, 68, 68, 0.5);
  
  --blue:        #64748b;
  --blue-bg:     rgba(100, 116, 139, 0.15);
  --blue-glow:   0 0 12px rgba(100, 116, 139, 0.3);

  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin:0; padding:0; box-sizing:border-box; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

body {
  background: radial-gradient(circle at top center, #111827 0%, var(--bg-body) 100%);
  color: var(--text-main);
  font-family: 'Sarabun', 'Inter', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

header {
  background: rgba(9, 9, 11, 0.7);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}
.header-inner {
  max-width: 1600px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 76px; gap: 1rem;
}
.logo {
  display: flex; align-items: center; gap: 1rem;
}
.logo-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; font-weight: 700; color: #ffffff;
  font-family: 'Kanit', sans-serif;
  box-shadow: 0 0 20px var(--accent-glow), inset 0 1px 1px rgba(255,255,255,0.3);
}
.logo-text h1 {
  font-family: 'Kanit', sans-serif;
  font-size: 1.25rem; font-weight: 600; color: #ffffff;
  line-height: 1.2; letter-spacing: 0.02em;
}
.logo-text p {
  font-size: 0.8rem; color: var(--text-muted); font-weight: 400;
  letter-spacing: 0.01em;
}
.header-right {
  display: flex; align-items: center; gap: 1.25rem;
}

#month-select {
  background: var(--bg-card2); 
  border: 1px solid var(--border);
  color: var(--text-main); 
  padding: 0.5rem 1.25rem;
  border-radius: 10px; 
  font-family: 'Kanit', sans-serif; 
  font-size: 0.9rem;
  cursor: pointer; outline: none;
  transition: all 0.3s var(--ease-out);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.02);
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1em;
  padding-right: 2.5rem;
}
#month-select:hover, #month-select:focus { 
  border-color: var(--border-hover); 
  background-color: rgba(255,255,255,0.05);
}
.btn-refresh {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff; padding: 0.5rem 1.25rem;
  border-radius: 10px; font-family: 'Kanit', sans-serif; font-size: 0.9rem;
  cursor: pointer; font-weight: 500;
  transition: all 0.3s var(--ease-out);
  display: flex; align-items: center; gap: 0.5rem;
  box-shadow: 0 4px 12px var(--accent-glow), inset 0 1px 1px rgba(255,255,255,0.2);
}
.btn-refresh:hover { 
  box-shadow: 0 6px 16px var(--accent-glow), inset 0 1px 1px rgba(255,255,255,0.3);
  transform: translateY(-1px); 
}
.btn-refresh:active { transform: translateY(1px); }
#last-update { font-family: 'Inter', sans-serif; font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }

#loading-overlay {
  position: fixed; inset: 0; background: rgba(9, 9, 11, 0.8);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 9999; gap: 1.5rem;
  transition: opacity 0.4s var(--ease-out);
}
.spinner {
  width: 48px; height: 48px; border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  box-shadow: 0 0 20px var(--accent-glow);
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading-overlay p { color: var(--text-main); font-size: 0.95rem; font-family: 'Kanit', sans-serif; font-weight: 500; letter-spacing: 0.02em; }

main {
  max-width: 1600px; margin: 0 auto;
  padding: 2.5rem 2rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem; margin-bottom: 2.5rem;
}
.stat-card {
  background: var(--bg-card); 
  border: 1px solid var(--border);
  border-radius: 16px; padding: 1.5rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  position: relative; overflow: hidden;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255,255,255,0.05);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), border-color 0.4s;
}
.stat-card:hover { 
  transform: translateY(-4px); 
  border-color: var(--border-hover);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1); 
}
.stat-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at top right, rgba(255,255,255,0.03) 0%, transparent 70%);
  pointer-events: none;
}
.stat-card.green:hover { box-shadow: 0 12px 40px rgba(16, 185, 129, 0.15), inset 0 1px 0 rgba(255,255,255,0.1); border-color: rgba(16, 185, 129, 0.3); }
.stat-card.yellow:hover { box-shadow: 0 12px 40px rgba(245, 158, 11, 0.15), inset 0 1px 0 rgba(255,255,255,0.1); border-color: rgba(245, 158, 11, 0.3); }
.stat-card.red:hover { box-shadow: 0 12px 40px rgba(239, 68, 68, 0.15), inset 0 1px 0 rgba(255,255,255,0.1); border-color: rgba(239, 68, 68, 0.3); }
.stat-card.black:hover { box-shadow: 0 12px 40px rgba(71, 85, 105, 0.15), inset 0 1px 0 rgba(255,255,255,0.1); border-color: rgba(71, 85, 105, 0.3); }

.stat-label { font-family: 'Kanit', sans-serif; font-size: 0.85rem; color: var(--text-muted); font-weight: 500; letter-spacing: .02em; }
.stat-value { font-family: 'Inter', sans-serif; font-size: 2.75rem; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.stat-card.green .stat-value { color: var(--green); text-shadow: var(--green-glow); }
.stat-card.yellow .stat-value { color: var(--yellow); text-shadow: var(--yellow-glow); }
.stat-card.red .stat-value { color: var(--red); text-shadow: var(--red-glow); }
.stat-card.black .stat-value { color: var(--blue); text-shadow: var(--blue-glow); }
.stat-card.total .stat-value { color: #ffffff; }
.stat-pct { font-family: 'Inter', sans-serif; font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }

.stat-badge {
  position: absolute; top: 1.25rem; right: 1.25rem;
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; border: 1px solid rgba(255,255,255,0.05);
}
.stat-card.green .stat-badge { background: var(--green-bg); color: var(--green); box-shadow: var(--green-glow); }
.stat-card.yellow .stat-badge { background: var(--yellow-bg); color: var(--yellow); box-shadow: var(--yellow-glow); }
.stat-card.red .stat-badge { background: var(--red-bg); color: var(--red); box-shadow: var(--red-glow); }
.stat-card.black .stat-badge { background: rgba(71, 85, 105, 0.15); color: #475569; box-shadow: 0 0 12px rgba(71, 85, 105, 0.3); }
.stat-card.total .stat-badge { background: rgba(255,255,255,0.05); color: #fff; }

.charts-row {
  display: grid; grid-template-columns: 320px 1fr; gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.card {
  background: var(--bg-card); 
  border: 1px solid var(--border);
  border-radius: 16px; padding: 1.75rem;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255,255,255,0.05);
}
.card-title {
  font-family: 'Kanit', sans-serif; font-size: 1.05rem; font-weight: 500;
  color: var(--text-main); margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: 0.6rem; letter-spacing: 0.01em;
}
.card-title .dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 10px var(--accent-glow); }

.donut-wrap {
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 1.5rem;
}
.donut-svg { width: 170px; height: 170px; filter: drop-shadow(0 8px 16px rgba(0,0,0,.5)); }
.donut-legend {
  display: flex; flex-direction: column; gap: 0.75rem; width: 100%;
  background: rgba(0,0,0,0.2); padding: 1rem; border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.03);
}
.legend-item {
  display: flex; align-items: center; justify-content: space-between;
  font-family: 'Kanit', sans-serif; font-size: 0.85rem;
}
.legend-dot { 
  width: 12px; height: 12px; border-radius: 4px; 
  margin-right: 0.75rem; flex-shrink: 0;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.3);
}
.legend-label { display: flex; align-items: center; color: var(--text-muted); }
.legend-count { font-family: 'Inter', sans-serif; font-weight: 600; color: var(--text-main); font-size: 0.95rem; }

.trend-canvas-wrap { position: relative; height: 220px; }
canvas#trendChart { width: 100%; height: 100%; }

.filter-bar {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1.5rem; flex-wrap: wrap;
}
.search-wrap {
  flex: 1; min-width: 260px;
  position: relative;
}
.search-icon {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 1.1rem; pointer-events: none;
}
#search-input {
  width: 100%; background: var(--bg-card2); border: 1px solid var(--border);
  color: var(--text-main); padding: 0.65rem 1rem 0.65rem 2.75rem;
  border-radius: 10px; font-family: 'Kanit', sans-serif; font-size: 0.9rem;
  outline: none; transition: all 0.3s var(--ease-out);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
#search-input:focus { 
  border-color: var(--accent); 
  background: rgba(255,255,255,0.03);
  box-shadow: 0 0 0 3px var(--accent-glow), inset 0 1px 1px rgba(255,255,255,0.02);
}
#search-input::placeholder { color: #64748b; }

.filter-btn {
  background: var(--bg-card2); border: 1px solid var(--border);
  color: var(--text-muted); padding: 0.65rem 1.25rem;
  border-radius: 10px; font-family: 'Kanit', sans-serif; font-size: 0.85rem;
  cursor: pointer; transition: all 0.3s var(--ease-out); font-weight: 500;
}
.filter-btn.active { border-color: currentColor; box-shadow: inset 0 1px 1px rgba(255,255,255,0.1); }
.filter-btn.all.active   { color: var(--text-main); border-color: var(--accent2); background: rgba(99,102,241,.15); box-shadow: 0 0 12px rgba(99,102,241,0.2); }
.filter-btn.green.active { color: var(--green); border-color: var(--green); background: var(--green-bg); box-shadow: var(--green-glow); }
.filter-btn.yellow.active{ color: var(--yellow); border-color: var(--yellow); background: var(--yellow-bg); box-shadow: var(--yellow-glow); }
.filter-btn.red.active   { color: var(--red); border-color: var(--red); background: var(--red-bg); box-shadow: var(--red-glow); }
.filter-btn.blue.active  { color: var(--blue); border-color: var(--blue); background: var(--blue-bg); box-shadow: var(--blue-glow); }
.filter-btn:hover:not(.active) { border-color: var(--border-hover); color: var(--text-main); background: rgba(255,255,255,0.03); }

.result-count { font-family: 'Kanit', sans-serif; font-size: 0.85rem; color: var(--text-muted); margin-left: auto; white-space: nowrap; }

.table-wrap {
  overflow-x: auto; border-radius: 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255,255,255,0.05);
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; min-width: 1000px; }
thead tr { background: rgba(0,0,0,0.2); border-bottom: 1px solid var(--border); }
thead th {
  padding: 1rem 1.25rem; text-align: left;
  font-family: 'Kanit', sans-serif; font-size: 0.8rem; font-weight: 500;
  color: var(--text-muted); white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: color 0.3s ease;
}
thead th:hover { color: var(--text-main); }
thead th.sorted { color: #fff; background: rgba(255,255,255,0.02); }
thead th .sort-icon { margin-left: 6px; opacity: .4; font-size: .65rem; transition: opacity 0.3s; }
thead th.sorted .sort-icon { opacity: 1; color: var(--accent); }

tbody tr {
  border-bottom: 1px solid rgba(255,255,255,.03);
  transition: background 0.2s ease;
  cursor: pointer;
}
tbody tr:hover { background: rgba(255,255,255,.04); }
tbody tr:last-child { border-bottom: none; }
tbody td { padding: 0.85rem 1.25rem; font-size: 0.9rem; vertical-align: middle; }

.td-no { color: var(--text-muted); font-size: 0.8rem; font-family: 'Inter', sans-serif; }
.td-name { font-weight: 600; color: var(--text-main); font-family: 'Kanit', sans-serif; font-size: 0.95rem; }
.td-nick { color: var(--text-muted); font-size: 0.85rem; font-family: 'Kanit', sans-serif; }
.td-num { text-align: right; font-family: 'Inter', sans-serif; font-weight: 500; }
.td-money { text-align: right; font-family: 'Inter', sans-serif; font-weight: 500; font-size: 0.85rem; color: #a1a1aa; }

.tl-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px;
  font-family: 'Inter', sans-serif; font-size: 0.95rem; font-weight: 700;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
  border: 1px solid rgba(255,255,255,0.05);
}
tr:hover .tl-badge { transform: scale(1.1); }
.tl-G { background: var(--green-bg); color: var(--green); box-shadow: var(--green-glow); }
.tl-Y { background: var(--yellow-bg); color: var(--yellow); box-shadow: var(--yellow-glow); }
.tl-R { background: var(--red-bg); color: var(--red); box-shadow: var(--red-glow); }
.tl-B { background: var(--blue-bg); color: var(--blue); box-shadow: var(--blue-glow); }

.score-bar-wrap {
  display: flex; align-items: center; gap: 0.75rem; min-width: 120px;
}
.score-bar {
  flex: 1; height: 6px; border-radius: 99px;
  background: rgba(255,255,255,.05); overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}
.score-bar-fill { 
  height: 100%; border-radius: 99px; 
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1); 
  box-shadow: 0 0 8px currentColor;
}
.score-val { font-family: 'Inter', sans-serif; font-size: 0.85rem; font-weight: 700; min-width: 32px; text-align: right; }

.spark-wrap { display: flex; align-items: flex-end; gap: 3px; height: 32px; }
.spark-bar {
  flex: 1; border-radius: 2px 2px 0 0; min-height: 2px;
  transition: height 0.4s var(--ease-out);
}
.spark-bar:hover { filter: brightness(1.3); }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s var(--ease-out);
  padding: 1rem;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: rgba(24, 24, 27, 0.85); 
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px; padding: 2.5rem; max-width: 720px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  transform: scale(0.92) translateY(15px); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
  backdrop-filter: blur(32px); -webkit-backdrop-filter: blur(32px);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  margin-bottom: 2rem; border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
}
.modal-name { font-family: 'Kanit', sans-serif; font-size: 1.5rem; font-weight: 600; color: #fff; letter-spacing: 0.01em; }
.modal-nick { color: var(--accent); font-size: 1rem; font-weight: 500; margin-left: 0.5rem; }
.modal-close {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.05); 
  color: var(--text-muted); font-size: 1.2rem; width: 36px; height: 36px; border-radius: 10px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s var(--ease-out);
}
.modal-close:hover { background: rgba(255,255,255,0.1); color: #fff; transform: scale(1.05); }

.modal-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem; margin-bottom: 2rem;
}
.modal-stat {
  background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.03);
  border-radius: 12px; padding: 1rem 1.25rem;
  transition: transform 0.2s ease, background 0.2s;
}
.modal-stat:hover { transform: translateY(-2px); background: rgba(255,255,255,0.03); }
.modal-stat-label { font-family: 'Kanit', sans-serif; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.4rem; letter-spacing: 0.02em; }
.modal-stat-value { font-family: 'Inter', sans-serif; font-size: 1.25rem; font-weight: 700; color: #fff; }

.modal-chart-title {
  font-family: 'Kanit', sans-serif; font-size: 1rem; font-weight: 500;
  color: var(--text-main); margin-bottom: 1rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.modal-chart-title::before { content: ''; width: 4px; height: 16px; background: var(--accent); border-radius: 4px; }

.modal-months {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
}
.month-chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.03); 
  border-radius: 10px; padding: 0.6rem 0.75rem;
  min-width: 58px; gap: 0.25rem; transition: background 0.2s;
}
.month-chip:hover { background: rgba(255,255,255,0.05); }
.month-chip-label { font-family: 'Inter', sans-serif; font-size: 0.65rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; }
.month-chip-val { font-family: 'Inter', sans-serif; font-size: 0.95rem; font-weight: 700; }

.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 0.5rem; margin-top: 2rem; flex-wrap: wrap;
}
.page-btn {
  background: var(--bg-card2); border: 1px solid rgba(255,255,255,0.05);
  color: var(--text-muted); width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-family: 'Inter', sans-serif;
  cursor: pointer; font-size: 0.9rem; font-weight: 500; transition: all 0.2s var(--ease-out);
}
.page-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.05); color: #fff; border-color: rgba(255,255,255,0.1);
}
.page-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2)); 
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 12px var(--accent-glow);
}
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-info { font-family: 'Kanit', sans-serif; font-size: 0.85rem; color: var(--text-muted); margin: 0 0.75rem; font-weight: 400; }

@media (max-width: 900px) {
  .charts-row { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  header { padding: 0 1rem; }
  .header-inner { flex-direction: column; height: auto; padding: 1rem 0; align-items: flex-start; gap: 0.75rem; }
  .header-right { width: 100%; justify-content: space-between; }
  main { padding: 1rem; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin-bottom: 1.5rem; }
  .stat-card { padding: 1.25rem; }
  .stat-value { font-size: 2.25rem; }
  .filter-bar { gap: 0.5rem; justify-content: flex-start; }
  .filter-btn { padding: 0.5rem 0.75rem; font-size: 0.75rem; flex: 1; text-align: center; }
  .modal { padding: 1.5rem; margin: 1rem; max-height: 85vh; }
  .modal-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .summary-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .search-wrap { width: 100%; }
  .filter-btn { width: 100%; }
  .modal-stats { grid-template-columns: 1fr; }
}

footer {
  text-align: center; padding: 2.5rem 2rem; color: var(--text-muted);
  font-family: 'Inter', sans-serif; font-size: 0.8rem; 
  border-top: 1px solid var(--border); margin-top: 3rem;
  background: rgba(0,0,0,0.2);
}

.tooltip {
  position: fixed; background: rgba(15, 23, 42, 0.95); border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px; padding: 0.6rem 0.85rem; font-family: 'Inter', sans-serif; font-size: 0.8rem; font-weight: 500;
  color: #fff; z-index: 500; pointer-events: none;
  opacity: 0; transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out); 
  transform: translateY(4px); white-space: nowrap;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
}
.tooltip.show { opacity: 1; transform: translateY(0); }

.section-title {
  font-family: 'Kanit', sans-serif; font-size: 1.1rem; font-weight: 500;
  color: var(--text-main); margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: 0.75rem; letter-spacing: 0.02em;
}
.section-title::after {
  content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent);
}
