:root {
  --accent: #f05a3c;
  --accent-soft: #ffe8df;
  --bg: #faf8f4;
  --border: #e5e0d8;
  --ink: #191919;
  --muted: #746f68;
  --panel: #ffffff;
  --teal: #16827a;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
}

.auth-page {
  background: #14100d;
  min-height: 100vh;
  position: relative;
}

.auth-page::before {
  background:
    linear-gradient(90deg, rgba(15, 12, 10, 0.82), rgba(15, 12, 10, 0.54) 46%, rgba(15, 12, 10, 0.3)),
    rgba(15, 12, 10, 0.28);
  content: "";
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: -1;
}

.auth-bg-video {
  height: 100%;
  inset: 0;
  object-fit: cover;
  position: fixed;
  width: 100%;
  z-index: -2;
}

.brand {
  color: var(--accent);
  font-size: 25px;
  font-weight: 950;
  text-decoration: none;
}

.auth-shell {
  align-items: center;
  display: grid;
  gap: 48px;
  grid-template-columns: minmax(0, 0.9fr) 420px;
  min-height: 100vh;
  padding: 48px;
  position: relative;
  z-index: 1;
}

.auth-page .auth-copy .brand {
  display: inline-block;
  margin-bottom: 34px;
}

.auth-stack {
  display: grid;
  gap: 14px;
}

.auth-footer {
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.5;
  text-align: center;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 50px;
  font-weight: 950;
  line-height: 1.08;
}

.auth-page h1 {
  color: #ffffff;
  text-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
}

.auth-copy p,
header p,
.panel-grid p,
li {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.auth-copy p {
  font-size: 18px;
  margin-top: 20px;
  max-width: 560px;
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: grid;
  gap: 18px;
  padding: 30px;
}

.auth-page .auth-card {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.22);
}

label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 850;
  gap: 8px;
}

input,
button {
  font: inherit;
}

input {
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 48px;
  padding: 0 14px;
}

button {
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  font-weight: 950;
  min-height: 48px;
  padding: 0 16px;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.notice {
  background: var(--accent-soft);
  border-radius: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  padding: 12px;
}

.totp-panel {
  background: #f8fbfa;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.totp-panel[hidden] {
  display: none;
}

.totp-panel strong {
  font-size: 15px;
}

.totp-panel p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.totp-link {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.totp-qr {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  padding: 14px;
}

.totp-qr[hidden] {
  display: none;
}

.totp-qr canvas {
  display: block;
  height: 180px;
  width: 180px;
}

.secret-key {
  background: #ffffff;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--ink);
  display: block;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
  padding: 12px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 18px;
}

.admin-sidebar nav {
  display: grid;
  gap: 8px;
}

.admin-sidebar nav button,
.logout {
  background: transparent;
  color: var(--muted);
  min-height: 46px;
  text-align: left;
}

.admin-sidebar nav button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.logout {
  border: 1px solid var(--border);
  margin-top: auto;
  text-align: center;
}

.admin-main {
  padding: 34px;
}

header {
  align-items: flex-end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
}

.metric-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-grid article,
.panel-grid article {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}

.metric-grid span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 850;
}

.metric-grid strong {
  display: block;
  font-size: 30px;
  margin-top: 10px;
}

.app-overview {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 18px;
  padding: 20px;
}

.section-title-row {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title-row h2 {
  font-size: 22px;
  margin-bottom: 4px;
}

.section-title-row span {
  background: var(--accent-soft);
  border-radius: 999px;
  color: var(--accent);
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 12px;
}

.compact-metric-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-metric-grid article {
  background: #fbfaf8;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 92px;
  padding: 14px;
}

.compact-metric-grid span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 850;
}

.compact-metric-grid strong {
  display: block;
  font-size: 25px;
  margin-top: 8px;
}

.table-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
  margin-top: 14px;
}

.table-grid article {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.table-grid h3 {
  font-size: 16px;
  margin: 0 0 12px;
}

.table-list {
  display: grid;
  gap: 8px;
}

.table-row {
  align-items: center;
  background: #fbfaf8;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 58px;
  padding: 11px 12px;
}

.table-row strong,
.table-row span,
.table-row time {
  display: block;
}

.table-row strong {
  font-size: 14px;
}

.table-row span,
.table-row time,
.empty-state {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.panel-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
  margin-top: 18px;
}

.panel-grid h2 {
  font-size: 20px;
  margin-bottom: 12px;
}

ul {
  margin: 0;
  padding-left: 18px;
}

@media (max-width: 900px) {
  .auth-page::before {
    background: rgba(15, 12, 10, 0.68);
  }

  .auth-shell,
  .admin-shell,
  .metric-grid,
  .compact-metric-grid,
  .panel-grid,
  .table-grid {
    grid-template-columns: 1fr;
  }

  .auth-shell {
    padding: 28px;
  }

  .auth-footer {
    font-size: 10px;
  }

  .admin-sidebar {
    border-bottom: 1px solid var(--border);
    border-right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-bg-video {
    display: none;
  }
}
