* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Malgun Gothic", sans-serif;
  color: #1f2937;
  background: #f3f4f6;
  font-size: 14px;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===================== 로그인 (2열) ===================== */
.login-wrap {
  display: grid;
  grid-template-columns: 45% 55%;
  min-height: 100vh;
}
.login-brand {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #3b82f6 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px;
}
.login-brand .logo {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 16px;
}
.login-brand .tagline { font-size: 17px; opacity: .9; line-height: 1.6; max-width: 420px; }
.login-brand .meta { margin-top: 48px; font-size: 13px; opacity: .7; }

.login-form-col {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: #fff;
}
.login-card { width: 100%; max-width: 360px; }
.login-card h2 { margin: 0 0 4px; font-size: 24px; }
.login-card p.sub { margin: 0 0 28px; color: #6b7280; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #374151; }
.field input {
  width: 100%; padding: 12px 14px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 15px;
}
.field input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.btn-primary {
  width: 100%; padding: 12px; border: 0; border-radius: 8px; background: #2563eb; color: #fff;
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn-primary:hover { background: #1d4ed8; }
.alert-error {
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; padding: 10px 14px;
  border-radius: 8px; margin-bottom: 18px; font-size: 13px;
}
@media (max-width: 768px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { padding: 40px; min-height: 220px; }
}

/* ===================== 관리자 셸 ===================== */
.app-header {
  height: 56px; background: #111827; color: #fff; display: flex; align-items: center;
  justify-content: space-between; padding: 0 20px; position: fixed; top: 0; left: 0; right: 0; z-index: 20;
}
.app-header .brand { font-weight: 700; font-size: 16px; }
.app-header .brand span { color: #60a5fa; }
.app-header .user { font-size: 13px; color: #d1d5db; }
.app-header .user a { color: #93c5fd; margin-left: 12px; }

.app-sidebar {
  position: fixed; top: 56px; bottom: 0; left: 0; width: 220px; background: #1f2937; color: #cbd5e1;
  padding: 16px 0; overflow-y: auto;
}
.app-sidebar a {
  display: block; padding: 12px 22px; color: #cbd5e1; font-size: 14px; border-left: 3px solid transparent;
}
.app-sidebar a:hover { background: #374151; text-decoration: none; }
.app-sidebar a.active { background: #111827; color: #fff; border-left-color: #3b82f6; font-weight: 600; }
.app-sidebar .group { padding: 8px 22px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; margin-top: 8px; }

.app-content {
  margin-top: 56px; margin-left: 220px; width: calc(100% - 220px); min-height: calc(100vh - 56px);
  padding: 24px 28px;
}
.app-content h1 { margin: 0 0 20px; font-size: 22px; }

/* 카드 / 통계 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 18px 20px; }
.stat-card .label { font-size: 13px; color: #6b7280; margin-bottom: 8px; }
.stat-card .value { font-size: 26px; font-weight: 700; }

.panel { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 0; margin-bottom: 24px; overflow: hidden; }
.panel-head { padding: 14px 18px; border-bottom: 1px solid #e5e7eb; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }

/* 테이블 */
table.data { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
table.data th, table.data td { padding: 9px 10px; border-bottom: 1px solid #eef0f3; text-align: left; vertical-align: middle; }
table.data th { background: #f9fafb; font-weight: 600; color: #374151; white-space: nowrap; }
table.data tr:hover td { background: #f9fafb; }
table.data img.thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 4px; background: #eee; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge.success { background: #dcfce7; color: #166534; }
.badge.failed { background: #fee2e2; color: #991b1b; }
.badge.running { background: #fef9c3; color: #854d0e; }

.btn {
  display: inline-block; padding: 9px 16px; border-radius: 8px; border: 1px solid #2563eb; background: #2563eb;
  color: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn:hover { background: #1d4ed8; text-decoration: none; }
.btn.secondary { background: #fff; color: #2563eb; }
.btn.secondary:hover { background: #eff6ff; }
.btn.gray { background: #6b7280; border-color: #6b7280; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar input[type=text], .toolbar select { padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px; }

.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 18px; }
.pagination a, .pagination span {
  padding: 7px 12px; border: 1px solid #e5e7eb; border-radius: 7px; background: #fff; font-size: 13px; color: #374151;
}
.pagination span.cur { background: #2563eb; color: #fff; border-color: #2563eb; }

.kv { width: 100%; border-collapse: collapse; }
.kv th { text-align: left; width: 180px; padding: 10px 12px; background: #f9fafb; border-bottom: 1px solid #eef0f3; font-weight: 600; color: #374151; }
.kv td { padding: 10px 12px; border-bottom: 1px solid #eef0f3; }

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; }
.flash.ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.flash.err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.muted { color: #9ca3af; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
