* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Noto Sans KR', sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-logo {
  width: 200px;
  height: auto;
  margin: 0 auto 1rem;
  background: transparent;
  border: none;
  border-radius: 0;
  display: block;
  padding: 0;
}

.login-logo .yewon-logo {
  width: 100%;
  height: auto;
  max-height: 48px;
  object-fit: contain;
}

.login-card h1 {
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.login-card > p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#login-form input {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.9375rem;
}

#login-form button {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.75rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

#login-form button:hover { background: var(--primary-dark); }

.error-msg {
  color: #c0392b;
  font-size: 0.8125rem;
  margin-top: 0.75rem;
}

.login-hint {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.login-hint code {
  color: var(--primary);
  font-weight: 600;
}

.back-link {
  display: inline-block;
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: none;
}

.back-link:hover { color: var(--primary); }

.admin-header {
  background: var(--header-gradient);
  color: #fff;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-header h1 { font-size: 1.125rem; }
.admin-header p { font-size: 0.8125rem; opacity: 0.9; margin-top: 0.25rem; }

.header-actions { display: flex; gap: 0.5rem; }

.btn-primary, .btn-outline, .btn-small, .btn-danger {
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.5625rem 1rem;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-outline {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.5);
  padding: 0.5625rem 1rem;
  text-decoration: none;
}

.admin-main .btn-outline {
  color: var(--primary);
  border-color: var(--border);
  background: #fff;
}

.btn-outline:hover { opacity: 0.85; }

.btn-small {
  background: var(--bot-bg);
  color: var(--primary);
  border: 1px solid var(--border);
  padding: 0.375rem 0.75rem;
}

.btn-danger {
  background: #fff;
  color: #c0392b;
  border: 1px solid #f0c0c0;
  padding: 0.4375rem 0.875rem;
}

.admin-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.panel h2 {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.panel-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-head .panel-desc { margin-bottom: 0; }

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.settings-form textarea,
.dialog-body input[type="text"],
.dialog-body input[type="number"],
.dialog-body textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0.625rem 0.875rem;
  font-family: inherit;
  font-size: 0.875rem;
  margin-top: 0.375rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.hint { font-weight: 400; color: var(--text-muted); font-size: 0.75rem; }

.items-list { display: flex; flex-direction: column; gap: 0.75rem; }

.item-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  background: #fafafa;
}

.item-card.inactive { opacity: 0.55; }

.item-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.item-card h3 {
  font-size: 0.9375rem;
  color: var(--text);
}

.item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.item-preview {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0.5rem 0;
  white-space: pre-line;
}

.item-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

.badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  margin-left: 0.375rem;
}

.badge.off {
  background: #ccc;
}

.item-dialog {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  width: min(560px, 92vw);
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
}

.item-dialog::backdrop { background: rgba(0,0,0,0.4); }

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bot-bg);
}

.dialog-header h3 { font-size: 1rem; color: var(--primary); }

.icon-btn {
  background: none;
  border: none;
  font-size: 1.125rem;
  cursor: pointer;
  color: var(--text-muted);
}

.dialog-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.dialog-body label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.links-section { margin-top: 0.25rem; }

.links-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.links-head strong { font-size: 0.8125rem; }

.link-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.link-row input {
  margin-top: 0 !important;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

.empty-msg {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

@media (max-width: 600px) {
  .link-row { grid-template-columns: 1fr; }
  .item-card-head { flex-direction: column; }
}
