* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.20), transparent 24%),
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.18), transparent 22%),
    linear-gradient(180deg, #fff7ed 0%, #eff6ff 42%, #f8fafc 100%);
  color: #172554;
}

.page {
  padding: 24px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo-wrap {
  width: 92px;
  height: 92px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(254, 215, 170, 0.9), rgba(191, 219, 254, 0.95));
  border: 1px solid rgba(251, 146, 60, 0.3);
  box-shadow: 0 18px 40px rgba(59, 130, 246, 0.14);
}

.baboon-logo {
  width: 76px;
  height: 76px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #f97316;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
}

h1 {
  margin: 0;
  font-size: 32px;
}

.subtle {
  color: #475569;
}

.composer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid #dbeafe;
  box-shadow: 0 20px 45px rgba(59, 130, 246, 0.08);
}

.composer-title {
  margin: 0 0 4px;
  font-weight: 700;
}

.composer-subtle {
  margin: 0;
  color: #64748b;
}

.add-row-controls {
  display: flex;
  gap: 12px;
  align-items: end;
}

.catalog-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: end;
}

.toolbar label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

select,
button {
  border-radius: 10px;
  border: 1px solid #bfdbfe;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
}

button {
  cursor: pointer;
  background: linear-gradient(135deg, #f59e0b, #fb7185);
  border: 0;
  color: white;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid #cbd5e1;
  color: #1e293b;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 180px));
  gap: 12px;
  margin-bottom: 20px;
}

.stats article {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid #dbeafe;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(59, 130, 246, 0.07);
}

.stats span {
  display: block;
  color: #64748b;
  margin-bottom: 6px;
  font-size: 13px;
}

.stats strong {
  font-size: 24px;
}

.sheet-wrap {
  overflow: auto;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 48px rgba(59, 130, 246, 0.08);
}

.sheet {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.sheet th,
.sheet td {
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 12px;
  text-align: right;
  min-width: 72px;
  background: rgba(255, 255, 255, 0.96);
}

.sheet thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eff6ff;
}

.day-header {
  text-align: center !important;
}

.day-header span,
.day-header strong {
  display: block;
}

.weekend-icon {
  margin: 4px 0;
  font-size: 13px;
  line-height: 1;
  color: #f59e0b;
}

.sticky-col {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left !important;
  background: #f8fafc !important;
}

.project-col {
  min-width: 280px !important;
  max-width: 280px;
}

.row-title,
.row-subtitle {
  display: block;
}

.row-subtitle {
  color: #64748b;
  font-size: 13px;
  margin-top: 4px;
}

.row-flag {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #e0f2fe;
  color: #0c4a6e;
}

.hour-input {
  width: 100%;
  min-width: 48px;
  border: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  border-radius: 8px;
  padding: 8px 6px;
  text-align: right;
}

.row-total-input {
  width: 100%;
  min-width: 64px;
  border: 1px solid #fcd34d;
  background: rgba(255, 251, 235, 0.95);
  color: #92400e;
  border-radius: 8px;
  padding: 8px 6px;
  text-align: right;
  font-weight: 700;
}

.hour-input:focus {
  outline: none;
  border-color: #f59e0b;
  background: white;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2);
}

.row-total-input:focus {
  outline: none;
  border-color: #f59e0b;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2);
}

.weekend {
  background: #f8fafc !important;
}

.sheet thead .weekend {
  background: #fff7ed !important;
}

.total-cell {
  font-weight: 700;
  background: #fffbeb !important;
}

tfoot td,
tfoot th {
  font-weight: 700;
}

.action-col {
  min-width: 90px !important;
  text-align: center !important;
  background: #f8fafc !important;
}

.row-remove-button {
  background: transparent;
  color: #b91c1c;
  border: 1px solid #fecaca;
  padding: 8px 10px;
}

.day-empty-workday {
  background: #fef3c7 !important;
}

.day-over-hours {
  background: #fee2e2 !important;
}

.hour-input.day-empty-workday {
  background: #fffbeb;
  border-color: #fcd34d;
}

.hour-input.day-over-hours {
  background: #fff1f2;
  border-color: #fda4af;
}

.day-dirty {
  box-shadow: inset 0 2px 0 #38bdf8;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(760px, 100%);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #dbeafe;
  border-radius: 28px;
  padding: 32px;
  box-shadow: 0 28px 60px rgba(59, 130, 246, 0.1);
}

.auth-logo {
  margin-bottom: 18px;
}

.auth-subtle {
  color: #475569;
  line-height: 1.5;
}

.auth-steps {
  color: #334155;
  line-height: 1.6;
  padding-left: 20px;
}

.auth-label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-textarea {
  width: 100%;
  min-height: 220px;
  border-radius: 16px;
  border: 1px solid #cbd5e1;
  background: white;
  color: #0f172a;
  padding: 14px 16px;
  font: 14px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.auth-actions {
  margin-top: 16px;
}

.auth-message {
  margin-top: 14px;
  min-height: 22px;
}

.auth-error {
  color: #b91c1c;
}

.flash-row td,
.flash-row th {
  animation: flash-row 1.2s ease;
}

@keyframes flash-row {
  0% {
    background: rgba(249, 115, 22, 0.28);
  }
  100% {
    background: inherit;
  }
}

@media (max-width: 900px) {
  .page {
    padding: 16px;
  }

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

  .brand-block,
  .composer,
  .add-row-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar {
    flex-wrap: wrap;
  }

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