:root {
  --ink-900: #16222b;
  --ink-700: #33434f;
  --ink-500: #61717f;
  --mint-700: #17616d;
  --mint-500: #2390a1;
  --mint-100: #e7f6f7;
  --sand-100: #fffaf0;
  --sand-200: #f6ecde;
  --paper: #fffef9;
  --danger: #c4362d;
  --shadow: 0 16px 40px rgba(18, 39, 47, 0.12);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Outfit", "Trebuchet MS", sans-serif;
  color: var(--ink-900);
  background:
    radial-gradient(circle at 12% 22%, #d8eff0 0%, transparent 40%),
    radial-gradient(circle at 88% 12%, #f4e8cb 0%, transparent 42%),
    linear-gradient(160deg, #f8faf9, #f4f7f6);
  position: relative;
}

.bg-glow {
  position: fixed;
  border-radius: 999px;
  filter: blur(40px);
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
}

.glow-a {
  width: 360px;
  height: 360px;
  background: #8fd3dc;
  top: -120px;
  left: -90px;
}

.glow-b {
  width: 420px;
  height: 420px;
  background: #ffcd8f;
  bottom: -180px;
  right: -140px;
}

.app-shell {
  width: min(1320px, 96vw);
  margin: 22px auto;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  position: relative;
  z-index: 1;
}

.dashboard-panel,
.workspace-panel {
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.dashboard-panel {
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: calc(100vh - 44px);
  position: sticky;
  top: 22px;
}

.admin-button {
  width: 100%;
}

.brand-block h1,
.workspace-header h2,
.empty-state h3 {
  font-family: "Fraunces", Georgia, serif;
  margin: 0;
  line-height: 1.1;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--mint-100);
  color: var(--mint-700);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-block h1 {
  font-size: 1.75rem;
}

.lead {
  color: var(--ink-700);
  margin: 10px 0 0;
  line-height: 1.45;
}

.form-cards {
  display: grid;
  gap: 10px;
  overflow-y: auto;
  padding-right: 4px;
}

.admin-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 23, 26, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 8;
}

.admin-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 96vw);
  height: 100vh;
  background: #f9fcfd;
  border-left: 1px solid #d8e7eb;
  box-shadow: -12px 0 24px rgba(15, 45, 52, 0.16);
  z-index: 9;
  transform: translateX(104%);
  transition: transform 220ms ease;
  padding: 16px;
  overflow-y: auto;
}

.admin-panel.open {
  transform: translateX(0);
}

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

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-header h3,
.admin-section h4 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
}

.admin-section {
  border: 1px solid #dde9ed;
  border-radius: 12px;
  padding: 12px;
  margin-top: 14px;
  background: #fff;
  display: grid;
  gap: 10px;
}

.signature-library-list {
  display: grid;
  gap: 8px;
}

.signature-library-item {
  border: 1px solid #d8e7eb;
  border-radius: 10px;
  background: #f8fbfc;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.signature-library-item img {
  width: 112px;
  height: 40px;
  object-fit: contain;
  border: 1px solid #d6e5ea;
  border-radius: 6px;
  background: #fff;
  padding: 2px 6px;
}

.signature-library-item .name {
  font-size: 0.9rem;
  color: var(--ink-900);
  flex: 1;
}

.form-card {
  border: 1px solid #d7e6ea;
  background: var(--paper);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
  animation: card-in 420ms ease both;
}

.form-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(24, 60, 69, 0.12);
  border-color: #a2c6cc;
}

.form-card.active {
  border-color: var(--mint-500);
  box-shadow: inset 0 0 0 1px var(--mint-500);
  background: linear-gradient(130deg, #f8fffe, #eef8fa);
}

.form-card h3 {
  margin: 0;
  font-size: 1rem;
}

.form-card p {
  margin: 5px 0 0;
  color: var(--ink-500);
  font-size: 0.88rem;
}

.workspace-panel {
  padding: 22px;
}

.workspace-header {
  margin-bottom: 18px;
}

.workspace-header h2 {
  font-size: clamp(1.4rem, 2.3vw, 2rem);
}

.workspace-header p {
  margin: 6px 0 0;
  color: var(--ink-700);
}

.form-host {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e7eff1;
  border-radius: var(--radius-md);
  padding: 18px;
}

.empty-state {
  border: 2px dashed #d4e7eb;
  border-radius: var(--radius-md);
  padding: 28px;
  text-align: center;
  color: var(--ink-700);
}

.empty-state p {
  margin: 10px 0 0;
}

.schedule-form {
  display: grid;
  gap: 20px;
}

.panel-section {
  border: 1px solid #e2ecef;
  border-radius: var(--radius-md);
  padding: 14px;
  background: linear-gradient(180deg, #ffffff, #fbfffd);
}

.panel-section h3 {
  margin: 0 0 10px;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.1rem;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

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

.field label {
  font-size: 0.88rem;
  color: var(--ink-700);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  font: inherit;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid #c9d9de;
  background: #fff;
  color: var(--ink-900);
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--mint-500);
  box-shadow: 0 0 0 3px rgba(35, 144, 161, 0.16);
}

.status-table-wrap {
  overflow-x: auto;
}

.status-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

.status-table th,
.status-table td {
  border-bottom: 1px solid #e4edef;
  padding: 8px 6px;
  vertical-align: top;
}

.status-table th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-700);
  background: #f7fafb;
  position: sticky;
  top: 0;
}

.status-table td.item-cell {
  width: 38%;
  font-size: 0.92rem;
}

.status-table td.choice-cell {
  text-align: center;
  width: 8%;
}

.status-table td.details-cell {
  width: 30%;
}

.group-row td {
  background: #f0f8f9;
  color: var(--mint-700);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.checkbox-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.chip-option {
  border: 1px solid #d2e2e7;
  border-radius: 999px;
  background: #fff;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.chip-option:hover {
  border-color: #9dc3cb;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button,
.button-link {
  font: inherit;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  padding: 10px 16px;
}

.btn-primary {
  background: linear-gradient(120deg, var(--mint-700), var(--mint-500));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 14px rgba(24, 99, 111, 0.2);
}

.btn-secondary {
  background: var(--sand-100);
  color: var(--ink-900);
  border: 1px solid var(--sand-200);
}

.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
}

.required-star {
  color: var(--danger);
  margin-left: 4px;
}

.form-note {
  margin: 0;
  color: var(--ink-500);
  font-size: 0.86rem;
}

.signature-preview {
  min-height: 56px;
  border: 1px dashed #bfd4d9;
  border-radius: 10px;
  background: #f8fbfc;
  padding: 8px 10px;
  color: var(--ink-700);
  display: flex;
  align-items: center;
  gap: 10px;
}

.signature-preview img {
  max-height: 40px;
  max-width: 220px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #dbe9ed;
  border-radius: 6px;
  padding: 2px 6px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #0f2f35;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events: none;
  z-index: 3;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1060px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .dashboard-panel {
    position: static;
    max-height: none;
  }

  .meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .workspace-panel,
  .dashboard-panel {
    padding: 14px;
  }

  .meta-grid {
    grid-template-columns: 1fr;
  }

  .checkbox-grid {
    grid-template-columns: 1fr 1fr;
  }
}
