/* ============================================================
   Hidden Mint Records — Admin
   Reference: Kakao/MM-style SaaS admin panel
   ============================================================ */
:root {
  --accent:   #1FDFBE;
  --accent-d: #0fbfa0;
  --accent-t: rgba(31,223,190,0.1);
  --topbar-h: 52px;
  --sidebar-w: 180px;
  --white:  #ffffff;
  --bg:     #f5f6f8;
  --border: #e5e7eb;
  --text:   #111827;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --red:    #ef4444;
  --r:      6px;
  --f:      'Inter', system-ui, sans-serif;
  --tr:     0.15s ease;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--f); background: var(--bg); color: var(--text); }
a { text-decoration: none; color: inherit; }
button, input, select, textarea { font-family: var(--f); }

/* ════════════════════════════
   LOGIN
════════════════════════════ */
#loginScreen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-card {
  width: 380px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 32px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.logo-sq {
  width: 36px; height: 36px;
  background: var(--accent);
  color: #0d1117;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}
.login-brand { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.login-sub-text { font-size: 0.75rem; color: var(--text-3); margin-top: 2px; }
.login-error {
  display: none;
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--r);
  color: #dc2626;
  font-size: 0.82rem;
}

/* ════════════════════════════
   LAYOUT
════════════════════════════ */
#adminLayout { display: none; min-height: 100vh; flex-direction: column; }
#adminLayout.visible { display: flex; flex-direction: column; }

.admin-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ── Top bar ── */
.top-bar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.top-bar-left { display: flex; align-items: center; gap: 16px; }
.top-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
}
.top-bar-right { display: flex; align-items: center; gap: 10px; }
.top-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  height: 100%;
}
.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #0d1117;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
#adminEmail { font-size: 0.8rem; color: var(--text-2); }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 12px 0 24px;
}
.nav-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 14px 18px 5px;
}
.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 18px;
  font-size: 0.855rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: color var(--tr), background var(--tr);
  border-radius: 0;
}
.nav-item:hover { color: var(--text); background: #f3f4f6; }
.nav-item.active {
  color: var(--accent-d);
  font-weight: 600;
  background: var(--accent-t);
}
.nav-badge {
  background: var(--accent);
  color: #0d1117;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 100px;
}

/* ── Main ── */
.admin-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 28px 32px;
}
.page { display: none !important; }
.page.active { display: block !important; }

/* ── Page header ── */
.page-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}
.page-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}
.page-top .page-title { margin-bottom: 0; }
.page-sub { font-size: 0.8rem; color: var(--text-3); margin-top: 2px; }

/* ════════════════════════════
   BUTTONS
════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--r);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--tr);
  line-height: 1.4;
  white-space: nowrap;
}
.btn svg { width: 13px; height: 13px; }
.btn-primary { background: var(--accent); color: #0d1117; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-d); border-color: var(--accent-d); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger { background: transparent; border-color: rgba(239,68,68,0.25); color: var(--red); }
.btn-danger:hover { background: var(--red); border-color: var(--red); color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 0.78rem; }
.btn-full { width: 100%; justify-content: center; margin-top: 6px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ════════════════════════════
   CONTENT PANEL (card)
════════════════════════════ */
.content-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.content-panel > *:not(.tbl):not(table) { padding: 20px 24px; }
.content-panel > .tbl-wrap,
.content-panel > table { padding: 0; }
.panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px !important;
  border-bottom: 1px solid var(--border);
}
.panel-title { font-size: 0.9rem; font-weight: 600; }

/* ════════════════════════════
   STATS
════════════════════════════ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
}
.stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}
.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 1;
}
.stat-value.accent { color: var(--accent-d); }

/* ════════════════════════════
   TABLE
════════════════════════════ */
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead tr { border-bottom: 1px solid var(--border); }
.tbl th {
  text-align: left;
  padding: 10px 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  background: #fafafa;
}
.tbl td {
  padding: 12px 20px;
  font-size: 0.855rem;
  color: var(--text);
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: #fafafa; }
.tbl-empty {
  text-align: center;
  padding: 48px 20px !important;
  color: var(--text-3);
  font-style: italic;
}
.row-actions { display: flex; gap: 6px; }

/* ════════════════════════════
   BADGE
════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-new  { background: var(--accent-t); color: var(--accent-d); }
.badge-read { background: #f3f4f6; color: var(--text-3); }

/* ════════════════════════════
   ARTIST LIST
════════════════════════════ */
.artist-list {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.artist-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid #f3f4f6;
  transition: background var(--tr);
}
.artist-row:last-child { border-bottom: none; }
.artist-row:hover { background: #fafafa; }
.artist-ava {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-2);
  flex-shrink: 0;
}
.artist-ava img { width: 100%; height: 100%; object-fit: cover; }
.artist-info { flex: 1; min-width: 0; }
.artist-info-name { font-size: 0.9rem; font-weight: 600; }
.artist-info-role { font-size: 0.78rem; color: var(--text-2); margin-top: 2px; }
.artist-info-chips { display: flex; gap: 5px; margin-top: 6px; }
.chip {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.chip-yt { background: rgba(239,68,68,0.07); color: #dc2626; }
.chip-ig { background: rgba(219,39,119,0.07); color: #db2777; }
.chip-sp { background: rgba(22,163,74,0.07); color: #16a34a; }
.artist-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ════════════════════════════
   DETAIL TABS
════════════════════════════ */
.detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.dtab {
  padding: 8px 18px;
  font-size: 0.855rem;
  font-weight: 500;
  color: var(--text-2);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: var(--tr);
}
.dtab:hover { color: var(--text); }
.dtab.active { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.tab-pane { display: none !important; }
.tab-pane.active { display: block !important; }
.tab-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.tab-note { font-size: 0.8rem; color: var(--text-3); }
.tab-note b { color: var(--accent-d); font-weight: 700; }

/* ════════════════════════════
   CARD GRID (albums / concerts)
════════════════════════════ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.ccard {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--tr);
}
.ccard:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.07); }
.ccard-img {
  width: 100%; aspect-ratio: 1;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.ccard-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.featured-pill {
  position: absolute; top: 8px; right: 8px;
  background: var(--accent); color: #0d1117;
  font-size: 0.62rem; font-weight: 700;
  padding: 2px 7px; border-radius: 100px;
}
.ccard-body { padding: 11px 13px; flex: 1; }
.ccard-title { font-size: 0.87rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ccard-sub { font-size: 0.77rem; color: var(--text-2); margin-top: 3px; }
.ccard-desc { font-size: 0.77rem; color: var(--text-3); margin-top: 5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ccard-foot { padding: 9px 13px; border-top: 1px solid var(--border); display: flex; gap: 6px; }

/* ════════════════════════════
   FORMS
════════════════════════════ */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color var(--tr), box-shadow var(--tr);
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31,223,190,0.1);
}
.form-group input[type="file"] {
  padding: 7px 10px;
  background: var(--bg);
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-2);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-3); }
.form-group textarea { resize: vertical; min-height: 85px; line-height: 1.6; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-divider {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin: 20px 0 14px;
}
.form-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  width: 15px; height: 15px;
  margin: 0; padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.img-row { display: flex; gap: 18px; align-items: flex-start; }
.circle-preview {
  width: 90px; height: 90px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 0.72rem;
  color: var(--text-3);
}
.circle-preview img { width: 100%; height: 100%; object-fit: cover; }
.img-upload-preview {
  margin-top: -6px;
  margin-bottom: 10px;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  display: none;
}
.img-upload-preview.has-img { display: block; }
.img-upload-preview img { width: 100%; height: auto; display: block; max-height: 280px; object-fit: contain; }

/* ════════════════════════════
   MODAL
════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1rem; font-weight: 700; }
.modal-x {
  width: 26px; height: 26px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  color: var(--text-2);
  transition: var(--tr);
}
.modal-x:hover { background: #f3f4f6; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ════════════════════════════
   MESSAGE DETAIL
════════════════════════════ */
.msg-meta { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.msg-meta span { font-size: 0.82rem; color: var(--text-2); }
.msg-meta strong { color: var(--text); }
.msg-body { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); padding: 14px; line-height: 1.75; font-size: 0.875rem; color: var(--text-2); white-space: pre-wrap; min-height: 80px; }

/* ════════════════════════════
   EMPTY STATE
════════════════════════════ */
.empty-box {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
  font-size: 0.875rem;
}
.empty-box p { margin-top: 4px; }

/* ════════════════════════════
   TOAST
════════════════════════════ */
#adminToast {
  position: fixed;
  bottom: 22px; right: 22px;
  padding: 10px 16px;
  background: var(--text);
  color: var(--white);
  border-radius: var(--r);
  font-size: 0.83rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 9999;
  border-left: 3px solid var(--accent);
}
#adminToast.show { opacity: 1; transform: translateY(0); }

/* ════════════════════════════
   RESPONSIVE
════════════════════════════ */
@media (max-width: 768px) {
  .admin-body { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; top: 0; display: flex; overflow-x: auto; padding: 8px; gap: 4px; border-right: none; border-bottom: 1px solid var(--border); }
  .nav-section-label { display: none; }
  .nav-item { padding: 6px 12px; border-radius: 6px; white-space: nowrap; }
  .admin-main { padding: 20px 16px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .form-row-2 { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr 1fr; }
}
