:root {
  --sidebar-w: 240px;
  --detail-w: 380px;
  --header-h: 56px;
  --bg-app: #080807;
  --bg-card: rgba(18, 17, 16, 0.9);
  --bg-input: rgba(28, 27, 25, 0.94);
  --border-color: rgba(255, 255, 255, 0.12);
  --border-dark: rgba(255, 255, 255, 0.22);
  --text-main: #f5f1ea;
  --text-sub: #c7beb4;
  --text-muted: #8c847b;
  --accent: #ff6a2a;
  --accent-hover: #ff8a3d;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 4px;
  --shadow-sm: 0 12px 40px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 22px 70px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 32px 90px rgba(0, 0, 0, 0.58);
  --glass-blur: blur(18px);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans KR", sans-serif;
  background-color: var(--bg-app);
  background-image: radial-gradient(ellipse 90% 45% at 50% 100%, rgba(255, 106, 42, 0.26) 0%, rgba(46, 178, 139, 0.08) 34%, rgba(8, 8, 7, 0) 74%), linear-gradient(180deg, #10100f 0%, #080807 72%);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px), radial-gradient(circle at 50% 100%, rgba(255, 106, 42, 0.14), transparent 48%);
  background-size: 80px 100%, 100% 100%;
  opacity: 0.45;
}

body.sidebar-collapsed {
  --sidebar-w: 72px;
}

main {
  transition: margin-left 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

a {
  color: var(--accent-hover);
}

.custom-card {
  background: var(--bg-card);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.brand-symbol { width: 28px; height: 28px; display: block; }

.btn-custom {
  background: linear-gradient(180deg, #ff8a3d 0%, #ff5d22 100%);
  color: #fff7ed;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(255, 106, 42, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.btn-custom:hover {
  background: linear-gradient(180deg, #ff9a54 0%, #ff6a2a 100%);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff7ed;
  transform: translateY(-1px);
}

.btn-custom-outline {
  background-color: rgba(255, 255, 255, 0.035);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 8px 17px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.btn-custom-outline:hover {
  background-color: rgba(255, 255, 255, 0.07);
  border-color: var(--border-dark);
  color: var(--text-main);
  transform: translateY(-1px);
}

.btn-danger-soft {
  background-color: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.btn-danger-soft:hover {
  background-color: rgba(239, 68, 68, 0.18);
}

.form-control-custom {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background-color: var(--bg-input);
  font-size: 13.5px;
  color: var(--text-main);
  outline: none;
  transition: all 0.16s ease;
}

.form-control-custom::placeholder {
  color: #9c938a;
}

.form-control-custom:focus {
  border-color: rgba(255, 106, 42, 0.48);
  background-color: rgba(30, 27, 24, 0.96);
  box-shadow: 0 0 0 3px rgba(255, 106, 42, 0.08);
}

.form-control-custom.field-error,
.field-error {
  border-color: rgba(248, 113, 113, 0.84) !important;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.16) !important;
}

.form-control-custom.field-error::placeholder,
.field-error::placeholder {
  color: #fca5a5;
}

select.form-control-custom {
  appearance: none;
  -webkit-appearance: none;
}

@keyframes pulse {
  0% { opacity: 0.5; }
  50% { opacity: 0.8; }
  100% { opacity: 0.5; }
}

.skeleton-text {
  height: 12px;
  background-color: #1c1c1f;
  border-radius: 3px;
  width: 100%;
  animation: pulse 1.5s infinite ease-in-out;
}

.skeleton-text.short { width: 60%; }
.skeleton-text.medium { width: 80%; }

.skeleton-title {
  height: 20px;
  background-color: #1c1c1f;
  border-radius: 3px;
  width: 40%;
  margin-bottom: 12px;
  animation: pulse 1.5s infinite ease-in-out;
}

.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-folder-icon {
  width: 44px;
  height: 44px;
  background-color: #1c1c1f;
  border-radius: var(--radius-md);
  animation: pulse 1.5s infinite ease-in-out;
}

.spinner-custom {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

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

.custom-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.custom-modal.show { display: flex; }

.custom-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
  padding: 24px;
  position: relative;
  animation: modalIn 0.15s ease-out;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.custom-modal-content h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 10px;
}

.custom-modal-message {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 18px;
  line-height: 1.7;
}

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

@keyframes modalIn {
  from { transform: scale(0.98); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.custom-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 12px 16px;
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s;
  pointer-events: none;
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.custom-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.custom-toast.ok i { color: #34d399; }
.custom-toast.err i { color: #f87171; }
.custom-toast.info i { color: #60a5fa; }

.dot-grid {
  background-image: radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), radial-gradient(ellipse 80% 40% at 50% 100%, rgba(255, 106, 42, 0.16), transparent 70%);
  background-size: 20px 20px, 100% 100%;
}

.page-main {
  margin-top: 56px;
  margin-left: var(--sidebar-w);
  padding: 28px 32px 80px;
  min-height: calc(100vh - 56px);
  transition: margin-left 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.page-head h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.page-head p {
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 4px;
  line-height: 1.65;
}

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

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
}

.stat-card span {
  font-size: 11.5px;
  color: var(--text-sub);
}

.stat-card strong {
  display: block;
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  margin: 6px 0 2px;
  letter-spacing: -0.5px;
}

.stat-card small {
  font-size: 11px;
  color: var(--text-muted);
}

.stat-card .stat-up { color: #34d399; }

.section-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  margin-bottom: 20px;
}

.section-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-card-head h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.pill-tabs {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.pill-tab {
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-sub);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.pill-tab.active {
  border-color: rgba(255, 106, 42, 0.4);
  color: #ffb173;
  background-color: rgba(255, 106, 42, 0.08);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.data-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: #aaa298;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  color: #d1c8be;
}

.data-table tr:hover td { background-color: rgba(255, 255, 255, 0.02); }
.data-table td strong { color: var(--text-main); font-weight: 600; }

.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-app);
  color: #d3cbc2;
}

.tag-badge.green { color: #34d399; border-color: rgba(52, 211, 153, 0.28); background-color: rgba(52, 211, 153, 0.08); }
.tag-badge.orange { color: #ffb173; border-color: rgba(255, 106, 42, 0.28); background-color: rgba(255, 106, 42, 0.08); }
.tag-badge.blue { color: #60a5fa; border-color: rgba(96, 165, 250, 0.28); background-color: rgba(96, 165, 250, 0.08); }
.tag-badge.red { color: #f87171; border-color: rgba(239, 68, 68, 0.28); background-color: rgba(239, 68, 68, 0.08); }
.tag-badge.gray { color: var(--text-muted); }

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

.media-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.media-card:hover { transform: translateY(-2px); border-color: var(--border-dark); }

.media-thumb {
  position: relative;
  aspect-ratio: 9 / 16;
  background: linear-gradient(160deg, #221f1c, #0c0b0a);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 30px;
}

.media-thumb img { width: 100%; height: 100%; object-fit: cover; }

.media-thumb .thumb-rank {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background-color: rgba(0, 0, 0, 0.7);
  color: #ffb173;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-thumb .thumb-tag {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background-color: rgba(0, 0, 0, 0.72);
  color: #fff;
}

.media-body { padding: 12px 13px 14px; }

.media-body h3 {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.media-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 11px;
  color: #aaa298;
}

.media-actions { display: flex; gap: 6px; margin-top: 10px; }

.mini-action {
  flex: 1;
  text-align: center;
  border: 1px solid var(--border-color);
  background-color: var(--bg-app);
  color: var(--text-sub);
  border-radius: var(--radius-sm);
  padding: 6px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.mini-action.primary {
  border-color: rgba(255, 106, 42, 0.3);
  color: #ffb173;
  background-color: rgba(255, 106, 42, 0.07);
}

.empty-hint {
  text-align: center;
  padding: 54px 22px;
  color: #aaa298;
  font-size: 13px;
  line-height: 1.65;
}

.empty-hint i {
  font-size: 34px;
  display: block;
  margin-bottom: 10px;
  opacity: 0.75;
  color: #ffb173;
}

.friendly-panel {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 106, 42, 0.08), rgba(52, 211, 153, 0.035) 46%, rgba(18, 17, 16, 0.92));
  box-shadow: var(--shadow-sm);
  padding: 22px;
  margin-bottom: 20px;
}

.friendly-panel.compact { padding: 18px; }

.friendly-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.friendly-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 106, 42, 0.15);
  color: #ffb173;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.friendly-title {
  color: var(--text-main);
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 5px;
}

.friendly-copy {
  color: #c9c0b7;
  font-size: 12.5px;
  line-height: 1.7;
}

.friendly-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.friendly-step {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.035);
  padding: 14px;
}

.friendly-step b {
  display: block;
  color: var(--text-main);
  font-size: 12.5px;
  margin-bottom: 5px;
}

.friendly-step span {
  display: block;
  color: #aaa298;
  font-size: 11.5px;
  line-height: 1.55;
}

.quick-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.quick-chip,
button.quick-chip {
  border: 1px solid rgba(255, 106, 42, 0.28);
  background: rgba(255, 106, 42, 0.08);
  color: #ffd0b5;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  cursor: pointer;
}

.quick-chip:hover {
  background: rgba(255, 106, 42, 0.14);
  border-color: rgba(255, 106, 42, 0.42);
  color: #fff2e8;
}

.empty-panel {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.035);
  padding: 42px 24px;
  text-align: center;
  color: #bdb4aa;
  margin-bottom: 20px;
}

.empty-panel > i {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 106, 42, 0.12);
  color: #ffb173;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  margin-bottom: 14px;
}

.empty-panel strong {
  display: block;
  color: var(--text-main);
  font-size: 15px;
  margin-bottom: 6px;
}

.empty-panel p {
  color: #aaa298;
  font-size: 12.5px;
  line-height: 1.7;
  margin: 0 auto;
  max-width: 520px;
}

.empty-panel .empty-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.state-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #c9c0b7;
  font-size: 12px;
  line-height: 1.6;
}

.state-note i {
  color: #ffb173;
  font-size: 16px;
  margin-top: 1px;
}

.switch { font-size: 10px; font-weight: 800; padding: 3px 9px; border-radius: 999px; letter-spacing: 0.5px; }
.switch.on { background-color: rgba(52, 211, 153, 0.14); color: #34d399; }
.switch.off { background-color: rgba(255, 255, 255, 0.06); color: var(--text-muted); }

.dj-field { margin-bottom: 16px; }
.dj-field label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 7px; color: var(--text-main); }
.dj-field .hint { font-size: 11px; color: var(--text-muted); margin-top: 5px; }

textarea.form-control-custom { resize: vertical; min-height: 80px; font-family: inherit; line-height: 1.6; }

.dj-toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.dj-toggle input { opacity: 0; width: 0; height: 0; }
.dj-toggle .slider { position: absolute; cursor: pointer; inset: 0; background-color: rgba(255,255,255,0.1); border-radius: 999px; transition: 0.2s; }
.dj-toggle .slider::before { content: ""; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: #fff; border-radius: 50%; transition: 0.2s; }
.dj-toggle input:checked + .slider { background: linear-gradient(180deg, #ff8a3d, #ff5d22); }
.dj-toggle input:checked + .slider::before { transform: translateX(18px); }

.mp-usage-modal {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.mp-usage-modal-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  color: #d8cec6;
  font-size: 12px;
  text-align: left;
}

.mp-usage-modal-row span {
  color: #aaa198;
}

.mp-usage-modal-row b {
  color: #fff7ef;
  font-weight: 900;
  text-align: right;
}

@media (max-width: 980px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .friendly-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .page-main { margin-left: 0; padding: 20px 16px 60px; }
  .friendly-panel,
  .empty-panel { padding: 18px; }
  .friendly-head { gap: 11px; }
  .friendly-icon { width: 38px; height: 38px; border-radius: 10px; }
  .quick-chip-row { gap: 7px; }
  .quick-chip,
  button.quick-chip { font-size: 11.5px; padding: 7px 10px; }
}
