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

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --success: #16a34a;
  --warn: #d97706;
}

html { font-size: 100%; } /* 1rem = 브라우저 기본 폰트크기(기본 16px). 유저가 키우면 전체 스케일 업 */

body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Public layout ===== */
.public-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--surface);
  border-bottom: 0.0625rem solid var(--border);
}
.public-header .brand {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
}
.public-header nav { display: flex; gap: 0.5rem; align-items: center; }

.public-main {
  max-width: 60rem;
  margin: 3rem auto;
  padding: 0 1rem;
}

.hero {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--surface);
  border-radius: 0.75rem;
  border: 0.0625rem solid var(--border);
}
.hero h1 { font-size: 2rem; margin-bottom: 1rem; }
.hero p { color: var(--muted); margin-bottom: 1.5rem; }

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  border: 0.0625rem solid transparent;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1.05rem; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.85rem; }

/* ===== Forms ===== */
.auth-form { display: flex; flex-direction: column; gap: 0.9rem; }
.auth-form label { display: flex; flex-direction: column; gap: 0.3rem; }
.auth-form label span { font-size: 0.9rem; color: var(--muted); }
.auth-form input, .auth-form select {
  padding: 0.55rem 0.7rem;
  border: 0.0625rem solid var(--border);
  border-radius: 0.375rem;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
}
.auth-form input:focus, .auth-form select:focus {
  outline: 0.125rem solid var(--primary);
  outline-offset: -0.0625rem;
  border-color: var(--primary);
}

.auth-card {
  max-width: 26.25rem;
  margin: 2rem auto;
  background: var(--surface);
  padding: 2rem;
  border: 0.0625rem solid var(--border);
  border-radius: 0.75rem;
}
.auth-card h1 { margin-bottom: 1.5rem; font-size: 1.4rem; }

/* ===== Alerts ===== */
.alert {
  padding: 0.7rem 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-error { background: #fee2e2; color: var(--danger); border: 0.0625rem solid #fecaca; }
.alert-success { background: #dcfce7; color: var(--success); border: 0.0625rem solid #bbf7d0; }
.alert-warn { background: #fef3c7; color: var(--warn); border: 0.0625rem solid #fde68a; }

/* ===== Dashboard ===== */
body.dashboard { display: flex; min-height: 100vh; }

.sidebar {
  width: 13.75rem;
  background: #111827;
  color: #e5e7eb;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sidebar .brand {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: #fff;
}
.sidebar nav { display: flex; flex-direction: column; gap: 0.2rem; }
.sidebar nav a {
  color: #d1d5db;
  padding: 0.5rem 0.7rem;
  border-radius: 0.375rem;
}
.sidebar nav a:hover { background: #1f2937; color: #fff; text-decoration: none; }
.sidebar .logout-form { margin-top: auto; }
.sidebar .logout-form button {
  width: 100%;
  background: transparent;
  color: #e5e7eb;
  border-color: #374151;
}
.sidebar .logout-form button:hover { background: #1f2937; }

.content { flex: 1; padding: 2rem; overflow-x: auto; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.page-header h1 { font-size: 1.4rem; }

.user-badge {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.9rem;
  color: var(--muted);
}
.role {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 100rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: 0.0625rem solid transparent;
}
.role-superadmin { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.role-manager    { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.role-staff      { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }

/* ===== Cards / grid ===== */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1rem; }

.card {
  background: var(--surface);
  border: 0.0625rem solid var(--border);
  border-radius: 0.625rem;
  padding: 1.2rem;
}
.card h3 { margin-bottom: 0.6rem; font-size: 1rem; }
.card hr { border: none; border-top: 0.0625rem solid var(--border); margin: 1rem 0; }

.meta { display: grid; grid-template-columns: 5rem 1fr; gap: 0.4rem 1rem; font-size: 0.9rem; }
.meta dt { color: var(--muted); }

/* ===== Table ===== */
.data-table {
  width: 100%;
  background: var(--surface);
  border: 0.0625rem solid var(--border);
  border-radius: 0.625rem;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  font-size: 0.9rem;
}
.data-table th, .data-table td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  border-bottom: 0.0625rem solid var(--border);
  vertical-align: top;
}
.data-table thead th { background: #f9fafb; font-weight: 600; color: var(--muted); }
.data-table tbody tr:last-child td { border-bottom: none; }

.empty {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--surface);
  border: 0.0625rem dashed var(--border);
  border-radius: 0.625rem;
  color: var(--muted);
}
.empty .hint { font-size: 0.85rem; margin-top: 0.5rem; }

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

.inline-form { display: inline-flex; gap: 0.4rem; align-items: flex-start; }
.inline-form select { padding: 0.3rem; }

/* ========== Landing page ========== */
body.landing {
  background: #0b0d10;
  color: #f3f4f6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.landing-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  padding: 1.2rem 1.5rem;
  background: transparent;
}
.header-inner {
  max-width: 75rem;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.landing-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  text-decoration: none;
}
.landing-logo:hover { text-decoration: none; }
.landing-logo .logo-mark {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  border-radius: 0.375rem;
}
.landing-logo .logo-text {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.landing-nav .btn-primary {
  background: rgba(255,255,255,0.12);
  border: 0.0625rem solid rgba(255,255,255,0.25);
  backdrop-filter: blur(0.375rem);
}
.landing-nav .btn-primary:hover {
  background: rgba(255,255,255,0.2);
}

.hero-full {
  position: relative;
  flex: 1;
  min-height: calc(100vh - 16.25rem);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.25) 40%, rgba(0,0,0,0.55) 100%);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  max-width: 53.75rem;
  padding: 0 1.5rem;
}
.hero-title {
  font-size: clamp(1.8rem, 3.6vw, 2.8rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0.125rem 0.75rem rgba(0,0,0,0.5);
  letter-spacing: -0.02em;
  margin-bottom: 0.8rem;
}
.hero-sub {
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  color: rgba(255,255,255,0.85);
  text-shadow: 0 0.0625rem 0.375rem rgba(0,0,0,0.5);
  margin-bottom: 2rem;
}

.hero-search {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  max-width: 38.75rem;
  margin: 0 auto;
  padding: 1.1rem 1.4rem;
  background: rgba(255,255,255,0.1);
  border: 0.09375rem solid rgba(255,255,255,0.5);
  border-radius: 100rem;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(0.625rem);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.hero-search:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.8);
  text-decoration: none;
}
.hero-search:active { transform: scale(0.995); }
.hero-search-icon {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  color: rgba(255,255,255,0.9);
}
.hero-search-placeholder {
  flex: 1;
  text-align: left;
  font-size: 1rem;
}

.landing-footer {
  background: #111418;
  color: #9ca3af;
  padding: 2rem 3rem;
  font-size: 0.85rem;
  border-top: 0.0625rem solid #1f2937;
}
.footer-inner {
  max-width: 75rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.footer-links { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.footer-links a { color: #d1d5db; }
.footer-links span { color: #4b5563; }
.footer-info { display: flex; gap: 0.4rem; flex-wrap: wrap; color: #9ca3af; }
.footer-info .sep { color: #4b5563; }
.footer-address { color: #9ca3af; }
.footer-copy { color: #6b7280; margin-top: 0.4rem; font-size: 0.8rem; }

@media (max-width: 40rem) {
  .landing-header { padding: 0.9rem 1rem; }
  .landing-footer { padding: 1.5rem 1rem; }
  .hero-search { padding: 0.9rem 1.1rem; }
  .hero-search-placeholder { font-size: 0.9rem; }
}
