:root {
  --ink: #1b1d1f;
  --muted: #5f666d;
  --line: rgba(27, 29, 31, 0.12);
  --paper: rgba(255, 252, 246, 0.92);
  --accent: #b3532d;
  --olive: #647257;
  --danger: #9f2d24;
  --success: #2f6e49;
  --shadow: 0 18px 50px rgba(41, 31, 23, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background: linear-gradient(145deg, #efe1d0, #fbf7f1 55%, #e6ebdd);
  min-height: 100vh;
}

.background {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(8px);
  opacity: 0.45;
}

.orb-a {
  width: 22rem;
  height: 22rem;
  right: -4rem;
  top: -3rem;
  background: radial-gradient(circle, #d7763c, transparent 68%);
}

.orb-b {
  width: 28rem;
  height: 28rem;
  left: -6rem;
  bottom: -8rem;
  background: radial-gradient(circle, #a8b699, transparent 65%);
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 1rem 4rem;
}

.site-header,
.panel,
.table-wrap,
.hero,
.stats {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 24px;
  backdrop-filter: blur(12px);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 15;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.18) 0 1px, transparent 2px),
    radial-gradient(circle at 36% 16%, rgba(255, 255, 255, 0.14) 0 1px, transparent 2px),
    radial-gradient(circle at 62% 20%, rgba(255, 255, 255, 0.16) 0 1px, transparent 2px),
    radial-gradient(circle at 82% 14%, rgba(255, 255, 255, 0.12) 0 1px, transparent 2px),
    radial-gradient(ellipse at 50% 118%, rgba(145, 222, 255, 0.55) 0%, rgba(78, 161, 210, 0.22) 22%, rgba(5, 15, 24, 0) 48%),
    linear-gradient(180deg, #02070d 0%, #051321 58%, #071b2d 100%);
  border: 1px solid rgba(180, 226, 255, 0.18);
  box-shadow:
    inset 0 -18px 40px rgba(122, 205, 255, 0.08),
    0 14px 38px rgba(4, 12, 22, 0.28);
  border-radius: 0;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: auto 10% -30px 10%;
  height: 64px;
  background: radial-gradient(ellipse at center, rgba(255, 246, 210, 0.68) 0%, rgba(134, 210, 255, 0.3) 28%, rgba(0, 0, 0, 0) 70%);
  filter: blur(8px);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--muted);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.brand-block {
  position: relative;
  z-index: 1;
}

.brand-logo-image {
  display: block;
  width: auto;
  height: 82px;
  max-width: 100%;
  object-fit: contain;
}

.calendar-header h2 {
  font-size: calc(1.5rem - 4px);
}

.top-nav {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.top-nav a,
.top-nav button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0.95rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  color: #edf4fb;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1rem;
  background: var(--ink);
  color: #fff;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.top-nav a:hover,
.top-nav button:hover {
  transform: translateY(-1px);
  border-color: rgba(188, 233, 255, 0.32);
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 0 1px rgba(188, 233, 255, 0.08);
}

.top-nav .secondary,
.button.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.top-nav .secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #edf4fb;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.top-nav .active {
  color: #ffffff;
  border-color: rgba(183, 236, 255, 0.28);
  background: linear-gradient(135deg, rgba(61, 132, 166, 0.92), rgba(17, 60, 86, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 12px 28px rgba(2, 7, 13, 0.32);
}

.top-nav-links,
.top-nav-actions {
  display: flex;
  align-items: center;
}

.top-nav-links {
  flex: 1;
  justify-content: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.top-nav-links-staff {
  flex-direction: column;
}

.top-nav-primary,
.top-nav-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  width: 100%;
}

.top-nav-actions {
  justify-content: flex-end;
}

.topbar-icon-button {
  width: 68px;
  height: 68px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.topbar-icon-button svg {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.08));
}

.layout,
.split,
.layout-stack {
  display: grid;
  gap: 1rem;
}

.layout {
  grid-template-columns: 1.15fr 0.85fr;
}

.split {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.hero,
.panel,
.stats,
.table-wrap {
  padding: 1.5rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.stat {
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
}

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

.tag {
  display: inline-flex;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.9rem;
  background: rgba(100, 114, 87, 0.12);
  color: var(--olive);
}

.tag.unavailable {
  background: rgba(159, 45, 36, 0.1);
  color: var(--danger);
}

form {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.4rem;
  font-weight: 600;
}

label.is-disabled {
  opacity: 0.65;
}

input,
select,
textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 0.85rem 0.95rem;
  font: inherit;
  background: rgba(255, 255, 255, 0.75);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.message {
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
}

.message.error {
  background: rgba(159, 45, 36, 0.08);
  color: var(--danger);
}

.message.success {
  background: rgba(47, 110, 73, 0.08);
  color: var(--success);
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.multi-select {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
  overflow: hidden;
}

.multi-select summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  cursor: pointer;
  font-weight: 600;
}

.multi-select summary::-webkit-details-marker {
  display: none;
}

.multi-select summary::after {
  content: "▾";
  color: var(--muted);
  flex-shrink: 0;
}

.multi-select[open] summary::after {
  content: "▴";
}

.multi-select-value {
  color: var(--muted);
  font-weight: 400;
  text-align: right;
}

.multi-select .checkbox-grid {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--line);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
}

.checkbox-pill {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 0.8rem;
  background: rgba(255, 255, 255, 0.65);
  font-weight: 400;
}

.checkbox-pill input {
  width: auto;
  margin: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.95rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.entry-note-row td {
  padding-top: 0.35rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.entry-note-row[hidden] {
  display: none;
}

.entry-note {
  display: grid;
  gap: 0.25rem;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
}

.entry-main-row.is-clickable {
  cursor: pointer;
  transition: background-color 120ms ease, box-shadow 120ms ease;
}

.entry-main-row.is-clickable:hover td {
  background: rgba(179, 83, 45, 0.06);
}

.entry-main-row.is-clickable[aria-expanded="true"] td {
  background: rgba(179, 83, 45, 0.08);
}

.entry-actions {
  width: 1%;
  white-space: nowrap;
}

.icon-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
}

.icon-button {
  min-width: 2rem;
  min-height: 2rem;
  padding: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}

.icon-button.danger {
  color: var(--danger);
  border-color: rgba(159, 45, 36, 0.2);
}

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

.page-actions {
  margin-top: 1rem;
}

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

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

.client-search {
  width: min(420px, 100%);
}

.client-filter {
  width: min(220px, 100%);
}

.client-count {
  margin: 0;
}

.pagination-wrap {
  margin-top: 1rem;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.pagination-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pagination-page {
  min-width: 2.75rem;
  justify-content: center;
}

.pagination-status {
  margin-left: auto;
}

.finder-form .row {
  align-items: end;
}

.finder-list {
  display: grid;
  gap: 0.75rem;
}

.finder-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
}

.finder-item h3 {
  margin-bottom: 0.25rem;
}

.calendar-shell {
  display: grid;
  gap: 1rem;
}

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

.calendar-controls {
  display: grid;
  gap: 0.75rem;
  justify-items: end;
}

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

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
}

.dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 999px;
  display: inline-block;
}

.dot.available {
  background: linear-gradient(135deg, rgb(39, 173, 96), rgb(18, 124, 67));
  box-shadow: 0 0 0 1px rgba(12, 90, 47, 0.98);
}

.dot.unavailable {
  background:
    repeating-linear-gradient(
      135deg,
      rgb(124, 23, 23) 0,
      rgb(124, 23, 23) 4px,
      rgb(86, 12, 12) 4px,
      rgb(86, 12, 12) 8px
    );
  box-shadow: 0 0 0 1px rgba(72, 8, 8, 0.98);
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.6rem;
}

.calendar-weekdays {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.calendar-day {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.58);
  display: grid;
  align-content: start;
  gap: 0.2rem;
}

.calendar-day.tone-available {
  background:
    linear-gradient(135deg, rgba(39, 173, 96, 0.94), rgba(18, 124, 67, 0.94));
  border-color: rgba(12, 90, 47, 0.98);
  box-shadow:
    inset 0 0 0 2px rgba(240, 255, 246, 0.22),
    0 0 0 1px rgba(44, 201, 112, 0.2);
  color: #f7fff9;
}

.calendar-day.tone-unavailable {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(124, 23, 23, 0.96) 0,
      rgba(124, 23, 23, 0.96) 10px,
      rgba(86, 12, 12, 0.96) 10px,
      rgba(86, 12, 12, 0.96) 20px
    );
  border-color: rgba(72, 8, 8, 0.98);
  box-shadow: inset 0 0 0 2px rgba(255, 232, 232, 0.16);
  color: #fff5f5;
}

.calendar-day.tone-available .calendar-day-head,
.calendar-day.tone-unavailable .calendar-day-head {
  color: inherit;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.calendar-day.today {
  border-color: rgba(179, 83, 45, 0.45);
  box-shadow: inset 0 0 0 1px rgba(179, 83, 45, 0.2);
}

.calendar-day.empty-day {
  background: transparent;
  border-style: dashed;
}

.calendar-day-head {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}

.empty {
  padding: 1rem 0;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(27, 29, 31, 0.35);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 20;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-panel {
  width: min(760px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.modal-panel.modal-panel-narrow {
  width: min(520px, 100%);
}

.self-tape-workspace {
  gap: 1.25rem;
}

.self-tape-hero {
  background:
    radial-gradient(circle at top right, rgba(179, 83, 45, 0.2), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.68), rgba(255, 248, 240, 0.9));
}

.self-tape-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.self-tape-summary-card {
  padding: 1.1rem 1.15rem;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 14px 32px rgba(41, 31, 23, 0.08);
}

.self-tape-summary-card h3 {
  margin-bottom: 0.35rem;
  font-size: 2rem;
}

.self-tape-section {
  display: grid;
  gap: 0.85rem;
}

.self-tape-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.52);
  box-shadow: 0 12px 28px rgba(41, 31, 23, 0.07);
}

.self-tape-count {
  min-width: 3rem;
  min-height: 3rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(27, 29, 31, 0.92);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}

.self-tape-card-list {
  display: grid;
  gap: 0.85rem;
}

.self-tape-table-section {
  display: grid;
  gap: 1rem;
}

.self-tape-table {
  width: 100%;
}

.self-tape-table tbody tr td {
  background: rgba(255, 255, 255, 0.46);
}

.self-tape-table .entry-main-row.is-clickable:hover td {
  background: rgba(179, 83, 45, 0.08);
}

.staff-self-tape-toolbar {
  margin-bottom: 1rem;
}

.self-tape-table td select {
  min-width: 180px;
}

.self-tape-card {
  padding: 1.2rem 1.25rem;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(250, 245, 238, 0.92));
  box-shadow: 0 14px 36px rgba(41, 31, 23, 0.08);
  display: grid;
  gap: 0.9rem;
}

.self-tape-card-intake {
  border-color: rgba(179, 83, 45, 0.22);
  box-shadow: 0 16px 42px rgba(179, 83, 45, 0.12);
}

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

.self-tape-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

.self-tape-detail-card {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(27, 29, 31, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.self-tape-detail-card[hidden] {
  display: none !important;
}

.self-tape-detail-card-soft {
  background: rgba(248, 244, 237, 0.9);
}

.self-tape-response-actions {
  padding-top: 0.25rem;
}

.self-tape-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.self-tape-meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(100, 114, 87, 0.1);
  color: var(--olive);
  font-size: 0.9rem;
}

.self-tape-upload-wrap {
  display: grid;
  gap: 0.75rem;
}

.self-tape-upload-wrap[hidden] {
  display: none !important;
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .site-header {
    grid-template-columns: 1fr;
    padding: 1.25rem 1rem;
  }

  .calendar-weekdays,
  .calendar-grid {
    gap: 0.4rem;
  }

  .calendar-day {
    min-height: 48px;
    padding: 0.4rem;
  }

  .calendar-controls {
    justify-items: stretch;
  }

  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .client-toolbar {
    align-items: stretch;
  }

  .top-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .top-nav-links,
  .top-nav-actions {
    justify-content: flex-start;
  }

  .top-nav-primary,
  .top-nav-secondary {
    justify-content: flex-start;
  }

  .pagination-status {
    margin-left: 0;
  }

  .finder-item {
    align-items: stretch;
    flex-direction: column;
  }

  .self-tape-section-head,
  .self-tape-card-head {
    flex-direction: column;
  }
}
