* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, "Malgun Gothic", sans-serif;
  background: #f5f7fa;
  color: #202939;
}
:root {
  --navy: #1f3a5f;
  --navy-dark: #172b46;
  --purple: #6a1b9a;
  --bg: #f5f7fa;
  --border: #d9e1ec;
  --muted: #667085;
}
.erp-topbar {
  height: 72px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(15,23,42,.04);
}
.erp-brand { display: flex; align-items: center; gap: 14px; }
.erp-logo { width: 118px; max-height: 46px; object-fit: contain; }
.erp-title-wrap { border-left: 1px solid #e6edf5; padding-left: 14px; }
.erp-title { font-size: 21px; font-weight: 900; color: var(--navy); }
.erp-subtitle { margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.erp-user-area { display: flex; align-items: center; gap: 14px; }
.erp-user-info { text-align: right; line-height: 1.3; }
.erp-user-name { display: block; font-weight: 900; font-size: 14px; }
.erp-user-role { display: block; color: var(--purple); font-weight: 800; font-size: 12px; }
.erp-clock { color: var(--muted); font-size: 13px; font-weight: 700; }
.erp-user-link, .erp-logout {
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 900;
}
.erp-user-link { color: var(--purple); background: #f3e8ff; }
.erp-logout { color: #fff; background: var(--navy); }
.erp-icon-button {
  width: 39px; height: 39px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 12px;
  cursor: pointer;
}
.erp-layout { display: flex; min-height: calc(100vh - 72px); }
.erp-sidebar {
  width: 280px;
  background: var(--navy-dark);
  color: #fff;
  padding: 18px 12px;
  overflow-y: auto;
  flex-shrink: 0;
}
.erp-sidebar-group { margin-bottom: 14px; }
.erp-sidebar-toggle {
  width: 100%;
  border: none;
  background: transparent;
  color: rgba(255,255,255,.58);
  padding: 8px 12px;
  margin: 4px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: inherit;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .5px;
  cursor: pointer;
}
.erp-sidebar-group.collapsed .erp-sidebar-menu { display: none; }
.erp-sidebar a {
  display: block;
  color: rgba(255,255,255,.9);
  text-decoration: none;
  padding: 10px 12px;
  margin: 3px 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  transition: all .15s ease;
}
.erp-sidebar a:hover, .erp-sidebar a.active {
  background: rgba(255,255,255,.15);
  color: #fff;
}
.erp-main { flex: 1; min-width: 0; padding: 26px; }
.erp-footer {
  margin-top: 24px;
  padding: 14px 2px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.erp-auth-page {
  min-height: calc(100vh - 72px);
  background: var(--bg);
  padding: 28px 18px;
}
.login-wrap {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 34px 36px;
  box-shadow: 0 6px 18px rgba(15,23,42,.045);
}
.login-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 26px;
  padding-bottom: 22px;
  border-bottom: 1px solid #e6edf5;
}
.login-logo img {
  width: 175px;
  max-height: 90px;
  object-fit: contain;
}
.page-header, .table-card, .form-card, .detail-card, .box, .cards > div {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 6px 18px rgba(15,23,42,.045);
}
.page-header h1 { margin: 0 0 8px; color: var(--navy); font-weight: 900; }
.page-header p { margin: 0; color: var(--muted); font-weight: 700; }
.row-between, .row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.cards, .status-panel { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.cards b, .status-panel strong { display: block; font-size: 28px; color: var(--navy); margin-top: 8px; }
.table-card { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border-radius: 16px; overflow: hidden; }
th, td { padding: 12px 10px; border-bottom: 1px solid #eef2f7; text-align: left; vertical-align: top; }
th { background: #f8fafc; color: #344054; font-size: 13px; font-weight: 900; }
tbody tr:hover { background: #f8fafc; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
label { display: block; margin: 12px 0 6px; font-weight: 900; color: #344054; }
input, select, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #cfd8e3;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
}
textarea { min-height: 110px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(106,27,154,.12);
}
.password-field { display: flex; gap: 8px; align-items: center; }
.password-field input { flex: 1; }
.password-toggle {
  white-space: nowrap;
  border: 1px solid #cfd8e3;
  background: #f8fafc;
  color: #344054;
  border-radius: 10px;
  padding: 12px 11px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
}
.primary-btn, .primary-link, .secondary-link, .small-btn {
  text-decoration: none;
  border: none;
  border-radius: 10px;
  padding: 10px 13px;
  font-weight: 900;
  font-family: inherit;
  display: inline-block;
  cursor: pointer;
}
.primary-btn, .primary-link { background: var(--navy); color: #fff; }
.secondary-link, .small-btn { background: #eef2f7; color: #344054; }
.full { width: 100%; margin-top: 20px; }
.inline-actions, .button-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-actions form { margin: 0; }
.button-like { border: none; cursor: pointer; font-family: inherit; }
.danger-small { background: #fee4e2 !important; color: #912018 !important; }
.badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: #eef2f7;
  color: #344054;
  margin: 2px;
}
.status-사용 { background: #d1fadf; color: #05603a; }
.status-잠금, .status-퇴사 { background: #fee4e2; color: #912018; }
.small-text { color: var(--muted); font-size: 12px; font-weight: 700; }
.mono { font-family: Consolas, monospace; }
.permission-box { margin-top: 18px; padding: 16px; background: #f8fafc; border: 1px solid #e6edf5; border-radius: 14px; }
.permission-box h2 { margin: 0 0 6px; color: var(--navy); }
.permission-box p { margin: 0 0 12px; color: var(--muted); font-weight: 700; }
.permission-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.check-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin: 0;
  display: flex;
  gap: 8px;
  align-items: center;
}
.flash-wrap { margin-bottom: 14px; }
.alert {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 800;
}
@media (max-width: 1000px) {
  .erp-layout { display: block; }
  .erp-sidebar { width: 100%; }
  .cards, .status-panel, .permission-grid, .form-grid { grid-template-columns: 1fr; }
  .row-between, .row { display: block; }
}
