@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700;800&display=swap");
/* 나눔스퀘어 — 사용자가 지정한 본문 글꼴(무료 상업용 웹폰트, jsDelivr로 배포되는 공식 GitHub 저장소). */
@import url("https://cdn.jsdelivr.net/gh/moonspam/NanumSquare@2.0/nanumsquare.css");

/* ============================================================
   기업자금 SOLUTION — 전역 디자인 시스템
   메인 브랜드 컬러: #010133 (딥네이비)
   ============================================================ */
* { box-sizing: border-box; }

:root {
  /* 브랜드 */
  --navy: #010133;
  --navy-700: #12123f;
  --navy-600: #24245a;
  --navy-100: #e7e7f0;
  --navy-50: #f1f1f8;

  /* 뉴트럴 */
  --white: #ffffff;
  --gray-50: #f6f7f9;
  --gray-100: #eceef2;
  --gray-200: #dfe2e8;
  --gray-300: #c7cbd4;
  --gray-500: #7a8091;
  --gray-700: #454a58;
  --gray-900: #1a1c24;

  /* 시맨틱 */
  --info: #2f6fed;
  --success: #17915a;
  --success-bg: #e8f7ef;
  --warning: #b5790a;
  --warning-bg: #fff6e0;
  --danger: #d64545;
  --danger-bg: #fdecec;

  /* 레이아웃 */
  --sidebar-w: 240px;
  --sidebar-w-collapsed: 76px;
  --header-h: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 15, 40, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 15, 40, 0.06);
}

html, body { height: 100%; }
body {
  font-family: "NanumSquare", "Noto Sans KR", -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
  margin: 0;
  background: var(--gray-50);
  color: var(--gray-900);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; }

/* ---------- App Shell (Sidebar + Main) ---------- */
.app-shell { display: flex; min-height: 100vh; }

.main-area {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  transition: margin-left 0.18s ease;
  display: flex;
  flex-direction: column;
}
.app-shell.sidebar-collapsed .main-area { margin-left: var(--sidebar-w-collapsed); }

.main-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  position: sticky;
  top: 0;
  z-index: 5;
}
.main-header h2 { font-size: 16px; font-weight: 700; color: var(--gray-900); }
.header-right { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--gray-700); }

.main-content {
  flex: 1;
  padding: 28px;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--navy);
  color: #cfd2e6;
  display: flex;
  flex-direction: column;
  transition: width 0.18s ease;
  z-index: 10;
  overflow: hidden;
}
.app-shell.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  white-space: nowrap;
}
.sidebar-brand .mark {
  width: 34px; height: 34px; min-width: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #4a4fd1, #7d5fe0);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: white; font-size: 14px;
}
.sidebar-brand .text { font-size: 12.5px; line-height: 1.4; overflow: hidden; }
.sidebar-brand .text b { display: block; color: #fff; font-size: 13.5px; font-weight: 700; }
.app-shell.sidebar-collapsed .sidebar-brand .text { display: none; }

.sidebar-toggle {
  margin-left: auto;
  background: none; border: none; color: #8b8fb3; cursor: pointer;
  padding: 4px; border-radius: 6px; display: flex;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.08); color: white; }
.app-shell.sidebar-collapsed .sidebar-toggle { margin: 0 auto; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px; }
.sidebar-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 10px 12px; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13.5px; font-weight: 500;
  color: #cfd2e6; white-space: nowrap; margin-bottom: 2px;
}
.nav-item svg { flex: none; width: 19px; height: 19px; stroke: currentColor; }
.nav-item:hover { background: rgba(255,255,255,0.08); color: #ffffff; }
.nav-item.active { background: #ffffff; color: var(--navy); font-weight: 700; }
.app-shell.sidebar-collapsed .nav-item { justify-content: center; padding: 10px; }
.app-shell.sidebar-collapsed .nav-item .label { display: none; }
.app-shell.sidebar-collapsed .sidebar-nav { padding: 10px 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: var(--radius-sm);
  padding: 10px 18px; cursor: pointer; font-size: 13.5px; font-weight: 600;
  font-family: inherit; transition: opacity 0.15s ease, transform 0.1s ease;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { opacity: 0.92; }
.btn-secondary { background: var(--white); color: var(--navy); border: 1px solid var(--navy); }
.btn-secondary:hover { background: var(--navy-50); }
.btn-ghost { background: transparent; color: var(--gray-700); border: 1px solid var(--gray-200); }
.btn-ghost:hover { background: var(--gray-50); }
.btn-danger { background: var(--danger); color: #fff; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* ---------- Card ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}

/* ---------- Form controls ---------- */
label {
  font-size: 12.5px; font-weight: 600; color: var(--gray-700);
  display: block; margin-bottom: 6px;
}
input, select, textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-900);
  font-size: 13.5px;
  font-family: inherit;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--gray-300); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--navy-100);
}
.field { margin-bottom: 16px; }
.field.checkbox { display: flex; align-items: center; gap: 8px; height: 40px; }
.field.checkbox input { width: auto; height: auto; }
.field.checkbox label { margin: 0; }

.error-msg { color: var(--danger); font-size: 13px; margin-top: 8px; }
.ok-msg { color: var(--success); font-size: 13px; margin-top: 8px; }

.section-title {
  font-size: 13px; font-weight: 700; color: var(--navy);
  margin-bottom: 14px; display: flex; align-items: center; gap: 6px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ---------- Badge ---------- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.badge-gray { background: var(--gray-100); color: var(--gray-700); }
.badge-info { background: #eaf1fe; color: var(--info); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; padding: 10px 12px; color: var(--gray-500);
  font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--gray-100);
  white-space: nowrap;
}
.data-table td {
  padding: 12px; border-bottom: 1px solid var(--gray-50); color: var(--gray-900);
  white-space: nowrap;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table a.row-link { color: var(--navy); font-weight: 700; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 30px 10px; color: var(--gray-500); font-size: 12.5px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .main-content { padding: 20px; }
}
@media (max-width: 860px) {
  .sidebar { width: var(--sidebar-w-collapsed); }
  .sidebar-brand .text { display: none; }
  .nav-item .label { display: none; }
  .nav-item { justify-content: center; }
  .main-area { margin-left: var(--sidebar-w-collapsed); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid-4 { grid-template-columns: 1fr; }
  .main-header { padding: 0 16px; }
  .main-content { padding: 16px; }
}
