:root {
  --ink-950: #17202a;
  --ink-900: #1f2933;
  --ink-muted: #52606d;
  --paper-50: #faf9f6;
  --paper-100: #f5f3ee;
  --surface-0: #ffffff;
  --brand-700: #176b67;
  --brand-500: #2a8c86;
  --danger-700: #9b3c3c;
  --warning-700: #8a6418;
  --success-700: #2f6b4f;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

body {
  font-feature-settings: "tnum" 1, "ss01" 1;
  background-color: var(--paper-50);
  background-image:
    radial-gradient(ellipse 90% 55% at 0% -10%, rgba(23, 107, 103, 0.07), transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 0%, rgba(23, 32, 42, 0.04), transparent 50%),
    linear-gradient(180deg, #f7f5f0 0%, var(--paper-50) 42%, var(--paper-50) 100%);
  background-attachment: fixed;
}

[x-cloak] { display: none !important; }

.font-display {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  letter-spacing: -0.02em;
}

.table-dense th,
.table-dense td {
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
}

/* Status: label + tone; colour is secondary to wording */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 0.25rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 550;
  line-height: 1.2;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-badge::before {
  content: "";
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.85;
  flex-shrink: 0;
}

.status-badge--brand {
  color: var(--brand-700);
  background: #eef8f7;
  border-color: rgba(23, 107, 103, 0.14);
}

.status-badge--warning {
  color: var(--warning-700);
  background: #f6eed5;
  border-color: rgba(138, 100, 24, 0.18);
}

.status-badge--danger {
  color: var(--danger-700);
  background: #f8e5e5;
  border-color: rgba(155, 60, 60, 0.16);
}

.status-badge--success {
  color: var(--success-700);
  background: #e4f1e9;
  border-color: rgba(47, 107, 79, 0.16);
}

.status-badge--ink {
  color: var(--ink-900);
  background: #eef0f2;
  border-color: rgba(31, 41, 51, 0.12);
}

.status-badge--muted {
  color: var(--ink-muted);
  background: #f3f2ef;
  border-color: rgba(82, 96, 109, 0.12);
}

.status-badge--muted::before {
  opacity: 0.45;
}

/* Attention queue rows */
.attn-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(45, 55, 66, 0.1);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  overflow: hidden;
}

.attn-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-left: 3px solid transparent;
  transition: background 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

.attn-row + .attn-row {
  border-top: 1px solid rgba(45, 55, 66, 0.08);
}

.attn-row:hover {
  background: rgba(250, 249, 246, 0.95);
}

.attn-row--danger {
  border-left-color: var(--danger-700);
}

.attn-row--warning {
  border-left-color: var(--warning-700);
}

.attn-row--money {
  border-left-color: var(--brand-700);
}

.attn-meta {
  color: var(--ink-muted);
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

.attn-done {
  flex-shrink: 0;
  border: 1px solid rgba(45, 55, 66, 0.14);
  border-radius: 0.375rem;
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  color: var(--ink-900);
  background: var(--surface-0);
  transition: background 140ms var(--ease-out), border-color 140ms var(--ease-out), color 140ms var(--ease-out);
}

.attn-done:hover {
  background: var(--brand-700);
  border-color: var(--brand-700);
  color: #fff;
}

.home-count {
  display: inline-flex;
  flex-direction: column;
  min-width: 4.5rem;
}

.home-count strong {
  font-variant-numeric: tabular-nums;
  font-size: 1.25rem;
  line-height: 1.1;
  color: var(--ink-950);
  font-weight: 650;
}

.home-count span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-top: 0.2rem;
}

.home-count--danger strong { color: var(--danger-700); }

.section-label {
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

/* Capture palette */
.capture-backdrop {
  animation: fade-in 160ms var(--ease-out);
}

.capture-panel {
  animation: capture-rise 200ms var(--ease-out);
}

.capture-success {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  border-radius: 0.5rem;
  padding: 0.75rem 0.85rem;
  background: #e4f1e9;
  border: 1px solid rgba(47, 107, 79, 0.18);
  color: var(--success-700);
  animation: fade-in 180ms var(--ease-out);
}

.capture-success--error {
  background: #f8e5e5;
  border-color: rgba(155, 60, 60, 0.16);
  color: var(--danger-700);
}

.shell-aside {
  background:
    linear-gradient(180deg, rgba(238, 248, 247, 0.55) 0%, rgba(255, 255, 255, 0.96) 28%, #fff 100%);
}

/* Shared Django widget styling inside .fp-form */
.fp-form input[type="text"],
.fp-form input[type="email"],
.fp-form input[type="password"],
.fp-form input[type="number"],
.fp-form input[type="date"],
.fp-form input[type="search"],
.fp-form input[type="url"],
.fp-form textarea,
.fp-form select {
  width: 100%;
  border: 1px solid rgba(23, 32, 42, 0.15);
  border-radius: 0.375rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  background: #fff;
  color: var(--ink-900);
}

.fp-form input:focus,
.fp-form textarea:focus,
.fp-form select:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(42, 140, 134, 0.35);
  border-color: rgba(23, 107, 103, 0.45);
}

.fp-form .errorlist {
  list-style: none;
  margin: 0 0 0.35rem;
  padding: 0;
  color: var(--danger-700);
  font-size: 0.8rem;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes capture-rise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.reason-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.reason-chip--danger { color: var(--danger-700); background: #f8e5e5; border-color: rgba(155, 60, 60, 0.14); }
.reason-chip--warning { color: var(--warning-700); background: #f6eed5; border-color: rgba(138, 100, 24, 0.16); }
.reason-chip--brand { color: var(--brand-700); background: #eef8f7; border-color: rgba(23, 107, 103, 0.14); }
.reason-chip--ink,
.reason-chip--muted { color: var(--ink-muted); background: #f3f2ef; border-color: rgba(82, 96, 109, 0.12); }

.attn-row--focus {
  outline: 2px solid rgba(42, 140, 134, 0.45);
  outline-offset: -2px;
  background: rgba(238, 248, 247, 0.65);
}

.attn-row--done {
  opacity: 0.72;
  border-left-color: var(--success-700);
  animation: fade-in 160ms var(--ease-out);
}

.attn-row--brand { border-left-color: var(--brand-700); }
.attn-row--ink { border-left-color: transparent; }
.attn-row--muted { border-left-color: transparent; }

.kbd {
  display: inline-block;
  border: 1px solid rgba(45, 55, 66, 0.16);
  border-bottom-width: 2px;
  border-radius: 0.25rem;
  padding: 0 0.3rem;
  font-size: 0.65rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink-muted);
  background: #fff;
}

.eng-tab {
  color: var(--ink-muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-weight: 500;
  transition: color 140ms var(--ease-out), border-color 140ms var(--ease-out);
}

.eng-tab:hover { color: var(--ink-900); }

.eng-tab--active {
  color: var(--brand-700);
  border-bottom-color: var(--brand-700);
  font-weight: 650;
}

.eng-panel { animation: fade-in 160ms var(--ease-out); }

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.55rem 0.25rem;
  color: var(--ink-muted);
  font-size: 0.65rem;
  font-weight: 500;
}

.mobile-nav-item--active {
  color: var(--brand-700);
  font-weight: 650;
}

.mobile-nav-capture {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -0.85rem;
}

.mobile-nav-capture span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  background: var(--brand-700);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(23, 107, 103, 0.28);
}

@media (prefers-reduced-motion: reduce) {
  .capture-backdrop,
  .capture-panel,
  .capture-success,
  .attn-row,
  .attn-done,
  .eng-panel {
    animation: none !important;
    transition: none !important;
  }
}
