:root {
  color-scheme: light;

  --bg: #e5eaf0;
  --bg-accent: #5f9bf5;

  --text: #172033;
  --text-head: #0f172a;
  --muted: #5b6475;

  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: #ffffff;
  --surface-soft: #f8fbff;
  --surface-elevated: rgba(255, 255, 255, 0.72);

  --border: #d9e4f2;
  --border-strong: #c5d4e8;

  --header-bg: rgba(243, 247, 252, 0.72);
  --header-border: rgba(197, 212, 232, 0.9);

  --nav-bg: rgba(255, 255, 255, 0.78);
  --nav-bg-hover: #ffffff;

  --input-bg: #ffffff;
  --input-border: #d5e0ee;
  --input-border-focus: #93c5fd;

  --code-bg: rgba(15, 23, 42, 0.06);

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #dbeafe;

  --success: #166534;
  --success-soft: #dcfce7;

  --warning: #92400e;
  --warning-soft: #fef3c7;

  --danger: #991b1b;
  --danger-soft: #fee2e2;

  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 4px 14px rgba(15, 23, 42, 0.05);

  --radius: 18px;
  --radius-sm: 12px;
  --content-width: 980px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --bg: #1c2e51;
    --bg-accent: #18263c;

    --text: #e5edf8;
    --text-head: #f8fbff;
    --muted: #9fb0c8;

    --surface: rgba(16, 24, 39, 0.72);
    --surface-strong: #111a2b;
    --surface-soft: #162235;
    --surface-elevated: rgba(20, 30, 48, 0.88);

    --border: #2a3b57;
    --border-strong: #365074;

    --header-bg: rgba(8, 14, 24, 0.68);
    --header-border: rgba(54, 80, 116, 0.72);

    --nav-bg: rgba(22, 34, 53, 0.78);
    --nav-bg-hover: #1d2c45;

    --input-bg: #0f1726;
    --input-border: #314764;
    --input-border-focus: #60a5fa;

    --code-bg: rgba(148, 163, 184, 0.14);

    --primary: #60a5fa;
    --primary-hover: #3b82f6;
    --primary-soft: rgba(96, 165, 250, 0.18);

    --success: #4ade80;
    --success-soft: rgba(74, 222, 128, 0.16);

    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, 0.16);

    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.16);

    --shadow: 0 16px 40px rgba(0, 0, 0, 0.32);
    --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.22);
  }
}

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

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(
      circle at top center,
      rgba(255, 255, 255, 0.08),
      transparent 28%
    ),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-accent) 100%);
}

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

a:hover {
  text-decoration: underline;
}

.head-title {
  color: var(--text-head);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px) saturate(160%);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
}

.site-header__inner,
.page-shell {
  width: min(100%, var(--content-width));
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.site-header__inner {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.site-title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.2;
}

.site-brand {
  color: var(--text-head);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-brand:hover {
  text-decoration: none;
}

.site-nav {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.site-nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.site-nav__user {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem 0.85rem;
}

.site-nav__user-status {
  font-size: 0.95rem;
  color: var(--muted);
}

.site-nav__user-name {
  font-weight: 600;
  color: var(--text-head);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--nav-bg);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-soft);
}

.nav-link:hover {
  text-decoration: none;
  background: var(--nav-bg-hover);
  border-color: var(--border-strong);
}

.inline-form {
  display: inline;
  margin: 0;
}

.page-shell {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

.page-content {
  display: grid;
  gap: 1rem;
}

section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.demo-login-section {
  margin-top: 1.25rem;
}

h1,
h2,
h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-head);
}

p,
ul,
ol,
dl {
  margin-top: 0;
}

p:last-child,
ul:last-child,
ol:last-child,
dl:last-child,
form:last-child {
  margin-bottom: 0;
}

.meta-list {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.3rem;
}

.action-list,
.record-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.action-list li a {
  display: block;
  padding: 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-soft);
}

.action-list li a:hover {
  text-decoration: none;
  background: var(--surface-strong);
  border-color: var(--border-strong);
}

.record-list li {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.detail-list {
  margin: 1rem 0 0;
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) 1fr;
  gap: 0.85rem 1rem;
}

.detail-list dt {
  font-weight: 700;
  color: var(--muted);
}

.detail-list dd {
  margin: 0;
}

.form-stack {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.form-stack p,
.form-stack > div {
  margin: 0;
}

label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 700;
  color: var(--text-head);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--input-border);
  border-radius: 14px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
  outline: 2px solid transparent;
  border-color: var(--input-border-focus);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.helptext {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.errorlist {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  color: var(--danger);
}

.button,
button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.7rem 1rem;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--primary);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.2);
}

.button:hover,
button:hover,
input[type="submit"]:hover {
  background: var(--primary-hover);
}

.button--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
  box-shadow: none;
}

.button--ghost:hover {
  background: var(--surface-strong);
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: 1rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
}

.status-badge--pending {
  color: var(--warning);
  background: var(--warning-soft);
}

.status-badge--approved {
  color: var(--success);
  background: var(--success-soft);
}

.status-badge--rejected {
  color: var(--danger);
  background: var(--danger-soft);
}

.muted {
  color: var(--muted);
}

.message-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.message-item {
  padding: 0.9rem 1rem;
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
}

code {
  padding: 0.15rem 0.4rem;
  border-radius: 8px;
  background: var(--code-bg);
  font-size: 0.95em;
}

@media (max-width: 720px) {
  .site-header__inner,
  .page-shell {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }

  section {
    padding: 1rem;
  }
}
