:root {
  --bg: #eef3f7;
  --bg-deep: #d9e6ee;
  --surface: rgba(249, 252, 254, 0.86);
  --surface-strong: #ffffff;
  --surface-muted: #eef4f8;
  --ink: #13212c;
  --ink-soft: #52616d;
  --line: rgba(19, 33, 44, 0.1);
  --line-strong: rgba(19, 33, 44, 0.18);
  --accent: #0a7ea4;
  --accent-strong: #08556e;
  --accent-soft: #dff3fb;
  --accent-wash: rgba(10, 126, 164, 0.12);
  --success: #1f8f64;
  --success-soft: #e6f8ef;
  --warn: #c77719;
  --warn-soft: #fff2de;
  --danger: #b23a48;
  --danger-soft: #fdecef;
  --shadow-sm: 0 12px 32px rgba(15, 33, 50, 0.08);
  --shadow-md: 0 22px 60px rgba(15, 33, 50, 0.14);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --main-width: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(150, 208, 226, 0.52), transparent 34%),
    radial-gradient(circle at top right, rgba(255, 217, 166, 0.48), transparent 26%),
    linear-gradient(180deg, #f7fbfe 0%, var(--bg) 52%, #e4edf3 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: -1;
  filter: blur(18px);
}

body::before {
  top: 96px;
  left: -40px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(10, 126, 164, 0.14);
}

body::after {
  right: -70px;
  bottom: 110px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(199, 119, 25, 0.12);
}

a {
  color: inherit;
}

header {
  position: sticky;
  top: 0;
  z-index: 40;
  width: min(calc(100% - 28px), var(--main-width));
  margin: 16px auto 0;
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: calc(var(--radius-lg) - 4px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(239, 247, 252, 0.84));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}

.app-brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.app-brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, var(--accent) 0%, #0f9eb4 58%, #ffc873 100%);
  box-shadow: 0 14px 28px rgba(10, 126, 164, 0.28);
  overflow: hidden;
}

.app-brand-mark span {
  color: #fff;
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1;
}

.app-brand-mark.has-logo {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 28px rgba(10, 126, 164, 0.16);
}

.app-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.app-brand-text {
  min-width: 0;
}

header nav {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.desktop-nav {
  display: flex;
}

.mobile-nav-toggle,
.mobile-drawer,
.mobile-drawer-backdrop {
  display: none;
}

header nav > a,
header nav > form > button,
.nav-menu > summary,
.btn,
button {
  position: relative;
  border-radius: 999px;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

header nav > a,
.nav-menu > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.54);
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 700;
}

header nav > a:hover,
.nav-menu > summary:hover,
.btn:hover,
button:hover,
header nav > form > button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(16, 37, 53, 0.12);
}

header nav > a[aria-current="page"] {
  border-color: rgba(10, 126, 164, 0.2);
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(10, 126, 164, 0.08);
}

.nav-menu {
  position: relative;
}

.nav-menu > summary {
  list-style: none;
  cursor: pointer;
}

.nav-menu > summary::-webkit-details-marker {
  display: none;
}

.nav-menu[open] > summary {
  border-color: rgba(10, 126, 164, 0.2);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.nav-menu-items {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 240px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 6px;
  z-index: 30;
}

.nav-menu-items a {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
}

.nav-menu-items a:hover {
  background: var(--surface-muted);
}

.nav-menu-items a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.mobile-nav-toggle {
  width: 46px;
  height: 46px;
  min-width: 46px;
  padding: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  justify-self: end;
  align-self: center;
  gap: 5px;
  line-height: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  box-shadow: none;
}

.mobile-nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
}

.mobile-nav-toggle span + span {
  margin-top: 0;
}

main {
  width: min(calc(100% - 28px), var(--main-width));
  margin: 24px auto 0;
  padding: 0 0 30px;
}

main > .card:first-child {
  animation: rise-in 0.42s ease both;
}

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

.card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 251, 253, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 34%);
  pointer-events: none;
}

.card > * {
  position: relative;
  z-index: 1;
}

.card h1,
.card h2,
.card h3,
.card p {
  margin-top: 0;
  margin-bottom: 10px;
}

.card h1 {
  font-size: clamp(1.65rem, 2.6vw, 2.25rem);
  letter-spacing: -0.03em;
}

.card h2 {
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  letter-spacing: -0.02em;
}

.page-hero {
  padding: 22px 24px;
}

.page-hero h1 {
  margin-bottom: 6px;
}

.page-hero .actions {
  margin-top: 14px;
}

.section-card h2,
.section-card h3 {
  margin-bottom: 12px;
}

.section-stack {
  display: grid;
  gap: 16px;
}

.pet-edit-shell {
  display: grid;
  gap: 16px;
}

.pet-edit-intro {
  max-width: 720px;
  margin-bottom: 0;
}

.pet-edit-grid {
  gap: 14px 16px;
}

.pet-edit-grid label {
  align-content: start;
}

.field-hint {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.35;
}

.pet-edit-actions {
  justify-content: flex-start;
}

.pet-edit-danger {
  border-color: rgba(178, 58, 72, 0.16);
}

.table-card > .table,
details.card > .table {
  margin-top: 12px;
}

.table-card > .actions,
details.card > .actions {
  margin-top: 12px;
}

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

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-divider {
  display: block;
  width: 100%;
  height: 1px;
  margin: 12px 0 0;
  background: linear-gradient(90deg, rgba(19, 33, 44, 0.12), transparent);
}

.toolbar-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(230, 239, 245, 0.8);
}

.toolbar-tabs .btn {
  box-shadow: none;
}

.visit-tabs {
  margin: 14px 0 18px;
}

.visit-form-shell {
  display: grid;
  gap: 16px;
}

.visit-tab-panel {
  padding: 2px 0 0;
}

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

.visit-tab-panel-stack {
  display: grid;
  gap: 16px;
}

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

.visit-form-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-top: 8px;
}

.visit-autosave-status {
  min-height: 22px;
  color: var(--ink-soft);
  font-weight: 700;
}

.visit-autosave-status[data-state="saving"] {
  color: var(--accent-strong);
}

.visit-autosave-status[data-state="saved"] {
  color: var(--success);
}

.visit-autosave-status[data-state="error"] {
  color: var(--danger);
}

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

.meta-card {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(19, 33, 44, 0.06);
}

.meta-card b {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.text-break {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-sections {
  display: grid;
  gap: 14px;
}

details.card > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  cursor: pointer;
}

details.card > summary::-webkit-details-marker {
  display: none;
}

details.card > summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--accent-strong);
  font-weight: 800;
}

details.card[open] > summary::before {
  content: "−";
}

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

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

form.grid {
  gap: 10px;
}

.intake-form {
  gap: 16px;
}

.intake-section {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(19, 33, 44, 0.08);
  background: rgba(255, 255, 255, 0.44);
}

.intake-section h2 {
  margin: 0 0 8px;
  font-size: 1.16rem;
}

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

.intake-grid .field-full {
  grid-column: 1 / -1;
}

.intake-actions {
  display: flex;
  justify-content: flex-start;
}

.intake-actions .btn,
.intake-actions button {
  width: auto;
  min-width: 260px;
}

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

  .intake-actions .btn,
  .intake-actions button {
    width: 100%;
    min-width: 0;
  }
}

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
  color: var(--ink-soft);
}

input,
select,
textarea,
button {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font: inherit;
}

input::placeholder,
textarea::placeholder {
  color: #8796a2;
}

input:focus,
select:focus,
textarea:focus,
button:focus,
.btn:focus,
summary:focus {
  outline: 0;
  border-color: rgba(10, 126, 164, 0.52);
  box-shadow: 0 0 0 4px rgba(10, 126, 164, 0.14);
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  padding: 0;
  accent-color: var(--accent);
}

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

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--accent) 0%, #1495b8 100%);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(10, 126, 164, 0.22);
}

.btn.secondary,
button.btn.secondary {
  background: rgba(255, 255, 255, 0.88);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: none;
}

.btn.warn,
button.btn.warn {
  background: linear-gradient(135deg, #c84a58 0%, #a92d3d 100%);
  box-shadow: 0 16px 30px rgba(178, 58, 72, 0.18);
}

button:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
}

.table th,
.table td {
  padding: 12px 12px;
  text-align: left;
  vertical-align: middle;
}

.table thead th {
  position: sticky;
  top: 0;
  background: rgba(239, 246, 250, 0.96);
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--line);
}

.table tbody tr {
  background: rgba(255, 255, 255, 0.5);
}

.table tbody tr + tr td {
  border-top: 1px solid rgba(19, 33, 44, 0.06);
}

.table tr[data-row-href] {
  cursor: pointer;
}

.table tr[data-row-href]:hover td {
  background: rgba(10, 126, 164, 0.06);
}

.compact-table th,
.compact-table td {
  padding: 10px 10px;
}

.compact-form input,
.compact-form select,
.compact-form textarea,
.compact-form button {
  padding: 10px 12px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.actions > form {
  margin: 0;
}

.calendar-inline-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.calendar-inline-form input,
.calendar-inline-form select {
  width: auto;
  min-width: 180px;
}

.calendar-inline-label {
  margin: 0;
}

.table td.actions,
.table .row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.table td form {
  margin: 0;
}

.table .btn,
.table button {
  min-height: 38px;
  padding: 8px 12px;
}

.row-edit-inline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
}

.row-edit-inline input,
.row-edit-inline select {
  width: auto;
  min-width: 82px;
}

.row-edit-inline input[name="note"] {
  min-width: 160px;
  flex: 1 1 180px;
}

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

.admin-users-table {
  table-layout: auto;
}

.admin-users-table th:nth-child(1),
.admin-users-table td:nth-child(1) { width: 5%; white-space: nowrap; }

.admin-users-table th:nth-child(2),
.admin-users-table td:nth-child(2) { width: 28%; vertical-align: top; }

.admin-users-table th:nth-child(3),
.admin-users-table td:nth-child(3) { width: 13%; vertical-align: top; }

.admin-users-table th:nth-child(4),
.admin-users-table td:nth-child(4) { width: 16%; font-variant-numeric: tabular-nums; }

.admin-users-table th:nth-child(5),
.admin-users-table td:nth-child(5) { width: 29%; vertical-align: top; }

.admin-users-table th:nth-child(6),
.admin-users-table td:nth-child(6) { width: 10%; white-space: nowrap; }

.admin-users-created-cell {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-schedules-table {
  table-layout: fixed;
}

.admin-schedules-table th:nth-child(1),
.admin-schedules-table td:nth-child(1) { width: 42%; word-break: break-word; }

.admin-schedules-table th:nth-child(2),
.admin-schedules-table td:nth-child(2) { width: 18%; white-space: nowrap; }

.admin-schedules-table th:nth-child(3),
.admin-schedules-table td:nth-child(3),
.admin-schedules-table th:nth-child(4),
.admin-schedules-table td:nth-child(4) { width: 12%; white-space: nowrap; }

.admin-schedules-table th:nth-child(5),
.admin-schedules-table td:nth-child(5) { width: 16%; white-space: nowrap; }

.admin-schedule-date-cell {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.admin-services-table {
  table-layout: fixed;
}

.admin-services-table th:nth-child(1),
.admin-services-table td:nth-child(1) { width: 23%; word-break: break-word; }

.admin-services-table th:nth-child(2),
.admin-services-table td:nth-child(2) { width: 10%; white-space: nowrap; }

.admin-services-table th:nth-child(3),
.admin-services-table td:nth-child(3) { width: 67%; vertical-align: top; }

.admin-services-table td:last-child {
  overflow-wrap: anywhere;
}

.admin-services-table .row-edit-inline {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.admin-services-table .row-edit-inline input[name="service_name"] {
  flex: 1 1 180px;
  min-width: 140px;
  width: auto;
}

.admin-services-table .row-edit-inline input[name="default_price"] {
  flex: 0 1 88px;
  min-width: 76px;
  width: auto;
}

.admin-services-table .row-edit-inline input[name="notes"] {
  flex: 1 1 150px;
  min-width: 110px;
  width: auto;
}

.admin-services-table .row-edit-inline .service-row-actions {
  margin-left: auto;
  flex: 0 0 auto;
}

.service-system-label,
.service-system-lock {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(223, 243, 251, 0.9);
  color: var(--accent-strong);
  font-weight: 800;
  white-space: nowrap;
}

.service-system-lock {
  background: rgba(238, 244, 248, 0.95);
  color: var(--ink-soft);
}

.service-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.service-row-actions .btn,
.service-row-actions button {
  min-width: 92px;
  justify-content: center;
  white-space: nowrap;
  line-height: 1.1;
}

.admin-document-templates-table {
  table-layout: fixed;
}

.admin-document-templates-table th:nth-child(1),
.admin-document-templates-table td:nth-child(1) { width: 22%; vertical-align: top; word-break: break-word; }

.admin-document-templates-table th:nth-child(2),
.admin-document-templates-table td:nth-child(2) { width: 10%; white-space: nowrap; vertical-align: top; }

.admin-document-templates-table th:nth-child(3),
.admin-document-templates-table td:nth-child(3) { width: 56%; vertical-align: top; }

.admin-document-templates-table th:nth-child(4),
.admin-document-templates-table td:nth-child(4) { width: 12%; white-space: nowrap; vertical-align: top; }

.line-items-table input,
.line-items-table select,
.line-items-table button {
  padding: 8px 10px;
}

.line-items-table {
  table-layout: fixed;
}

.line-items-table th:nth-child(1),
.line-items-table td:nth-child(1) { width: 24%; }

.line-items-table th:nth-child(2),
.line-items-table td:nth-child(2) { width: 22%; }

.line-items-table th:nth-child(3),
.line-items-table td:nth-child(3) { width: 10%; white-space: nowrap; }

.line-items-table th:nth-child(4),
.line-items-table td:nth-child(4) { width: 16%; }

.line-items-table th:nth-child(5),
.line-items-table td:nth-child(5) { width: 10%; white-space: nowrap; }

.line-items-table th:nth-child(6),
.line-items-table td:nth-child(6) { width: 12%; }

.line-items-table th:nth-child(7),
.line-items-table td:nth-child(7) { width: 6%; white-space: nowrap; }

.line-items-table td {
  vertical-align: top;
}

.line-items-table--service th:nth-child(1),
.line-items-table--service td:nth-child(1) { width: 30%; }

.line-items-table--service th:nth-child(2),
.line-items-table--service td:nth-child(2) { width: 26%; }

.line-items-table--service th:nth-child(3),
.line-items-table--service td:nth-child(3) { width: 12%; white-space: nowrap; }

.line-items-table--service th:nth-child(4),
.line-items-table--service td:nth-child(4) { width: 12%; white-space: nowrap; }

.line-items-table--service th:nth-child(5),
.line-items-table--service td:nth-child(5) { width: 14%; }

.line-items-table--service th:nth-child(6),
.line-items-table--service td:nth-child(6) { width: 6%; white-space: nowrap; }

.vaccination-line-items-table th:nth-child(1),
.vaccination-line-items-table td:nth-child(1) { width: 22%; }

.vaccination-line-items-table th:nth-child(2),
.vaccination-line-items-table td:nth-child(2) { width: 20%; }

.vaccination-line-items-table th:nth-child(3),
.vaccination-line-items-table td:nth-child(3) { width: 12%; white-space: nowrap; }

.vaccination-line-items-table th:nth-child(4),
.vaccination-line-items-table td:nth-child(4) { width: 11%; white-space: nowrap; }

.vaccination-line-items-table th:nth-child(5),
.vaccination-line-items-table td:nth-child(5) { width: 11%; white-space: nowrap; }

.vaccination-line-items-table th:nth-child(6),
.vaccination-line-items-table td:nth-child(6) { width: 18%; }

.vaccination-line-items-table th:nth-child(7),
.vaccination-line-items-table td:nth-child(7) { width: 6%; white-space: nowrap; }

.inline-editor {
  display: inline-block;
}

.inline-editor > summary {
  list-style: none;
  cursor: pointer;
}

.inline-editor > summary::-webkit-details-marker {
  display: none;
}

.inline-editor > summary.btn {
  display: inline-flex;
}

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

.month-grid-header {
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
}

.month-cell {
  border: 1px solid rgba(19, 33, 44, 0.08);
  border-radius: 18px;
  min-height: 92px;
  padding: 10px;
  text-decoration: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.month-cell .day {
  font-weight: 800;
  margin-bottom: 8px;
}

.month-cell .count {
  font-size: 12px;
  color: var(--ink-soft);
}

.month-cell.outside {
  opacity: 0.48;
  background: rgba(230, 237, 242, 0.82);
}

.month-cell.today {
  border-color: rgba(10, 126, 164, 0.4);
  box-shadow: inset 0 0 0 1px rgba(10, 126, 164, 0.18);
}

.month-cell.selected {
  background: linear-gradient(180deg, #f0fbff 0%, #dff2f8 100%);
  border-color: rgba(10, 126, 164, 0.28);
}

.slot-row.drop-over td {
  background: rgba(10, 126, 164, 0.08);
}

.appt-chip {
  border: 1px dashed rgba(10, 126, 164, 0.38);
  border-radius: 16px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #f8fdff 0%, #eff8fb 100%);
  cursor: grab;
}

.appt-chip.dragging {
  opacity: 0.55;
  cursor: grabbing;
}

.picker-list {
  display: grid;
  gap: 8px;
  max-height: 200px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.picker-list:empty {
  display: none;
}

.pick-btn {
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  border-radius: 14px;
  padding: 10px 12px;
}

.pick-btn.selected {
  border-color: rgba(10, 126, 164, 0.34);
  background: var(--accent-soft);
}

.pick-btn.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.vaccination-picker-card {
  margin: 10px 0 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(223, 243, 251, 0.75), rgba(255, 255, 255, 0.92));
}

.vaccination-picker-inline {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 10px 0 12px;
}

.vaccination-quick-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vaccination-form-actions {
  align-items: stretch;
}

.vaccination-form-actions > .btn,
.vaccination-form-actions > button {
  min-width: 180px;
}

.btn-chip {
  min-height: 38px;
  padding: 8px 14px;
}

.form-span-all {
  grid-column: 1 / -1;
}

.form-inline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.form-inline input,
.form-inline select,
.form-inline textarea {
  width: auto;
}

.form-inline input[name="service_name"] {
  flex: 1 1 220px;
  min-width: 180px;
}

.form-inline input[name="notes"] {
  flex: 1 1 180px;
  min-width: 140px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border-radius: 999px;
  padding: 5px 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.badge-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge-warn {
  background: var(--warn-soft);
  color: #7b4b09;
}

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

.update-admin-card {
  min-height: 100%;
}

.update-release-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.update-release-item {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(102, 130, 148, 0.14);
}

.release-notes-banner {
  margin-bottom: 18px;
}

.release-notes-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.release-notes-kicker {
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}

.release-notes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.release-note-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(238,246,250,0.92));
  border: 1px solid rgba(102, 130, 148, 0.14);
}

.release-note-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  font-weight: 800;
  color: #0b617a;
  background: rgba(169, 220, 239, 0.6);
}

.update-restart-card {
  max-width: 640px;
}

.update-restart-status {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(169, 220, 239, 0.22);
  color: var(--accent-strong);
  font-weight: 700;
}

.update-restart-steps {
  display: grid;
  gap: 10px;
  margin: 14px 0 8px;
}

.update-restart-step {
  padding: 11px 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(102, 130, 148, 0.14);
}

.update-restart-emergency {
  margin: 14px 0 4px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 244, 220, 0.72);
  border: 1px solid rgba(199, 145, 58, 0.24);
}

.update-restart-emergency .btn {
  margin-top: 10px;
}

.license-expiry-banner {
  width: min(calc(100% - 28px), var(--main-width));
  margin: 14px auto 0;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: .87rem;
  text-align: center;
}
.license-expiry-banner.license-warning {
  background: #fff8e1;
  border: 1px solid #ffe082;
  color: #7c5a00;
}
.license-expiry-banner.license-expired {
  background: #fff0f0;
  border: 1px solid #ffb3b3;
  color: #8b0000;
  font-weight: 600;
}

.call-reminder-bar {
  width: min(calc(100% - 28px), var(--main-width));
  margin: 14px auto 0;
}

.call-reminder-title {
  margin-bottom: 8px;
  font-weight: 800;
  color: var(--ink-soft);
}

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

.call-reminder-item {
  border: 1px solid rgba(199, 119, 25, 0.22);
  background: linear-gradient(180deg, #fff7ea 0%, #fff2dd 100%);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.calls-table .calls-time,
.calls-table .calls-pet {
  white-space: nowrap;
}

.calls-table {
  table-layout: auto;
  min-width: 1040px;
}

.calls-table th:nth-child(1),
.calls-table td:nth-child(1) {
  width: 150px;
  min-width: 150px;
  vertical-align: top;
}

.calls-table th:nth-child(2),
.calls-table td:nth-child(2) {
  width: 210px;
  min-width: 190px;
  vertical-align: top;
  overflow-wrap: break-word;
  word-break: normal;
}

.calls-table th:nth-child(3),
.calls-table td:nth-child(3) {
  width: 140px;
  min-width: 120px;
  vertical-align: top;
  overflow-wrap: break-word;
  word-break: normal;
}

.calls-table th:nth-child(4),
.calls-table td:nth-child(4) {
  width: 180px;
  min-width: 160px;
  vertical-align: top;
}

.calls-table th:nth-child(5),
.calls-table td:nth-child(5) {
  width: 150px;
  min-width: 130px;
  vertical-align: top;
  overflow-wrap: break-word;
  word-break: normal;
}

.calls-table th:nth-child(6),
.calls-table td:nth-child(6) {
  width: 130px;
  min-width: 130px;
  white-space: nowrap;
  vertical-align: top;
}

.calls-table th:nth-child(7),
.calls-table td:nth-child(7) {
  width: 340px;
  min-width: 340px;
  vertical-align: top;
}

.calls-table .calls-reason {
  white-space: normal;
  word-break: break-word;
}

.calls-table td.calls-actions-cell {
  vertical-align: top;
  width: 340px;
  min-width: 340px;
}

.calls-table .calls-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: stretch;
}

.calls-table td:nth-child(6) .badge {
  display: inline-flex;
  max-width: 100%;
  white-space: nowrap;
}

.calls-table .calls-actions > * {
  width: 100%;
}

.calls-table .calls-actions form {
  margin: 0;
}

.calls-table .calls-actions .btn,
.calls-table .calls-actions button {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 7px 12px;
  justify-content: center;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
}

.calls-table td.calls-actions-cell .calls-meta {
  display: block;
  width: auto;
  margin-top: 8px;
  min-width: max-content;
  max-width: none;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.biocides-history-table .usage-date-cell {
  white-space: nowrap;
}

.biocides-history-table {
  table-layout: fixed;
}

.biocides-history-table th:nth-child(1),
.biocides-history-table td:nth-child(1) { width: 10%; white-space: nowrap; }

.biocides-history-table th:nth-child(2),
.biocides-history-table td:nth-child(2) { width: 14%; vertical-align: top; }

.biocides-history-table th:nth-child(3),
.biocides-history-table td:nth-child(3) { width: 15%; vertical-align: top; }

.biocides-history-table th:nth-child(4),
.biocides-history-table td:nth-child(4) { width: 13%; vertical-align: top; }

.biocides-history-table th:nth-child(5),
.biocides-history-table td:nth-child(5) { width: 10%; white-space: nowrap; }

.biocides-history-table th:nth-child(6),
.biocides-history-table td:nth-child(6) { width: 10%; white-space: nowrap; }

.biocides-history-table th:nth-child(7),
.biocides-history-table td:nth-child(7) { width: 12%; vertical-align: top; }

.biocides-history-table th:nth-child(8),
.biocides-history-table td:nth-child(8) { width: 9%; vertical-align: top; }

.biocides-history-table th:nth-child(9),
.biocides-history-table td:nth-child(9) { width: 7%; white-space: nowrap; }

.inventory-balances-table {
  table-layout: fixed;
}

.inventory-balances-table th:nth-child(1),
.inventory-balances-table td:nth-child(1) {
  width: 24%;
  vertical-align: top;
}

.inventory-balances-table th:nth-child(2),
.inventory-balances-table td:nth-child(2) { width: 10%; }

.inventory-balances-table th:nth-child(3),
.inventory-balances-table td:nth-child(3) { width: 10%; white-space: nowrap; }

.inventory-balances-table th:nth-child(4),
.inventory-balances-table td:nth-child(4) { width: 10%; white-space: nowrap; }

.inventory-balances-table th:nth-child(5),
.inventory-balances-table td:nth-child(5) { width: 10%; white-space: nowrap; }

.inventory-balances-table th:nth-child(6),
.inventory-balances-table td:nth-child(6) { width: 10%; white-space: nowrap; }

.inventory-balances-table th:nth-child(7),
.inventory-balances-table td:nth-child(7) { width: 8%; white-space: nowrap; }

.inventory-balances-table th:nth-child(8),
.inventory-balances-table td:nth-child(8) { width: 18%; }

.inventory-balances-table td.actions,
.inventory-balances-table td.actions .actions {
  display: grid;
  gap: 8px;
  align-content: start;
}

.inventory-balances-table td.actions .actions > * {
  width: 100%;
}

.inventory-balances-table td.actions .btn,
.inventory-balances-table td.actions button {
  width: 100%;
  justify-content: center;
  min-width: 112px;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.inventory-item-cell {
  word-break: break-word;
}
.inventory-item-cell > b > a,
.table td > a:not([class]) {
  display: inline-block;
  min-height: 24px;
  padding: 2px 0;
}

.inventory-date-cell {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.system-files-table {
  table-layout: fixed;
}

.system-files-table th:nth-child(1),
.system-files-table td:nth-child(1) { width: 42%; vertical-align: top; }

.system-files-table th:nth-child(2),
.system-files-table td:nth-child(2) { width: 22%; vertical-align: top; }

.system-files-table th:nth-child(3),
.system-files-table td:nth-child(3) { width: 16%; white-space: nowrap; }

.system-files-table th:nth-child(4),
.system-files-table td:nth-child(4) { width: 20%; vertical-align: top; }

.system-files-date-cell {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pet-documents-table {
  table-layout: fixed;
}

.pet-documents-table th:nth-child(1),
.pet-documents-table td:nth-child(1) { width: 34%; vertical-align: top; }

.pet-documents-table th:nth-child(2),
.pet-documents-table td:nth-child(2) { width: 30%; vertical-align: top; }

.pet-documents-table th:nth-child(3),
.pet-documents-table td:nth-child(3) {
  width: 16%;
  white-space: nowrap;
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}

.pet-documents-table th:nth-child(4),
.pet-documents-table td:nth-child(4) { width: 20%; vertical-align: top; }

.pet-documents-table td.actions,
.pet-documents-table td.actions .actions {
  display: grid;
  gap: 8px;
  align-content: start;
}

.pet-documents-table td.actions > *,
.pet-documents-table td.actions .actions > * {
  width: 100%;
}

.pet-documents-table td.actions .btn,
.pet-documents-table td.actions button {
  width: 100%;
  justify-content: center;
  min-width: 112px;
  white-space: nowrap;
}

.invoices-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.invoices-table {
  table-layout: auto;
  min-width: 1220px;
}

.invoices-table th:nth-child(1),
.invoices-table td:nth-child(1) {
  width: 100px;
  min-width: 100px;
}

.invoices-table th:nth-child(2),
.invoices-table td:nth-child(2) {
  width: 170px;
  min-width: 170px;
}

.invoices-table th:nth-child(3),
.invoices-table td:nth-child(3) {
  width: 110px;
  min-width: 110px;
  white-space: nowrap;
}

.invoices-table th:nth-child(4),
.invoices-table td:nth-child(4) {
  width: 170px;
  min-width: 170px;
}

.invoices-table th:nth-child(5),
.invoices-table td:nth-child(5) {
  width: 110px;
  min-width: 110px;
  white-space: nowrap;
}

.invoices-table th:nth-child(6),
.invoices-table td:nth-child(6) {
  width: 180px;
  min-width: 180px;
}

.invoices-table th:nth-child(7),
.invoices-table td:nth-child(7) {
  width: 150px;
  min-width: 150px;
}

.invoices-table th:nth-child(8),
.invoices-table td:nth-child(8) {
  width: 230px;
  min-width: 230px;
}

.invoices-table td {
  vertical-align: top;
}

.invoices-table td.invoice-actions-cell {
  min-width: 230px;
  width: 230px;
  vertical-align: top;
}

.invoices-table .invoice-cell-text {
  display: inline;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

.invoices-table .invoice-paid-meta {
  margin-top: 6px;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  line-height: 1.35;
}

.invoices-table .invoice-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
  min-width: 210px;
}

.invoices-table .invoice-payment-form {
  margin: 0;
  width: 100%;
}

.invoices-table .invoice-actions .btn,
.invoices-table .invoice-actions button {
  min-width: 0;
  width: 100%;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  line-height: 1.22;
  justify-content: center;
}

.prescriptions-table {
  table-layout: fixed;
}

.prescriptions-table .prescription-no-cell,
.prescriptions-table .prescription-date-cell,
.prescriptions-table .prescription-visit-cell {
  white-space: nowrap;
}

.prescriptions-table td {
  vertical-align: top;
}

.prescriptions-table th:nth-child(1),
.prescriptions-table td:nth-child(1) { width: 8%; }

.prescriptions-table th:nth-child(2),
.prescriptions-table td:nth-child(2) { width: 12%; }

.prescriptions-table th:nth-child(3),
.prescriptions-table td:nth-child(3) { width: 16%; }

.prescriptions-table th:nth-child(4),
.prescriptions-table td:nth-child(4) { width: 18%; }

.prescriptions-table th:nth-child(5),
.prescriptions-table td:nth-child(5) { width: 10%; }

.prescriptions-table th:nth-child(6),
.prescriptions-table td:nth-child(6) { width: 14%; }

.prescriptions-table th:nth-child(7),
.prescriptions-table td:nth-child(7) { width: 22%; white-space: nowrap; }

.reports-audit-table {
  table-layout: fixed;
}

.reports-filter-actions {
  width: 100%;
}

.reports-export-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 10px;
  width: min(100%, 760px);
  margin-left: auto;
}

.reports-export-actions > .btn {
  white-space: nowrap;
}

.reports-audit-table th:nth-child(1),
.reports-audit-table td:nth-child(1) { width: 5%; }

.reports-audit-table td:nth-child(1) {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.reports-audit-table th:nth-child(2),
.reports-audit-table td:nth-child(2) { width: 14%; }

.reports-audit-table th:nth-child(3),
.reports-audit-table td:nth-child(3) { width: 15%; }

.reports-audit-table th:nth-child(4),
.reports-audit-table td:nth-child(4) { width: 19%; }

.reports-audit-table th:nth-child(5),
.reports-audit-table td:nth-child(5) { width: 15%; }

.reports-audit-table th:nth-child(6),
.reports-audit-table td:nth-child(6) { width: 32%; }

.reports-audit-table td:nth-child(2),
.reports-audit-table td:nth-child(3),
.reports-audit-table td:nth-child(4),
.reports-audit-table td:nth-child(5),
.reports-audit-table td:nth-child(6) {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

.reports-audit-table .inline-editor {
  display: block;
  width: 100%;
  max-width: 100%;
}

.reports-audit-table .inline-editor > summary {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

.visit-date-cell,
.owner-appt-date,
.pet-date-cell {
  white-space: nowrap;
}

.pet-visits-table td {
  vertical-align: top;
}

.extract-date-list {
  max-height: 240px;
  overflow: auto;
  padding-right: 6px;
}

.extract-field-groups {
  align-items: start;
}

.extract-helper {
  margin: 0 0 12px;
}

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

.extract-date-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  min-height: 72px;
}

.extract-option-copy {
  display: grid;
  gap: 3px;
}

.extract-option-title {
  font-weight: 800;
}

.extract-option-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.extract-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.extract-field-grid-wide {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.extract-field-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
}

.extract-field-option span {
  line-height: 1.35;
  font-weight: 700;
}

.extract-date-option input[type="checkbox"],
.extract-field-option input[type="checkbox"] {
  margin-top: 2px;
}

.form-template-preview {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.72);
}

.form-template-editor-body,
.form-template-editor-consent {
  width: 100%;
  resize: vertical;
  font-family: inherit;
}

.form-template-editor-body {
  min-height: 220px;
}

.form-template-editor-consent {
  min-height: 120px;
}

.receipt-table {
  table-layout: auto;
}

.receipt-table th:nth-child(1),
.receipt-table td:nth-child(1) {
  width: 170px;
  min-width: 170px;
}

.receipt-table th:nth-child(2),
.receipt-table td:nth-child(2) {
  width: 30%;
}

.receipt-table th,
.receipt-table td {
  vertical-align: top;
}

.receipt-date-cell {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.receipt-nowrap-cell {
  white-space: nowrap;
}

.receipt-name-cell {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.appt-type.planinis { background: #e7f2ff; color: #153b66; }
.appt-type.skubus { background: #ffe7e7; color: #7c1212; }
.appt-type.kontrolinis { background: #fff3d9; color: #744a03; }

.flash {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid transparent;
  font-weight: 800;
  line-height: 1.45;
}

.flash.success {
  background: var(--success-soft);
  border-color: rgba(31, 143, 100, 0.2);
  color: #176648;
}

.flash.error {
  background: var(--danger-soft);
  border-color: rgba(178, 58, 72, 0.18);
  color: #842734;
}

.error {
  color: var(--danger);
  font-weight: 800;
}

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

.time-picker-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.time-picker-inline select {
  width: auto;
  min-width: 86px;
}

.rx-fieldset {
  margin: 0;
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
}

.rx-fieldset legend {
  padding: 0 8px;
  font-weight: 800;
  color: var(--ink-soft);
}

.rx-choice-grid,
.rx-withhold-grid {
  display: grid;
  gap: 10px;
}

.rx-choice-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.rx-withhold-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.rx-choice-option,
.rx-withhold-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
}

.rx-choice-option span,
.rx-withhold-option span {
  line-height: 1.3;
}

.rx-choice-option > span {
  font-weight: 700;
}

.rx-days-input {
  width: 92px;
  min-width: 92px;
}

.login-screen {
  min-height: calc(100vh - 170px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(100%, 520px);
  padding: 28px;
  border-radius: 28px;
}

.login-card::after {
  content: "";
  position: absolute;
  inset: auto -30px -40px auto;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 200, 115, 0.34), transparent 68%);
  pointer-events: none;
}

.login-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(10, 126, 164, 0.1);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.login-card h1 {
  margin-bottom: 8px;
}

.login-card p {
  color: var(--ink-soft);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.login-brand-mark {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 18px;
}

.login-brand-copy {
  min-width: 0;
}

.login-brand-copy h1 {
  margin: 0 0 8px;
}

.login-brand-copy p {
  margin: 0;
}

.app-footer {
  width: min(calc(100% - 28px), var(--main-width));
  margin: 0 auto 22px;
  padding: 14px 0 24px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  text-align: center;
}

.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(10, 20, 29, 0.34);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.mobile-drawer {
  position: fixed;
  top: 10px;
  right: 10px;
  bottom: 10px;
  width: min(88vw, 360px);
  z-index: 50;
  padding: 18px 16px 22px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(252, 254, 255, 0.98), rgba(239, 247, 251, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-md);
  overflow: auto;
}

.mobile-drawer[hidden],
.mobile-drawer-backdrop[hidden] {
  display: none !important;
}

.mobile-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.mobile-drawer-kicker {
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mobile-drawer-section + .mobile-drawer-section {
  margin-top: 18px;
}

.mobile-drawer-title {
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mobile-drawer-links {
  display: grid;
  gap: 8px;
}

.mobile-drawer-link {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(19, 33, 44, 0.07);
  text-decoration: none;
  font-weight: 700;
}

.mobile-drawer-link[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: rgba(10, 126, 164, 0.18);
}

.mobile-drawer-meta {
  margin-bottom: 12px;
  color: var(--ink-soft);
}

@media (max-width: 960px) {
  header {
    align-items: flex-start;
    flex-direction: column;
  }

  header nav {
    width: 100%;
    justify-content: flex-start;
  }

  header nav > a,
  header nav > form,
  header nav > form > button,
  .nav-menu {
    max-width: 100%;
  }
}

@media (max-width: 720px) {
  body {
    background:
      radial-gradient(circle at top left, rgba(150, 208, 226, 0.36), transparent 30%),
      linear-gradient(180deg, #f8fbfd 0%, #e9f0f5 100%);
  }

  header,
  main,
  .call-reminder-bar,
  .app-footer {
    width: min(calc(100% - 20px), var(--main-width));
  }

  header {
    margin-top: 10px;
    padding: 14px;
    border-radius: 22px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .app-brand {
    width: auto;
    font-size: 0.95rem;
  }

  .mobile-nav-toggle {
    margin: 0;
    place-self: center end;
    transform: translateY(2px);
  }

  .mobile-nav-toggle {
    display: inline-flex;
  }

  .mobile-drawer,
  .mobile-drawer-backdrop {
    display: block;
  }

  .desktop-nav {
    display: none;
  }

  main {
    margin-top: 16px;
    padding-bottom: 20px;
  }

  .card {
    padding: 16px;
    border-radius: 20px;
  }

  .page-hero {
    padding: 18px;
  }

  .pet-edit-grid {
    gap: 12px;
  }

  .pet-edit-actions > .btn,
  .pet-edit-actions > button,
  .pet-edit-actions > form {
    width: 100%;
  }

  .actions > .btn,
  .actions > form,
  .actions > form > button {
    width: 100%;
  }

  .reports-export-actions {
    width: 100%;
    margin-left: 0;
    grid-template-columns: 1fr;
  }

  .reports-export-actions > .btn {
    width: 100%;
    white-space: normal;
  }

  .calendar-inline-form,
  .form-inline,
  .row-edit-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .calendar-inline-form input,
  .calendar-inline-form select,
  .form-inline input,
  .form-inline select,
  .form-inline textarea,
  .row-edit-inline input,
  .row-edit-inline select,
  .time-picker-inline,
  .time-picker-inline select {
    width: 100%;
    min-width: 0;
  }

  .calendar-inline-label {
    width: 100%;
  }

  .table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table th,
  .table td {
    white-space: nowrap;
  }

  .table td.text-break,
  .table td.inventory-item-cell,
  .calls-table td,
  .calls-table th {
    white-space: normal;
  }

  .table.mobile-card-table {
    display: block;
    overflow: visible;
  }

  .table.mobile-card-table thead {
    display: none;
  }

  .table.mobile-card-table tbody {
    display: grid;
    gap: 12px;
  }

  .table.mobile-card-table tr {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(19, 33, 44, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow-sm);
  }

  .table.mobile-card-table,
  .table.mobile-card-table thead,
  .table.mobile-card-table tbody {
    table-layout: auto !important;
    width: 100%;
  }

  .table.mobile-card-table td {
    display: grid;
    grid-template-columns: minmax(84px, 108px) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 0;
    border: 0;
    white-space: normal;
    width: auto !important;
    min-width: 0;
    max-width: none;
    white-space: normal !important;
  }

  .table.mobile-card-table td::before {
    content: attr(data-label);
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .table.mobile-card-table td > * {
    min-width: 0;
    max-width: 100%;
  }

  .table.mobile-card-table td a,
  .table.mobile-card-table td span,
  .table.mobile-card-table td small,
  .table.mobile-card-table td strong,
  .table.mobile-card-table td b {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .table.mobile-card-table td.actions,
  .table.mobile-card-table td:last-child.actions {
    grid-template-columns: 1fr;
  }

  .table.mobile-card-table td.actions > *,
  .table.mobile-card-table td:last-child.actions > * {
    width: 100%;
  }

  .table.mobile-card-table td.actions .btn,
  .table.mobile-card-table td.actions button,
  .table.mobile-card-table td:last-child.actions .btn,
  .table.mobile-card-table td:last-child.actions button {
    width: 100%;
    justify-content: center;
  }

  .table.mobile-card-table .table-empty-row td {
    display: block;
  }

  .table.mobile-card-table .table-empty-row td::before {
    content: none;
  }

  .calls-table {
    display: block;
    overflow: visible;
    min-width: 0;
    width: 100%;
  }

  .calls-table thead {
    display: none;
  }

  .calls-table tbody {
    display: grid;
    gap: 12px;
  }

  .calls-table tr {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(19, 33, 44, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow-sm);
  }

  .calls-table td {
    display: grid;
    grid-template-columns: minmax(84px, 108px) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 0;
    border: 0;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    white-space: normal !important;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .calls-table th:nth-child(1),
  .calls-table td:nth-child(1),
  .calls-table th:nth-child(2),
  .calls-table td:nth-child(2),
  .calls-table th:nth-child(3),
  .calls-table td:nth-child(3),
  .calls-table th:nth-child(4),
  .calls-table td:nth-child(4),
  .calls-table th:nth-child(5),
  .calls-table td:nth-child(5),
  .calls-table th:nth-child(6),
  .calls-table td:nth-child(6),
  .calls-table th:nth-child(7),
  .calls-table td:nth-child(7) {
    width: auto !important;
  }

  .calls-table td::before {
    content: attr(data-label);
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .calls-table td.calls-actions-cell {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .calls-table td.calls-actions-cell::before {
    margin-bottom: 2px;
  }

  .calls-table td.calls-actions-cell > * {
    width: 100%;
  }

  .calls-table td.calls-actions-cell .calls-meta {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .calls-table .calls-actions .btn,
  .calls-table .calls-actions button {
    width: 100%;
    justify-content: center;
  }

  .calls-table .table-empty-row td {
    display: block;
  }

  .calls-table .table-empty-row td::before {
    content: none;
  }

  .line-items-table {
    display: block;
    overflow: visible;
  }

  .line-items-table thead {
    display: none;
  }

  .line-items-table tbody {
    display: grid;
    gap: 12px;
  }

  .line-items-table tr {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(19, 33, 44, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.74);
  }

  .line-items-table td {
    display: grid;
    gap: 6px;
    padding: 0;
    white-space: normal;
    border: 0;
    width: auto !important;
    min-width: 0;
    max-width: none;
  }

  .line-items-table td::before {
    content: attr(data-label);
    color: var(--ink-soft);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .line-items-table td {
    grid-column: 1 / -1;
  }

  .line-items-table td > * {
    min-width: 0;
    max-width: 100%;
  }

  .line-items-table td input,
  .line-items-table td select,
  .line-items-table td button {
    min-height: 48px;
  }

  .line-items-table td:nth-child(7) button {
    width: 100%;
    justify-content: center;
  }

  .line-items-table td input,
  .line-items-table td select {
    width: 100%;
  }

  .line-items-table td:last-child {
    margin-top: 4px;
  }

  .line-items-table--service td:nth-child(6) button {
    width: 100%;
    justify-content: center;
  }

  .vaccination-picker-inline {
    grid-template-columns: 1fr;
  }

  #vaccination_module_section {
    border-radius: 18px;
  }

  #vaccination_form {
    gap: 14px;
  }

  #vaccination_form > label,
  #vaccination_form > .full-span {
    min-width: 0;
  }

  #vaccination_form input[readonly] {
    background: rgba(245, 249, 252, 0.96);
  }

  .vaccination-picker-card {
    padding: 12px;
    border-radius: 18px;
  }

  .vaccination-quick-picks .btn {
    width: 100%;
    justify-content: center;
  }

  .vaccination-form-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .vaccination-form-actions > .btn,
  .vaccination-form-actions > button {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }

  #vaccination_module_section .table.mobile-card-table tr,
  #vaccination_module_section .line-items-table tr {
    border-radius: 18px;
    padding: 14px;
  }

  #vaccination_module_section .table.mobile-card-table td,
  #vaccination_module_section .line-items-table td {
    gap: 8px;
  }

  #vaccination_module_section .table.mobile-card-table td::before,
  #vaccination_module_section .line-items-table td::before {
    font-size: 12px;
    letter-spacing: 0.08em;
  }

  #vaccination_module_section .table.mobile-card-table td.actions {
    gap: 8px;
  }

  #vaccination_module_section .table.mobile-card-table td.actions > * {
    width: 100%;
  }

  #vaccination_module_section .inline-editor > summary.btn,
  #vaccination_module_section td.actions .btn.warn,
  #vaccination_module_section td.actions button.warn {
    width: 100%;
    justify-content: center;
  }

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

  .visit-tabs > .btn,
  .visit-tabs > button {
    width: 100%;
    justify-content: center;
    min-height: 46px;
    padding-inline: 12px;
  }

  .visit-form-footer {
    align-items: stretch;
  }

  .visit-form-footer .actions,
  .visit-form-footer .actions > * {
    width: 100%;
  }

  .visit-form-footer .actions > .btn,
  .visit-form-footer .actions > button {
    justify-content: center;
  }

  .calls-table td.calls-time,
  .calls-table td.calls-pet {
    white-space: nowrap;
  }

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

  .invoices-table {
    min-width: 0;
  }

  .invoices-table .invoice-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 8px;
    min-width: 0;
  }

  .invoices-table td.invoice-actions-cell {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .invoices-table td.invoice-actions-cell::before {
    margin-bottom: 2px;
  }

  .invoices-table .invoice-actions > *,
  .invoices-table .invoice-actions .btn,
  .invoices-table .invoice-actions button,
  .invoices-table .invoice-payment-form {
    width: 100%;
  }

  .invoices-table .invoice-actions .btn,
  .invoices-table .invoice-actions button {
    min-width: 0;
    white-space: normal;
    overflow-wrap: normal;
    word-break: keep-all;
  }

  .invoices-table .invoice-paid-meta {
    overflow-wrap: break-word;
    word-break: normal;
  }

  .rx-choice-grid,
  .rx-withhold-grid {
    grid-template-columns: 1fr;
  }

  .month-grid,
  .month-grid-header {
    gap: 6px;
  }

  .month-cell {
    min-height: 76px;
    padding: 8px;
  }

  .month-cell .count {
    font-size: 11px;
  }

  .call-reminder-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .services-create-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .services-create-form > * {
    width: 100%;
  }

  .services-tools,
  .services-import-form {
    display: grid;
    gap: 10px;
  }

  .services-tools > *,
  .services-import-form > * {
    width: 100%;
  }

  .services-tools .btn,
  .services-tools button,
  .services-import-form .btn,
  .services-import-form button {
    width: 100%;
    justify-content: center;
  }

  .admin-services-table {
    display: block;
    overflow: visible;
  }

  .admin-services-table thead {
    display: none;
  }

  .admin-services-table tbody {
    display: grid;
    gap: 12px;
  }

  .admin-services-table tr {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(19, 33, 44, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow-sm);
  }

  .admin-services-table td {
    display: grid;
    grid-template-columns: minmax(84px, 108px) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 0;
    border: 0;
    white-space: normal;
  }

  .admin-services-table td::before {
    content: attr(data-label);
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .admin-services-table td:last-child {
    grid-template-columns: 1fr;
  }

  .admin-services-table td:last-child::before {
    margin-bottom: 2px;
  }

  .admin-services-table .row-edit-inline {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .admin-services-table .row-edit-inline input[name="service_name"],
  .admin-services-table .row-edit-inline input[name="notes"] {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .admin-services-table .row-edit-inline .service-row-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-system-label,
  .service-system-lock {
    width: 100%;
    justify-content: center;
  }

  .admin-services-table .row-edit-inline input[name="default_price"],
  .admin-services-table .row-edit-inline button {
    width: 100%;
    min-width: 0;
  }

  .admin-services-table .table-empty-row td {
    display: block;
  }

  .admin-services-table .table-empty-row td::before {
    content: none;
  }

  .login-screen {
    min-height: auto;
    padding-top: 10px;
  }

  .login-card {
    padding: 20px;
  }

  .login-brand {
    align-items: flex-start;
  }

  .extract-date-list,
  .extract-field-grid,
  .extract-field-grid-wide,
  .update-admin-grid,
  .release-notes-grid {
    grid-template-columns: 1fr;
  }

  body.drawer-open {
    overflow: hidden;
  }
}

@media (max-width: 720px) and (pointer: fine) {
  .mobile-nav-toggle,
  .mobile-drawer,
  .mobile-drawer-backdrop {
    display: none !important;
  }

  .desktop-nav {
    display: flex !important;
  }

  header {
    display: flex;
  }
}

@media (min-width: 721px) {
  .mobile-nav-toggle,
  .mobile-drawer,
  .mobile-drawer-backdrop {
    display: none !important;
  }

  .desktop-nav {
    display: flex !important;
  }
}

@media (max-width: 520px) {
  .login-brand {
    flex-direction: column;
    gap: 12px;
  }

  .login-brand-mark {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
    border-radius: 16px;
  }

  .app-brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 12px;
  }

  .month-grid-header {
    font-size: 12px;
  }
}

@media print {
  body {
    background: #fff;
  }

  body::before,
  body::after,
  header,
  footer,
  .call-reminder-bar,
  .receipt-actions {
    display: none !important;
  }

  main {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .card {
    border: 1px solid #d8d8d8;
    box-shadow: none;
    margin-bottom: 8mm;
    break-inside: avoid;
    page-break-inside: avoid;
    background: #fff;
  }

  .card::before,
  .card::after {
    display: none;
  }

  .receipt-table thead {
    display: table-header-group;
  }

  .receipt-table tr,
  .receipt-table td,
  .receipt-table th {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .badge {
    border: 1px solid #d8d8d8;
    background: #fff;
    color: #111;
  }
}
