:root {
  --brand-purple: #5a2d91;
  --brand-purple-dark: #472474;
  --brand-cyan: #1aa7e0;
  --brand-cyan-dark: #1186b6;
  --bg: #f4f7fc;
  --surface: #ffffff;
  --border: #d9e2ef;
  --text: #1f2b3d;
  --text-soft: #5a6a80;
  --ok-bg: #e8f7ee;
  --ok-border: #95d5ac;
  --err-bg: #fdecec;
  --err-border: #ebb2b2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(140deg, #eef4ff 0%, #f8fbff 48%, #eefbff 100%);
}

.page-shell {
  width: min(1040px, calc(100% - 2rem));
  margin: 1.75rem auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  box-shadow: 0 10px 28px rgba(53, 76, 110, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--brand-purple);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand img {
  height: 44px;
  width: auto;
  display: block;
}

.brand.no-logo span {
  padding-left: 0.3rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--brand-purple);
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
}

.site-nav a:hover {
  background: #f3effa;
  border-color: #dfd0f4;
}

.signed-in-meta {
  margin: 0.75rem 0 0.25rem;
  color: var(--text-soft);
  font-size: 0.93rem;
}

.flash-stack {
  margin: 1rem 0;
}

.flash {
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  margin-bottom: 0.6rem;
  border: 1px solid;
}

.flash.success {
  background: var(--ok-bg);
  border-color: var(--ok-border);
}

.flash.error {
  background: var(--err-bg);
  border-color: var(--err-border);
}

h1,
h2 {
  color: var(--brand-purple-dark);
  margin-top: 0;
}

.intro {
  color: var(--text-soft);
  margin-top: -0.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 22px rgba(58, 73, 96, 0.07);
}

.status-message {
  display: none;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0.65rem 0.8rem;
  margin-bottom: 0.9rem;
  font-weight: 600;
}

.status-message.success,
.status-message.error {
  display: block;
}

.status-message.success {
  background: var(--ok-bg);
  border-color: var(--ok-border);
  color: #245c35;
}

.status-message.error {
  background: var(--err-bg);
  border-color: var(--err-border);
  color: #7a1f1f;
}

label {
  display: inline-block;
  margin-bottom: 0.3rem;
  font-weight: 600;
}

input,
select,
button {
  font: inherit;
  border-radius: 8px;
}

input,
select {
  width: min(440px, 100%);
  border: 1px solid #cdd8e6;
  background: #fff;
  padding: 0.55rem 0.7rem;
  margin: 0 0 0.9rem;
}

input:focus,
select:focus {
  outline: 3px solid rgba(26, 167, 224, 0.22);
  border-color: var(--brand-cyan);
}

button {
  border: 1px solid var(--brand-cyan-dark);
  background: linear-gradient(180deg, var(--brand-cyan), var(--brand-cyan-dark));
  color: #fff;
  font-weight: 700;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.04);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  border: 1px solid #d7e1ee;
  text-align: left;
  vertical-align: top;
  padding: 0.6rem;
}

th {
  color: var(--brand-purple-dark);
  background: #f2f5fb;
}

form.inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

form.inline input,
form.inline select {
  width: auto;
  margin: 0;
}

@media (max-width: 860px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    flex-wrap: wrap;
  }
}
