/* ============================================================
   LMS Admin — Unified CSS (v3.0)
   통합 관리자 스타일시트
   Font: Noto Sans KR  |  Base: 14px → 15px (가독성 향상)
   ============================================================ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── CSS Variables ── */
:root {
  --bg:         #f0f2f7;
  --sidebar-w:  240px;
  --header-h:   60px;
  --white:      #ffffff;
  --primary:    #3b6bfe;
  --primary-d:  #2a52d6;
  --primary-l:  #eef1ff;
  --danger:     #ef4444;
  --warning:    #f59e0b;
  --success:    #10b981;
  --info:       #3b82f6;
  --text:       #1e2235;
  --text-sub:   #6b7280;
  --border:     #e5e8f0;
  --radius:     8px;
  --shadow:     0 1px 4px rgba(0,0,0,.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,.1);
  --font-base:  15px;
}

html, body {
  height: 100%;
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: var(--font-base);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── 상단 헤더 ── */
#admin-header {
  position: fixed;
  top: 0; left: var(--sidebar-w); right: 0;
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.header-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.btn-sidebar-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--text-sub); padding: 6px; border-radius: 6px;
  transition: background .15s;
  display: none;
}
.btn-sidebar-toggle:hover { background: var(--bg); }
.breadcrumb {
  font-size: .85rem; color: var(--text-sub);
  display: flex; align-items: center; gap: 6px;
}
.breadcrumb span { color: var(--text); font-weight: 500; }

.header-right { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.header-admin-info {
  display: flex; align-items: center; gap: 9px;
  font-size: .88rem;
}
.header-admin-info .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary);
  color: #fff; font-weight: 700; font-size: .82rem;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: -.5px;
}
.header-admin-info .name { font-weight: 600; color: var(--text); }
.header-admin-info .role { font-size: .78rem; color: var(--text-sub); margin-top: 1px; }

.btn-logout {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px 14px;
  font-family: inherit; font-size: .82rem; color: var(--text-sub);
  cursor: pointer; transition: all .15s;
  display: flex; align-items: center; gap: 5px;
  text-decoration: none;
}
.btn-logout:hover { border-color: var(--danger); color: var(--danger); text-decoration: none; }

/* ── 사이드바 ── */
#admin-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: #1a2035;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 200;
  transition: transform .25s;
}
#admin-sidebar::-webkit-scrollbar { width: 4px; }
#admin-sidebar::-webkit-scrollbar-thumb { background: #2e3650; border-radius: 4px; }

.sidebar-brand {
  height: var(--header-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid #252d45;
  color: #fff;
  text-decoration: none;
}
.sidebar-brand:hover { text-decoration: none; }
.sidebar-brand .logo-box {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .78rem; color: #fff;
  flex-shrink: 0;
}
.sidebar-brand .site-name { font-size: .88rem; font-weight: 700; line-height: 1.2; }
.sidebar-brand .admin-tag { font-size: .7rem; color: #7080a0; margin-top: 1px; }

.sidebar-section {
  padding: 20px 14px 6px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #3e4f6e;
}
.sidebar-menu { list-style: none; padding: 0 8px; }
.sidebar-item { border-radius: 8px; overflow: hidden; margin-bottom: 2px; }

.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #8090b0;
  text-decoration: none;
  font-size: .88rem;
  font-weight: 500;
  transition: background .15s, color .15s;
  position: relative;
}
.sidebar-link:hover,
.sidebar-link.active {
  background: #252e4a;
  color: #e0e6f8;
  text-decoration: none;
}
.sidebar-link.active {
  background: rgba(59,107,254,.25);
  color: #7ba3ff;
}
.sidebar-link.active::before {
  content: '';
  position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; border-radius: 0 2px 2px 0;
  background: #3b6bfe;
}
.s-ico { width: 18px; height: 18px; flex-shrink: 0; }
.chevron { width: 14px; height: 14px; margin-left: auto; opacity: .5; }

/* 서브메뉴 */
.sidebar-sub { list-style: none; padding: 0 0 6px 28px; display: none; }
.sidebar-item.open .sidebar-sub { display: block; }
.sidebar-sub li a {
  display: block;
  padding: 6px 12px;
  font-size: .83rem;
  color: #7080a0;
  text-decoration: none;
  border-radius: 6px;
  transition: all .15s;
}
.sidebar-sub li a:hover, .sidebar-sub li a.active { background: #252e4a; color: #c0d0f0; text-decoration: none; }

/* ── 플래시 메시지 ── */
#flash-messages {
  position: fixed; top: calc(var(--header-h) + 12px);
  right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
  max-width: 380px;
}
.flash-item {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .88rem;
  font-weight: 500;
  display: flex; align-items: flex-start; gap: 9px;
  box-shadow: var(--shadow-md);
  animation: slideIn .3s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.flash-success { background: #ecfdf5; border: 1px solid #6ee7b7; color: #065f46; }
.flash-error   { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.flash-warning { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
.flash-info    { background: #eff6ff; border: 1px solid #93c5fd; color: #1e40af; }

/* ── 메인 콘텐츠 ── */
#admin-main {
  margin-left: var(--sidebar-w);
  padding-top: var(--header-h);
  min-height: 100vh;
}
.admin-content { padding: 28px; }

/* ── 공통 카드 ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.card-header h5 { font-size: .95rem; font-weight: 600; }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); background: #fafbfd; border-radius: 0 0 var(--radius) var(--radius); }

/* ── 페이지 타이틀 ── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; gap: 12px; flex-wrap: wrap;
}
.page-header h2 { font-size: 1.2rem; font-weight: 700; }
.page-header .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-desc { font-size: .88rem; color: var(--text-sub); margin-top: 4px; }

/* ── 버튼 ── */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 16px;
  border-radius: var(--radius); border: 1px solid transparent;
  font-family: inherit; font-size: .88rem; font-weight: 500;
  cursor: pointer; text-decoration: none;
  transition: all .15s; white-space: nowrap;
  line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn-sm { padding: 5px 11px; font-size: .82rem; }
.btn-lg { padding: 10px 22px; font-size: .95rem; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-d); border-color: var(--primary-d); color: #fff; }
.btn-outline { background: var(--white); color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--bg); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #059669; color: #fff; }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-warning:hover { background: #d97706; color: #fff; }
.btn-info { background: var(--info); color: #fff; border-color: var(--info); }
.btn-info:hover { background: #2563eb; color: #fff; }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* ── 테이블 ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.admin-table th {
  background: #f8f9fc; color: var(--text-sub);
  font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .3px;
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  white-space: nowrap; text-align: left;
}
table.admin-table td {
  padding: 12px 14px; border-bottom: 1px solid #f0f2f7;
  vertical-align: middle;
}
table.admin-table tbody tr:hover { background: #fafbff; }
table.admin-table tbody tr:last-child td { border-bottom: none; }
table.admin-table .text-center { text-align: center; }
table.admin-table .text-right { text-align: right; }
table.admin-table .nowrap { white-space: nowrap; }

/* ── 배지 ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: .78rem; font-weight: 600; white-space: nowrap;
}
.badge-primary { background: var(--primary-l); color: var(--primary); }
.badge-success { background: #ecfdf5; color: #065f46; }
.badge-danger  { background: #fef2f2; color: #991b1b; }
.badge-warning { background: #fffbeb; color: #92400e; }
.badge-info    { background: #eff6ff; color: #1e40af; }
.badge-gray    { background: #f3f4f6; color: #6b7280; }

/* ── 폼 ── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; color: var(--text-sub); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 9px 13px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: .92rem; color: var(--text);
  background: var(--white); outline: none; transition: border-color .15s, box-shadow .15s;
  line-height: 1.5;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,107,254,.12); }
.form-control:disabled, .form-control[readonly] { background: #f3f4f6; color: #9ca3af; cursor: not-allowed; }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
.form-check { display: flex; align-items: center; gap: 7px; cursor: pointer; font-size: .9rem; }
.form-check input[type=checkbox], .form-check input[type=radio] { width: 17px; height: 17px; cursor: pointer; accent-color: var(--primary); }
textarea.form-control { resize: vertical; min-height: 80px; }
.text-danger { color: var(--danger); font-size: .82rem; margin-top: 4px; }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-muted { color: var(--text-sub); }
.required { color: var(--danger); margin-left: 2px; }
.form-inline { display: flex; align-items: center; gap: 8px; }
.form-inline .form-control { width: auto; }

/* ── 검색 필터 박스 ── */
.search-box {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  margin-bottom: 16px; box-shadow: var(--shadow);
}
.search-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-row .form-control, .search-row .form-select { width: auto; min-width: 140px; }
.search-row .btn { flex-shrink: 0; }

/* ── 페이지네이션 ── */
.pagination { display: flex; align-items: center; gap: 4px; list-style: none; padding: 0; margin: 20px 0 0; justify-content: center; }
.page-item .page-link {
  display: flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 6px; border-radius: 6px;
  font-size: .82rem; font-weight: 500; color: var(--text-sub);
  background: var(--white); border: 1px solid var(--border);
  text-decoration: none; transition: all .15s;
}
.page-item .page-link:hover { background: var(--primary-l); color: var(--primary); border-color: var(--primary-l); text-decoration: none; }
.page-item.active .page-link { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-item.disabled .page-link { color: #ccc; cursor: default; pointer-events: none; }

/* ── 모달 ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 9000;
  align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: #fff; border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: 100%; max-width: 520px; margin: 20px;
  animation: modalIn .2s ease;
  max-height: 90vh; overflow-y: auto;
}
@keyframes modalIn { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h5 { font-size: .95rem; font-weight: 700; }
.modal-body { padding: 20px 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.btn-modal-close { background: none; border: none; cursor: pointer; color: var(--text-sub); padding: 2px; }
.btn-modal-close:hover { color: var(--danger); }
.modal-lg .modal-box { max-width: 720px; }

/* ── 관리자 푸터 ── */
#admin-footer {
  padding: 14px 28px;
  text-align: right;
  font-size: .78rem;
  color: #a0a8c0;
  border-top: 1px solid var(--border);
  background: #fff;
}

/* ── 탭 ── */
.tab-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px;
  box-shadow: var(--shadow);
}
.tab-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-sub);
  text-decoration: none;
  border-radius: 6px;
  white-space: nowrap;
  transition: all .2s ease;
}
.tab-nav a:hover {
  color: var(--text);
  background: #f3f4f8;
  text-decoration: none;
}
.tab-nav a.active {
  color: var(--white);
  background: var(--primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(59,107,254,.3);
}
.tab-nav .tab-count {
  display: inline-block;
  padding: 0 7px;
  min-width: 20px;
  text-align: center;
  border-radius: 10px;
  font-size: .7rem;
  font-weight: 600;
  line-height: 18px;
  background: #eef0f4;
  color: var(--text-sub);
}
.tab-nav a:hover .tab-count {
  background: #e4e6ec;
}
.tab-nav a.active .tab-count {
  background: rgba(255,255,255,.25);
  color: var(--white);
}
.tab-nav .tab-badge {
  display: inline-block;
  padding: 0 7px;
  min-width: 20px;
  text-align: center;
  border-radius: 10px;
  font-size: .7rem;
  font-weight: 700;
  line-height: 18px;
  background: var(--danger);
  color: #fff;
}

/* ── 통계 카드 ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow);
}
.stat-card .label { font-size: .82rem; color: var(--text-sub); font-weight: 500; margin-bottom: 8px; }
.stat-card .value { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.stat-card .change { font-size: .78rem; margin-top: 4px; }
.stat-card .change.up { color: var(--success); }
.stat-card .change.down { color: var(--danger); }

/* ── 유틸리티 ── */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }
.p-0 { padding: 0 !important; }
.p-2 { padding: 16px !important; }
.d-flex { display: flex; }
.d-none { display: none; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.fw-bold { font-weight: 700; }
.fw-normal { font-weight: 400; }
.fs-sm { font-size: .82rem; }
.fs-lg { font-size: 1.1rem; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }

/* ── 반응형 폼 그리드 유틸리티 ── */
.form-grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

/* ── 대시보드 KPI 그리드 ── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi-grid .card .card-body { padding: 18px 20px; }
.kpi-grid .kpi-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.kpi-grid .kpi-label { font-size: .72rem; font-weight: 600; color: var(--text-sub); text-transform: uppercase; letter-spacing: .5px; }
.kpi-grid .kpi-value { font-size: 1.7rem; font-weight: 800; color: var(--text); line-height: 1.1; margin-top: 4px; }
.kpi-grid .kpi-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kpi-grid .kpi-bottom { display: flex; gap: 14px; font-size: .74rem; color: var(--text-sub); flex-wrap: wrap; }

/* ── 대시보드 2단 그리드 ── */
.dash-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.dash-grid-main { grid-template-columns: 1fr 380px; }
.dash-grid-sub  { grid-template-columns: 1fr 340px; }

/* ── 회원 목록 아이템 ── */
.member-list { list-style: none; padding: 0; margin: 0; }
.member-item { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid #f5f6fa; }
.member-avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg,#3b6bfe,#7c3aed); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; flex-shrink: 0; }
.member-info { flex: 1; min-width: 0; }
.member-info .name { font-weight: 600; font-size: .83rem; }
.member-info .uid { font-size: .73rem; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-meta { text-align: right; flex-shrink: 0; }
.member-meta .date { font-size: .72rem; color: var(--text-sub); }

/* ── 수료 현황 박스 ── */
.cert-row { display: flex; align-items: center; justify-content: space-between; padding: 14px; background: #f8f9fc; border-radius: 8px; }
.cert-row .cert-label { font-size: .72rem; color: var(--text-sub); font-weight: 600; margin-bottom: 4px; }
.cert-row .cert-value { font-size: 1.4rem; font-weight: 800; }
.cert-row .cert-unit  { font-size: .8rem; font-weight: 400; color: var(--text-sub); margin-left: 3px; }

/* ── 수강 프로그레스 ── */
.enroll-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.enroll-bar-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.enroll-bar-label { font-size: .77rem; flex: 1; }
.enroll-bar-count { font-size: .77rem; font-weight: 600; }
.enroll-bar-pct { font-size: .72rem; color: var(--text-sub); width: 38px; text-align: right; }
.enroll-bar-track { height: 4px; background: #e5e7eb; border-radius: 2px; margin-bottom: 8px; overflow: hidden; }
.enroll-bar-fill { height: 100%; border-radius: 2px; }

/* ── .tbl 호환 (retake_manage 등에서 사용) ── */
table.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.tbl th {
  background: #f8f9fc; color: var(--text-sub);
  font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .3px;
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  white-space: nowrap; text-align: left;
}
table.tbl td {
  padding: 12px 14px; border-bottom: 1px solid #f0f2f7;
  vertical-align: middle;
}
table.tbl tbody tr:hover { background: #fafbff; }
table.tbl .text-center { text-align: center; }

/* ── stat-row / stat-chip (retake_manage, bulk_upload) ── */
.stat-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.stat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius);
  background: var(--white); border: 1px solid var(--border);
  font-size: .82rem; font-weight: 500; box-shadow: var(--shadow);
  white-space: nowrap;
}
.stat-chip strong { font-weight: 700; font-size: .95rem; }

/* ── detail-panel (retake_manage) ── */
.detail-panel {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); margin-bottom: 16px;
}

/* ── bulk-grid (bulk_upload) ── */
.bulk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 20px; }

/* ── action-btns (retake_manage) ── */
.action-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── 공통 모바일 카드 그리드 (건수/통계 카드) ── */
.m-stat-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}
.m-stat-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.m-stat-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.m-stat-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.m-stat-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.m-stat-grid.cols-6 { grid-template-columns: repeat(6, 1fr); }
.m-stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.m-stat-card .m-stat-label { font-size: .72rem; color: var(--text-sub); font-weight: 500; margin-bottom: 4px; }
.m-stat-card .m-stat-value { font-size: 1.3rem; font-weight: 700; }

/* ── 사이드바 레이아웃 (카테고리+테이블) ── */
.side-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
}

/* ── 2단 레이아웃 유틸리티 ── */
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-sidebar-r { display: grid; grid-template-columns: 1fr 280px; gap: 16px; }

/* ── 인라인 필터 폼 (inline flex wrap) ── */
.filter-inline {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.filter-inline .form-control,
.filter-inline .form-select { min-width: 0; }

/* ── 모바일 테이블 카드뷰 전환 ── */
.mobile-card-list { display: none; }

/* ── 인라인 폼 그리드 (system pages) ── */
.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

/* ============================================================
   반응형 (Mobile-first optimization)
   ============================================================ */

@media (max-width: 992px) {
  #admin-sidebar { transform: translateX(-100%); }
  #admin-sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.25); }
  #admin-header { left: 0; }
  #admin-main { margin-left: 0; }
  .btn-sidebar-toggle { display: flex; }
  .form-grid-4 { grid-template-columns: 1fr 1fr; }
  /* KPI 그리드 2열 */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  /* 대시보드 2단 → 1단 */
  .dash-grid-main, .dash-grid-sub { grid-template-columns: 1fr; }
  /* 사이드바 레이아웃 1단 */
  .side-layout { grid-template-columns: 1fr; }
  /* 2단 유틸 1단 */
  .grid-sidebar-r { grid-template-columns: 1fr; }
  /* stat 그리드 축소 */
  .m-stat-grid.cols-5, .m-stat-grid.cols-6 { grid-template-columns: repeat(3, 1fr); }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .admin-content { padding: 20px 16px; }
  .search-row { flex-direction: column; align-items: stretch; }
  .search-row .form-control, .search-row .form-select { width: 100%; min-width: 0; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  /* 헤더 반응형 */
  #admin-header { padding: 0 12px; gap: 8px; }
  .header-left { gap: 8px; min-width: 0; flex: 1; }
  .breadcrumb { font-size: .78rem; min-width: 0; }
  .breadcrumb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; display: inline-block; vertical-align: middle; }
  .header-right { gap: 8px; flex-shrink: 0; }
  .header-admin-info .name { font-size: .8rem; }
  .header-admin-info .role { display: none; }
  .btn-logout { padding: 5px 10px; font-size: .78rem; }
  .form-grid-4 { grid-template-columns: 1fr 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }

  /* 테이블 가로 스크롤 */
  .table-wrap { margin: 0 -16px; padding: 0 16px; }

  /* 탭 내비 스크롤 */
  .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; gap: 4px; }
  .tab-nav a { flex-shrink: 0; padding: 6px 10px; font-size: .75rem; }

  /* stat-row / stat-chip */
  .stat-row { gap: 8px; }
  .stat-chip { padding: 6px 12px; font-size: .78rem; flex: 1 1 auto; min-width: 0; justify-content: center; }

  /* detail-panel */
  .detail-panel { padding: 16px; }

  /* bulk-grid 2열 */
  .bulk-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  /* action-btns 풀폭 */
  .action-btns { flex-direction: column; }
  .action-btns .btn { width: 100%; justify-content: center; }

  /* 카드 헤더 */
  .card-header { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .card-body { padding: 16px; }

  /* 모달 */
  .modal-box { max-width: calc(100vw - 32px); margin: 16px; }
  .modal-header { padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px; flex-wrap: wrap; }

  /* 페이지네이션 */
  .pagination { gap: 3px; flex-wrap: wrap; }
  .page-item .page-link { min-width: 30px; height: 30px; font-size: .78rem; }

  /* 플래시 메시지 */
  #flash-messages { left: 16px; right: 16px; max-width: none; }

  /* stat 그리드 2열 */
  .m-stat-grid.cols-3, .m-stat-grid.cols-4,
  .m-stat-grid.cols-5, .m-stat-grid.cols-6 { grid-template-columns: repeat(2, 1fr); }
  .m-stat-card .m-stat-value { font-size: 1.1rem; }

  /* 인라인 필터 세로 스택 */
  .filter-inline { flex-direction: column; align-items: stretch; }
  .filter-inline .form-control,
  .filter-inline .form-select { width: 100% !important; min-width: 0 !important; }

  /* form-grid-3 → 1열 */
  .form-grid-3 { grid-template-columns: 1fr; }

  /* 2열 유틸 */
  .grid-2col { grid-template-columns: 1fr; }

  /* 768px 숨김 */
  .hide-tablet { display: none !important; }
}

@media (max-width: 640px) {
  .admin-content { padding: 16px 12px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-header .actions { width: 100%; }
  .page-header .actions .btn { flex: 1; justify-content: center; font-size: .78rem; }
  .stat-grid { grid-template-columns: 1fr; }

  /* KPI 2열 유지 (모바일에서도 한줄 2개 카드) */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  /* stat 그리드 1열 (글자 많은 카드) */
  .m-stat-grid.cols-1-mobile { grid-template-columns: 1fr; }
  .m-stat-grid.cols-5, .m-stat-grid.cols-6 { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid .kpi-value { font-size: 1.4rem; }
  .kpi-grid .kpi-icon { width: 36px; height: 36px; }

  /* 테이블 모바일 최적화 */
  table.admin-table { font-size: .82rem; }
  table.admin-table th, table.admin-table td { padding: 9px 10px; }
  table.tbl { font-size: .82rem; }
  table.tbl th, table.tbl td { padding: 9px 10px; }

  /* 숨길 컬럼 지원 */
  .hide-mobile { display: none !important; }

  .form-grid-4 { grid-template-columns: 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }

  /* 헤더 추가 축소 */
  #admin-header { padding: 0 10px; }
  .header-admin-info { gap: 6px; }
  .header-admin-info .avatar { width: 28px; height: 28px; font-size: .72rem; }
  .breadcrumb span { max-width: 80px; }

  /* 버튼 터치 영역 확보 */
  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; padding: 6px 12px; }

  /* 수료 현황 */
  .cert-row { padding: 12px; }
  .cert-row .cert-value { font-size: 1.2rem; }

  /* stat-chip 풀폭 */
  .stat-chip { flex: 1 1 100%; }

  /* bulk-grid 1열 */
  .bulk-grid { grid-template-columns: 1fr; }

  /* 회원 목록 */
  .member-item { padding: 10px 14px; gap: 10px; }
  .member-avatar { width: 30px; height: 30px; font-size: .68rem; }
  .member-info .name { font-size: .8rem; }

  /* 검색 박스 */
  .search-box { padding: 14px 12px; }

  /* 카드 */
  .card { margin-bottom: 14px; }
  .card-header h5 { font-size: .88rem; }
}

/* ── 480px 이하 극소화면(작은 모바일) ── */
@media (max-width: 480px) {
  .admin-content { padding: 12px 8px; }
  #admin-header { height: 50px; }
  #admin-main { padding-top: 50px; }
  .sidebar-brand { height: 50px; }

  .breadcrumb { display: none; }
  .header-admin-info .name { max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* KPI 축소 */
  .kpi-grid .kpi-value { font-size: 1.2rem; }
  .kpi-grid .kpi-bottom { font-size: .68rem; gap: 8px; }
  .kpi-grid .kpi-icon { width: 32px; height: 32px; }
  .kpi-grid .kpi-icon svg { width: 16px; height: 16px; }

  /* 카드 더 축소 */
  .card-header { padding: 10px 12px; }
  .card-body { padding: 12px; }

  /* 테이블 최소 폰트 */
  table.admin-table, table.tbl { font-size: .78rem; }
  table.admin-table th, table.admin-table td,
  table.tbl th, table.tbl td { padding: 7px 8px; }

  /* 페이지네이션 간소화 */
  .page-item .page-link { min-width: 28px; height: 28px; font-size: .72rem; padding: 0 4px; }

  /* 모달 풀스크린 */
  .modal-box { margin: 0; border-radius: 0; max-width: 100vw; max-height: 100vh; height: 100vh; }

  /* 버튼 풀폭 */
  .page-header .actions { flex-direction: column; }
  .page-header .actions .btn { width: 100%; }
}

/* ============================================================
   모바일 반응형 stat grid 및 테이블 (대시보드용)
   ============================================================ */

/* Stat Grid - responsive columns */
.m-stat-grid {
  display: grid;
  gap: 15px;
  margin-bottom: 30px;
}

.m-stat-grid.cols-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.m-stat-grid.cols-3 {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.m-stat-grid.cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

/* Stat Card */
.m-stat-card {
  padding: 0;
  text-align: center;
}

.m-stat-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 10px;
  display: block;
}

.m-stat-value {
  font-size: 32px;
  font-weight: bold;
  display: block;
  line-height: 1.2;
  margin: 0;
}

/* 2-column grid layout */
.grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

/* Table wrapper for responsive tables */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  padding: 0;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  table-layout: auto;
}

/* Mobile responsive for stat grids */
@media (max-width: 1024px) {
  .m-stat-grid.cols-4 {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .m-stat-grid.cols-3 {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .m-stat-value {
    font-size: 26px;
  }
}

@media (max-width: 768px) {
  .m-stat-grid.cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .m-stat-grid.cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-2col {
    grid-template-columns: 1fr;
  }

  .m-stat-label {
    font-size: 11px;
  }

  .m-stat-value {
    font-size: 24px;
  }

  /* Tables responsive on mobile - font/padding 축소만 (카드형 변환은 data-label 필요하므로 제거) */
  .admin-table {
    font-size: 13px;
  }

  .admin-table th,
  .admin-table td {
    padding: 10px 8px;
  }
}

@media (max-width: 480px) {
  .m-stat-grid.cols-4,
  .m-stat-grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .m-stat-value {
    font-size: 22px;
  }

  .m-stat-label {
    font-size: 10px;
  }
}

/* ============================================================
   Mobile Responsive Optimization (v1.0)
   모바일 반응형 최적화
============================================================ */

/* Form Grid Layout Classes */
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.form-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

/* Mobile Form Grid */
.m-form-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

/* Filter Inline Form */
.filter-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-item label {
  font-size: 12px;
  color: #6b7280;
  display: block;
  margin-bottom: 3px;
  font-weight: 500;
}

.filter-item input,
.filter-item select {
  font-size: 13px;
}

.date-range {
  flex: 1;
  min-width: 300px;
}

.date-inputs {
  display: flex;
  gap: 6px;
  align-items: center;
}

.date-sep {
  color: #9ca3af;
  margin: 0 6px;
}

.filter-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Form Actions */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 30px;
}

/* Character Counter */
.char-counter {
  color: #9ca3af;
  font-size: 12px;
}

/* Table Wrapper */
.table-wrap {
  overflow-x: auto;
  margin: 0;
}

/* Hide Mobile */
.hide-mobile {
  display: table-cell;
}

/* Card Header Responsive */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-weight: 600;
}

.card-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}

.card-header-hint {
  font-size: 12px;
  color: #6b7280;
  font-weight: normal;
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 2px solid #f0f0f0;
}

.tab-link {
  flex: 1;
  min-width: 120px;
  padding: 15px;
  text-align: center;
  text-decoration: none;
  color: #333;
  font-weight: normal;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.tab-link.active {
  border-bottom-color: #007bff;
  color: #007bff;
  font-weight: bold;
}

.tab-link:hover {
  background: #f9fafb;
}

/* Stat Grid */
.m-stat-grid {
  display: grid;
  gap: 12px;
}

.m-stat-grid.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.m-stat-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.m-stat-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.m-stat-label {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 8px;
}

.m-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #1e2235;
}

/* Pagination */
.pagination {
  display: flex;
  gap: 4px;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.page-item {
  display: inline-block;
}

.page-link {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  text-decoration: none;
  color: #333;
  transition: all 0.2s;
}

.page-link:hover {
  background: #f0f2f7;
  border-color: #3b6bfe;
  color: #3b6bfe;
}

.page-link.active {
  background: #3b6bfe;
  color: white;
  border-color: #3b6bfe;
}

.page-link.disabled {
  color: #999;
  cursor: not-allowed;
}

/* Mobile Responsive Breakpoints */
@media (max-width: 1024px) {
  .form-grid-4 { grid-template-columns: repeat(3, 1fr); }
  .form-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .m-form-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .m-stat-grid.cols-4 { grid-template-columns: repeat(3, 1fr); }
  .m-stat-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  /* Form Grids */
  .form-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .form-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .form-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .m-form-grid-2 { grid-template-columns: 1fr; }

  /* Stat Grids */
  .m-stat-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .m-stat-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .m-stat-value { font-size: 24px; }

  /* Filter Form */
  .filter-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-item {
    width: 100%;
  }

  .filter-item input,
  .filter-item select {
    width: 100%;
  }

  .date-range {
    min-width: 100%;
  }

  .date-inputs {
    width: 100%;
  }

  .date-inputs input {
    flex: 1;
  }

  .filter-actions {
    width: 100%;
  }

  .filter-actions .btn {
    flex: 1;
  }

  /* Form Actions */
  .form-actions {
    justify-content: stretch;
  }

  .form-actions .btn {
    flex: 1;
  }

  /* Tab Navigation */
  .tab-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-link {
    min-width: 100px;
    padding: 12px 10px;
    font-size: 13px;
    flex-shrink: 0;
  }

  /* Hide Mobile - Table Cells */
  .hide-mobile {
    display: none !important;
  }

  /* Card Header */
  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Table on Mobile - font 축소 (카드형 변환은 data-label 미지원 페이지와 충돌하므로 제거) */
  .admin-table {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  /* Form Grids */
  .form-grid-4, .form-grid-3, .form-grid-2, .m-form-grid-2 {
    grid-template-columns: 1fr;
  }

  /* Stat Grids */
  .m-stat-grid.cols-4, .m-stat-grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .m-stat-value { font-size: 22px; }
  .m-stat-label { font-size: 10px; }

  /* Pagination */
  .pagination { gap: 2px; }
  .page-link { padding: 4px 8px; font-size: 12px; }

  /* Button responsive */
  .btn { min-height: 40px; }

  /* Tab Navigation compact */
  .tab-link {
    padding: 10px 8px;
    font-size: 12px;
    min-width: 80px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE OPTIMIZATION — List View Components
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────────
   Filter & Search Components
   ─────────────────────────────────────────────────────────────────────────────── */
.search-box {
  margin: 16px 0;
  background: var(--white);
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.search-row.filter-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.search-row.filter-inline select.form-control,
.search-row.filter-inline input.form-control {
  flex: 1;
  min-width: 120px;
}

.search-input {
  flex: 1;
  min-width: 160px;
  max-width: 100%;
}

.date-separator {
  color: var(--text-sub);
  padding: 0 4px;
}

@media (max-width: 768px) {
  .search-row.filter-inline {
    gap: 8px;
  }

  .search-row.filter-inline select.form-control,
  .search-row.filter-inline input.form-control {
    min-width: 100px;
  }
}

@media (max-width: 480px) {
  .search-row.filter-inline {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .search-row.filter-inline button,
  .search-row.filter-inline a {
    grid-column: span 1;
  }

  .search-input {
    grid-column: span 2;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Card Header Actions
   ─────────────────────────────────────────────────────────────────────────────── */
.card-count {
  color: var(--text-sub);
  font-weight: 400;
  font-size: 0.8rem;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .header-actions {
    gap: 6px;
  }
}

@media (max-width: 480px) {
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .header-actions {
    width: 100%;
    flex-direction: column;
  }

  .header-actions button,
  .header-actions form {
    width: 100%;
  }

  .header-actions button {
    display: block;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Table Column Management
   ─────────────────────────────────────────────────────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 12px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

/* Column width classes */
.col-checkbox { width: 38px; text-align: center; }
.col-num { width: 55px; text-align: center; }
.col-company { min-width: 100px; }
.col-manager { width: 90px; }
.col-type { width: 80px; text-align: center; }
.col-course { width: 130px; }
.col-count { width: 70px; text-align: center; }
.col-date { width: 100px; }
.col-status { width: 70px; text-align: center; }
.col-admin { width: 90px; }
.col-regdate { width: 95px; text-align: center; }

.col-rating { width: 45px; text-align: center; }
.col-content { min-width: 200px; }
.col-author { width: 70px; }
.col-public { width: 55px; text-align: center; }
.col-blind { width: 55px; text-align: center; }
.col-report { width: 45px; text-align: center; }
.col-reply { width: 45px; text-align: center; }
.col-action { width: 60px; text-align: center; }

.col-category { width: 100px; }
.col-priority { width: 55px; text-align: center; }
.col-subject { min-width: 180px; }
.col-counselor { width: 90px; }
.col-phone { width: 110px; }

/* ─────────────────────────────────────────────────────────────────────────────
   Hide/Show for Responsive
   ─────────────────────────────────────────────────────────────────────────────── */
.hide-mobile { display: table-cell; }
.hide-sm { display: table-cell; }
.hide-md { display: table-cell; }

@media (max-width: 1024px) {
  .hide-md { display: none !important; }
}

@media (max-width: 768px) {
  .hide-sm { display: none !important; }
}

@media (max-width: 480px) {
  .hide-mobile { display: none !important; }
  .hide-sm { display: none !important; }
  .hide-md { display: none !important; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Text Alignment Helpers
   ─────────────────────────────────────────────────────────────────────────────── */
.text-center { text-align: center; }

/* ─────────────────────────────────────────────────────────────────────────────
   Table Row States
   ─────────────────────────────────────────────────────────────────────────────── */
.empty-row {
  text-align: center;
  padding: 30px !important;
  color: var(--text-sub);
}

.row-blinded {
  opacity: 0.65;
}

.row-completed {
  opacity: 0.65;
}

.row-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.row-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.row-num {
  font-size: 0.75rem;
  color: var(--text-sub);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Inline Table Content Helpers
   ─────────────────────────────────────────────────────────────────────────────── */
.badge-new {
  background: var(--danger);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  margin-left: 4px;
  display: inline-block;
}

.manager-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.manager-name {
  font-size: 0.82rem;
}

.manager-tel {
  font-size: 0.75rem;
  color: var(--text-sub);
}

.course-title {
  font-size: 0.82rem;
}

.emp-count {
  font-size: 0.83rem;
  font-weight: 600;
}

.days-left {
  color: var(--danger);
  font-size: 0.7rem;
  margin-left: 3px;
}

.admin-name {
  font-size: 0.82rem;
}

.reg-date {
  font-size: 0.75rem;
  color: var(--text-sub);
}

.review-content {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
}

.rating-stars {
  color: var(--warning);
  font-size: 0.95rem;
}

.rating-value {
  color: var(--text-sub);
  font-size: 0.75rem;
}

.author-name {
  font-size: 0.82rem;
}

.category-name {
  font-size: 0.82rem;
  color: var(--text-sub);
}

.priority-empty {
  color: var(--text-sub);
}

.counselor-name {
  font-size: 0.82rem;
}

.phone-number {
  font-size: 0.78rem;
  color: var(--text-sub);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Pagination
   ─────────────────────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
}

.page-item {
  display: inline-block;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  min-width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.15s;
}

.page-link:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-l);
}

.page-link.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.page-link.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Modal (Review Reply Modal)
   ─────────────────────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.4);
  align-items: center;
  justify-content: center;
}

.modal-overlay.modal-active {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  width: 560px;
  max-width: 95vw;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.modal-title {
  margin: 0 0 12px;
  font-size: 16px;
}

.modal-preview {
  background: #f9fafb;
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 12px;
  max-height: 100px;
  overflow: auto;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.modal-content textarea {
  margin-bottom: 12px;
}

@media (max-width: 480px) {
  .modal-content {
    padding: 20px;
    width: 90vw;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions button {
    width: 100%;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Responsive Table Adjustments
   ─────────────────────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .admin-table {
    font-size: 0.9rem;
  }

  .admin-table th,
  .admin-table td {
    padding: 10px 6px;
  }

  .col-company { min-width: 80px; }
  .col-course { width: 100px; }
}

@media (max-width: 768px) {
  .table-wrap {
    overflow-x: auto;
  }

  .admin-table {
    font-size: 0.85rem;
    min-width: 600px;
  }

  .admin-table th,
  .admin-table td {
    padding: 8px 4px;
  }

  .search-row.filter-inline {
    gap: 6px;
  }

  .search-row.filter-inline select,
  .search-row.filter-inline input {
    min-width: 90px;
  }
}

@media (max-width: 480px) {
  .admin-table {
    font-size: 0.75rem;
  }

  .col-checkbox { width: 32px; }
  .col-company { min-width: 60px; }
  .col-date { width: 70px; }
  .col-status { width: 60px; }

  .review-content {
    max-width: 100%;
  }
}
