/* ==================== DESIGN SYSTEM ==================== */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

:root {
  --primary: #6366f1;
  --primary-light: #e0e7ff;
  --primary-dark: #4f46e5;
  --primary-50: #eef2ff;
  --secondary: #8b5cf6;
  --accent: #06b6d4;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #3b82f6;
  --info-light: #dbeafe;

  --bg: #f1f5f9;
  --bg-card: #ffffff;
  --bg-hover: #f8fafc;
  --bg-active: #eef2ff;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --text-disabled: #cbd5e1;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --divider: #f1f5f9;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.06);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --sidebar-w: 260px;
  --header-h: 64px;
  --transition: 0.2s cubic-bezier(.4,0,.2,1);
}

/* ==================== RESET ==================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Pretendard Variable', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ==================== LAYOUT ==================== */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 200;
  transition: transform var(--transition);
}
.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-logo {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; font-weight: 800;
}
.sidebar-title {
  font-size: 16px; font-weight: 700; color: var(--text);
  line-height: 1.3;
}
.sidebar-subtitle { font-size: 11px; color: var(--text-tertiary); font-weight: 500; }
.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-group { margin-bottom: 8px; }
.nav-group-label {
  font-size: 11px; font-weight: 700; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 8px 12px 4px; margin-bottom: 2px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-md);
  color: var(--text-secondary); font-size: 14px; font-weight: 500;
  transition: all var(--transition); cursor: pointer;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active {
  background: var(--primary-50); color: var(--primary);
  font-weight: 600;
}
.nav-item .icon { font-size: 18px; width: 24px; text-align: center; opacity: 0.7; }
.nav-item.active .icon { opacity: 1; }
.nav-item .badge-count {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; padding: 2px 7px;
  border-radius: var(--radius-full); min-width: 20px; text-align: center;
}
.sidebar-footer {
  padding: 16px 10px;
  border-top: 1px solid var(--border-light);
}

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 16px;
}
.topbar-title { font-size: 18px; font-weight: 700; flex: 1; }
.hamburger {
  display: none;
  background: none; border: none;
  font-size: 22px; color: var(--text-secondary);
  padding: 8px; border-radius: var(--radius-sm);
}
.hamburger:hover { background: var(--bg-hover); }
.content { flex: 1; padding: 28px; max-width: 1280px; width: 100%; margin: 0 auto; }

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; border: none; border-radius: var(--radius-md);
  font-weight: 600; font-size: 14px; padding: 10px 18px;
  transition: all var(--transition); cursor: pointer;
  white-space: nowrap; line-height: 1.4;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg); color: var(--text-secondary); }
.btn-secondary:hover { background: var(--border); color: var(--text); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg); }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-outline-danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); }
.btn-outline-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 24px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius-md); }
.btn-icon.sm { width: 30px; height: 30px; font-size: 13px; }

/* ==================== CARDS ==================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.card-header h3 { font-size: 15px; font-weight: 700; }
.card-body { padding: 22px; }
.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-hover);
}

/* ==================== STAT CARDS ==================== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: opacity var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card:hover::before { opacity: 1; }
.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 14px;
}
.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.purple { background: #ede9fe; color: var(--secondary); }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -1px; line-height: 1.2; color: var(--text); }
.stat-label { font-size: 13px; font-weight: 500; color: var(--text-tertiary); margin-top: 4px; }

/* ==================== FORMS ==================== */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px; font-weight: 600; color: var(--text);
  margin-bottom: 6px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-input, .form-select {
  width: 100%; padding: 11px 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px; color: var(--text);
  transition: all var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-input::placeholder { color: var(--text-disabled); }
.form-input.error { border-color: var(--danger); }
.form-hint { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
textarea.form-input { resize: vertical; min-height: 80px; }

/* ==================== TABLES ==================== */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  background: var(--bg-hover);
  padding: 12px 16px;
  font-size: 12px; font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-hover); }
.table .clickable { cursor: pointer; }
.table .text-center { text-align: center; }
.table .text-right { text-align: right; }
.table .text-mono { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }

/* ==================== BADGES ==================== */
.badge {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 600; padding: 4px 10px;
  border-radius: var(--radius-full);
  line-height: 1.4;
}
.badge-active, .badge-이용중, .badge-활성, .badge-판매중 { background: var(--success-light); color: var(--success); }
.badge-휴면, .badge-일시정지 { background: var(--warning-light); color: var(--warning); }
.badge-탈퇴, .badge-환불, .badge-판매중단 { background: var(--danger-light); color: var(--danger); }
.badge-만료 { background: var(--bg); color: var(--text-tertiary); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-info { background: var(--info-light); color: var(--info); }

/* ==================== SEARCH & FILTER ==================== */
.toolbar {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap;
}
.search-box {
  position: relative; flex: 1; min-width: 240px; max-width: 400px;
}
.search-box .icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-tertiary); font-size: 16px;
}
.search-box input {
  width: 100%; padding: 10px 14px 10px 40px;
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius-full); font-size: 14px;
  transition: all var(--transition); outline: none;
}
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.filter-select {
  padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius-md); font-size: 14px;
  background: var(--bg-card); color: var(--text);
  outline: none; min-width: 120px;
}
.filter-select:focus { border-color: var(--primary); }

/* ==================== PAGINATION ==================== */
.pagination-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-top: 1px solid var(--border-light);
}
.pagination-info { font-size: 13px; color: var(--text-tertiary); }
.pagination { display: flex; gap: 4px; }
.page-btn {
  width: 32px; height: 32px; border: none;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  background: transparent; color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--transition);
}
.page-btn:hover { background: var(--bg); }
.page-btn.active { background: var(--primary); color: #fff; }
.page-btn:disabled { opacity: 0.4; cursor: default; }

/* ==================== MODAL ==================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%; max-width: 560px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s ease;
}
.modal-overlay.show .modal { transform: translateY(0) scale(1); }
.modal-header {
  padding: 22px 24px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; border: none;
  border-radius: var(--radius-sm); background: transparent;
  font-size: 18px; color: var(--text-tertiary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--transition);
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border-light);
  display: flex; justify-content: flex-end; gap: 10px;
  background: var(--bg-hover);
}
.modal-lg { max-width: 720px; }
.modal-sm { max-width: 400px; }

/* ==================== TOAST ==================== */
.toast-container {
  position: fixed; top: 20px; right: 20px;
  z-index: 2000; display: flex;
  flex-direction: column; gap: 10px;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 10px;
  min-width: 280px; max-width: 420px;
  animation: toastIn 0.3s ease-out;
  font-size: 14px; font-weight: 500;
}
.toast.removing { animation: toastOut 0.3s ease-in forwards; }
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }

/* ==================== LOADING ==================== */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(4px);
  z-index: 3000;
  display: none;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 16px;
}
.loading-overlay.show { display: flex; }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 14px; font-weight: 600; color: var(--primary); }

/* ==================== LOGIN SCREEN ==================== */
.login-screen {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 48px 40px;
  width: 100%; max-width: 420px;
  text-align: center;
}
.login-logo {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 28px; font-weight: 800;
  margin: 0 auto 20px;
}
.login-title { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.login-subtitle { font-size: 14px; color: var(--text-tertiary); margin-bottom: 32px; }
.login-form { text-align: left; }
.login-form .form-input {
  padding: 14px 16px; font-size: 16px;
  text-align: center; letter-spacing: 1px;
}
.login-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 24px 0; color: var(--text-disabled); font-size: 13px;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.login-footer {
  margin-top: 28px; padding-top: 20px;
  border-top: 1px solid var(--border-light);
  font-size: 12px; color: var(--text-disabled);
}
.admin-code-display {
  background: var(--bg); border: 2px dashed var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  text-align: center; margin: 20px 0;
}
.admin-code-display span {
  font-size: 32px; font-weight: 800; letter-spacing: 10px;
  color: var(--primary);
  font-family: 'JetBrains Mono', monospace;
}

/* ==================== CALENDAR ==================== */
.calendar { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.calendar-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border-light);
}
.calendar-header h3 { font-size: 18px; font-weight: 700; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day-label {
  text-align: center; font-size: 12px; font-weight: 700;
  color: var(--text-tertiary); padding: 8px 0;
}
.cal-day-label:first-child { color: var(--danger); }
.cal-day-label:last-child { color: var(--info); }
.cal-day {
  min-height: 80px; padding: 6px 8px;
  border: 1px solid var(--border-light); border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--transition);
  background: var(--bg-card);
}
.cal-day:hover { background: var(--primary-50); border-color: var(--primary); }
.cal-day.today { background: var(--primary-50); border: 2px solid var(--primary); }
.cal-day.other { opacity: 0.35; }
.cal-day-num {
  font-size: 13px; font-weight: 600; margin-bottom: 4px;
}
.cal-day.sun .cal-day-num { color: var(--danger); }
.cal-day.sat .cal-day-num { color: var(--info); }
.cal-dot {
  display: inline-block; padding: 1px 5px; border-radius: 3px;
  font-size: 10px; font-weight: 600; margin: 1px;
}
.cal-dot.expire { background: var(--danger-light); color: var(--danger); }
.cal-dot.start { background: var(--success-light); color: var(--success); }
.cal-dot.new { background: var(--info-light); color: var(--info); }

/* ==================== MEMBER PORTAL ==================== */
.member-portal { max-width: 600px; margin: 0 auto; padding: 20px; min-height: 100vh; background: var(--bg); }
.member-portal-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; padding: 24px 20px; border-radius: var(--radius-lg);
  margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center;
}
.member-portal-header h2 { font-size: 18px; font-weight: 700; }
.member-portal-header p { font-size: 13px; opacity: 0.8; margin-top: 2px; }
.member-section { margin-bottom: 16px; }
.member-section-title {
  font-size: 15px; font-weight: 700; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
  color: var(--text);
}
.member-section-title .icon { color: var(--primary); }
.member-reg-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 12px;
}
.member-reg-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; padding: 16px 18px;
  display: flex; justify-content: space-between; align-items: center;
}
.member-reg-header h4 { font-size: 15px; font-weight: 600; }
.member-reg-body { padding: 16px 18px; }
.member-info-row {
  display: flex; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border-light);
}
.member-info-row:last-child { border-bottom: none; }
.member-info-label { font-size: 13px; color: var(--text-tertiary); }
.member-info-value { font-size: 14px; font-weight: 600; color: var(--text); }
.progress-bar-wrap { background: var(--bg); border-radius: var(--radius-full); height: 8px; overflow: hidden; margin-top: 10px; }
.progress-bar-fill { height: 100%; border-radius: var(--radius-full); background: linear-gradient(90deg, var(--primary), var(--secondary)); transition: width 0.5s ease; }

/* ==================== AUTOCOMPLETE ==================== */
.autocomplete { position: relative; }
.autocomplete-dropdown {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); margin-top: 4px;
  max-height: 200px; overflow-y: auto;
  z-index: 1000; box-shadow: var(--shadow-lg);
  display: none;
}
.autocomplete-dropdown.show { display: block; }
.autocomplete-item {
  padding: 10px 14px; cursor: pointer;
  transition: background 0.1s; font-size: 14px;
  border-bottom: 1px solid var(--border-light);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.active { background: var(--primary-50); }
.autocomplete-item small { display: block; color: var(--text-tertiary); font-size: 12px; margin-top: 2px; }

/* ==================== CONFIRM MODAL ==================== */
.confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5); backdrop-filter: blur(4px);
  z-index: 1500;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.confirm-box {
  background: var(--bg-card); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl); padding: 28px;
  max-width: 380px; width: 100%; text-align: center;
}
.confirm-box p { font-size: 15px; margin-bottom: 20px; line-height: 1.5; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }

/* ==================== EMPTY STATE ==================== */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-tertiary);
}
.empty-state .icon { font-size: 48px; opacity: 0.2; margin-bottom: 16px; }
.empty-state p { font-size: 15px; }

/* ==================== GENDER BUTTONS ==================== */
.gender-group { display: flex; gap: 10px; }
.gender-btn {
  flex: 1; padding: 12px; border: 1.5px solid var(--border);
  background: var(--bg-card); border-radius: var(--radius-md);
  font-weight: 500; font-size: 14px; cursor: pointer;
  transition: all var(--transition); text-align: center;
  color: var(--text-secondary);
}
.gender-btn:hover { border-color: var(--text-tertiary); }
.gender-btn.active-m { border-color: var(--info); background: var(--info-light); color: var(--info); }
.gender-btn.active-f { border-color: var(--danger); background: var(--danger-light); color: var(--danger); }

/* ==================== UTILITY ==================== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.ml-auto { margin-left: auto; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-muted { color: var(--text-tertiary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.font-mono { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }
.font-bold { font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.section-title {
  font-size: 18px; font-weight: 800; margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
}
.section-title .icon { color: var(--primary); font-size: 22px; }

.day-detail-list { max-height: 400px; overflow-y: auto; }
.day-detail-item {
  padding: 10px 0; border-bottom: 1px solid var(--border-light);
  display: flex; justify-content: space-between; align-items: center;
}
.day-detail-item:last-child { border-bottom: none; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.3);
    z-index: 199; display: none;
  }
  .sidebar-backdrop.show { display: block; }
  .main { margin-left: 0; }
  .hamburger { display: flex; }
  .content { padding: 16px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-box { max-width: none; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .cal-day { min-height: 56px; padding: 4px; }
  .cal-day-num { font-size: 11px; }
  .cal-dot { font-size: 9px; padding: 0 3px; }
  .login-card { padding: 32px 24px; }
  .table-wrap { border-radius: var(--radius-md); }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 22px; }
  .modal { margin: 12px; border-radius: var(--radius-lg); }
}

/* ==================== FADE IN ==================== */
.fade-in { animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ==================== TABS ==================== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  padding: 10px 18px; border: none; background: transparent;
  font-size: 14px; font-weight: 500; color: var(--text-tertiary);
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: all var(--transition);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
