﻿:root {
  --bg: #f5f7f3;
  --surface: #ffffff;
  --ink: #163024;
  --ink-soft: #486457;
  --accent: #0f766e;
  --accent-2: #d97706;
  --line: #dbe5df;
  --danger: #b42318;
  --radius: 16px;
  --shadow: 0 20px 40px rgba(14, 51, 37, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Outfit", sans-serif;
  background: var(--bg);
  color: var(--ink);
  position: relative;
}

body.modal-open {
  overflow: hidden;
}

.ambient-bg {
  position: absolute;
  inset: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 15% 20%, rgba(15, 118, 110, 0.14) 0%, transparent 32%),
    radial-gradient(circle at 80% 10%, rgba(217, 119, 6, 0.15) 0%, transparent 38%),
    radial-gradient(circle at 70% 80%, rgba(15, 118, 110, 0.1) 0%, transparent 34%);
  z-index: 0;
  pointer-events: none;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.site-header > div {
  min-width: 0;
}

.hero-copy {
  flex: 1 1 360px;
  max-width: 680px;
}

.hero-subcopy {
  margin: 0.65rem 0 0;
  color: var(--ink-soft);
  max-width: 56ch;
}

.hero-graphic {
  width: min(360px, 35vw);
  min-width: 220px;
  max-height: 200px;
  border-radius: 16px;
  border: 1px solid rgba(15, 118, 110, 0.2);
  box-shadow: 0 14px 28px rgba(14, 51, 37, 0.12);
  object-fit: cover;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--accent);
  font-size: 0.8rem;
}

h1 {
  margin: 0.35rem 0 0;
  font-family: "Fraunces", serif;
  font-size: clamp(1.3rem, 2.4vw, 2rem);
}

.main-wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 2rem;
  padding: 0 0.8rem;
  position: relative;
  z-index: 1;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  min-width: 0;
  background-image:
    radial-gradient(circle at 100% 0%, rgba(15, 118, 110, 0.08) 0%, rgba(15, 118, 110, 0) 36%),
    radial-gradient(circle at 0% 100%, rgba(217, 119, 6, 0.08) 0%, rgba(217, 119, 6, 0) 30%);
}

.auth-card {
  width: min(560px, 100%);
  margin: 3rem auto;
}

.welcome-card {
  margin-bottom: 1rem;
}

.panel {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.form-grid {
  display: grid;
  gap: 0.8rem;
}

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

.form-grid label {
  display: grid;
  gap: 0.35rem;
  font-weight: 500;
  color: var(--ink-soft);
  min-width: 0;
}

.full-width {
  grid-column: 1 / -1;
}

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

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: #fbfdfb;
  width: 100%;
  min-width: 0;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(15, 118, 110, 0.3);
  border-color: var(--accent);
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 0.7rem 1rem;
  font-weight: 600;
  cursor: pointer;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
}

.btn.secondary {
  background: var(--accent-2);
  color: #fff;
}

.btn.ghost {
  background: #eff4f1;
  color: var(--ink);
}

.btn.small-btn {
  padding: 0.45rem 0.65rem;
  font-size: 0.82rem;
}

.inline-pay-rate-input {
  min-width: 7rem;
}

.inline-effective-date-input {
  min-width: 9.5rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 0.6rem;
  vertical-align: top;
  word-break: normal;
  hyphens: none;
}

.data-table td {
  overflow-wrap: break-word;
}

.data-table th {
  background: #f4f8f5;
  font-weight: 600;
  white-space: nowrap;
  overflow-wrap: normal;
}

.data-table .summary-row td {
  background: #eef7f3;
  border-top: 2px solid #b9d9cc;
}

#myEntriesTable {
  min-width: 1060px;
  table-layout: auto;
}

#myEntriesTable th {
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: normal;
}

#myEntriesTable th:nth-child(1),
#myEntriesTable td:nth-child(1) {
  min-width: 110px;
}

#myEntriesTable th:nth-child(2),
#myEntriesTable td:nth-child(2) {
  min-width: 170px;
}

#myEntriesTable th:nth-child(3),
#myEntriesTable td:nth-child(3),
#myEntriesTable th:nth-child(4),
#myEntriesTable td:nth-child(4) {
  min-width: 110px;
}

#myEntriesTable th:nth-child(5),
#myEntriesTable td:nth-child(5) {
  min-width: 90px;
}

#myEntriesTable th:nth-child(6),
#myEntriesTable td:nth-child(6) {
  min-width: 170px;
}

#myEntriesTable th:nth-child(7),
#myEntriesTable td:nth-child(7) {
  min-width: 220px;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

.genworth-pdf-tools {
  margin: 0.4rem 0 0.75rem;
}

.genworth-preview-wrap {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #edf2ef;
}

.genworth-preview-frame {
  width: 100%;
  max-width: 100%;
  min-height: 620px;
  border: 0;
  display: block;
}

.message {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  background: #ecfdf3;
  color: #0f5132;
  border: 1px solid #abefc6;
}

.message.error {
  background: #fff0f0;
  color: var(--danger);
  border-color: #f3c0c0;
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0;
}

.section-icon {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: linear-gradient(145deg, #0f766e, #1f8a82);
  color: #fff;
  font-size: 0.92rem;
  box-shadow: 0 6px 14px rgba(15, 118, 110, 0.24);
}

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

.hidden {
  display: none !important;
}

.demo-help {
  margin-top: 1rem;
  color: var(--ink-soft);
}

.time-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.time-input-row input {
  min-width: 0;
}

.clock-btn {
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fbfdfb;
  cursor: pointer;
  font-size: 1.05rem;
}

.clock-btn:hover {
  border-color: var(--accent);
}

.activity-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.activity-badge::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.82;
}

.activity-badge.home-care {
  color: #0a6a63;
  background: #d9f4ee;
}

.activity-badge.errand {
  color: #8a5716;
  background: #fdeccf;
}

.activity-badge.transport {
  color: #3f52b7;
  background: #e3e9ff;
}

.activity-badge.meal {
  color: #7a2f74;
  background: #f7e2f4;
}

.activity-badge.medication {
  color: #1d64a3;
  background: #deefff;
}

.activity-badge.companionship {
  color: #6c4f0d;
  background: #f8efda;
}

.activity-badge.other {
  color: #3e5560;
  background: #e8eef1;
}

.clock-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 23, 17, 0.5);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 999;
  overflow: hidden;
}

.clock-panel {
  width: min(360px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1rem;
}

.clock-title {
  margin: 0 0 0.75rem;
}

.clock-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.clock-display-part {
  border: 0;
  background: transparent;
  font-size: 2rem;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  font-weight: 600;
}

.clock-display-part.active {
  color: var(--accent);
}

.clock-sep {
  font-size: 1.9rem;
  color: var(--ink-soft);
}

.clock-period {
  display: grid;
  gap: 0.2rem;
  margin-left: 0.35rem;
}

.clock-period-btn {
  border: 1px solid var(--line);
  background: #fbfdfb;
  border-radius: 8px;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  min-width: 3rem;
}

.clock-period-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.clock-dial-wrap {
  position: relative;
  width: 310px;
  height: 310px;
  margin: 0 auto 0.75rem;
}

.clock-dial {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #f2f7f4;
  border: 1px solid var(--line);
}

.clock-point {
  position: absolute;
  width: 2rem;
  height: 2rem;
  margin-left: -1rem;
  margin-top: -1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 600;
  cursor: pointer;
}

.clock-point.active {
  background: var(--accent);
  color: #fff;
}

.clock-hand {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 88px;
  background: var(--accent);
  transform-origin: center bottom;
  transform: translate(-50%, -100%) rotate(0deg);
  pointer-events: none;
}

.clock-center-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.clock-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.date-panel {
  width: min(420px, 100%);
}

.date-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.date-month-label {
  text-align: center;
  font-weight: 600;
}

.date-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
  margin-bottom: 0.4rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
  text-align: center;
}

.date-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.date-day-btn {
  border: 1px solid var(--line);
  background: #fbfdfb;
  border-radius: 10px;
  min-height: 2.3rem;
  cursor: pointer;
}

.date-day-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.date-day-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

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

  .main-wrap {
    width: min(1200px, 96vw);
  }

  .clock-dial-wrap {
    width: 285px;
    height: 285px;
  }
}

@media (max-width: 600px) {
  .site-header {
    padding: 0.9rem 0.8rem;
  }

  h1 {
    font-size: clamp(1.15rem, 6vw, 1.45rem);
  }

  .card {
    padding: 0.85rem;
  }

  .hero-graphic {
    width: 100%;
    min-width: 0;
    max-height: 170px;
  }

  .main-wrap {
    width: 100%;
    max-width: 100%;
    padding: 0 0.55rem 1rem;
  }

  .data-table {
    min-width: 100%;
    table-layout: fixed;
  }

  #myEntriesTable {
    min-width: 1060px;
    table-layout: auto;
  }

  .clock-modal {
    place-items: center;
    padding: 0.45rem;
  }

  .clock-panel {
    width: min(360px, calc(100vw - 0.9rem));
    border-radius: 18px;
    max-height: 90vh;
    overflow-y: auto;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }

  .clock-dial-wrap {
    width: 218px;
    height: 218px;
  }

  .clock-point {
    width: 1.8rem;
    height: 1.8rem;
    margin-left: -0.9rem;
    margin-top: -0.9rem;
    font-size: 0.86rem;
  }

  .genworth-preview-frame {
    min-height: 420px;
  }
}

@media print {
  .site-header,
  #loginSection,
  #addCaregiverForm,
  #reportForm,
  #logoutBtn,
  .message {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
