:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --text: #0f172a;
  --text-muted: #475569;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --border: #dbe4ee;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  --success-bg: #ecfdf3;
  --success-text: #047857;
  --danger-bg: #fef2f2;
  --danger-text: #b91c1c;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: radial-gradient(circle at top, #eef4ff 0%, var(--bg) 45%);
  color: var(--text);
  font-family:
    "Inter",
    "Segoe UI",
    -apple-system,
    BlinkMacSystemFont,
    "Helvetica Neue",
    Arial,
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.app-shell {
  margin: 0 auto;
  max-width: 980px;
  padding: 2.25rem 1rem 3rem;
}

.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.topbar-actions {
  align-items: center;
  display: flex;
  gap: 0.6rem;
}

.user-chip {
  background: #e8eef8;
  border: 1px solid #cdd9ea;
  border-radius: 999px;
  color: #1e293b;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.main-nav a {
  background: #eef4ff;
  border: 1px solid #cdddff;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
}

.brand {
  color: #0b1320;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.content-card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-muted) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

h1,
h2,
h3 {
  color: #0b1320;
  line-height: 1.2;
  margin-top: 0;
}

h1 {
  font-size: 1.75rem;
  margin-bottom: 0.85rem;
}

h2 {
  border-top: 1px solid var(--border);
  font-size: 1.15rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
}

p {
  color: var(--text-muted);
  margin: 0.5rem 0 1rem;
}

ul {
  display: grid;
  gap: 0.65rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

li {
  background: #f8fbff;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #13253f;
  padding: 0.7rem 0.85rem;
}

.metrics-grid,
.link-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 1rem;
}

.metric-card,
.screen-link {
  background: #f8fbff;
  border: 1px solid var(--border);
  border-radius: 10px;
  display: block;
  padding: 0.8rem;
}

.metric-label {
  color: #334155;
  font-size: 0.85rem;
  margin: 0;
}

.metric-value {
  color: #0f172a;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0.2rem 0 0;
}

.data-table {
  border-collapse: collapse;
  margin-top: 0.6rem;
  width: 100%;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid #d7e2ef;
  padding: 0.5rem 0.4rem;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: #334155;
  font-size: 0.82rem;
  text-transform: uppercase;
}

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

a:hover,
a:focus-visible {
  color: var(--primary-hover);
  text-decoration: underline;
}

.flash {
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 1rem;
  padding: 0.7rem 0.9rem;
}

.flash-notice {
  background: var(--success-bg);
  border: 1px solid #a7f3d0;
  color: var(--success-text);
}

.flash-alert {
  background: var(--danger-bg);
  border: 1px solid #fecaca;
  color: var(--danger-text);
}

form {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
  max-width: 420px;
}

label {
  color: #1e293b;
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  min-height: 42px;
  outline: none;
  padding: 0.55rem 0.75rem;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

button,
input[type="submit"] {
  background: var(--primary);
  border: 1px solid transparent;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  min-height: 42px;
  padding: 0.55rem 0.95rem;
  transition: background-color 0.18s ease;
}

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

.inline-form {
  display: inline-flex;
  gap: 0;
  margin: 0;
  max-width: none;
}

.btn-secondary {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #1e293b;
}

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

@media (max-width: 640px) {
  .app-shell {
    padding: 1.25rem 0.75rem 2rem;
  }

  .topbar {
    gap: 0.75rem;
  }

  .brand {
    font-size: 1rem;
  }

  .content-card {
    border-radius: 12px;
    padding: 1rem;
  }
}
