:root {
  --radius: 0.75rem;
  --background: #ffffff;
  --foreground: #142122;
  --ink: #142122;
  --card: #ffffff;
  --primary-foreground: #ffffff;
  --secondary: #eef5f1;
  --muted-foreground: #5b6b70;
  --muted-on-dark: #aebac2;
  --accent: #e3f7ec;
  --highlight: #0bbe68;
  --highlight-dark: #008052;
  --highlight-foreground: #05532f;
  --border: #e3e7e6;
  --ring: #0bbe68;
  --shadow-soft: 0 1px 2px rgba(20, 33, 34, 0.04), 0 12px 32px -18px rgba(20, 33, 34, 0.28);
  --shadow-lift: 0 2px 6px rgba(20, 33, 34, 0.06), 0 24px 48px -24px rgba(20, 33, 34, 0.35);
  --font-display: "Poppins", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Poppins", ui-sans-serif, system-ui, sans-serif;
  --topbar-height: 3.75rem;
  --danger: #c0372b;
  --danger-soft: #fdeceb;
}

* {
  box-sizing: border-box;
  border-color: var(--border);
}

body {
  margin: 0;
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

.container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */

.hero {
  position: relative;
  overflow: hidden;
  background-color: var(--ink);
  color: var(--primary-foreground);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image: radial-gradient(circle at 1px 1px, rgba(11, 190, 104, 0.18) 1px, transparent 0);
  background-size: 18px 18px;
}

.hero-inner {
  position: relative;
  padding: 4rem 1rem;
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--highlight);
}

.hero h1 {
  margin-top: 1rem;
  max-width: 48rem;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.05;
}

.hero h1 .accent {
  color: var(--highlight);
}

.hero-desc {
  margin-top: 1.25rem;
  max-width: 36rem;
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
}

.stats {
  margin-top: 2.5rem;
  max-width: 42rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background-color: rgba(255, 255, 255, 0.15);
}

.stat {
  background-color: var(--ink);
  padding: 1rem 1.25rem;
}

.stat dt {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.6);
}

.stat dd {
  margin: 0.25rem 0 0;
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .hero h1 { font-size: 3.75rem; }
  .hero-inner { padding: 5rem 1rem; }
}

/* Filter bar */

.filter-bar {
  position: sticky;
  top: var(--topbar-height);
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  padding: 1rem;
  margin: 0 -1rem;
}

.filter-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .filter-grid {
    grid-template-columns: 1.6fr 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .filter-grid {
    grid-template-columns: 1.8fr 1fr 1fr 1fr;
  }
}

.search-wrap {
  position: relative;
}

.search-wrap .icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  pointer-events: none;
}

.search-wrap input {
  padding-left: 2.75rem;
}

input[type="text"], select {
  height: 2.75rem;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--card);
  padding: 0 1rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  outline: none;
  transition: border-color 0.15s ease;
}

select {
  appearance: none;
  padding-right: 2.25rem;
  font-weight: 500;
  cursor: pointer;
}

.select-wrap {
  position: relative;
}

.select-wrap .chevron {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: var(--muted-foreground);
  pointer-events: none;
}

input[type="text"]:hover, select:hover {
  border-color: rgba(11, 190, 104, 0.6);
}

input[type="text"]:focus-visible, select:focus-visible {
  box-shadow: 0 0 0 2px var(--ring);
}

.filter-meta {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.result-count {
  font-variant-numeric: tabular-nums;
}

.clear-filters {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: none;
  border-radius: 999px;
  background-color: var(--secondary);
  color: var(--ink);
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}

.clear-filters:hover {
  background-color: var(--accent);
}

/* Cards */

.empty-state {
  padding: 5rem 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.empty-state p {
  margin: 0;
}

.card-grid {
  display: grid;
  gap: 1.25rem;
  padding: 2rem 0;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}

.experience-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-align: left;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background-color: var(--card);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.experience-card:hover {
  transform: translateY(-4px);
  border-color: rgba(11, 190, 104, 0.6);
  box-shadow: var(--shadow-lift);
}

.experience-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--ring);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.card-industry {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--highlight-dark);
}

.card-title {
  margin-top: 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

.card-client {
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.card-arrow {
  flex-shrink: 0;
  color: var(--muted-foreground);
  transition: color 0.15s ease;
}

.experience-card:hover .card-arrow {
  color: var(--highlight);
}

.card-problem {
  margin-top: 1rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgba(20, 33, 34, 0.75);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-result {
  margin-top: 1.25rem;
  border-radius: var(--radius);
  background-color: var(--secondary);
  padding: 0.75rem 1rem;
}

.card-result-label {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted-foreground);
}

.card-result-value {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}

.card-footer {
  margin-top: auto;
  padding-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.card-people {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.card-year {
  margin-left: auto;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* Detail panel (sheet) */

.overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(20, 33, 34, 0.5);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 36rem;
  background-color: var(--background);
  z-index: 50;
  box-shadow: var(--shadow-lift);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
}

.sheet.open {
  transform: translateX(0);
}

.sheet-inner {
  padding: 1.5rem;
}

.sheet-close {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted-foreground);
  padding: 0.375rem;
  border-radius: 0.5rem;
  line-height: 0;
}

.sheet-close:hover {
  background-color: var(--secondary);
  color: var(--ink);
}

.sheet-meta {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--highlight-dark);
}

.sheet-title {
  margin-top: 0.5rem;
  font-size: 1.5rem;
  color: var(--ink);
}

.sheet-client {
  margin-top: 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.sheet-badges {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge {
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-highlight {
  background-color: rgba(11, 190, 104, 0.15);
  color: var(--highlight-foreground);
}

.badge-secondary {
  background-color: var(--secondary);
  color: var(--muted-foreground);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.sheet-result {
  margin-top: 1.25rem;
  border-radius: 1rem;
  background-color: var(--ink);
  color: var(--primary-foreground);
  padding: 1.25rem;
}

.sheet-result-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted-on-dark);
}

.sheet-result-value {
  margin-top: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
}

.sheet-section {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  margin-top: 1.25rem;
}

.sheet-section h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted-foreground);
}

.sheet-section-body {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgba(20, 33, 34, 0.8);
}

.sheet-example {
  border-radius: var(--radius);
  background-color: var(--secondary);
  padding: 1rem;
  font-style: italic;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.chip-outline {
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background-color: var(--card);
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.chip-fill {
  border-radius: 0.5rem;
  background-color: var(--secondary);
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
}

body.sheet-locked {
  overflow: hidden;
}

/* ==========================================================================
   App shell: top bar + tab navigation
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border);
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
}

.topbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-mark img {
  display: block;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.main-nav::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  white-space: nowrap;
  padding: 0.4375rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted-foreground);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-tab:hover {
  background-color: var(--secondary);
  color: var(--ink);
}

.nav-tab.is-active {
  background-color: var(--ink);
  color: #fff;
}

.nav-count {
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  padding: 0.0625rem 0.375rem;
  border-radius: 999px;
  background-color: var(--secondary);
  color: var(--muted-foreground);
}

.nav-tab.is-active .nav-count {
  background-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.storage-warning {
  margin: 0;
  padding: 0.625rem 1rem;
  background-color: #fff6e0;
  border-bottom: 1px solid #f0dca8;
  color: #6b4e00;
  font-size: 0.8125rem;
  text-align: center;
}

@media (max-width: 900px) {
  .topbar {
    height: auto;
    position: static;
  }

  .topbar-inner {
    flex-wrap: wrap;
    height: auto;
    padding-top: 0.625rem;
    padding-bottom: 0.625rem;
    gap: 0.625rem;
  }

  .filter-bar {
    top: 0;
  }

  .main-nav {
    order: 3;
    flex-basis: 100%;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .btn-sm span {
    display: none;
  }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4375rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.625rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--ring);
}

.btn-sm {
  padding: 0.4375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-primary {
  background-color: var(--ink);
  color: #fff;
}

.btn-primary:hover {
  background-color: #0c1a1b;
}

.btn-ghost {
  background-color: var(--card);
  border-color: var(--border);
  color: var(--ink);
}

.btn-ghost:hover {
  background-color: var(--secondary);
}

.btn-danger {
  background-color: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background-color: #a32d23;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background-color: var(--card);
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
  background-color: var(--secondary);
  color: var(--ink);
  border-color: rgba(11, 190, 104, 0.6);
}

.icon-btn-danger:hover {
  background-color: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}

.icon-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--ring);
}

/* ==========================================================================
   Data (backup) menu
   ========================================================================== */

.data-menu-wrap {
  position: relative;
}

.data-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.375rem);
  z-index: 40;
  min-width: 14rem;
  padding: 0.3125rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--card);
  box-shadow: var(--shadow-lift);
}

.data-menu.open {
  display: block;
}

.data-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  border-radius: 0.5rem;
  padding: 0.5rem 0.625rem;
  font-family: inherit;
  font-size: 0.8125rem;
  color: var(--ink);
  cursor: pointer;
}

.data-menu button:hover {
  background-color: var(--secondary);
}

.data-menu button.danger {
  color: var(--danger);
}

.data-menu button.danger:hover {
  background-color: var(--danger-soft);
}

/* ==========================================================================
   Management screens
   ========================================================================== */

.admin-view {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.admin-intro h2 {
  font-size: 1.5rem;
}

.admin-lead {
  margin: 0.375rem 0 0;
  max-width: 44rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--muted-foreground);
}

.admin-tools {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.admin-search {
  height: 2.5rem;
  width: 16rem;
  max-width: 50vw;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--card);
  padding: 0 0.875rem;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--ink);
  outline: none;
}

.admin-search:hover {
  border-color: rgba(11, 190, 104, 0.6);
}

.admin-search:focus-visible {
  box-shadow: 0 0 0 2px var(--ring);
}

.admin-count {
  margin: 1.25rem 0 0.625rem;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background-color: var(--card);
  box-shadow: var(--shadow-soft);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.admin-table th {
  text-align: left;
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-foreground);
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.admin-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-table tbody tr:hover {
  background-color: rgba(238, 245, 241, 0.55);
}

.admin-table a {
  color: var(--highlight-dark);
}

.col-strong {
  font-weight: 600;
  color: var(--ink);
}

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

.col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.col-wide {
  min-width: 14rem;
}

.col-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.col-actions .icon-btn + .icon-btn {
  margin-left: 0.375rem;
}

.cell-people {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3125rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background-color: var(--secondary);
  color: var(--ink);
  padding: 0.1875rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.col-strong .pill {
  margin-left: 0.5rem;
}

.pill-highlight {
  background-color: var(--accent);
  color: var(--highlight-foreground);
}

.pill-muted {
  background-color: #f2f4f4;
  color: var(--muted-foreground);
}

.table-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 4rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  border: 1px dashed var(--border);
  border-radius: 1rem;
}

.table-empty p {
  margin: 0;
  max-width: 28rem;
}

@media (max-width: 720px) {
  .admin-toolbar {
    align-items: stretch;
  }

  .admin-tools {
    width: 100%;
  }

  .admin-search {
    flex: 1;
    width: auto;
    max-width: none;
  }

  /* Each row becomes a stacked card with its column name as the label. */
  .table-scroll {
    border: none;
    box-shadow: none;
    background: none;
    overflow-x: visible;
  }

  .admin-table thead {
    display: none;
  }

  .admin-table,
  .admin-table tbody,
  .admin-table tr,
  .admin-table td {
    display: block;
    width: 100%;
  }

  .admin-table tr {
    margin-bottom: 0.875rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background-color: var(--card);
    box-shadow: var(--shadow-soft);
    padding: 0.5rem 0.25rem;
  }

  .admin-table td {
    border-bottom: none;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.4375rem 1rem;
    text-align: right;
  }

  .admin-table td::before {
    content: attr(data-label);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted-foreground);
    text-align: left;
    flex-shrink: 0;
  }

  .admin-table td.col-actions {
    justify-content: flex-end;
    padding-top: 0.625rem;
  }

  .admin-table td.col-actions::before {
    content: none;
  }

  .cell-people {
    justify-content: flex-end;
  }
}

/* ==========================================================================
   Modal + forms
   ========================================================================== */

body.modal-locked,
body.sheet-locked {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(20, 33, 34, 0.55);
  z-index: 60;
}

.modal {
  position: fixed;
  z-index: 61;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 2rem);
  max-width: 32rem;
  max-height: calc(100vh - 3rem);
  display: flex;
  flex-direction: column;
  border-radius: 1rem;
  background-color: var(--card);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}

.modal-wide {
  max-width: 46rem;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1.125rem;
}

.modal-subtitle {
  margin: 0.3125rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted-foreground);
}

.modal-close {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted-foreground);
  padding: 0.3125rem;
  border-radius: 0.5rem;
  line-height: 0;
  flex-shrink: 0;
}

.modal-close:hover {
  background-color: var(--secondary);
  color: var(--ink);
}

.modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.625rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background-color: #fbfcfc;
}

.confirm-message {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink);
}

.confirm-detail {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-field-full {
    grid-column: 1 / -1;
  }
}

.form-field {
  min-width: 0;
}

.form-label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink);
}

.form-label .required {
  color: var(--danger);
  margin-left: 0.1875rem;
}

.form-control {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--card);
  padding: 0.625rem 0.875rem;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease;
}

textarea.form-control {
  line-height: 1.55;
  resize: vertical;
  min-height: 3rem;
}

select.form-control {
  height: 2.625rem;
  appearance: auto;
  cursor: pointer;
}

input.form-control:hover,
textarea.form-control:hover,
select.form-control:hover {
  border-color: rgba(11, 190, 104, 0.6);
}

input.form-control:focus-visible,
textarea.form-control:focus-visible,
select.form-control:focus-visible {
  box-shadow: 0 0 0 2px var(--ring);
}

.form-field-inline .form-label {
  margin: 0;
  font-weight: 500;
}

.checkbox-row-single {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: #fbfcfc;
}

.checkbox-row-single input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--highlight-dark);
  margin: 0;
  cursor: pointer;
}

.checkbox-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--card);
  padding: 0.5rem;
}

.checkbox-filter {
  width: 100%;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.4375rem 0.625rem;
  font-family: inherit;
  font-size: 0.8125rem;
  outline: none;
}

.checkbox-filter:focus-visible {
  box-shadow: 0 0 0 2px var(--ring);
}

.checkbox-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.125rem;
  max-height: 13rem;
  overflow-y: auto;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4375rem 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.checkbox-row:hover {
  background-color: var(--secondary);
}

.checkbox-row input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--highlight-dark);
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
}

.checkbox-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkbox-note {
  margin-left: auto;
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.checkbox-empty {
  margin: 0;
  padding: 0.75rem;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.form-help {
  margin: 0.375rem 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--muted-foreground);
}

.form-error {
  display: none;
  margin: 0.375rem 0 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--danger);
}

.form-field.has-error .form-control,
.form-field.has-error .checkbox-group {
  border-color: var(--danger);
}

.form-alert {
  display: none;
  margin-bottom: 1rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid #f0bdb8;
  border-radius: var(--radius);
  background-color: var(--danger-soft);
  color: #7c231b;
  font-size: 0.8125rem;
}

.form-alert p {
  margin: 0;
}

.form-alert p + p {
  margin-top: 0.375rem;
}

/* ==========================================================================
   Toasts
   ========================================================================== */

.toast-host {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: calc(100% - 2rem);
  max-width: 28rem;
  pointer-events: none;
}

.toast {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background-color: var(--ink);
  color: #fff;
  font-size: 0.8125rem;
  line-height: 1.5;
  box-shadow: var(--shadow-lift);
  animation: toast-in 0.2s ease;
}

.toast-error {
  background-color: var(--danger);
}

.toast-out {
  opacity: 0;
  transition: opacity 0.25s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Detail sheet additions
   ========================================================================== */

.sheet-inner {
  position: relative;
}

.sheet-actions {
  position: absolute;
  top: 1.125rem;
  right: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sheet-muted {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* ------------------------------------------------ online version (AWS) */

/* The hidden attribute must win over display rules such as .btn. */
[hidden] {
  display: none !important;
}

.storage-warning .status-action {
  margin-left: 0.75rem;
}

.signed-out {
  max-width: 32rem;
  padding: 6rem 1.5rem;
  text-align: center;
}

.signed-out h1 {
  margin: 1.5rem 0 0.5rem;
}

.signed-out p {
  margin: 0.5rem 0 1.5rem;
}
