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

:root {
  --bg: #f0f4f8;
  --surface: #ffffff;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #cbd5e1;
  --radius: 10px;
}

html {
  font-size: 11px;
}

body {
  font-family: "Segoe UI", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0.9rem;
  line-height: 1.4;
}

.container {
  width: 100%;
  max-width: 420px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.2rem 1.05rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

h1 {
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.3rem;
}

.subtitle {
  font-size: 0.63rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1.2rem;
}

.form-group {
  margin-bottom: 0.75rem;
}

label {
  display: block;
  font-size: 0.66rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  font-size: 0.69rem;
  padding: 0.54rem 0.6rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
  background: white;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
}

.btn {
  display: block;
  width: 100%;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.6rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 0.3rem;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.btn-secondary {
  background: #e2e8f0;
  color: var(--text);
}

.btn-secondary:hover {
  background: #cbd5e1;
}

.error-message {
  display: none;
  background: #fef2f2;
  color: var(--danger);
  font-size: 0.63rem;
  font-weight: 600;
  padding: 0.54rem 0.6rem;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  text-align: center;
}

.error-message.visible {
  display: block;
}

.user-info {
  font-size: 0.69rem;
  text-align: center;
  margin-bottom: 0.9rem;
  color: var(--text-muted);
}

.user-info strong {
  color: var(--text);
  font-size: 0.75rem;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.status-box {
  background: #f8fafc;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-bottom: 0.9rem;
  text-align: center;
}

.status-box p {
  font-size: 0.66rem;
  margin-bottom: 0.2rem;
}

.status-box .time {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
}

.logout-link {
  display: block;
  text-align: center;
  margin-top: 0.9rem;
  font-size: 0.6rem;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
}

/* ---- 관리자 화면 공통 컨테이너 (넓은 화면용) ---- */
.admin-container,
.payroll-container,
.admin-edu-container,
.match-container,
.grade-container,
.register-container,
.acc-container,
.lb-container {
  max-width: 780px;
}

/* ---- 관리자 상단 네비게이션 메뉴 (가로 스크롤) ---- */
.admin-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.admin-nav::-webkit-scrollbar {
  height: 5px;
}

.admin-nav::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.admin-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.33rem 0.6rem;
  border-radius: 999px;
  font-size: 0.53rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-muted);
  background: #eef2f7;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.admin-nav-link:hover {
  background: #e2e8f0;
  color: var(--text);
}

.admin-nav-link.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary-hover);
}

.admin-nav-edit-toggle {
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  padding: 0.33rem 0.6rem;
  font-size: 0.53rem;
  font-weight: 700;
  cursor: pointer;
  background: #dbeafe;
  color: var(--primary);
  white-space: nowrap;
  margin-left: 0.2rem;
}

.admin-nav-edit-toggle:hover {
  background: #bfdbfe;
}

.admin-nav-edit-item {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
}

.admin-nav-move-btn {
  border: none;
  background: #e2e8f0;
  color: var(--text);
  border-radius: 999px;
  width: 1.2rem;
  height: 1.2rem;
  font-size: 0.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}

.admin-nav-move-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.admin-nav-move-btn:hover:not(:disabled) {
  background: #cbd5e1;
}

/* ---- 공통 표(table) 스타일 ---- */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.6rem;
}

th,
td {
  padding: 0.42rem 0.36rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  font-size: 0.57rem;
}

th {
  background: #f8fafc;
  font-weight: 700;
  color: var(--text);
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 300px;
  overflow-y: auto;
}

.empty-msg {
  text-align: center;
  padding: 1.2rem 0.6rem;
  color: var(--text-muted);
  font-size: 0.63rem;
}

hr {
  border: none;
  border-top: 2px solid var(--border);
  margin: 1rem 0;
}

/* ---- 화면을 한눈에 담기 위한 압축 레이아웃 ---- */
.row-2 {
  display: flex;
  gap: 0.6rem;
}
.row-2 .form-group {
  flex: 1;
}

.filter-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}
.filter-row .form-group {
  margin-bottom: 0;
  flex: 1;
  min-width: 100px;
}
.filter-row button {
  white-space: nowrap;
  padding: 0.54rem 0.9rem;
}

.summary-row {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.6rem;
}
.summary-box {
  flex: 1;
  text-align: center;
  padding: 0.6rem;
  border-radius: var(--radius);
}
.summary-label {
  font-size: 0.5rem;
  color: var(--text-muted);
}
.summary-value {
  font-size: 0.78rem;
  font-weight: 700;
  margin-top: 0.2rem;
}

/* ---- 모바일(스마트폰) 화면 최적화 ---- */
@media (max-width: 480px) {
  html {
    font-size: 12px;
  }

  .card {
    padding: 1.05rem 0.75rem;
  }

  .admin-container,
  .payroll-container,
  .admin-edu-container,
  .match-container,
  .grade-container,
  .register-container,
  .acc-container,
  .lb-container {
    max-width: 100%;
  }

  .admin-nav {
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.6rem;
  }

  .admin-nav-link {
    font-size: 0.5rem;
    padding: 0.3rem 0.5rem;
  }

  table {
    font-size: 0.52rem;
  }

  th,
  td {
    padding: 0.3rem 0.25rem;
  }

  .row-2 {
    flex-direction: column;
  }

  .filter-row {
    flex-direction: column;
    align-items: stretch !important;
  }

  .filter-row button {
    width: 100%;
  }

  .summary-row {
    flex-direction: column;
  }
}

@media (min-width: 700px) {
  body {
    align-items: flex-start;
    padding-top: 1.5rem;
  }
}
/* ---- 디자인 다듬기 (기존 유지 + 시각적 개선) ---- */
:root {
  --primary: #2563eb;
  --primary-hover: #1e40af;
  --accent: #0ea5e9;
  --success: #16a34a;
  --warning: #d97706;
}

.card {
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.08);
  border: 1px solid #eef2f7;
}

h1 {
  letter-spacing: -0.01em;
}

.admin-nav-link {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.admin-nav-link.active {
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

table {
  border-radius: 8px;
  overflow: hidden;
}

th {
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.5rem;
  color: var(--text-muted);
  background: #f8fafc;
}

tr:hover td {
  background: #f8fafc;
}

.btn {
  letter-spacing: 0.01em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
}

.worker-card {
  border: 1px solid transparent;
  transition: border-color 0.15s, transform 0.1s;
}

.worker-card:hover {
  border-color: var(--border);
  transform: translateY(-1px);
}

.summary-box {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.03);
}