:root {
  --ink: #173d33;
  --green: #153f35;
  --mint: #c6e9df;
  --cream: #faf7ef;
  --coral: #dc654e;
  --line: #e2e6dd;
  --muted: #6b7971;
  --white: #fff;
  --radius: 22px;
}
.check {
  display: flex;
  align-items: center;
  gap: 12px;
}
.check input {
  width: 20px;
  height: 20px;
  min-height: 0;
  accent-color: var(--green);
}
.initial-service {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 0;
  min-width: 0;
}
.initial-service legend {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--coral);
}
@media (max-width: 760px) {
  .initial-service {
    grid-template-columns: 1fr;
  }
  .table-wrap table,
  .table-wrap tbody {
    display: block;
    width: 100%;
  }
  .table-wrap thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .table-wrap tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
  }
  .table-wrap tbody tr:last-child {
    border-bottom: 0;
  }
  .table-wrap td {
    display: block;
    padding: 0;
    border: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    min-width: 0;
  }
  .table-wrap td::before {
    content: attr(data-label);
    display: block;
    font-size: 9px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 5px;
  }
  .table-wrap td:last-child {
    grid-column: 1/-1;
  }
  .table-wrap td:last-child button {
    width: 100%;
    padding: 10px;
  }
  .stat strong {
    overflow-wrap: anywhere;
  }
}
* {
  box-sizing: border-box;
}
section > .card + .card {
  margin-top: 14px;
}
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font:
    15px/1.5 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
}
button {
  border: 0;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2,
h3 {
  overflow-wrap: anywhere;
}
.profile-top > div:not(.profile-actions) {
  min-width: 0;
  flex: 1;
}
.card-top > div {
  min-width: 0;
}
h1,
h2,
.serif {
  font-family: Georgia, serif;
  letter-spacing: -0.04em;
}
h1 {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.12;
  margin-bottom: 12px;
}
h2 {
  font-size: 28px;
}
h3 {
  font-size: 17px;
}
p {
  color: var(--muted);
}
.eyebrow {
  display: block;
  color: var(--coral);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  margin-bottom: 16px;
}
.primary,
.secondary,
.quiet,
.danger {
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 650;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.3;
}
.primary {
  background: var(--green);
  color: white;
}
.primary:hover {
  background: #285b4b;
}
.secondary {
  background: var(--mint);
  color: var(--ink);
}
.quiet {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.danger {
  background: #fae4df;
  color: #a63825;
}
.compact {
  padding: 10px 15px;
  font-size: 13px;
}
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 10px;
  top: 10px;
  z-index: 99;
  background: white;
  padding: 12px;
}
label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
}
input,
select,
textarea {
  border: 1px solid #ced8d0;
  border-radius: 11px;
  padding: 12px;
  width: 100%;
  background: white;
  color: var(--ink);
  min-height: 46px;
}
textarea {
  min-height: 96px;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #8cbfab;
  outline-offset: 2px;
}
:focus-visible {
  outline: 3px solid #dc654e;
  outline-offset: 3px;
}
.login {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 9vw;
  align-items: center;
  padding: 6vw;
  max-width: 1440px;
  margin: auto;
}
.login-brand {
  position: relative;
  padding: 30px;
}
.login-brand img {
  width: 300px;
  max-width: 100%;
  margin-bottom: 70px;
}
.login-brand h1 {
  font-size: clamp(44px, 6vw, 80px);
}
.login-brand p {
  font-size: 18px;
}
.paw {
  font-size: 120px;
  opacity: 0.08;
  position: absolute;
  right: 0;
  bottom: -30px;
  transform: rotate(-20deg);
}
.login-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 32px;
  padding: 42px;
  box-shadow: 0 25px 70px #244d3910;
  display: grid;
  gap: 20px;
  max-width: 470px;
}
.login-card h2 {
  font-size: 42px;
  margin-bottom: 0;
}
.login-card p {
  margin: 0;
}
.login-card a {
  font-size: 12px;
  color: var(--muted);
}
#login-error {
  color: #a63825;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 238px;
  background: var(--green);
  color: white;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.brand img {
  width: 100%;
  background: var(--cream);
  border-radius: 14px;
  padding: 12px;
}
.workspace {
  font-size: 9px;
  letter-spacing: 0.15em;
  color: #a5cdbf;
  margin: 35px 12px 14px;
}
.sidebar nav {
  display: grid;
  gap: 6px;
}
.sidebar nav a {
  text-decoration: none;
  border-radius: 12px;
  padding: 13px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  color: #c5d9cf;
}
.sidebar nav a.active {
  background: var(--mint);
  color: var(--ink);
  font-weight: 700;
}
.sidebar nav a:hover:not(.active) {
  background: #ffffff0b;
}
.sidebar-bottom {
  margin-top: auto;
  font-size: 12px;
  padding: 12px;
}
.sidebar-bottom p {
  color: #d2e1d9;
}
.sidebar-bottom small {
  color: #93b6a5;
}
.sidebar-bottom button {
  color: #d9e7e0;
  border-color: #ffffff22;
  padding: 9px 12px;
}
.workspace-main {
  margin-left: 238px;
}
.topbar {
  height: 84px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 38px;
  border-bottom: 1px solid var(--line);
  background: #faf7efe8;
  gap: 12px;
}
.topbar > span {
  font-size: 13px;
  color: var(--muted);
}
.topbar > div {
  display: flex;
  gap: 12px;
  align-items: center;
}
main {
  max-width: 1440px;
  margin: auto;
  padding: 38px;
}
.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}
.page-head p {
  margin: 0;
}
.page-head .eyebrow {
  margin-bottom: 12px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}
.stat {
  padding: 24px;
  border: 1px solid var(--line);
  background: white;
  border-radius: var(--radius);
}
.stat.highlight {
  background: var(--mint);
  border-color: transparent;
}
.stat small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.stat strong {
  display: block;
  font-size: 34px;
  letter-spacing: -0.04em;
  margin: 8px 0;
}
.stat span {
  font-size: 12px;
  color: var(--muted);
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.section-head h2 {
  margin: 0;
}
.tabs {
  display: flex;
  gap: 4px;
  background: #eeeede;
  border-radius: 12px;
  padding: 4px;
}
.tabs button {
  background: transparent;
  padding: 8px 16px;
  border-radius: 9px;
  color: var(--muted);
}
.tabs button.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 2px 8px #00000008;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 23px;
  min-width: 0;
}
.card h3 {
  margin: 0 0 5px;
  font-size: 20px;
}
.card p {
  font-size: 13px;
  margin: 4px 0;
}
.card-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.avatar {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 17px;
  background: var(--mint);
  display: grid;
  place-items: center;
  font-size: 25px;
  flex-shrink: 0;
}
.avatar.big {
  width: 112px;
  height: 112px;
  border-radius: 26px;
  font-size: 48px;
}
.badge {
  display: inline-block;
  background: #eaf4ef;
  color: #426b56;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 11px;
  white-space: nowrap;
}
.badge.cancelled {
  background: #fce4df;
  color: #a64030;
}
.badge.completed {
  background: #e8edf7;
  color: #536787;
}
.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.card-actions button {
  flex: 1;
  font-size: 12px;
}
.time {
  font-weight: 750;
  font-size: 22px;
  margin-bottom: 12px;
}
.empty {
  border: 1px dashed #bccabe;
  border-radius: var(--radius);
  padding: 50px 24px;
  text-align: center;
  background: #fff8;
}
.empty span {
  font-size: 34px;
  display: block;
  margin-bottom: 14px;
}
.empty h3 {
  margin-bottom: 8px;
}
.empty p {
  margin-bottom: 20px;
}
.search {
  max-width: 660px;
  margin-bottom: 25px;
}
.search input {
  padding: 15px 18px;
  background: white;
  border-radius: 14px;
}
.muted {
  color: var(--muted);
  font-size: 13px;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 24px;
}
.profile-top {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
}
.profile-top h1 {
  margin-bottom: 4px;
}
.profile-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.details dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}
.details dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.notes {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
td,
th {
  padding: 15px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td button {
  font-size: 11px;
  padding: 7px 10px;
}
.month-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.month-nav h2 {
  margin: 0;
  font-size: 24px;
  text-transform: capitalize;
}
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}
.weekday {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding: 8px;
}
.day {
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 84px;
  padding: 10px;
  background: white;
  text-align: left;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.day.selected {
  border: 2px solid var(--coral);
  padding: 9px;
}
.day.today {
  background: #edf7f1;
}
.day small {
  background: var(--mint);
  padding: 2px 5px;
  border-radius: 5px;
  font-size: 10px;
  align-self: start;
}
.day.blank {
  border: 0;
  background: none;
}
.date-controls {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 25px;
}
.date-controls label {
  max-width: 200px;
}
.app-footer {
  font-size: 11px;
  text-align: center;
  color: var(--muted);
  padding: 24px;
}
.warning {
  background: #fff1d3;
  padding: 15px;
  border-radius: 12px;
  font-size: 13px;
  color: #6b592f;
}
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 25px;
}
.loading {
  padding: 80px;
  text-align: center;
  color: var(--muted);
}
dialog {
  border: 0;
  border-radius: 26px;
  padding: 0;
  width: min(680px, calc(100% - 24px));
  max-height: 90svh;
  color: var(--ink);
  box-shadow: 0 30px 120px #0003;
}
dialog::backdrop {
  background: #0e332aaa;
  backdrop-filter: blur(3px);
}
.modal-body {
  padding: 30px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.modal-head h2 {
  margin: 0;
  font-size: 30px;
}
.modal-head button {
  font-size: 22px;
  padding: 5px 12px;
  background: var(--cream);
  border-radius: 10px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}
.wide {
  grid-column: 1/-1;
}
.form-section {
  grid-column: 1/-1;
  color: var(--coral);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-top: 12px;
}
.form-actions {
  margin-top: 25px;
  display: flex;
  gap: 10px;
  justify-content: end;
}
.form-error {
  color: #a63825;
  font-size: 13px;
  margin-top: 16px;
  white-space: pre-wrap;
}
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 420px;
  background: var(--green);
  color: white;
  border-radius: 14px;
  padding: 16px 22px;
  box-shadow: 0 12px 35px #0002;
  z-index: 50;
}
#toast.error {
  background: #98422e;
}
.notice {
  padding: 15px 18px;
  border-radius: 14px;
  background: var(--mint);
  font-size: 13px;
}
.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}
.pagination-info {
  font-size: 12px;
  color: var(--muted);
}
@media (min-width: 1500px) {
  .cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 1100px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .topbar {
    padding: 18px 24px;
  }
  main {
    padding: 28px;
  }
  .stats {
    gap: 12px;
  }
  .stat {
    padding: 20px;
  }
}
@media (max-width: 760px) {
  .login {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 30px 20px;
  }
  .login-brand {
    padding: 0;
  }
  .login-brand img {
    width: 240px;
    margin-bottom: 24px;
  }
  .login-brand h1 {
    font-size: 42px;
  }
  .login-brand p {
    font-size: 15px;
  }
  .login-card {
    padding: 28px;
    max-width: none;
  }
  .paw {
    display: none;
  }
  .sidebar {
    inset: auto 0 0;
    width: 100%;
    height: 76px;
    padding: 5px;
    background: var(--green);
    padding-bottom: max(6px, env(safe-area-inset-bottom));
  }
  .sidebar .brand,
  .workspace,
  .sidebar-bottom {
    display: none;
  }
  .sidebar nav {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 0;
  }
  .sidebar nav a {
    display: flex;
    flex-direction: column;
    padding: 7px 2px;
    gap: 2px;
    font-size: 18px;
    border-radius: 10px;
  }
  .sidebar nav a span {
    font-size: 9px;
  }
  .workspace-main {
    margin-left: 0;
    padding-bottom: 80px;
  }
  .topbar {
    height: 70px;
    padding: 12px 18px;
  }
  .topbar > span {
    font-size: 11px;
    max-width: 110px;
  }
  .topbar > div {
    gap: 6px;
  }
  .topbar .badge {
    display: none;
  }
  main {
    padding: 24px 18px;
  }
  .page-head {
    align-items: start;
    flex-wrap: wrap;
    margin-bottom: 22px;
  }
  .page-head h1 {
    font-size: 35px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .stats .stat:last-child {
    grid-column: 1/-1;
  }
  .stat {
    padding: 17px;
  }
  .stat strong {
    font-size: 28px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 20px;
  }
  .profile-top {
    gap: 16px;
    flex-wrap: wrap;
  }
  .profile-actions {
    margin: 0;
    width: 100%;
  }
  .avatar.big {
    width: 80px;
    height: 80px;
  }
  .details {
    gap: 18px;
  }
  .panel {
    padding: 20px;
  }
  .section-head {
    align-items: start;
    flex-wrap: wrap;
  }
  .calendar {
    gap: 3px;
  }
  .day {
    min-height: 61px;
    padding: 7px;
    font-size: 12px;
    border-radius: 7px;
  }
  .day.selected {
    padding: 6px;
  }
  .day small {
    font-size: 8px;
    padding: 2px 3px;
  }
  .weekday {
    font-size: 9px;
  }
  .month-nav h2 {
    font-size: 22px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .wide,
  .form-section {
    grid-column: auto;
  }
  .modal-body {
    padding: 23px;
  }
  .form-actions {
    flex-wrap: wrap;
  }
  .form-actions button {
    flex: 1;
  }
  .date-controls label {
    flex: 1;
    max-width: none;
  }
  .date-controls .primary {
    width: 100%;
  }
  #toast {
    left: 18px;
    right: 18px;
    bottom: 90px;
    max-width: none;
  }
  .app-footer {
    font-size: 10px;
  }
  .profile-top h1 {
    font-size: 32px;
  }
}
.care-notice {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #edbda8;
  border-radius: 14px;
  background: #fff2e8;
  color: #673623;
  overflow-wrap: anywhere;
}
.photo-trigger {
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 18px;
  cursor: zoom-in;
  flex-shrink: 0;
  line-height: 0;
}
.photo-trigger:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 4px;
}
.photo-trigger:hover .avatar {
  box-shadow: 0 0 0 3px var(--mint);
}
dialog.photo-viewer {
  width: min(1000px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 16px;
  overflow: auto;
}
.photo-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.photo-viewer-head h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 26px;
  min-width: 0;
}
.photo-viewer-head button {
  flex-shrink: 0;
}
.photo-enlarged {
  display: block;
  width: 100%;
  max-height: calc(100dvh - 150px);
  object-fit: contain;
  border-radius: 12px;
}
@media (max-width: 500px) {
  .photo-viewer-head h2 {
    font-size: 21px;
  }
}
.activity-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.expense-stat {
  background: #fff2e8;
}
.stat.negative-balance {
  background: #fbe1dd;
  color: #872d27;
}
.expense-description {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 320px;
}
.expense-breakdown {
  display: grid;
  gap: 10px;
}
.expense-breakdown > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  flex-wrap: wrap;
}
@media (max-width: 760px) {
  .finance-stats .stat strong {
    font-size: clamp(19px, 5.5vw, 28px);
    overflow-wrap: anywhere;
  }
  .activity-stats .stat:last-child {
    grid-column: auto;
  }
  .expense-description {
    max-width: none;
  }
  .date-controls select {
    max-width: 100%;
  }
  .sidebar nav a {
    min-width: 0;
  }
}
.care-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.care-badge {
  background: #f8ddcb;
  color: #673623;
  white-space: normal;
}
.care-options,
.photo-options,
.payment-options {
  min-width: 0;
  border: 1px solid #d8e3dc;
  border-radius: 14px;
  padding: 16px;
}
.care-options legend,
.photo-options legend,
.payment-options legend {
  font-weight: 700;
  padding: 0 6px;
}
.badge.payment-paid {
  background: #d7eee1;
  color: #174a32;
}
.badge.payment-pending {
  background: #fbe1dd;
  color: #872d27;
}
.badge.payment-partial {
  background: #fff0ce;
  color: #715317;
}
.payment-options .form-grid {
  margin-top: 10px;
}
.appointment-identity {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.appointment-identity legend {
  font-weight: 700;
  padding: 0 6px;
}
.appointment-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.appointment-mode .check {
  margin: 0;
}
.care-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 10px 0 18px;
}
.care-grid .check {
  margin: 0;
}
@media (max-width: 500px) {
  .care-grid {
    grid-template-columns: 1fr;
  }
}
