/* ==========================================================================
   Taekwon Career Admin Panel — admin.css
   ========================================================================== */

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

:root {
  --sidebar-w: 240px;
  --sidebar-bg: #0c2540;
  --sidebar-hover: rgba(255,255,255,0.07);
  --sidebar-active: rgba(37,99,235,0.25);
  --sidebar-accent: #2563eb;
  --header-h: 60px;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --light: #94a3b8;
  --blue: #2563eb;
  --blue-light: #eff6ff;
  --green: #10b981;
  --green-light: #ecfdf5;
  --red: #ef4444;
  --red-light: #fef2f2;
  --amber: #f59e0b;
  --amber-light: #fffbeb;
  --purple: #8b5cf6;
  --purple-light: #f5f3ff;
  --gold: #fbbf24;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --font: 'Pretendard', -apple-system, system-ui, sans-serif;
}

html { font-size: 15px; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  height: 100%;
  display: flex;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
img { max-width: 100%; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 9px; }

/* ─── Hidden ─── */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.admin-sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
  transition: transform 0.3s;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
}
.sidebar-logo svg { color: var(--blue); flex-shrink: 0; }
.sidebar-logo-sub {
  font-size: 0.65rem;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.5px;
  display: block;
  margin-top: -3px;
}

.sidebar-nav { flex: 1; padding: 0.75rem 0.75rem; }

.nav-group { margin-bottom: 0.5rem; }
.nav-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.6rem 0.6rem 0.3rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--r-sm);
  color: rgba(255,255,255,0.65);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.nav-item svg { flex-shrink: 0; opacity: 0.7; }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item:hover svg { opacity: 1; }
.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--sidebar-accent);
}
.nav-item.active svg { opacity: 1; color: #93c5fd; }

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.05rem 0.4rem;
  border-radius: 99px;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-admin-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem;
  border-radius: var(--r-sm);
  color: rgba(255,255,255,0.7);
  font-size: 0.82rem;
  font-weight: 600;
}
.sidebar-admin-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
}

/* ==========================================================================
   MAIN LAYOUT
   ========================================================================== */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Top Header ─── */
.admin-header {
  position: sticky;
  top: 0;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.header-breadcrumb {
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.header-breadcrumb strong {
  color: var(--text);
  font-weight: 700;
}
.header-page-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.header-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  position: relative;
  transition: background 0.15s;
}
.header-icon-btn:hover { background: var(--border); color: var(--text); }
.notif-dot {
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  position: absolute;
  top: 4px; right: 4px;
  border: 2px solid var(--surface);
}
.header-admin-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem 0.3rem 0.3rem;
  background: var(--bg);
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}
.header-admin-chip .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
}

/* ─── Content Area ─── */
.admin-content {
  flex: 1;
  padding: 1.75rem;
  overflow-y: auto;
}

/* ==========================================================================
   DASHBOARD VIEWS
   ========================================================================== */
.view { display: none; }
.view.active { display: block; }

/* ─── Stats Cards Row ─── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-card-label { font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.stat-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-icon.blue { background: var(--blue-light); color: var(--blue); }
.stat-icon.green { background: var(--green-light); color: var(--green); }
.stat-icon.amber { background: var(--amber-light); color: var(--amber); }
.stat-icon.red { background: var(--red-light); color: var(--red); }
.stat-icon.purple { background: var(--purple-light); color: var(--purple); }

.stat-value {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}

.stat-trend {
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}
.stat-trend.up { color: var(--green); }
.stat-trend.down { color: var(--red); }

/* ─── Dashboard Grid ─── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-grid-row2 {
  display: grid;
  grid-template-columns: 2fr 1.2fr;
  gap: 1rem;
}

/* ─── Card Panel ─── */
.panel {
  background: var(--surface);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.panel-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text);
}
.panel-subtitle {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 1px;
}
.panel-action {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
  transition: opacity 0.15s;
}
.panel-action:hover { opacity: 0.7; }
.panel-body { padding: 1.25rem; }

/* ─── Chart Canvas ─── */
.chart-wrap {
  position: relative;
  height: 200px;
}

/* ─── Donut Chart Panel ─── */
.donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
}
.donut-canvas-wrap {
  position: relative;
  width: 160px;
  height: 160px;
}
.donut-center-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.donut-center-value { font-size: 1.3rem; font-weight: 900; color: var(--text); }
.donut-center-label { font-size: 0.7rem; color: var(--muted); font-weight: 600; }

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-name { font-weight: 600; color: var(--text); flex: 1; }
.legend-count { font-weight: 800; color: var(--text); }
.legend-pct { color: var(--muted); font-size: 0.73rem; }

/* ==========================================================================
   TABLES
   ========================================================================== */
.table-wrap { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}
.data-table th {
  background: #f8fafc;
  padding: 0.65rem 0.9rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #f8fafc; }

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-blue { background: var(--blue-light); color: var(--blue); }
.badge-green { background: var(--green-light); color: var(--green); }
.badge-red { background: var(--red-light); color: var(--red); }
.badge-amber { background: var(--amber-light); color: var(--amber); }
.badge-gray { background: #f1f5f9; color: var(--muted); }
.badge-purple { background: var(--purple-light); color: var(--purple); }

/* ─── Action buttons in table ─── */
.action-btns { display: flex; gap: 0.3rem; align-items: center; }
.btn-icon {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all 0.15s;
  color: var(--muted);
}
.btn-icon:hover { background: var(--bg); color: var(--text); }
.btn-icon.danger:hover { background: var(--red-light); color: var(--red); }
.btn-icon.success:hover { background: var(--green-light); color: var(--green); }

/* ==========================================================================
   PAGE TOOLBAR
   ========================================================================== */
.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.page-title-block h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
}
.page-title-block p {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

.toolbar-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--r-sm);
  font-size: 0.83rem;
  font-weight: 700;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,0.2);
}
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg); }
.btn-danger {
  background: var(--red-light);
  color: var(--red);
  border: 1px solid #fecaca;
}
.btn-danger:hover { background: #fee2e2; }
.btn-success {
  background: var(--green-light);
  color: var(--green);
  border: 1px solid #a7f3d0;
}
.btn-success:hover { background: #d1fae5; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.78rem; }

/* ─── Search/Filter Bar ─── */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0.85rem 1.25rem;
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.filter-search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.filter-search-wrap svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--light);
  pointer-events: none;
}
.filter-input {
  width: 100%;
  height: 36px;
  padding: 0 0.75rem 0 2.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.83rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.filter-input:focus { border-color: var(--blue); }

.filter-select {
  height: 36px;
  padding: 0 2rem 0 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.83rem;
  color: var(--text);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 16px;
  transition: border-color 0.15s;
  min-width: 130px;
}
.filter-select:focus { border-color: var(--blue); }

/* ─── Table Panel Full ─── */
.table-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.results-count { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.results-count strong { color: var(--text); font-weight: 800; }

/* ─── Pagination ─── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 1rem;
  border-top: 1px solid var(--border);
}
.page-btn {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  transition: all 0.15s;
  cursor: pointer;
}
.page-btn:hover { background: var(--bg); color: var(--text); }
.page-btn.active { background: var(--blue); color: #fff; }
.page-btn:disabled { opacity: 0.35; cursor: default; }

/* ==========================================================================
   MODAL / DIALOG
   ========================================================================== */
.admin-dialog {
  border: none;
  border-radius: var(--r-lg);
  box-shadow: 0 25px 60px rgba(0,0,0,0.15);
  max-width: 560px;
  width: 94%;
  margin: auto;
  padding: 0;
  background: var(--surface);
  display: none;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: display 0.28s allow-discrete, opacity 0.28s ease, transform 0.28s ease, overlay 0.28s allow-discrete;
}
.admin-dialog[open] {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: none;
}
@starting-style {
  .admin-dialog[open] { opacity: 0; transform: translateY(16px) scale(0.98); }
}
.admin-dialog::backdrop {
  background: rgba(15,23,42,0.55);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.28s allow-discrete, overlay 0.28s allow-discrete;
}
.admin-dialog[open]::backdrop { opacity: 1; }
@starting-style { .admin-dialog[open]::backdrop { opacity: 0; } }

.dialog-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.dialog-hd h3 { font-size: 1rem; font-weight: 800; color: var(--text); }
.dialog-close-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: background 0.15s;
}
.dialog-close-btn:hover { background: var(--bg); color: var(--text); }

.dialog-bd { padding: 1.5rem; overflow-y: auto; max-height: 65vh; }
.dialog-ft {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: #f8fafc;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* ─── Banner Upload Dialog ─── */
.banner-dialog {
  max-width: 640px;
}

.banner-dialog-body {
  display: grid;
  gap: 1rem;
}

.banner-preview-panel {
  padding: 0.9rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.banner-preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.banner-preview-title {
  color: #334155;
  font-size: 0.86rem;
  font-weight: 800;
}

.banner-preview-caption {
  color: var(--light);
  font-size: 0.76rem;
  font-weight: 600;
  margin-top: 0.1rem;
}

.banner-preview-image {
  width: 100%;
  aspect-ratio: 5 / 1;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.banner-field {
  display: grid;
  gap: 0.4rem;
}

.banner-field label {
  color: #334155;
  font-size: 0.85rem;
  font-weight: 800;
}

.banner-url-input {
  width: 100%;
  height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: var(--r-md);
  padding: 0 0.95rem;
  font-size: 0.9rem;
  color: #0f172a;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.banner-url-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.banner-field-help {
  color: var(--light);
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0;
}

.banner-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 190px;
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--r-lg);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.2s;
}

.banner-upload-zone:hover,
.banner-upload-zone.is-dragging {
  background: #eff6ff;
  border-color: var(--blue);
  box-shadow: 0 10px 24px rgba(37,99,235,0.08);
}

.banner-upload-zone.is-selected {
  background: #f0fdf4;
  border-color: var(--green);
}

.banner-upload-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin-bottom: 0.85rem;
  color: var(--blue);
  background: #dbeafe;
  border-radius: 50%;
}

.banner-upload-zone.is-selected .banner-upload-icon {
  color: var(--green);
  background: #dcfce7;
}

.banner-upload-title {
  color: #334155;
  font-size: 0.95rem;
  font-weight: 800;
  margin: 0 0 0.25rem;
}

.banner-upload-subtitle {
  color: var(--light);
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0;
}

.banner-selected-meta {
  max-width: 100%;
  margin-top: 0.85rem;
  padding: 0.38rem 0.65rem;
  color: #166534;
  background: rgba(220,252,231,0.8);
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.banner-upload-progress {
  padding: 0.85rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.banner-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.55rem;
}

#banner-upload-filename {
  min-width: 0;
  color: #0f172a;
  font-size: 0.85rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#banner-upload-pct {
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 800;
}

.banner-progress-track {
  height: 7px;
  overflow: hidden;
  background: #e2e8f0;
  border-radius: 999px;
}

.banner-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg,#2563eb,#10b981);
  border-radius: 999px;
  transition: width 0.2s;
}

/* ─── Notice Image Upload ─── */
.notice-image-label-sub {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.notice-image-drop-zone {
  display: grid;
  gap: 0.8rem;
  min-height: 170px;
  padding: 1.2rem;
  text-align: center;
  cursor: pointer;
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--r-md);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.notice-image-drop-zone:hover,
.notice-image-drop-zone.is-dragging {
  background: #eff6ff;
  border-color: var(--blue);
  box-shadow: 0 10px 22px rgba(37,99,235,0.08);
}

.notice-image-drop-zone.is-selected {
  background: #f0fdf4;
  border-color: var(--green);
}

.notice-image-placeholder {
  display: flex;
  min-height: 130px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.notice-image-drop-zone.is-selected .notice-image-placeholder {
  display: none;
}

.notice-image-upload-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 0.7rem;
  color: var(--blue);
  background: #dbeafe;
  border-radius: 50%;
}

.notice-image-title {
  color: #334155;
  font-size: 0.9rem;
  font-weight: 800;
  margin: 0 0 0.2rem;
}

.notice-image-help {
  color: var(--light);
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0;
}

.notice-image-preview-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm);
}

.notice-image-preview-wrap img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  background: #fff;
}

.notice-image-remove-btn {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: #fff;
  background: rgba(15,23,42,0.72);
  border-radius: 50%;
  transition: background 0.15s, transform 0.15s;
}

.notice-image-remove-btn:hover {
  background: rgba(239,68,68,0.92);
  transform: scale(1.04);
}

.notice-image-meta {
  justify-self: center;
  max-width: 100%;
  padding: 0.36rem 0.65rem;
  color: #166534;
  background: rgba(220,252,231,0.8);
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Form Groups in Dialog ─── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.form-row.single { grid-template-columns: 1fr; }
.form-field { display: flex; flex-direction: column; gap: 0.35rem; }
.form-field label { font-size: 0.8rem; font-weight: 700; color: var(--text); }
.form-control {
  height: 38px;
  padding: 0 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.form-control:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
textarea.form-control { height: auto; padding: 0.6rem 0.75rem; resize: vertical; min-height: 80px; }
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 16px;
  padding-right: 2rem;
}

/* ==========================================================================
   ANALYTICS VIEW
   ========================================================================== */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.analytics-grid.three { grid-template-columns: 1fr 1fr 1fr; }

/* ==========================================================================
   NOTICE / ANNOUNCEMENT VIEW
   ========================================================================== */
.notice-list { display: flex; flex-direction: column; gap: 0; }
.notice-row {
  display: flex;
  align-items: center;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
  transition: background 0.1s;
  cursor: pointer;
}
.notice-row:last-child { border-bottom: none; }
.notice-row:hover { background: #f8fafc; }
.notice-pin { color: var(--amber); flex-shrink: 0; }
.notice-category { flex-shrink: 0; }
.notice-title { flex: 1; font-size: 0.88rem; font-weight: 600; color: var(--text); }
.notice-date { font-size: 0.75rem; color: var(--muted); flex-shrink: 0; }
.notice-views { font-size: 0.75rem; color: var(--light); flex-shrink: 0; min-width: 50px; text-align: right; }

/* ==========================================================================
   SETTINGS VIEW
   ========================================================================== */
.settings-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
}
.settings-nav { display: flex; flex-direction: column; gap: 0.25rem; }
.settings-nav-item {
  padding: 0.6rem 0.75rem;
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
.settings-nav-item:hover { background: var(--bg); color: var(--text); }
.settings-nav-item.active { background: var(--blue-light); color: var(--blue); font-weight: 700; }

.settings-section { display: none; }
.settings-section.active { display: block; }
.settings-section h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.settings-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.settings-row:last-child { border-bottom: none; }
.settings-label { font-size: 0.88rem; font-weight: 700; color: var(--text); }
.settings-desc { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

.product-settings-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.product-settings-table th,
.product-settings-table td {
  vertical-align: middle;
}

.product-settings-table .form-control {
  min-width: 120px;
  height: 34px;
  padding: 0 0.6rem;
}

.product-input-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.product-input-inline input {
  width: 110px;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 3px; left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--blue); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

.member-payment-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.member-payment-toggle .toggle-switch {
  width: 42px;
  height: 22px;
}

.member-payment-toggle .toggle-slider::before {
  width: 16px;
  height: 16px;
  left: 3px;
  bottom: 3px;
}

.member-payment-toggle .toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.toggle-state-on,
.toggle-state-off {
  font-size: 0.72rem;
  font-weight: 800;
}

.toggle-state-on { color: var(--blue); }
.toggle-state-off { color: var(--muted); }

.subscription-date {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: var(--muted);
  gap: 0.75rem;
  text-align: center;
}
.empty-state svg { color: var(--light); }
.empty-state p { font-size: 0.88rem; font-weight: 600; }

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  background: var(--text);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--r-sm);
  font-size: 0.83rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toast-in 0.3s ease;
  max-width: 300px;
}
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
.toast.warning { background: var(--amber); color: var(--text); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: none; }
}

.region-sync-row {
  align-items: flex-start;
}

.region-sync-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

#region-sync-message {
  flex-basis: 100%;
}

#region-sync-message.success {
  color: var(--green);
}

#region-sync-message.error {
  color: var(--red);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1200px) {
  .stats-row { grid-template-columns: repeat(3, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid-row2 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .admin-sidebar { transform: translateX(-240px); }
  .admin-sidebar.open { transform: none; width: 240px; }
  .admin-main { margin-left: 0; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .analytics-grid, .analytics-grid.three { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}

/* ─── Detail Modal Styles ────────────────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem 1.5rem;
}
.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  padding-bottom: 0.5rem;
}
.detail-item strong {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.detail-item span {
  font-size: 0.92rem;
  color: var(--text);
  font-weight: 500;
}
.detail-full {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.detail-full strong {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.detail-desc {
  background: var(--bg);
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text);
  border: 1px solid var(--border);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 250px;
  overflow-y: auto;
}
@media (max-width: 576px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .detail-full {
    grid-column: span 1;
  }
}

/* ============================================================
   배너 크로퍼 모바일 반응형 스타일 (Cropper Mobile Responsive)
   ============================================================ */
.cropper-container-box {
  max-height: 420px;
  overflow: hidden;
  background: #f8fafc;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  position: relative;
  width: 100%;
}

#banner-cropper-image {
  max-width: 100%;
  max-height: 420px;
  display: block;
}

#banner-cropper-dialog .dialog-bd {
  max-height: 72vh;
  overflow: hidden !important; /* 모바일에서 드래그 시 스크롤 중복 발생 방지 */
}

@media (max-width: 768px) {
  #banner-cropper-dialog {
    max-width: 96% !important;
    width: 96% !important;
    margin: auto;
  }
  .cropper-container-box {
    max-height: 260px; /* 모바일 화면 높이에 맞게 크로핑 영역 축소 */
  }
  #banner-cropper-image {
    max-height: 260px;
  }
  #banner-cropper-dialog .dialog-bd {
    padding: 0.75rem;
  }
  #banner-cropper-dialog p {
    font-size: 0.78rem;
    margin-bottom: 0.5rem;
  }
}
