/* ═══════════════════════════════════════════════════════
   SMS 솔루션 회원 사이트 — 공통 스타일
   ═══════════════════════════════════════════════════════ */

:root {
  --primary:      #4361ee;
  --primary-dark: #3a0ca3;
  --secondary:    #7209b7;
  --success:      #2dc653;
  --warning:      #f8961e;
  --danger:       #ef233c;
  --info:         #4cc9f0;
  --light:        #f8f9fa;
  --dark:         #212529;
  --gray-100:     #f8f9fa;
  --gray-200:     #e9ecef;
  --gray-300:     #dee2e6;
  --gray-400:     #ced4da;
  --gray-500:     #adb5bd;
  --gray-600:     #6c757d;
  --gray-700:     #495057;
  --gray-800:     #343a40;
  --gray-900:     #212529;
  --sidebar-width: 240px;
  --topbar-height: 64px;
  --radius:       8px;
  --shadow:       0 2px 8px rgba(0,0,0,.08);
  --font:         'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  color: var(--gray-800);
  background: var(--gray-100);
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── 레이아웃 ─────────────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ── 사이드바 ─────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: #1e2235;
  color: #c8cde4;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow: hidden;
  z-index: 100;
  transition: transform .3s ease;
}

.sidebar-logo {
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}

.sidebar-logo img { height: 32px; }

.sidebar-brand {
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-brand img { flex-shrink: 0; }

.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: rgba(200,205,228,.45);
  padding: 10px 16px 2px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  margin: 0;
  color: rgba(200,205,228,.82);
  font-size: 14px;
  font-weight: 400;
  border-radius: 0;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.sidebar-item:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.sidebar .sidebar-item.active,
.sidebar .sidebar-item.active:hover {
  background: var(--primary);
  color: #fff;
  font-weight: 500;
  text-decoration: none;
}

.sidebar .sidebar-item .si-icon {
  font-size: 17px;
  line-height: 1;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  opacity: .85;
  color: inherit;
}
.sidebar .sidebar-item.active .si-icon,
.sidebar .sidebar-item.active:hover .si-icon {
  opacity: 1;
  color: #fff;
}
.sidebar .sidebar-item.active .si-text,
.sidebar .sidebar-item.active:hover .si-text {
  color: #fff;
}
.sidebar .sidebar-item .si-text {
  font-size: 14px;
  line-height: 1.3;
}

.sidebar-footer {
  margin-top: auto;
  padding: 10px 16px 12px;
  border-top: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}

.btn-logout {
  width: 100%;
  padding: 7px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  color: #c8cde4;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
}
.btn-logout:hover { background: rgba(239,35,60,.15); color: #ef233c; }

/* ── 메인 영역 ────────────────────────────────────────── */
.main-wrap {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── 상단바 ───────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* ── 상단 칩 공통 (잔액 / 알림 / 회원) ───────────────── */
.topbar-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 6px 10px 6px 6px;
  border: none;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  text-align: left;
  transition: transform .12s;
}
.topbar-chip-btn:hover {
  transform: translateY(-1px);
}
.topbar-chip-btn[aria-expanded="true"] {
  transform: translateY(0);
}

.topbar-chip-icon {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.topbar-chip-icon .ph {
  font-size: 20px;
  color: #fff;
}

.topbar-chip-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.topbar-chip-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-600);
  letter-spacing: .02em;
  line-height: 1.2;
}

.topbar-chip-value {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--gray-800);
}

.topbar-chip-caret {
  font-size: 12px;
  color: var(--gray-500);
  margin-left: 2px;
  transition: transform .2s;
  flex-shrink: 0;
}
.topbar-chip-btn[aria-expanded="true"] .topbar-chip-caret {
  transform: rotate(180deg);
}

/* 잔액·충전 칩 */
.wallet-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 6px 6px;
  background: transparent;
  border: none;
  border-radius: 999px;
  transition: transform .15s;
}
.wallet-chip:hover {
  transform: translateY(-1px);
}

.wallet-chip .topbar-chip-icon,
.wallet-chip-icon {
  background: linear-gradient(145deg, var(--primary) 0%, #5b7cfa 100%);
  box-shadow: 0 2px 8px rgba(67, 97, 238, .35);
}

.wallet-chip-body {
  padding-right: 4px;
}

.wallet-chip-amount {
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, #3451d1 0%, var(--primary) 50%, #5b7cfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  min-width: 5ch;
}

/* 알림 칩 */
.notify-chip {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.notify-chip:hover {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.notify-chip-icon {
  background: linear-gradient(145deg, #f8961e 0%, #f3722c 100%);
  box-shadow: 0 2px 8px rgba(248, 150, 30, .4);
}
.notify-chip .topbar-chip-value {
  color: #c45c00;
}
.notify-chip[aria-expanded="true"] {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.user-chip[aria-expanded="true"] {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

/* 회원 칩 */
.user-chip {
  padding-right: 12px;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.user-chip:hover {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.user-chip-icon {
  background: linear-gradient(145deg, #7209b7 0%, #9d4edd 100%);
  box-shadow: 0 2px 8px rgba(114, 9, 183, .35);
}
.user-chip-name {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: linear-gradient(90deg, #5a189a 0%, #7209b7 50%, #9d4edd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-charge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 18px;
  margin-left: 2px;
  background: linear-gradient(145deg, var(--primary) 0%, #3451d1 100%);
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  border: none;
  box-shadow: 0 2px 10px rgba(67, 97, 238, .4);
  transition: background .15s, transform .12s, box-shadow .15s;
  flex-shrink: 0;
}
.btn-charge .ph {
  font-size: 15px;
}
.btn-charge:hover {
  background: linear-gradient(145deg, #3451d1 0%, #2a3fbb 100%);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(67, 97, 238, .45);
}
.btn-charge:active {
  transform: translateY(0);
  box-shadow: 0 1px 6px rgba(67, 97, 238, .35);
}

.topbar-divider {
  width: 1px;
  height: 28px;
  background: var(--gray-300);
  flex-shrink: 0;
}

.topbar-notify,
.topbar-user {
  position: relative;
}

.notify-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(239, 35, 60, .4);
}

.topbar-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  z-index: 200;
  overflow: hidden;
}

.notify-dropdown { min-width: 280px; }

.dropdown-header {
  padding: 14px 16px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-800);
  border-bottom: 1px solid var(--gray-100);
}

.notify-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--gray-500);
}
.notify-empty .ph {
  font-size: 32px;
  margin-bottom: 8px;
  opacity: .5;
}
.notify-empty p {
  margin: 0;
  font-size: 13px;
}

.notify-list-wrap {
  max-height: 320px;
  overflow-y: auto;
}

.notify-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.notify-item {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  text-decoration: none;
  color: inherit;
  transition: background .15s ease;
}
.notify-item:hover {
  background: var(--gray-50, #f9fafb);
  text-decoration: none;
}
.notify-item.is-unread {
  background: #fffbeb;
}
.notify-item.is-unread:hover {
  background: #fef3c7;
}

.notify-item-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.notify-item-date {
  margin-left: auto;
  font-size: 11px;
  color: var(--gray-400);
  white-space: nowrap;
}
.notify-item-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notify-item-body {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--gray-500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notify-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
}
.notify-type-system  { background: #ede9fe; color: #6d28d9; }
.notify-type-fail    { background: #ffe4e6; color: #be123c; }
.notify-type-done    { background: #d1fae5; color: #047857; }
.notify-type-balance { background: #fef3c7; color: #b45309; }
.notify-type-default { background: var(--gray-100); color: var(--gray-600); }

.notify-unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
}

.notify-dropdown-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--gray-100);
}
.notify-dropdown-footer .dropdown-footer-link {
  border-top: none;
}
.notify-dropdown-footer .dropdown-footer-link + .dropdown-footer-link {
  border-left: 1px solid var(--gray-100);
}

.notify-page-empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--gray-500);
}
.notify-page-empty .ph {
  font-size: 40px;
  margin-bottom: 10px;
  opacity: .45;
}
.notify-page-list {
  display: flex;
  flex-direction: column;
}
.notify-page-item {
  display: block;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-100);
  text-decoration: none;
  color: inherit;
}
.notify-page-item:hover {
  background: var(--gray-50, #f9fafb);
  text-decoration: none;
}
.notify-page-item.is-unread {
  background: #fffbeb;
}
.notify-page-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.notify-page-date {
  margin-left: auto;
  font-size: 12px;
  color: var(--gray-400);
}
.notify-page-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-800);
}
.notify-page-body {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--gray-500);
}
.notify-detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.notify-detail-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 800;
  color: var(--gray-900);
}
.notify-detail-body {
  padding: 14px 16px;
  background: var(--gray-50, #f9fafb);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-700);
  margin-bottom: 16px;
  white-space: pre-wrap;
}
.notify-detail-meta {
  display: grid;
  gap: 10px;
  margin: 0;
}
.notify-detail-meta > div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px;
  font-size: 13px;
}
.notify-detail-meta dt {
  margin: 0;
  color: var(--gray-500);
  font-weight: 600;
}
.notify-detail-meta dd {
  margin: 0;
  color: var(--gray-800);
}
.notify-ref-link {
  margin-left: 6px;
  color: var(--primary);
  font-weight: 600;
}

.dropdown-footer-link {
  display: block;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-align: center;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-100);
}
.dropdown-footer-link:hover {
  background: var(--gray-200);
  text-decoration: none;
}

.user-dropdown a,
.user-dropdown .dropdown-logout-form button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 13.5px;
  color: var(--gray-700);
  text-decoration: none;
  transition: background .12s;
}
.user-dropdown a:hover,
.user-dropdown .dropdown-logout-form button:hover {
  background: var(--gray-100);
  text-decoration: none;
}
.user-dropdown a .ph,
.user-dropdown .dropdown-logout-form button .ph {
  font-size: 17px;
  color: var(--gray-500);
}

.dropdown-divider {
  height: 1px;
  background: var(--gray-200);
  margin: 4px 0;
}

.dropdown-logout-form {
  margin: 0;
  padding: 0;
}
.dropdown-logout-form button {
  width: 100%;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  color: var(--danger) !important;
  text-align: left;
}
.dropdown-logout-form button .ph {
  color: var(--danger) !important;
}

/* ── 페이지 본문 ──────────────────────────────────────── */
.main-content {
  padding: 24px;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.page-title { font-size: 20px; font-weight: 700; margin: 0; }
.page-subtitle { font-size: 13px; color: var(--gray-600); margin: 4px 0 0; }

/* ── 카드 ─────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-body { padding: 20px; }
.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-100);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ── 폼 ───────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--gray-700); }
.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--gray-800);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  font-family: var(--font);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67,97,238,.12);
}
.form-control:disabled { background: var(--gray-100); color: var(--gray-600); }
textarea.form-control { resize: vertical; min-height: 120px; }

.form-hint { font-size: 11.5px; color: var(--gray-500); margin-top: 4px; }
.form-error { font-size: 11.5px; color: var(--danger); margin-top: 4px; }
.form-control.is-invalid { border-color: var(--danger); }

.input-group { display: flex; gap: 8px; }
.input-group .form-control { flex: 1; }

/* ── 버튼 ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  font-family: var(--font);
  white-space: nowrap;
}
.btn:hover { opacity: .88; text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary   { background: var(--primary); color: #fff; }
.btn-secondary { background: var(--gray-600); color: #fff; }
.btn-success   { background: var(--success); color: #fff; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-warning   { background: var(--warning); color: #fff; }
.btn-outline   { background: transparent; border: 1px solid var(--gray-300); color: var(--gray-700); }
.btn-sm        { padding: 6px 12px; font-size: 12px; }
.btn-lg        { padding: 12px 24px; font-size: 15px; }
.btn-block     { width: 100%; justify-content: center; }

/* ── 알림 ─────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 13.5px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── 테이블 ───────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  padding: 10px 12px;
  background: var(--gray-100);
  border-bottom: 2px solid var(--gray-200);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  color: var(--gray-700);
}
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-100); }

.table-count-cell {
  vertical-align: middle;
  padding-top: 6px;
  padding-bottom: 6px;
}

.msg-result-stack {
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 6px;
  font-size: 11px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.msg-result-item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.msg-result-sep {
  color: var(--gray-300);
  font-weight: 400;
  flex: 0 0 auto;
}

.msg-result-label::after {
  content: ' :';
}

.msg-result-label {
  flex: 0 0 auto;
  font-weight: 500;
}

.msg-result-val {
  font-weight: 600;
}

.msg-result-item.is-total .msg-result-label,
.msg-result-item.is-total .msg-result-val { color: #64748b; }
.msg-result-item.is-pending .msg-result-label,
.msg-result-item.is-pending .msg-result-val { color: #2563eb; }
.msg-result-item.is-success .msg-result-label,
.msg-result-item.is-success .msg-result-val { color: #16a34a; }
.msg-result-item.is-fail .msg-result-label,
.msg-result-item.is-fail .msg-result-val { color: #ef4444; }
.table-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.table-actions .btn.btn-sm {
  height: 32px;
  min-height: 32px;
  padding: 0 12px;
  box-sizing: border-box;
  line-height: 1;
  justify-content: center;
  border: 1px solid transparent;
}
.table-actions .btn.btn-outline {
  border-color: var(--gray-300);
}
.table-action-form {
  display: inline-flex;
  margin: 0;
}
.table-actions-cell {
  text-align: center;
}

/* ── 배지 ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: var(--gray-200); color: var(--gray-700); }
.badge-primary { background: rgba(67,97,238,.12); color: var(--primary); }

/* ── 페이지네이션 ─────────────────────────────────────── */
.pagination {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 20px 0 40px;
  padding: 0 20px 20px;
}
.page-link {
  padding: 6px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--gray-700);
  transition: background .12s, color .12s;
}
.page-link:hover { background: var(--gray-100); text-decoration: none; }
.page-link.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-link.disabled { opacity: .4; pointer-events: none; }

/* ── 모달 ─────────────────────────────────────────────── */
/* ── 공통 확인 다이얼로그 헤더 ──────────────────────── */
.modal-confirm-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  font-size: 15px;
  font-weight: 700;
}
.modal-confirm-header .modal-confirm-icon { font-size: 20px; }
.modal-confirm-header.danger  { background: #fff1f2; color: #be123c; border-bottom-color: #fecdd3; }
.modal-confirm-header.warning { background: #fffbeb; color: #b45309; border-bottom-color: #fde68a; }
.modal-confirm-header.info    { background: #eff6ff; color: #1d4ed8; border-bottom-color: #bfdbfe; }
.modal-confirm-header.success { background: #f0fdf4; color: #15803d; border-bottom-color: #bbf7d0; }

.confirm-detail-box {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
  background: var(--gray-50);
}
.confirm-detail-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--gray-200);
}
.confirm-detail-row:last-child { border-bottom: none; }
.confirm-detail-label {
  color: var(--gray-500);
  flex-shrink: 0;
  min-width: 72px;
}
.confirm-detail-value {
  color: var(--gray-800);
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}
.confirm-detail-value.is-highlight { color: #4361ee; font-size: 14px; }
.confirm-detail-value.is-warn { color: #be123c; }
.confirm-detail-row.is-muted .confirm-detail-value { color: var(--gray-400); font-weight: 500; }

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: none;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 12px;
  width: min(520px, 90vw);
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--gray-200);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 20px; color: var(--gray-500);
  line-height: 1; padding: 0;
}

/* ── 탭 ───────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 20px;
}
.tab-link {
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-600);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s;
}
.tab-link:hover { color: var(--primary); text-decoration: none; }
.tab-link.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── 통계 카드 ────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.stat-label { font-size: 12px; color: var(--gray-500); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 26px; font-weight: 800; margin: 4px 0; line-height: 1.2; }
.stat-sub   { font-size: 12px; color: var(--gray-500); }

/* ── 검색 폼 ──────────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 0;
  padding: 14px;
  background: var(--gray-100);
  border-radius: var(--radius);
}
.search-bar-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.search-bar-field > .form-label {
  font-size: 11px;
  margin-bottom: 0;
}
.search-bar-date-range {
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-bar-date-range span {
  font-size: 12px;
  color: var(--gray-400);
  line-height: 1;
}
.search-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.search-bar .form-control { flex: 1; min-width: 120px; }

/* ── 유틸리티 ─────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--gray-500); }
.text-danger { color: var(--danger); }
.text-success{ color: var(--success); }
.text-primary{ color: var(--primary); }
.fw-bold     { font-weight: 700; }
.d-flex      { display: flex; }
.align-center{ align-items: center; }
.gap-2       { gap: 8px; }
.gap-3       { gap: 12px; }
.mt-2        { margin-top: 8px; }
.mt-3        { margin-top: 12px; }
.mt-4        { margin-top: 16px; }
.mb-0        { margin-bottom: 0; }
.mb-2        { margin-bottom: 8px; }
.mb-3        { margin-bottom: 12px; }
.ms-auto     { margin-left: auto; }
.p-0         { padding: 0; }
.w-100       { width: 100%; }

/* ── 사이트 푸터 (회사 정보) ─────────────────────────────── */
.site-footer {
  margin-top: auto;
  padding: 1.75rem 1.5rem 1.5rem;
  border-top: 1px solid var(--gray-300);
  background: var(--gray-200);
  font-size: 0.8125rem;
  color: var(--gray-600);
}
.site-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.site-footer-name {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--gray-800);
  letter-spacing: -0.01em;
}
.site-footer-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.5rem;
  row-gap: 0.35rem;
  margin: 0 0 0.45rem;
  line-height: 1.65;
}
.site-footer-line:last-of-type {
  margin-bottom: 0;
}
.site-footer-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  white-space: nowrap;
}
.site-footer-item:not(:last-child)::after {
  content: '·';
  margin-left: 0.5rem;
  color: var(--gray-300);
  font-weight: 400;
}
.site-footer-label {
  color: var(--gray-500);
  font-weight: 600;
  font-size: 0.75rem;
}
.site-footer-value {
  color: var(--gray-700);
}
.site-footer-link {
  color: var(--gray-700);
  text-decoration: none;
}
.site-footer-link:hover {
  color: var(--primary);
  text-decoration: underline;
}
.site-footer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-300);
}
.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}
.site-footer-policy-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.site-footer-policy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  background: #fff;
  color: var(--gray-700);
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.site-footer-policy-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(67, 97, 238, 0.25);
}
.site-footer-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.8125rem;
}
.site-footer-links a:hover {
  text-decoration: underline;
}
.site-footer-copy {
  margin: 0;
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--gray-500);
}
@media (max-width: 640px) {
  .site-footer {
    padding: 1.5rem 1rem 1.25rem;
  }
  .site-footer-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .site-footer-copy {
    margin-left: 0;
  }
}

/* ── 전역 로딩 오버레이 (페이지 로드·검색) ─────────────── */
.app-loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, .45);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
}

html.app-page-loading .app-loading-overlay,
.app-loading-overlay.show {
  display: flex;
}

.app-loading-spinner {
  width: 52px;
  height: 52px;
  border: 5px solid rgba(255, 255, 255, .25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: app-loading-spin .8s linear infinite;
}

.app-loading-msg {
  color: #fff;
  font-size: 1.0625rem;
  font-weight: 700;
}

.app-loading-sub {
  color: rgba(255, 255, 255, .7);
  font-size: .875rem;
}

@keyframes app-loading-spin {
  to { transform: rotate(360deg); }
}

/* ── 반응형 ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .main-wrap { margin-left: 0; }
}
