/* style.css - 다크모드 기본 */
:root {
  --bg: #0f1115;
  --panel: #161a22;
  --border: #2a2f3a;
  --text: #e6e7eb;
  --subtext: #a9afbb;
  --accent: #4f8cff;
  --danger: #ff5c5c;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body.dark {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Apple SD Gothic Neo, "Noto Sans KR", "Malgun Gothic", sans-serif;
}

/* 상단바 */
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.topbar h1 { margin: 0; font-size: 18px; }

/* 레이아웃 */
.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 56px);
}
.sidebar {
  border-right: 1px solid var(--border);
  background: var(--panel);
  padding: 12px;
}
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.cat-actions button, .content-header .right button, .modal-actions button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.cat-actions button + button,
.content-header .right button + button { margin-left: 6px; }
.cat-actions button:hover,
.content-header .right button:hover,
.modal-actions button:hover { filter: brightness(1.1); }

.category-list {
  list-style: none; padding: 0; margin: 0;
}
.category-list li {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
}
.category-list li.active {
  background: #1b2130;
  border-color: #3c4a66;
}

/* 우측 영역 */
.content { padding: 16px; }
.content-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.search-box { display: inline-flex; gap: 8px; align-items: center; } /* ★ */
.search-box input {                                                  /* ★ */
  width: 220px;                                                      /* ★ */
  padding: 8px 10px;                                                 /* ★ */
  border-radius: 8px;                                                /* ★ */
  border: 1px solid var(--border);                                   /* ★ */
  background: #0f1420;                                               /* ★ */
  color: var(--text);                                                /* ★ */
}                                                                    /* ★ */

.content-header h3 { margin: 0; }

.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  border-bottom: 1px solid var(--border);
  padding: 10px;
  vertical-align: top;
}
.table thead th { background: #141925; position: sticky; top: 0; }
.table tbody tr:hover { background: #141826; }
.table a { color: var(--accent); }

/* 모달 */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: none; align-items: center; justify-content: center;
  padding: 16px; z-index: 50;
}
.modal-backdrop.show { display: flex; }
.modal {
  width: 100%; max-width: 680px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.modal h2 { margin-top: 0; }
.modal label { display: block; margin: 10px 0; }
.modal input[type="text"],
.modal input[type="password"],
.modal input[type="file"],
.modal textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1420;
  color: var(--text);
}
.modal-actions {
  margin-top: 12px; display: flex; gap: 8px; justify-content: flex-end;
}
.error { color: var(--danger); margin-top: 8px; }
.hidden { display: none; }
.pre {
  white-space: pre-wrap; word-break: break-word;
}
.hint { color: var(--subtext); font-size: 12px; margin-top: 6px; }
