:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #EBF4FF;
  --success-bg: #DCFCE7;
  --success-text: #16a34a;
  --warn-bg: #FEF3C7;
  --warn-text: #D97706;
  --danger-bg: #FEE2E2;
  --danger-text: #E24B4A;
  --neutral-bg: #e8e8e5;
  --neutral-text: #6b7280;
  --border: #e5e7eb;
  --surface: #f9fafb;
  --topnav-h: 52px;
}

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

body {
  font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
  font-size: 14px;
  background: #f3f4f6;
  color: #111;
}

/* ── 상단 네비게이션 ── */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--topnav-h);
  background: #1e1b4b;
  display: flex; align-items: center; gap: 0;
  padding: 0 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.topnav-brand {
  color: #fff; font-size: 15px; font-weight: 700;
  text-decoration: none; white-space: nowrap;
  margin-right: 20px; line-height: 1.2;
}
.topnav-brand small { display: block; font-size: 10px; font-weight: 400; color: #a5b4fc; }

.topnav-menu { display: flex; align-items: center; gap: 2px; flex: 1; }

.topnav-item { position: relative; }

.topnav-link {
  display: block; padding: 0 14px; height: var(--topnav-h); line-height: var(--topnav-h);
  color: #c7d2fe; font-size: 13px; font-weight: 500;
  text-decoration: none; white-space: nowrap;
  border-radius: 4px; cursor: pointer;
  transition: background .15s, color .15s;
}
.topnav-link:hover, .topnav-link.active { background: rgba(255,255,255,.12); color: #fff; }

/* 드롭다운 */
.topnav-dropdown { display: none; }
.topnav-item:hover .topnav-dropdown {
  display: block;
  position: absolute; top: var(--topnav-h); left: 0;
  background: #fff; border: 1px solid var(--border);
  border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,.12);
  min-width: 160px; z-index: 9999;
  padding: 4px 0;
}
.topnav-dropdown a {
  display: block; padding: 8px 16px;
  color: #374151; font-size: 13px; text-decoration: none;
}
.topnav-dropdown a:hover { background: var(--primary-light); color: var(--primary); }

.topnav-right {
  margin-left: auto; display: flex; align-items: center; gap: 12px;
  color: #a5b4fc; font-size: 12px;
}
.topnav-right span { color: #e0e7ff; font-weight: 600; }
.topnav-right a { color: #a5b4fc; text-decoration: none; font-size: 12px; }
.topnav-right a:hover { color: #fff; }

/* ── 본문 ── */
.page-body {
  margin-top: var(--topnav-h);
  padding: 28px 32px;
  min-height: calc(100vh - var(--topnav-h));
}

.page-title {
  font-size: 18px; font-weight: 700; color: #1e1b4b;
  margin-bottom: 20px;
}

/* ── 카드 ── */
.card {
  background: #fff; border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  padding: 20px;
}

.card-title {
  font-size: 13px; font-weight: 700; color: #374151;
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ── 대시보드 그리드 ── */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff; border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  padding: 20px 24px;
  display: flex; flex-direction: column; gap: 6px;
}
.stat-card .label { font-size: 12px; color: #6b7280; }
.stat-card .value { font-size: 28px; font-weight: 700; color: #1e1b4b; }

/* ── 테이블 ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  background: #374151; color: #fff;
  padding: 8px 12px; text-align: center; font-weight: 600;
}
.data-table td {
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  text-align: center;
}
.data-table tr:hover td { background: var(--primary-light); }

/* ── 상태 배지 ── */
.badge {
  display: inline-block; border-radius: 999px;
  padding: 2px 10px; font-size: 12px; font-weight: 600;
}
.badge-draft   { background: var(--neutral-bg); color: var(--neutral-text); }
.badge-review  { background: var(--warn-bg);    color: var(--warn-text); }
.badge-approved{ background: var(--success-bg); color: var(--success-text); }
.badge-rejected{ background: var(--danger-bg);  color: var(--danger-text); }

/* ── 버튼 ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 6px; border: none;
  font-size: 13px; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: background .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline {
  background: #fff; color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }
.btn-danger { background: var(--danger-bg); color: var(--danger-text); border: 1px solid #fca5a5; }

/* ── 로그인 페이지 ── */
.login-wrap {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: #f3f4f6;
}
.login-box {
  background: #fff; border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(0,0,0,.1);
  padding: 40px 36px; width: 360px;
}
.login-title {
  text-align: center; font-size: 20px; font-weight: 700;
  color: #1e1b4b; margin-bottom: 4px;
}
.login-sub {
  text-align: center; font-size: 12px; color: #6b7280;
  margin-bottom: 28px;
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 4px; }
.form-group input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 14px; outline: none;
  transition: border-color .15s;
}
.form-group input:focus { border-color: var(--primary); }
.login-btn {
  width: 100%; padding: 10px; background: var(--primary); color: #fff;
  border: none; border-radius: 6px; font-size: 14px; font-weight: 700;
  cursor: pointer; margin-top: 8px; transition: background .15s;
}
.login-btn:hover { background: var(--primary-hover); }
.login-error {
  background: var(--danger-bg); color: var(--danger-text);
  border-radius: 6px; padding: 8px 12px;
  font-size: 13px; margin-bottom: 16px; text-align: center;
}
