/* ============================================================
   유니브컨설팅 — 월말 리포트
   톤: 네이비(#1e4a8a) + 골드 액센트 + 크림 배경, 명조 헤딩, 샤프 코너
   ============================================================ */

:root {
  --brand-600: #2e60a9;
  --brand-700: #234e93;
  --brand-800: #1e4a8a;
  --brand-900: #16386b;

  --gold-300: #d4b572;
  --gold-500: #b8923c;
  --gold-600: #9a7a2e;

  --cream-50:  #faf7f2;
  --cream-100: #f3eee2;

  --zinc-200: #e4e4e7;
  --zinc-300: #d4d4d8;
  --zinc-400: #a1a1aa;
  --zinc-500: #71717a;
  --zinc-600: #52525b;
  --zinc-700: #3f3f46;
  --zinc-800: #27272a;
  --zinc-900: #18181b;

  --bg: var(--cream-50);
  --surface: #ffffff;
  --text: var(--zinc-900);
  --muted: var(--zinc-500);
  --border: var(--zinc-200);

  --primary: var(--brand-800);
  --primary-hover: var(--brand-900);
  --accent: var(--gold-500);

  --error: #b91c1c;

  --font-sans: "Pretendard Variable", Pretendard, "Noto Sans KR",
    -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-serif: "Noto Serif KR", "Nanum Myeongjo",
    "Apple SD Gothic Neo", "Malgun Gothic", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: keep-all;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--zinc-900);
}

a { color: var(--brand-700); text-decoration: none; }
a:hover { color: var(--brand-900); text-decoration: underline; text-underline-offset: 3px; }

/* ============================================================
   학생 뷰어 (index.html) — 상단 네이비 hero
   ============================================================ */
.hero {
  background: var(--brand-800);
  color: #fff;
  padding: 60px 24px 64px;
  border-bottom: 3px solid var(--brand-900);
  text-align: center;
  position: relative;
}
.hero::before {
  content: "CONSULTING REPORT";
  display: block;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 14px;
}
.hero h1 {
  font-family: var(--font-serif);
  font-size: 1.95rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
  letter-spacing: -0.015em;
}

/* ============================================================
   레이아웃 / 컨테이너
   ============================================================ */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 24px 96px;
}

/* ============================================================
   카드
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--brand-800);
  border-radius: 0;
  box-shadow: 0 1px 2px rgba(20, 30, 60, 0.03);
  padding: 44px 40px;
  max-width: 480px;
  margin: 0 auto;
}
.card h2 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--zinc-900);
}
.card h2 + p,
.card h2 + .muted {
  margin-top: 14px;
  position: relative;
}
.card h2::after {
  content: "";
  display: block;
  width: 36px;
  height: 2px;
  background: var(--accent);
  margin: 14px 0 0;
}

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* ============================================================
   폼 / 입력 / 버튼
   ============================================================ */
form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 24px;
}

input[type="password"],
input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 13px 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--zinc-900);
  background: #fff;
  border: 1px solid var(--zinc-300);
  border-radius: 0;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder { color: var(--zinc-400); }
input:focus {
  border-color: var(--brand-700);
  box-shadow: 0 0 0 2px rgba(30, 74, 138, 0.15);
}

button[type="submit"] {
  padding: 13px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: var(--brand-800);
  border: none;
  border-radius: 0;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.15s ease;
}
button[type="submit"]:hover:not(:disabled) { background: var(--brand-900); }
button[type="submit"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.error {
  color: var(--error);
  font-size: 0.9rem;
  margin: 4px 0 0;
}

.btn-secondary {
  display: inline-block;
  padding: 9px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--brand-800);
  background: var(--cream-100);
  border: 1px solid var(--zinc-300);
  border-radius: 0;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-secondary:hover {
  background: var(--brand-800);
  color: #fff;
  border-color: var(--brand-800);
  text-decoration: none;
}

/* ============================================================
   리포트 뷰어
   ============================================================ */
.viewer { margin-top: 8px; }

.viewer-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--zinc-300);
  flex-wrap: wrap;
}
.viewer-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.viewer-meta .small {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--brand-600);
  margin: 0;
}
.viewer-meta h2 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--zinc-900);
  letter-spacing: -0.015em;
}

.viewer-frame-wrap {
  width: 100%;
  height: calc(100vh - 260px);
  min-height: 540px;
  background: #fff;
  border: 1px solid var(--zinc-300);
  border-top: 2px solid var(--brand-800);
  border-radius: 0;
  overflow: hidden;
}
#pdf-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ============================================================
   로딩 / 유틸
   ============================================================ */
.loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(250, 247, 242, 0.86);
  backdrop-filter: blur(2px);
  z-index: 50;
  font-weight: 500;
  color: var(--zinc-700);
}
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--zinc-300);
  border-top-color: var(--brand-800);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 540px) {
  .hero { padding: 44px 20px 48px; }
  .hero h1 { font-size: 1.5rem; }
  .hero::before { font-size: 10px; letter-spacing: 0.28em; }
  .container { padding: 36px 16px 64px; }
  .card { padding: 32px 22px; }
  .viewer-frame-wrap { height: calc(100vh - 280px); min-height: 420px; }
  .viewer-meta h2 { font-size: 1.3rem; }
}

/* ============================================================
   관리자 페이지 (admin.html)
   ============================================================ */
.container-wide { max-width: 1240px; }

.admin-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 0 0 24px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.admin-topbar::before {
  content: "ADMIN · CONSULTING REPORT";
  position: absolute;
  top: -2px;
  left: 0;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: var(--brand-600);
}
.admin-topbar h1 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 24px 0 0;
  color: var(--zinc-900);
  letter-spacing: -0.015em;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}
.user-badge {
  font-size: 0.85rem;
  color: var(--zinc-700);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 6px 12px;
  font-weight: 500;
}

/* 가운데 정렬 카드 (boot / login / denied) */
.center-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 480px;
}
.center-card h2 { font-size: 1.4rem; margin: 0; }
.center-card h2::after { margin-left: auto; margin-right: auto; }
.center-card .spinner { width: 22px; height: 22px; }
.center-card p { margin: 0; }

/* 에러 배너 */
.error-banner {
  background: #fef2f2;
  color: #7f1d1d;
  border: 1px solid #fca5a5;
  border-left: 3px solid var(--error);
  border-radius: 0;
  padding: 12px 14px;
  margin: 0 0 20px;
  font-size: 0.92rem;
}

/* GitHub 버튼 */
.btn-github {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #24292f;
  color: #fff;
  border: none;
  border-radius: 0;
  padding: 12px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
  letter-spacing: 0.02em;
}
.btn-github:hover { background: #16191d; }
.btn-github svg { display: block; }

/* 관리자 카드 — 좌측 정렬, 전폭 */
.container-wide .card {
  max-width: none;
  margin: 0;
  padding: 32px 32px;
  border-top: 1px solid var(--border);
}
.container-wide .card + .card { margin-top: 24px; }
.container-wide .card > h2 {
  font-size: 1.15rem;
  font-weight: 600;
}
.container-wide .card > h2::after { display: none; }
.container-wide .card > p.muted { margin: 8px 0 0; }

/* 가운데 정렬 카드는 다시 윗줄 강조 (네이비) */
.container-wide .center-card {
  max-width: 480px;
  border-top: 3px solid var(--brand-800);
  margin: 24px auto 0;
  padding: 44px 36px;
}

/* 관리자 카드 헤더 */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.card-header h2 { margin: 0; font-size: 1.15rem; }
.card-header h2::after { display: none; }

/* 폼 */
.report-form { gap: 22px; margin-top: 22px; }
.report-form .field { display: flex; flex-direction: column; gap: 6px; }
.report-form label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--zinc-600);
}
.report-form .field > small { color: var(--muted); font-size: 0.82rem; margin-top: 2px; }
.report-form code {
  background: var(--cream-100);
  padding: 1px 6px;
  font-size: 0.85em;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  color: var(--brand-800);
  border-radius: 0;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.report-form input[type="file"] {
  padding: 12px;
  background: var(--cream-50);
  border: 1px dashed var(--zinc-400);
  border-radius: 0;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--zinc-700);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.form-actions button[type="submit"] {
  width: auto;
  padding: 11px 26px;
  font-size: 0.92rem;
}
.form-actions .btn-secondary {
  background: var(--cream-100);
  color: var(--zinc-800);
  border: 1px solid var(--zinc-300);
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 600;
}
.form-actions .btn-secondary:hover {
  background: var(--zinc-200);
  color: var(--zinc-900);
  border-color: var(--zinc-400);
}

/* 텍스트 버튼 */
.btn-text {
  background: none;
  border: none;
  color: var(--brand-700);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  font-family: inherit;
  padding: 4px 8px;
}
.btn-text:hover {
  color: var(--brand-900);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-text.danger { color: var(--error); }
.btn-text.danger:hover { color: #7f1d1d; }

/* 테이블 */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.reports-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.reports-table th,
.reports-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.reports-table th {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--zinc-500);
  background: var(--cream-50);
  border-bottom: 1px solid var(--zinc-300);
}
.reports-table tbody tr { transition: background 0.1s ease; }
.reports-table tbody tr:hover { background: var(--cream-50); }
.reports-table tr:last-child td { border-bottom: 0; }
.reports-table code {
  background: var(--cream-100);
  padding: 2px 8px;
  font-size: 0.85em;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  color: var(--brand-800);
}
.reports-table .center { text-align: center; }
.reports-table .muted { color: var(--zinc-500); }
.row-actions {
  white-space: nowrap;
  text-align: right;
}

@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
  .admin-topbar h1 { font-size: 1.25rem; }
  .container-wide .card { padding: 24px 22px; }
}
