:root {
  --tea-navy: #00224b;
  --tea-slate: #0f172a;
  --tea-slate-muted: #13355f;
  --tea-primary: #1a73e8;
  --tea-primary-dark: #1558b0;
  --tea-border: #ccd6e0;
  --tea-surface: #fff;
  --tea-radius: 12px;
  --tea-card-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  --tea-focus-ring: 0 0 0 3px rgba(26, 115, 232, 0.18);
  --tea-text-size: 0.85rem;
  --tea-font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --auth-control-radius: 12px;
}

.form-label {
  font-size: var(--tea-text-size);
  color: var(--tea-slate);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  font-family: inherit;
  font-size: var(--tea-text-size);
  border-radius: var(--tea-radius);
  border: 1px solid var(--tea-border);
  background: var(--tea-surface);
  padding: 0.55rem 0.75rem;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus-visible,
.form-control:focus {
  outline: none;
  border-color: var(--tea-primary);
  box-shadow: var(--tea-focus-ring);
}

.form-control[aria-invalid='true'] {
  border-color: #d93025;
  box-shadow: 0 0 0 3px rgba(217, 48, 37, 0.14);
}

.btn {
  font-size: var(--tea-text-size);
  font-weight: 600;
  border: none;
  border-radius: var(--tea-radius);
  padding: 0.65rem 1.15rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
}

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

.btn-primary:hover,
.btn-primary:focus-visible {
  background-color: var(--tea-primary-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #f8f9fb;
  color: var(--tea-slate);
  border: 1px solid var(--tea-border);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: #f1f3f7;
}

.card-shell {
  background: var(--tea-surface);
  border-radius: 16px;
  box-shadow: var(--tea-card-shadow);
}

body.page--profile-search {
  margin: 0;
  padding: calc(1.5rem + var(--options-bar-height, 3.25rem)) 1.5rem 1.5rem;
  background: #f8f9fb;
  color: #0f172a;
  font-family: var(--tea-font-family);
}

.page--profile-search main {
  max-width: 1200px;
  margin: 0 auto;
}

.page--profile-search h1 {
  font-size: 1.6rem;
  margin: 0 0 1rem;
  color: #0b2b4d;
}

.search-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: none;
}

.search-form {
  --search-control-height: 38px;
  --search-control-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 100%;
  margin: 0 auto;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: end;
  width: 100%;
}

.search-control {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  position: relative;
}

.search-control .form-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 0;
}

.search-control .search-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

/* Icon support for search inputs */
.search-icon-wrapper {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-control .search-field input.has-icon {
  padding-left: 2.5rem;
}

.search-control .form-control {
  font-size: 0.95rem;
  border-color: #e2e8f0;
  transition: all 0.2s ease;
  height: var(--search-control-height);
  min-height: var(--search-control-height);
  padding: 0.3rem 0.65rem;
  box-sizing: border-box;
}

.search-control .form-control:hover {
  border-color: #cbd5e1;
}

.search-control .form-control:focus {
  border-color: var(--tea-primary);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.search-control select.form-control {
  height: var(--search-control-height);
  min-height: var(--search-control-height);
  padding: 0.3rem 0.75rem;
  box-sizing: border-box;
}

.search-actions {
  display: flex;
  align-items: center;
}

.search-actions button {
  width: 100%;
  font-weight: 600;
  letter-spacing: 0.01em;
  height: var(--search-control-height);
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .search-row {
    grid-template-columns: 2fr 1fr auto;
    gap: 1rem;
  }

  .search-actions button {
    width: auto;
    min-width: 100px;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1100px) {
  .search-row {
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr) auto;
  }
}

.results-summary {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: #465a75;
}

.table-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.table-controls .dataTables_length,
.table-controls .dataTables_filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 38px;
  font-size: 0.85rem;
  color: #1f3c5d;
  margin: 0;
  float: none !important;
}

.table-controls .dataTables_filter label,
.table-controls .dataTables_length label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  line-height: 1.2;
}

.table-controls .dataTables_filter input,
.table-controls .dataTables_length select {
  font: inherit;
  border-radius: 12px;
  border: 1px solid #ccd6e0;
  padding: 0.45rem 0.7rem;
  height: 36px;
  min-height: 36px;
  background: #fdfdfd;
  transition: border 0.2s ease;
  box-shadow: none;
}

.table-controls .dataTables_filter input:focus,
.table-controls .dataTables_length select:focus {
  outline: 2px solid rgba(26, 115, 232, 0.4);
  outline-offset: 0;
  border-color: #1a73e8;
  box-shadow: none;
}

table.dataTable thead th,
table.dataTable thead td,
.dataTables_scrollHead table.dataTable thead th,
.dataTables_scrollHead table.dataTable thead td,
.DTFC_Cloned table.dataTable thead th,
.DTFC_Cloned table.dataTable thead td {
  background: #00224b !important;
  color: #fff !important;
  white-space: normal !important;
  overflow-wrap: break-word;
  word-break: normal;
  line-height: 1.35;
  font-size: 0.85rem;
}

table.dataTable tbody tr:hover {
  background: rgba(26, 115, 232, 0.08);
}

.table-wrapper table.dataTable tbody td:not(:nth-last-child(-n + 2)) {
  font-size: 0.92rem;
  line-height: 1.4;
}

.table-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  padding: calc(1.5rem + 15px) 1.5rem 1.5rem;
}

.table-card h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: #0b2b4d;
}

.table-wrapper {
  width: 100%;
  margin-top: 0.35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrapper table.dataTable {
  min-width: 720px;
}

.table-wrapper table.dataTable thead th {
  white-space: normal !important;
}

.dataTables_info,
.dataTables_paginate {
  font-size: 0.92rem;
  line-height: 1.35;
}

.search-form .form-control {
  border-radius: var(--search-control-radius, 12px);
  min-height: var(--search-control-height, 38px);
  height: var(--search-control-height, 38px);
  padding: 0.3rem 0.65rem;
  line-height: 1.3;
  box-sizing: border-box;
}

.search-form .form-control:focus-visible,
.search-form .form-control:focus {
  box-shadow: none;
  outline: 2px solid rgba(26, 115, 232, 0.4);
  outline-offset: 0;
}

.search-actions .btn {
  border-radius: var(--search-control-radius, 12px);
  box-shadow: none;
  min-height: var(--search-control-height, 38px);
  height: var(--search-control-height, 38px);
  padding: 0 1.05rem;
  box-sizing: border-box;
}

.table-wrapper .workspace-add-btn {
  border-radius: 12px;
  box-shadow: none;
  width: var(--table-action-width, auto);
  min-width: var(--table-action-width, auto);
  max-width: 100%;
}

.table-wrapper .workspace-add-btn:hover,
.table-wrapper .workspace-add-btn:focus-visible,
.table-wrapper .workspace-add-btn:focus,
.table-wrapper .workspace-add-btn:active {
  box-shadow: none;
}

.table-wrapper .workspace-add-btn:focus-visible {
  outline: 2px solid rgba(26, 115, 232, 0.35);
  outline-offset: 0;
}

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

@media (max-width: 900px) {
  .search-row {
    width: 100%;
  }

  .search-control {
    align-items: stretch;
  }

  .search-actions {
    width: 100%;
  }
}

@media (max-width: 640px) {
  body.page--profile-search {
    padding: calc(1rem + var(--options-bar-height, 3.25rem)) 1rem 1rem;
  }

  .table-card {
    padding: calc(1rem + 15px) 1rem 1rem;
  }

  .table-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .table-controls .dataTables_length,
  .table-controls .dataTables_filter {
    width: 100%;
    justify-content: space-between;
  }

  .table-controls .dataTables_filter input {
    flex: 1;
  }
}

.help-text {
  color: #4b5563;
  margin: 0;
}

body.page--closures-landing {
  margin: 0;
  padding: calc(1.5rem + var(--options-bar-height, 3.25rem)) 1.5rem 1.5rem;
  background: #f8f9fb;
  font-family: var(--tea-font-family);
}

.page--closures-landing main {
  max-width: 720px;
  margin: 0 auto;
}

.page--closures-landing header {
  margin-bottom: 2rem;
}

.page--closures-landing header h1 {
  font-size: 1.75rem;
  margin: 0;
  color: #1f2a44;
}

.closures-form {
  display: grid;
  gap: 1.25rem;
  background: #ffffff;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 24px 64px rgba(31, 42, 68, 0.08);
}

.select-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.page--closures-landing label {
  font-weight: 600;
  color: #1f2a44;
}

.page--closures-landing select {
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  font-size: 1rem;
  background-color: #ffffff;
  width: 100%;
  box-shadow: none;
  transition: border-color 0.2s ease;
}

.page--closures-landing select:focus {
  outline: none;
  border-color: #1a73e8;
}

.page--closures-landing .closures-form button {
  justify-self: start;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  background: #0d6efd;
  cursor: pointer;
  transition: background 0.2s ease;
  width: 100%;
  box-shadow: none;
}

.page--closures-landing .closures-form button:hover,
.page--closures-landing .closures-form button:focus-visible {
  background: #0b5ed7;
}

.btn-pill {
  border-radius: 999px;
  padding: 0.75rem 1.35rem;
}

.btn-brand {
  background: #0d6efd;
  color: #fff;
}

.btn-brand:hover,
.btn-brand:focus-visible {
  background: #1558d6;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-ghost {
  background: #f8f9fb;
  color: var(--tea-slate);
  border: 1px solid var(--tea-border);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: #f1f3f7;
}

body.auth-page {
  --auth-top-padding: 3rem;
  --auth-side-padding: 1.5rem;
  margin: 0;
  padding: var(--auth-top-padding) var(--auth-side-padding) 2rem;
  background: #f3f5f9;
  color: var(--tea-slate);
  font-family: var(--tea-font-family);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
}

body.auth-page--with-options-bar {
  --auth-top-padding: calc(var(--options-bar-height, 3.5rem) + 4vh);
}

body.auth-page--compact {
  --auth-top-padding: 3rem;
}

body.auth-page--column {
  flex-direction: column;
  align-items: center;
}

body.auth-page--centered {
  align-items: center;
}

@media (max-width: 540px) {
  body.auth-page {
    --auth-side-padding: 1rem;
  }

  body.auth-page--with-options-bar {
    --auth-top-padding: calc(var(--options-bar-height, 3.5rem) + 4vh);
  }
}

.auth-main {
  width: 100%;
  max-width: 520px;
}

.auth-main--narrow {
  max-width: 420px;
}

.auth-main--default {
  max-width: 480px;
}

.auth-main--wide {
  max-width: 560px;
}

.auth-main--centered {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.auth-main--centered>* {
  width: 100%;
}

.auth-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
  padding: 2rem;
  display: grid;
  gap: 1.25rem;
}

.auth-card--flat {
  border-radius: 16px;
}

.auth-card--pill {
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
  padding: 2.25rem;
  gap: 1.5rem;
}

@media (max-width: 540px) {
  .auth-card {
    padding: 1.5rem;
  }

  .auth-card--pill {
    padding: 1.75rem;
  }
}

.auth-card h1,
.auth-card .auth-title {
  margin: 0;
  font-size: 1.5rem;
  color: #061a3a;
}

.auth-card h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #0b2b4d;
}

.auth-card p {
  margin: 0;
  color: #475569;
}

.auth-card p+p {
  margin-top: 0.9rem;
}

.auth-support {
  font-size: 0.85rem;
  color: #55657e;
}

.auth-back-link {
  font-size: 0.9rem;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.auth-form {
  display: grid;
  gap: 1rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: #1e2a44;
}

.auth-form input[type='text'],
.auth-form input[type='password'],
.auth-form input[type='email'],
.auth-form input[type='search'],
.auth-form input[type='url'],
.auth-form input[type='tel'],
.auth-form input[type='number'],
.auth-form input[type='datetime-local'],
.auth-form input[type='date'],
.auth-form select,
.auth-form textarea {
  font: inherit;
  padding: 0.65rem 0.85rem;
  border-radius: var(--auth-control-radius);
  border: 1px solid #cfd8e6;
  background: #fdfdfd;
  transition: border 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.auth-form button,
.auth-form .btn,
.auth-actions .btn,
.auth-actions button {
  border-radius: var(--auth-control-radius);
}

.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus {
  outline: none;
  border-color: var(--tea-primary);
  box-shadow: var(--tea-focus-ring);
}

.auth-help,
.form-help {
  font-size: 0.85rem;
  color: #55657e;
  font-weight: 400;
}

.errorlist {
  margin: 0;
  padding: 0;
  list-style: none;
  color: #b91c1c;
  font-weight: 600;
  font-size: 0.9rem;
}

.non-field-errors {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(185, 28, 28, 0.12);
  color: #7f1d1d;
  font-weight: 600;
}

.auth-meta {
  margin-top: 0.5rem;
  color: #55657e;
  font-size: 0.85rem;
}
