:root {
  --ink: #172033;
  --ink-soft: #2a3552;
  --muted: #5f6678;
  --line: rgba(23, 32, 51, 0.12);
  --panel: rgba(255, 251, 244, 0.9);
  --panel-strong: #fffdf8;
  --accent: #8e744b;
  --accent-soft: #d8c5a2;
  --accent-deep: #5f4d32;
  --success: #17603b;
  --warning: #9a6808;
  --danger: #a12727;
  --canvas: #f6f1e6;
  --shadow: 0 20px 60px rgba(26, 30, 44, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Aptos", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(216, 197, 162, 0.75), transparent 28%),
    linear-gradient(135deg, #f2ebde 0%, #f8f4ec 45%, #efe7d7 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: var(--ink-soft);
}

.hidden {
  display: none !important;
}

.backdrop-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(10px);
  pointer-events: none;
  opacity: 0.5;
}

.backdrop-a {
  width: 280px;
  height: 280px;
  top: -80px;
  right: -30px;
  background: rgba(142, 116, 75, 0.22);
}

.backdrop-b {
  width: 220px;
  height: 220px;
  bottom: 6%;
  left: -50px;
  background: rgba(23, 32, 51, 0.1);
}

.backdrop-c {
  width: 180px;
  height: 180px;
  top: 42%;
  right: 12%;
  background: rgba(216, 197, 162, 0.26);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1520px, calc(100vw - 32px));
  margin: 22px auto 34px;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px;
  margin-bottom: 18px;
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -20% -50% 35%;
  height: 180px;
  background: linear-gradient(120deg, rgba(142, 116, 75, 0.12), transparent 60%);
  transform: rotate(-8deg);
}

.eyebrow {
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1,
.list-header h2,
.editor-head h2,
.section-card h3,
.auth-panel h2 {
  margin: 6px 0 10px;
  font-family: Baskerville, "Palatino Linotype", Georgia, serif;
  font-weight: 700;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.hero-copy {
  margin: 0;
  max-width: 780px;
  line-height: 1.6;
  color: var(--muted);
}

.hero-meta {
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
  justify-content: center;
}

.auth-panel {
  padding: 28px 30px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 26px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.auth-form label,
.field {
  display: grid;
  gap: 8px;
}

.auth-form span,
.field-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}

.workspace {
  display: grid;
  gap: 18px;
}

.workspace-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.nav-tabs,
.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.workspace-body {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.workspace.queue-view .workspace-body {
  grid-template-columns: 1fr;
}

.workspace.queue-view .editor-panel {
  display: none;
}

.workspace.detail-view .workspace-body {
  grid-template-columns: 1fr;
}

.workspace.detail-view .list-panel {
  display: none;
}

.workspace.detail-view .editor-panel {
  display: flex;
  justify-content: center;
}

.workspace.detail-view .editor-host {
  width: min(960px, 100%);
}

.list-panel,
.editor-panel {
  padding: 22px;
}

.list-header {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

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

.stats-grid:empty {
  display: none;
}

.stat-card {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

.stat-value {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 4px;
}

.filters {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.form-list {
  display: grid;
  gap: 10px;
}

.workspace.queue-view .form-list {
  grid-template-columns: repeat(auto-fit, minmax(520px, 1fr));
}

.log-panel {
  display: grid;
  gap: 16px;
}

.log-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.log-tabs,
.log-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.active-filter {
  border-color: rgba(142, 116, 75, 0.45);
  background: rgba(255, 255, 255, 0.92);
}

.log-table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1100px;
}

.log-table th,
.log-table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.log-table th {
  position: sticky;
  top: 0;
  background: #f8f3ea;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.log-table tbody tr {
  cursor: pointer;
  transition: background 0.14s ease;
}

.log-table tbody tr:hover {
  background: rgba(142, 116, 75, 0.08);
}

.log-empty {
  text-align: center !important;
  color: var(--muted);
  padding: 28px !important;
}

.signoff-bubble {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.workspace.queue-view .signoff-bubble {
  border-radius: 18px;
  align-items: flex-start;
}

.signoff-bubble:hover,
.signoff-bubble.active {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.08);
}

.signoff-bubble.severity-immediate {
  background: rgba(255, 242, 242, 0.86);
}

.signoff-bubble.severity-monthly {
  background: rgba(240, 247, 255, 0.86);
}

.signoff-bubble.severity-document {
  background: rgba(248, 248, 246, 0.86);
}

.bubble-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.list-item-title,
.bubble-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bubble-title {
  font-weight: 700;
}

.bubble-sub {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.status-border-draft {
  border-left-color: #d18b12;
}

.status-border-assigned {
  border-left-color: #2563eb;
}

.status-border-reviewer_review {
  border-left-color: #7c3aed;
}

.status-border-signer_review {
  border-left-color: #0891b2;
}

.status-border-signed_off {
  border-left-color: #15803d;
}

.signoff-bubble.severity-immediate {
  border-left-color: #dc2626;
}

.signoff-bubble.severity-monthly {
  border-left-color: #2563eb;
}

.signoff-bubble.severity-document {
  border-left-color: #64748b;
}

.status-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border-radius: 999px;
}

.status-dot-draft {
  background: #d18b12;
}

.status-dot-assigned {
  background: #2563eb;
}

.status-dot-reviewer_review {
  background: #7c3aed;
}

.status-dot-signer_review {
  background: #0891b2;
}

.status-dot-signed_off {
  background: #15803d;
}

.step-indicator {
  display: inline-grid;
  grid-template-columns: repeat(4, 64px);
  gap: 6px;
  flex: 0 0 auto;
}

.step-box {
  min-height: 46px;
  display: grid;
  place-items: center;
  gap: 1px;
  padding: 5px;
  border-radius: 8px;
  border: 1px solid rgba(23, 32, 51, 0.14);
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  text-align: center;
}

.step-box > span {
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.08;
  text-transform: uppercase;
}

.step-box.active {
  color: #fff;
  border-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 8px 18px rgba(23, 32, 51, 0.12);
}

.status-step-draft {
  background: #d18b12;
}

.status-step-assigned {
  background: #2563eb;
}

.status-step-reviewer_review {
  background: #7c3aed;
}

.status-step-signer_review {
  background: #0891b2;
}

.status-step-signed_off {
  background: #15803d;
}

.list-item {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  cursor: pointer;
}

.list-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.08);
  border-color: rgba(142, 116, 75, 0.45);
}

.list-item.active {
  border-color: rgba(142, 116, 75, 0.65);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(250, 242, 228, 0.95));
}

.list-item-top,
.meta-line,
.hero-tagline,
.editor-head,
.status-row,
.attachment-row,
.timeline-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.list-item-title {
  font-weight: 700;
}

.meta-line {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.94rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid transparent;
}

.status-draft {
  color: var(--warning);
  background: rgba(234, 179, 8, 0.12);
  border-color: rgba(234, 179, 8, 0.24);
}

.status-assigned {
  color: #1f5ea9;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.22);
}

.status-reviewer_review {
  color: #6d28d9;
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.22);
}

.status-signer_review {
  color: #0e7490;
  background: rgba(8, 145, 178, 0.12);
  border-color: rgba(8, 145, 178, 0.22);
}

.status-signed_off {
  color: var(--success);
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.2);
}

.editor-host {
  min-height: 620px;
}

.detail-back-row {
  margin-bottom: 14px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 420px;
  text-align: center;
  color: var(--muted);
}

.editor-head {
  margin-bottom: 18px;
}

.compact-editor-head {
  margin-bottom: 10px;
}

.editor-grid {
  display: grid;
  gap: 16px;
}

.section-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 252, 247, 0.94));
}

.section-card h3 {
  font-size: 1.15rem;
}

.simple-admin-card {
  max-width: 860px;
}

.simple-form {
  display: grid;
  gap: 18px;
}

.severity-hint {
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  border: 1px solid var(--line);
}

.severity-hint.severity-immediate {
  color: #991b1b;
  background: rgba(254, 226, 226, 0.82);
  border-color: rgba(220, 38, 38, 0.24);
}

.severity-hint.severity-monthly {
  color: #1d4ed8;
  background: rgba(219, 234, 254, 0.82);
  border-color: rgba(37, 99, 235, 0.24);
}

.severity-hint.severity-document {
  color: #475569;
  background: rgba(241, 245, 249, 0.9);
  border-color: rgba(100, 116, 139, 0.22);
}

.form-sheet {
  max-width: 900px;
  padding: 28px;
  border: 1px solid rgba(23, 32, 51, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 36px rgba(23, 32, 51, 0.08);
}

.admin-form-sheet {
  max-width: 860px;
}

.sheet-title {
  margin-bottom: 22px;
  text-align: center;
  font-family: Baskerville, "Palatino Linotype", Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
}

.sheet-row {
  padding: 14px 0;
  border-top: 1px solid rgba(23, 32, 51, 0.1);
}

.sheet-row.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

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

.sheet-field > span:last-child {
  line-height: 1.55;
}

.sheet-choice {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(23, 32, 51, 0.12);
  border-radius: 8px;
  background: rgba(247, 248, 250, 0.86);
  color: var(--muted);
}

.sheet-choice.selected {
  color: var(--ink);
  border-color: rgba(142, 116, 75, 0.42);
  background: rgba(255, 251, 243, 0.96);
}

.choice-index {
  font-weight: 700;
  color: var(--ink);
}

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

.sheet-signoff {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 2px solid rgba(23, 32, 51, 0.16);
}

.sheet-signoff-title {
  margin-bottom: 14px;
  font-weight: 700;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.section-grid.single {
  grid-template-columns: 1fr;
}

.field-row {
  display: grid;
  gap: 8px;
}

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

.decision-cards {
  display: grid;
  gap: 14px;
}

.decision-card {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(23, 32, 51, 0.12);
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.decision-card strong {
  font-size: 1.1rem;
}

.decision-card.active {
  border-color: rgba(142, 116, 75, 0.65);
  background: linear-gradient(180deg, rgba(255, 251, 241, 0.98), rgba(244, 235, 219, 0.98));
}

.decision-card.inactive {
  opacity: 0.58;
  background: rgba(239, 237, 233, 0.92);
}

.decision-note,
.prepared-line {
  color: var(--muted);
  line-height: 1.55;
}

.prepared-line {
  color: var(--ink-soft);
  font-weight: 700;
}

.compact-actions {
  align-items: center;
}

.choice-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
}

input[type="text"],
input[type="email"],
input[type="search"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(23, 32, 51, 0.14);
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(142, 116, 75, 0.6);
  box-shadow: 0 0 0 3px rgba(142, 116, 75, 0.12);
}

input[readonly],
textarea[readonly] {
  background: rgba(242, 238, 229, 0.9);
}

.document-block {
  border: 1px dashed rgba(142, 116, 75, 0.36);
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 253, 249, 0.76);
}

.document-title {
  font-family: Baskerville, "Palatino Linotype", Georgia, serif;
  text-align: center;
  font-size: 1.45rem;
  margin: 0 0 16px;
}

.document-note {
  color: var(--muted);
  font-size: 0.94rem;
  margin-top: 8px;
}

.paste-zone {
  min-height: 120px;
  padding: 16px;
  border-radius: 16px;
  border: 1px dashed rgba(142, 116, 75, 0.48);
  background: rgba(255, 253, 248, 0.92);
  color: var(--muted);
  line-height: 1.55;
}

.paste-zone:focus {
  outline: none;
  border-color: rgba(142, 116, 75, 0.72);
  box-shadow: 0 0 0 3px rgba(142, 116, 75, 0.12);
}

.attachment-stack {
  display: grid;
  gap: 10px;
}

.readonly-grid {
  display: grid;
  gap: 12px;
}

.readonly-item {
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.readonly-item strong {
  display: block;
  margin-bottom: 6px;
}

.attachment-row,
.actions-row,
.timeline-item {
  margin-top: 12px;
}

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

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

.screenshot-tile {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
}

.screenshot-tile img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(23, 32, 51, 0.08);
}

.readonly-shot-grid .screenshot-tile img {
  height: 180px;
}

.screenshot-remove {
  justify-self: start;
}

.btn,
.btn-secondary,
.btn-ghost {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

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

.btn:disabled,
.btn-secondary:disabled,
.btn-ghost:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.is-loading {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: #fff;
  border-radius: 999px;
  animation: spin 0.72s linear infinite;
}

.btn-secondary .spinner,
.btn-ghost .spinner {
  border-color: rgba(23, 32, 51, 0.22);
  border-top-color: var(--ink);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn {
  color: white;
  background: linear-gradient(135deg, var(--ink), var(--ink-soft));
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.18);
}

.btn-secondary {
  color: var(--ink);
  background: linear-gradient(135deg, rgba(216, 197, 162, 0.82), rgba(255, 255, 255, 0.88));
  border: 1px solid rgba(142, 116, 75, 0.34);
}

.btn-ghost {
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
}

.danger {
  background: linear-gradient(135deg, #a12727, #cc4d4d);
}

.success {
  background: linear-gradient(135deg, #17603b, #209458);
}

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

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.audit-details {
  margin-top: 5px;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 14px 18px;
  border-radius: 16px;
  color: white;
  background: rgba(23, 32, 51, 0.94);
  box-shadow: 0 16px 34px rgba(23, 32, 51, 0.24);
  z-index: 20;
}

.empty-list {
  padding: 26px 18px;
  border-radius: 18px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(23, 32, 51, 0.18);
}

@media (max-width: 1100px) {
  .workspace-body,
  .auth-panel {
    grid-template-columns: 1fr;
  }

  .hero {
    flex-direction: column;
  }

  .hero-meta {
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 18px, 100%);
    margin: 10px auto 20px;
  }

  .panel,
  .hero,
  .list-panel,
  .editor-panel {
    border-radius: 20px;
  }

  .hero,
  .list-panel,
  .editor-panel,
  .auth-panel {
    padding: 18px;
  }

  .section-grid,
  .sheet-row.two-col,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .workspace-top,
  .actions-row {
    flex-direction: column;
    align-items: stretch;
  }

  .workspace.queue-view .form-list {
    grid-template-columns: 1fr;
  }

  .signoff-bubble,
  .list-item-top {
    align-items: stretch;
  }

  .signoff-bubble {
    flex-direction: column;
  }

  .step-indicator {
    grid-template-columns: repeat(4, minmax(58px, 1fr));
  }
}
