/* =============================================
   Administor – Global Stylesheet
   Theme: Red (#C0392B) + Navy (#1B3A6B)
   Font: Pretendard | Icon: RemixIcon
   Breakpoint: 480px (mobile)
   ============================================= */

/* ---------- CSS Variables ---------- */
:root {
  --primary:       #C0392B;
  --primary-dark:  #962d22;
  --primary-light: #f5e6e5;
  --secondary:     #1B3A6B;
  --secondary-dark:#122849;
  --secondary-light:#e8edf5;

  --bg:            #f4f6fb;
  --surface:       #ffffff;
  --border:        #e2e6ef;
  --border-light:  #f0f2f7;

  --text:          #1a1d27;
  --text-sub:      #5a6070;
  --text-muted:    #9aa0b0;

  --success:       #27ae60;
  --warning:       #f39c12;
  --danger:        #e74c3c;
  --info:          #2980b9;

  --sidebar-w:           260px;
  --sidebar-collapsed-w: 64px;
  --header-h:      58px;
  --radius:        10px;
  --radius-sm:     6px;
  --shadow:        0 2px 12px rgba(27,58,107,.08);
  --shadow-md:     0 4px 24px rgba(27,58,107,.12);
  --transition:    .18s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* =============================================
   AUTH PAGES (login / register / forgot)
   ============================================= */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--secondary) 0%, #2a5298 50%, var(--primary) 100%);
  padding: 24px 16px;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo .logo-text {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--secondary);
}
.auth-logo .logo-text span { color: var(--primary); }
.auth-logo p {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.auth-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
}

/* ---------- Form Elements ---------- */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 6px;
}
.form-group label .req { color: var(--primary); }

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap .ri {
  position: absolute;
  left: 11px;
  font-size: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}
.input-wrap input,
.input-wrap select {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition);
  outline: none;
}
.input-wrap input:focus,
.input-wrap select:focus {
  border-color: var(--secondary);
}
.input-wrap input.error { border-color: var(--danger); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  border: none;
  transition: background var(--transition), opacity var(--transition), transform var(--transition);
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}
.btn-secondary:hover { background: var(--secondary-dark); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-sub);
}
.btn-outline:hover { border-color: var(--secondary); color: var(--secondary); }

.btn-ghost {
  background: transparent;
  color: var(--text-sub);
}
.btn-ghost:hover { background: var(--border-light); color: var(--text); }

.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger);  color: #fff; }

.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-lg { padding: 13px 28px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; pointer-events: none; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--border-light);
  color: var(--text-sub);
  font-size: 1rem;
  transition: background var(--transition), color var(--transition);
}
.btn-icon:hover { background: var(--secondary-light); color: var(--secondary); }

/* ---------- Auth links ---------- */
.auth-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}
.auth-links a {
  font-size: .8rem;
  color: var(--text-muted);
  transition: color var(--transition);
}
.auth-links a:hover { color: var(--secondary); }
.auth-links span { color: var(--border); font-size: .8rem; }

/* ---------- Alert ---------- */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: .8rem;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-danger  { background: #fdf0f0; color: var(--danger);  border: 1px solid #f5c2c2; }
.alert-success { background: #edfaf3; color: var(--success); border: 1px solid #bbe6d0; }
.alert-info    { background: #eaf4fd; color: var(--info);    border: 1px solid #b8d9f5; }
.alert-warning { background: #fef9ee; color: var(--warning); border: 1px solid #f5dfa0; }

/* =============================================
   ADMIN LAYOUT
   ============================================= */
.admin-wrap {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--secondary);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 200;
  transition: width .22s cubic-bezier(.4,0,.2,1), transform .22s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
  overflow-x: hidden;
}

/* ── 접힌 상태 ── */
.sidebar.collapsed { width: var(--sidebar-collapsed-w); }

.sidebar.collapsed .sidebar-logo p,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .btn-logout {
  opacity: 0;
  pointer-events: none;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.sidebar.collapsed .sidebar-logo {
  padding: 18px 0 14px;
  justify-content: center;
}
.sidebar.collapsed .logo-text { display: none; }
.sidebar.collapsed .logo-icon { display: flex !important; }
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 11px 0;
  gap: 0;
}
.sidebar.collapsed .nav-item .ri { font-size: 1.2rem; margin: 0 auto; }
.sidebar.collapsed .sidebar-footer { padding: 14px 0; }
.sidebar.collapsed .sidebar-user { justify-content: center; gap: 0; }
.sidebar.collapsed .btn-sidebar-collapse { margin: 0 auto; }

/* 접힌 상태 툴팁 */
.sidebar.collapsed .nav-item {
  position: relative;
}
.sidebar.collapsed .nav-item:hover::after {
  content: attr(data-label);
  position: absolute;
  left: calc(var(--sidebar-collapsed-w) + 6px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.75);
  color: #fff;
  font-size: .78rem;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  z-index: 999;
  pointer-events: none;
}

/* ── 로고 영역 ── */
.sidebar-logo {
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.logo-icon {
  display: none;
  font-size: 1.4rem;
  color: #e87070;
  margin: 0 auto;
}
.sidebar-logo .logo-text {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.3px;
  white-space: nowrap;
}
.sidebar-logo .logo-text span { color: #e87070; }
.sidebar-logo p {
  font-size: .7rem;
  color: rgba(255,255,255,.45);
  margin-top: 2px;
  white-space: nowrap;
}
.logo-texts { display: flex; flex-direction: column; }

/* ── 접기 버튼 ── */
.btn-sidebar-collapse {
  background: rgba(255,255,255,.08);
  border: none;
  color: rgba(255,255,255,.6);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition), transform .22s ease;
}
.btn-sidebar-collapse:hover { background: rgba(255,255,255,.16); color: #fff; }
.sidebar.collapsed .btn-sidebar-collapse { transform: rotate(180deg); }

.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-section-title {
  font-size: .65rem;
  font-weight: 700;
  color: rgba(255,255,255,.35);
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 12px 20px 4px;
  white-space: nowrap;
  transition: opacity .15s ease;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: rgba(255,255,255,.7);
  font-size: .875rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition), padding var(--transition);
  border-radius: 0;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}
.nav-label { transition: opacity .15s ease; }
.nav-item .ri { font-size: 1.1rem; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  width: 3px;
  height: 36px;
  background: #e87070;
  border-radius: 0 3px 3px 0;
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
  transition: padding var(--transition);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; transition: opacity .15s ease; }
.sidebar-user-info .uname {
  font-size: .8rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-info .urole {
  font-size: .7rem;
  color: rgba(255,255,255,.45);
}
.btn-logout {
  background: transparent;
  border: none;
  color: rgba(255,255,255,.5);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition), opacity .15s ease;
  flex-shrink: 0;
}
.btn-logout:hover { color: #e87070; }

/* ---------- Main Content ---------- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .22s cubic-bezier(.4,0,.2,1);
}
.main-content.collapsed { margin-left: var(--sidebar-collapsed-w); }

/* ---------- Top Header ---------- */
.topbar {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.btn-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text-sub);
  cursor: pointer;
  padding: 4px;
}
.page-breadcrumb { display: flex; align-items: center; gap: 6px; }
.breadcrumb-item { font-size: .8rem; color: var(--text-muted); }
.breadcrumb-item.active { color: var(--text); font-weight: 600; }
.breadcrumb-sep { font-size: .75rem; color: var(--text-muted); }

.topbar-right { display: flex; align-items: center; gap: 10px; }

/* ---------- Page Body ---------- */
.page-body {
  flex: 1;
  padding: 24px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.page-header-left h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}
.page-header-left p {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.card-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title .ri { color: var(--secondary); }
.card-body { padding: 20px; }

/* ---------- Dashboard Stats ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-icon.red    { background: var(--primary-light); color: var(--primary); }
.stat-icon.navy   { background: var(--secondary-light); color: var(--secondary); }
.stat-icon.green  { background: #edfaf3; color: var(--success); }
.stat-icon.orange { background: #fef5e7; color: var(--warning); }
.stat-info .stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.stat-info .stat-label {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---------- Search Bar ---------- */
.search-bar {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}
.search-field { display: flex; flex-direction: column; gap: 5px; }
.search-field label { font-size: .75rem; font-weight: 600; color: var(--text-sub); }
.search-field input,
.search-field select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .8rem;
  background: var(--surface);
  color: var(--text);
  outline: none;
  min-width: 120px;
}
.search-field input:focus,
.search-field select:focus { border-color: var(--secondary); }
.search-actions { display: flex; gap: 8px; align-items: flex-end; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .825rem;
}
thead tr {
  background: var(--border-light);
  border-bottom: 2px solid var(--border);
}
thead th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  color: var(--text-sub);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}
tbody tr:hover { background: var(--secondary-light); cursor: pointer; }
tbody tr.selected { background: var(--secondary-light); }
tbody td {
  padding: 10px 14px;
  color: var(--text);
  white-space: nowrap;
}
.td-sub { color: var(--text-muted); font-size: .78rem; }

/* ---------- Badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-success { background: #edfaf3; color: var(--success); }
.badge-danger   { background: #fdf0f0; color: var(--danger); }
.badge-warning  { background: #fef9ee; color: var(--warning); }
.badge-info     { background: #eaf4fd; color: var(--info); }
.badge-secondary{ background: var(--secondary-light); color: var(--secondary); }
.badge-muted    { background: var(--border-light); color: var(--text-muted); }

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-sub);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.page-btn:hover { border-color: var(--secondary); color: var(--secondary); }
.page-btn.active {
  background: var(--secondary);
  border-color: var(--secondary);
  color: #fff;
}
.page-btn:disabled { opacity: .4; pointer-events: none; }

/* ---------- Slide Panel ---------- */
.slide-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.3);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.slide-overlay.active { opacity: 1; pointer-events: auto; }

.slide-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100vw;
  height: 100vh;
  background: var(--surface);
  z-index: 400;
  box-shadow: -4px 0 24px rgba(0,0,0,.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.slide-panel.open { transform: translateX(0); }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--border-light);
  flex-shrink: 0;
}
.panel-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
}
.panel-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition);
}
.panel-close:hover { color: var(--primary); }

.panel-body { flex: 1; overflow-y: auto; padding: 20px; }

.detail-section { margin-bottom: 20px; }
.detail-section-title {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}
.detail-row {
  display: flex;
  gap: 8px;
  padding: 7px 0;
  align-items: flex-start;
  border-bottom: 1px dashed var(--border-light);
}
.detail-row:last-child { border-bottom: none; }
.detail-label {
  width: 110px;
  flex-shrink: 0;
  font-size: .78rem;
  color: var(--text-sub);
  font-weight: 600;
  padding-top: 1px;
}
.detail-value {
  flex: 1;
  font-size: .825rem;
  color: var(--text);
}
.detail-value input,
.detail-value select {
  width: 100%;
  padding: 5px 9px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .8rem;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color var(--transition);
}
.detail-value input:focus,
.detail-value select:focus { border-color: var(--secondary); }

.panel-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ---------- Call Button ---------- */
.btn-call {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
}
.btn-call:hover { background: #219a52; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.tab-btn {
  padding: 10px 18px;
  border: none;
  background: none;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab-btn:hover { color: var(--secondary); }
.tab-btn.active { color: var(--secondary); border-bottom-color: var(--secondary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ---------- Dashboard Grid ---------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.dashboard-grid .card.full { grid-column: 1 / -1; }

/* ---------- Recent List ---------- */
.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.recent-item:last-child { border-bottom: none; }
.recent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.recent-info { flex: 1; min-width: 0; }
.recent-info .rtitle { font-size: .825rem; font-weight: 600; color: var(--text); }
.recent-info .rsub { font-size: .75rem; color: var(--text-muted); margin-top: 1px; }
.recent-time { font-size: .75rem; color: var(--text-muted); white-space: nowrap; }

/* ---------- Profile Form ---------- */
.profile-wrap { max-width: 560px; }

/* ---------- Admin Menu ---------- */
.user-table-actions { display: flex; gap: 6px; }

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state .ri { font-size: 2.5rem; margin-bottom: 10px; display: block; }
.empty-state p { font-size: .875rem; }

/* ---------- Loading Spinner ---------- */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--secondary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toast ---------- */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--text);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: .825rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  animation: toastIn .2s ease;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warning { background: var(--warning); }
@keyframes toastIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* =============================================
   RESPONSIVE – Mobile (≤480px)
   ============================================= */
@media (max-width: 480px) {
  :root { --sidebar-w: 0px; }

  .btn-menu-toggle { display: flex; }
  .btn-sidebar-collapse { display: none; }

  .sidebar {
    transform: translateX(-260px);
    width: 260px;
  }
  .sidebar.open { transform: translateX(0); }
  /* 모바일에서는 collapsed 상태 무시 */
  .sidebar.collapsed { width: 260px; }
  .sidebar.collapsed .sidebar-logo p,
  .sidebar.collapsed .nav-section-title,
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .sidebar-user-info,
  .sidebar.collapsed .btn-logout { opacity: 1; pointer-events: auto; width: auto; overflow: visible; }
  .sidebar.collapsed .sidebar-logo { padding: 18px 20px 14px; justify-content: space-between; }
  .sidebar.collapsed .logo-text { display: block; }
  .sidebar.collapsed .logo-icon { display: none !important; }
  .sidebar.collapsed .nav-item { justify-content: flex-start; padding: 11px 20px; gap: 10px; }
  .sidebar.collapsed .sidebar-footer { padding: 14px 20px; }
  .sidebar.collapsed .sidebar-user { justify-content: flex-start; gap: 10px; }
  .sidebar.collapsed .nav-item:hover::after { display: none; }

  .main-content { margin-left: 0; }
  .main-content.collapsed { margin-left: 0; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; gap: 10px; }
  .stat-icon { width: 38px; height: 38px; font-size: 1.1rem; }
  .stat-info .stat-val { font-size: 1.2rem; }

  .dashboard-grid { grid-template-columns: 1fr; }

  .page-body { padding: 14px; }

  .auth-card { padding: 28px 20px; }

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

  .search-bar { flex-direction: column; align-items: stretch; }
  .search-field input, .search-field select { min-width: unset; }

  .slide-panel { width: 100vw; }

  .topbar { padding: 0 14px; }

  thead th, tbody td { padding: 8px 10px; }

  #toast-container { bottom: 12px; right: 12px; left: 12px; }
  .toast { min-width: unset; }
}

@media (max-width: 768px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
}
