:root {
  --bg: #f4ecdf;
  --bg-deep: #e7d7c4;
  --surface: rgba(255, 252, 247, 0.84);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --text: #13211d;
  --text-strong: #08120f;
  --text-soft-strong: #24332e;
  --muted: #61726d;
  --placeholder: #52635d;
  --line: rgba(19, 33, 29, 0.12);
  --accent: #1c6b5e;
  --accent-soft: rgba(28, 107, 94, 0.12);
  --accent-warm: #c89d57;
  --danger: #a15555;
  --shadow: 0 28px 60px rgba(36, 34, 28, 0.12);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  line-height: 1.5;
  font-family: "Manrope", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(200, 157, 87, 0.18), transparent 26%),
    radial-gradient(circle at right center, rgba(28, 107, 94, 0.16), transparent 22%),
    linear-gradient(145deg, var(--bg) 0%, #f8f3eb 55%, #efe3d2 100%);
}

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

button {
  cursor: pointer;
}

.page-shell {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 44px 20px 72px;
}

.ambient {
  position: absolute;
  border-radius: 999px;
  filter: blur(14px);
  opacity: 0.55;
  pointer-events: none;
}

.ambient-one {
  top: 10px;
  right: 80px;
  width: 180px;
  height: 180px;
  background: rgba(200, 157, 87, 0.14);
}

.ambient-two {
  left: -20px;
  top: 320px;
  width: 220px;
  height: 220px;
  background: rgba(28, 107, 94, 0.1);
}

.surface {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.section-kicker,
.metric-label,
.field-label,
.muted-text,
.table-note {
  color: var(--muted);
}

.section-kicker {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section-heading h2 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  letter-spacing: -0.03em;
}

.metric-card {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(19, 33, 29, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}
.metric-label,
.field-label,
.muted-text,
.table-note {
  font-size: 0.95rem;
}

.tab-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  margin-top: 0;
  padding: 12px;
}

.tab-button {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease;
}

.tab-button:hover,
.tab-button:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.62);
  outline: none;
}

.tab-button.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, #153f37 100%);
  box-shadow: 0 12px 24px rgba(21, 63, 55, 0.25);
}

.content-stack,
.tab-panel {
  display: grid;
  gap: 22px;
  margin-top: 24px;
}

.tab-panel[hidden] {
  display: none;
}

.tab-panel.is-active {
  animation: panel-rise 240ms ease;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 22px;
}

.surface > *:first-child {
  margin-top: 0;
}

.surface {
  padding: 28px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.section-heading h2 {
  font-size: clamp(1.6rem, 2vw, 2.15rem);
}

.split-heading {
  align-items: center;
}

.action-heading {
  align-items: center;
}

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

.metric-card {
  padding: 20px;
}

.metric-card .metric-label {
  display: inline-block;
  color: var(--text-soft-strong);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  letter-spacing: -0.03em;
}

.metric-card.accent {
  background: linear-gradient(145deg, rgba(200, 157, 87, 0.24), rgba(28, 107, 94, 0.14));
}

.metric-card.accent .metric-label,
.metric-card.accent strong {
  color: var(--text-strong);
}

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

.sync-message {
  margin: 0;
  color: rgba(19, 33, 29, 0.82);
  line-height: 1.7;
}

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

.sync-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(19, 33, 29, 0.08);
  color: var(--text-soft-strong);
  font-size: 0.92rem;
  font-weight: 800;
  text-align: center;
}

.sync-badge.is-online {
  background: rgba(28, 107, 94, 0.14);
  color: var(--accent);
}

.sync-badge.is-saving {
  background: rgba(200, 157, 87, 0.18);
  color: #835f20;
}

.sync-badge.is-error {
  background: rgba(161, 85, 85, 0.14);
  color: var(--danger);
}

.progress-block {
  margin-top: 24px;
  padding: 18px 20px 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.44));
  border: 1px solid rgba(19, 33, 29, 0.08);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 700;
}

.progress-track {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(19, 33, 29, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-warm) 100%);
  transition: width 220ms ease;
}

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

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

.field input,
.field textarea,
.hours-table input,
.hours-table select {
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(19, 33, 29, 0.22);
  border-radius: var(--radius-sm);
  background: rgba(248, 244, 238, 0.98);
  color: var(--text-strong);
  caret-color: var(--accent);
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.field textarea {
  resize: vertical;
  min-height: 144px;
  line-height: 1.7;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--placeholder);
  opacity: 1;
}

.field input:focus-visible,
.field textarea:focus-visible,
.hours-table input:focus-visible,
.hours-table select:focus-visible {
  outline: none;
  border-color: rgba(28, 107, 94, 0.62);
  box-shadow: 0 0 0 4px rgba(28, 107, 94, 0.16);
}

.primary-button,
.secondary-button,
.icon-button {
  border: 0;
  border-radius: 999px;
  font-weight: 800;
}

.primary-button,
.secondary-button {
  padding: 14px 20px;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, #143f38 100%);
  box-shadow: 0 14px 24px rgba(20, 63, 56, 0.22);
}

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

.secondary-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(19, 33, 29, 0.1);
}

.task-list {
  display: grid;
  gap: 14px;
}

.task-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  border: 1px solid rgba(19, 33, 29, 0.08);
}

.task-card.is-complete {
  background: linear-gradient(145deg, rgba(28, 107, 94, 0.09), rgba(255, 255, 255, 0.88));
}

.task-toggle {
  display: inline-flex;
  align-items: flex-start;
  padding-top: 4px;
}

.task-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.task-checkmark {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(19, 33, 29, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.task-checkmark::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  width: 7px;
  height: 13px;
  border-right: 3px solid #fff;
  border-bottom: 3px solid #fff;
  transform: rotate(40deg) scale(0);
  transition: transform 140ms ease;
}

.task-checkbox:checked + .task-checkmark {
  background: linear-gradient(135deg, var(--accent) 0%, #143f38 100%);
  border-color: transparent;
}

.task-checkbox:checked + .task-checkmark::after {
  transform: rotate(40deg) scale(1);
}

.task-body {
  min-width: 0;
}

.task-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.task-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.4;
}

.task-card.is-complete .task-title {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  color: rgba(19, 33, 29, 0.72);
}

.task-description {
  margin: 10px 0 0;
  color: rgba(19, 33, 29, 0.78);
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.icon-button {
  padding: 10px 14px;
  color: var(--danger);
  background: rgba(161, 85, 85, 0.1);
}

.empty-state {
  display: grid;
  gap: 6px;
  padding: 24px;
  border: 1px dashed rgba(19, 33, 29, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.52);
  color: var(--muted);
}

.empty-state strong {
  color: var(--text);
}

.empty-state.compact {
  margin-bottom: 18px;
}

.hours-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 12px;
}

.hours-table thead th {
  padding: 0 14px 8px;
  text-align: left;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hours-table tbody tr {
  background: var(--surface-strong);
}

.hours-table tbody td {
  padding: 14px;
  vertical-align: middle;
  border-top: 1px solid rgba(19, 33, 29, 0.08);
  border-bottom: 1px solid rgba(19, 33, 29, 0.08);
}

.hours-table tbody td:first-child {
  border-left: 1px solid rgba(19, 33, 29, 0.08);
  border-radius: 18px 0 0 18px;
}

.hours-table tbody td:last-child {
  border-right: 1px solid rgba(19, 33, 29, 0.08);
  border-radius: 0 18px 18px 0;
}

.hours-table tbody tr.is-invalid td {
  background: rgba(161, 85, 85, 0.08);
}

.day-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(28, 107, 94, 0.1);
  color: var(--accent);
  font-weight: 800;
}

.day-pill.is-empty {
  background: rgba(19, 33, 29, 0.08);
  color: var(--muted);
}

.hours-table select {
  min-width: 118px;
}

.duration-output,
.amount-output {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  font-weight: 700;
}

.amount-output {
  color: var(--accent);
}

.duration-output.is-invalid,
.amount-output.is-invalid {
  color: var(--danger);
}

.row-delete {
  width: 100%;
  white-space: nowrap;
}

.hours-table tfoot th,
.hours-table tfoot td {
  padding: 14px;
  font-weight: 800;
  background: rgba(19, 33, 29, 0.06);
}

.hours-table tfoot th:first-child {
  border-radius: 18px 0 0 18px;
}

.hours-table tfoot td:last-child {
  border-radius: 0 18px 18px 0;
}

.actions-cell {
  background: transparent;
}

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

.table-note {
  margin: 16px 0 0;
  line-height: 1.6;
}

@keyframes panel-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 820px) {
  .page-shell {
    padding: 18px 12px 44px;
  }

  .ambient {
    display: none;
  }

  .surface {
    padding: 20px;
    border-radius: 24px;
  }

  .tab-bar {
    position: sticky;
    top: 10px;
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
    box-shadow: 0 16px 28px rgba(36, 34, 28, 0.12);
  }

  .tab-button {
    min-height: 54px;
    padding: 15px 18px;
    font-size: 1rem;
  }

  .content-stack,
  .tab-panel {
    gap: 18px;
    margin-top: 18px;
  }

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

  .task-header,
  .section-heading,
  .split-heading,
  .action-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .section-heading {
    margin-bottom: 18px;
  }

  .section-heading h2 {
    font-size: clamp(1.45rem, 5vw, 1.9rem);
    line-height: 1.08;
  }

  .progress-block,
  .empty-state,
  .task-card,
  .metric-card {
    border-radius: 20px;
  }

  .sync-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .field {
    gap: 8px;
  }

  .field textarea {
    min-height: 132px;
  }

  .task-card {
    padding: 18px;
  }

  .hours-table,
  .hours-table thead,
  .hours-table tbody,
  .hours-table tfoot,
  .hours-table tr,
  .hours-table th,
  .hours-table td {
    display: block;
    width: 100%;
  }

  .hours-table {
    border-spacing: 0;
  }

  .table-wrap {
    overflow-x: visible;
  }

  .hours-table thead {
    display: none;
  }

  .hours-table tbody tr {
    margin-bottom: 14px;
    border: 1px solid rgba(19, 33, 29, 0.08);
    border-radius: 22px;
    overflow: hidden;
  }

  .hours-table tbody td,
  .hours-table tfoot th,
  .hours-table tfoot td {
    border: 0;
    border-radius: 0;
  }

  .hours-table tbody td {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
  }

  .hours-table tbody td::before {
    content: attr(data-label);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .hours-table tbody td + td {
    border-top: 1px solid rgba(19, 33, 29, 0.08);
  }

  .hours-table tfoot tr {
    margin-top: 8px;
    border-radius: 20px;
    overflow: hidden;
  }

  .hours-table tfoot th,
  .hours-table tfoot td {
    padding: 14px 16px;
  }

  .hours-table tfoot td::before {
    content: attr(data-label);
    margin-right: 10px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
  }

  .hours-table tfoot .actions-cell {
    display: none;
  }

  .table-note {
    font-size: 0.98rem;
  }
}

@media (max-width: 560px) {
  .page-shell {
    padding: 14px 10px 34px;
  }

  .surface {
    padding: 18px;
  }

  .tab-button,
  .primary-button,
  .secondary-button,
  .icon-button {
    width: 100%;
  }

  .summary-grid,
  .task-list,
  .stack-form {
    gap: 12px;
  }

  .progress-header {
    flex-wrap: wrap;
  }

  .task-card {
    grid-template-columns: 1fr;
  }

  .task-toggle {
    padding-top: 0;
  }

  .task-header {
    gap: 12px;
  }

  .empty-state {
    padding: 18px;
  }

  .hours-table tbody td {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 14px;
  }

  .hours-table tbody td::before {
    margin-bottom: 2px;
  }

  .hours-table tfoot th,
  .hours-table tfoot td {
    padding: 12px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
