:root {
  /* Brand palette inspired by craneosacral.es */
  --brand-sidebar: #5c5648;
  --brand-sidebar-dark: #4a4538;
  --brand-primary: #837a5e;
  --brand-primary-hover: #6f654f;
  --brand-accent: #d4c49d;
  --brand-accent-soft: #ebe4d2;
  --brand-link: #85795f;
  --brand-text: #333333;
  --brand-muted: #6b6560;
  --brand-bg: #f7f5f0;
  --brand-surface: #ffffff;
  --brand-border: #e8e2d8;
  --brand-success: #5a7a5e;
  --brand-warning: #b8860b;
  --brand-danger: #a94442;

  /* Consulta colours (BCN / VNG / PRV) — solid background, white text */
  --practice-bcn: #607d9b;
  --practice-vng: #827b5d;
  --practice-prv: #4b8341;
  --practice-bcn-accent: #2a3d52;
  --practice-vng-accent: #453f2d;
  --practice-prv-accent: #1e3d1a;
  --practice-on-solid: #ffffff;

  --sidebar-width: 260px;
  --topbar-height: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --shadow-sm: 0 1px 3px rgba(74, 69, 56, 0.08);
  --shadow-md: 0 8px 24px rgba(74, 69, 56, 0.12);

  --font-body: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-heading: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-size-base: 0.875rem;
  --font-size-sm: 0.8125rem;
  --font-size-xs: 0.75rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  color: var(--brand-text);
  background: var(--brand-bg);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.auth-page {
  overflow-x: hidden;
  max-width: 100%;
}

h1, h2, h3, h4, h5, h6,
.page-title {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0;
}

h1, .h1 { font-size: 1.5rem; }
h2, .h2 { font-size: 1.3rem; }
h3, .h3 { font-size: 1.15rem; }
h4, .h4 { font-size: 1.05rem; }
h5, .h5 { font-size: 0.95rem; }
h6, .h6 { font-size: 0.875rem; }

.table {
  font-size: var(--font-size-sm);
}

.btn {
  font-size: var(--font-size-sm);
}

.form-control,
.form-select {
  font-size: var(--font-size-sm);
}

a {
  color: var(--brand-link);
}

.app-shell {
  min-height: 100vh;
  display: flex;
}

.app-sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--brand-sidebar) 0%, var(--brand-sidebar-dark) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  transition: transform 0.25s ease;
}

.app-nav {
  flex: 1;
  padding: 1.25rem 0.75rem 1rem;
  overflow-y: auto;
}

.app-nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.85rem;
  margin-bottom: 0.25rem;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.app-nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.app-nav-link.active {
  background: rgba(212, 196, 157, 0.22);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(212, 196, 157, 0.35);
}

.app-nav-icon {
  width: 0.95rem;
  font-size: 0.9rem;
  text-align: center;
  opacity: 0.9;
}

.app-sidebar-footer {
  padding: 1rem 0.75rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.app-sidebar-util-link {
  display: block;
  padding: 0.3rem 0.85rem;
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color 0.15s ease;
}

.app-sidebar-util-link:hover {
  color: rgba(255, 255, 255, 0.85);
}

.patients-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.patients-toolbar-title {
  min-width: 0;
}

.patients-toolbar-search {
  flex: 0 1 260px;
  width: 260px;
  max-width: 100%;
  margin-left: auto;
}

.patients-search-group .input-group-text {
  background: var(--brand-surface);
  border-color: var(--brand-border);
  color: var(--brand-muted);
  padding-inline: 0.65rem;
}

@media (max-width: 767px) {
  .patients-toolbar-search {
    flex-basis: 100%;
    width: 100%;
    margin-left: 0;
  }
}

.patient-picker {
  position: relative;
}

.patient-picker-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  max-height: 16rem;
  overflow-y: auto;
  border: 1px solid var(--brand-border);
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08);
  background: var(--brand-surface, #fff);
}

.patient-picker-menu .list-group-item {
  border-left: 0;
  border-right: 0;
  font-size: 0.9375rem;
}

.patient-picker-menu .list-group-item:first-child {
  border-top: 0;
}

.patient-picker-menu .list-group-item:last-child {
  border-bottom: 0;
}

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

@media (max-width: 599px) {
  .patients-table-wrap {
    overflow-x: visible;
  }

  .patients-table {
    display: block;
  }

  .patients-table thead {
    display: none;
  }

  .patients-table tbody {
    display: block;
  }

  .patients-table tbody tr {
    display: block;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--brand-border);
  }

  .patients-table tbody tr:last-child {
    border-bottom: none;
  }

  .patients-table tbody td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0;
    border: none;
    text-align: right;
    min-width: 0;
  }

  .patients-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--brand-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex: 0 0 auto;
    max-width: 42%;
    text-align: left;
  }

  .patients-table tbody td[data-label="Nombre"] {
    padding-top: 0;
    border-bottom: 1px solid var(--brand-border);
    margin-bottom: 0.35rem;
    padding-bottom: 0.65rem;
  }

  .patients-table tbody td[data-label="Nombre"]::before {
    display: none;
  }

  .patients-table tbody td[data-label="Nombre"] a {
    font-weight: 600;
    font-size: 1rem;
    text-align: left;
    width: 100%;
  }

  .patients-table tbody td[data-label="Próxima cita"] {
    flex-wrap: wrap;
  }
}

.patients-practice-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.patients-sort-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.patients-sort-link:hover {
  color: var(--brand-primary);
}

.patients-sort-link.is-active {
  color: var(--brand-primary);
}

.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  height: var(--topbar-height);
  background: var(--brand-surface);
  border-bottom: 1px solid var(--brand-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.topbar-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.topbar-logo {
  display: block;
  height: 42px;
  width: auto;
  max-width: min(280px, 42vw);
  object-fit: contain;
}

.topbar-tagline {
  color: var(--brand-muted);
  font-size: var(--font-size-sm);
  white-space: nowrap;
}

.app-content {
  padding: 1.5rem;
}

.app-content-inner {
  max-width: 1400px;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1035;
}

.sidebar-toggle {
  display: none;
  border: 1px solid var(--brand-border);
  background: var(--brand-surface);
  color: var(--brand-text);
  border-radius: var(--radius-sm);
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
}

.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  display: grid;
  place-items: center;
  padding: max(1.5rem, env(safe-area-inset-top)) max(1.5rem, env(safe-area-inset-right)) max(1.5rem, env(safe-area-inset-bottom)) max(1.5rem, env(safe-area-inset-left));
  box-sizing: border-box;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(212, 196, 157, 0.35), transparent 28%),
    var(--brand-bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  min-width: 0;
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  box-sizing: border-box;
}

.auth-card-wide {
  max-width: 560px;
}

.auth-brand {
  text-align: center;
  margin-bottom: 1.75rem;
  max-width: 100%;
  overflow: hidden;
}

.auth-logo {
  display: block;
  width: auto;
  max-width: min(100%, 320px);
  height: auto;
  max-height: 140px;
  margin: 0 auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

@media (max-width: 599px) {
  .auth-shell {
    place-items: start center;
    padding-top: max(1.25rem, env(safe-area-inset-top));
    padding-inline: max(1rem, env(safe-area-inset-left)) max(1rem, env(safe-area-inset-right));
  }

  .auth-card {
    padding: 1.25rem;
  }

  .auth-logo {
    max-height: 110px;
  }
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.card-panel,
.card.shadow-sm,
.calendar-card,
.day-panel,
.year-card {
  background: var(--brand-surface) !important;
  border: 1px solid var(--brand-border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-sm) !important;
}

.table {
  --bs-table-bg: transparent;
}

.table thead th,
.table-light th {
  background: var(--brand-accent-soft) !important;
  color: var(--brand-text);
  border-bottom: 1px solid var(--brand-border);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.table > :not(caption) > * > * {
  border-color: var(--brand-border);
}

.btn-primary {
  --bs-btn-bg: var(--brand-primary);
  --bs-btn-border-color: var(--brand-primary);
  --bs-btn-hover-bg: var(--brand-primary-hover);
  --bs-btn-hover-border-color: var(--brand-primary-hover);
  --bs-btn-active-bg: var(--brand-primary-hover);
  --bs-btn-active-border-color: var(--brand-primary-hover);
}

.btn-outline-primary {
  --bs-btn-color: var(--brand-primary);
  --bs-btn-border-color: var(--brand-primary);
  --bs-btn-hover-bg: var(--brand-primary);
  --bs-btn-hover-border-color: var(--brand-primary);
}

.btn-outline-secondary {
  --bs-btn-color: var(--brand-muted);
  --bs-btn-border-color: var(--brand-border);
  --bs-btn-hover-bg: var(--brand-accent-soft);
  --bs-btn-hover-border-color: var(--brand-border);
  --bs-btn-hover-color: var(--brand-text);
}

.form-control,
.form-select {
  border-color: var(--brand-border);
  border-radius: var(--radius-sm);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 0.2rem rgba(131, 122, 94, 0.15);
}

@media (max-width: 767px) {
  .form-control,
  .form-select {
    font-size: 16px;
  }

  .note-form textarea.form-control {
    width: 100%;
    max-width: 100%;
    resize: vertical;
  }
}

.badge.bg-success {
  background-color: var(--brand-success) !important;
}

.text-muted {
  color: var(--brand-muted) !important;
}

.alert {
  border-radius: var(--radius-sm);
}

.session-idle-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 1080;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: #4a3f2f;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.session-idle-banner[hidden] {
  display: none !important;
}

.session-idle-banner-text {
  flex: 1 1 16rem;
  font-size: 0.95rem;
  line-height: 1.35;
}

@media (min-width: 768px) {
  .session-idle-banner {
    left: auto;
    right: 1.25rem;
    bottom: 1.25rem;
    max-width: 28rem;
  }
}

.app-notice-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(32, 28, 22, 0.45);
}

.app-notice-overlay[hidden] {
  display: none !important;
}

.app-notice-dialog {
  width: min(100%, 26rem);
  padding: 1.25rem 1.35rem 1.15rem;
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  border-top: 4px solid var(--brand-primary, #607d9b);
}

.app-notice-dialog.is-success {
  border-top-color: #3d7a55;
}

.app-notice-dialog.is-warning {
  border-top-color: #b07d2a;
}

.app-notice-dialog.is-danger,
.app-notice-dialog.is-error {
  border-top-color: #a04545;
}

.app-notice-title {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: #2c2a26;
}

.app-notice-message {
  margin: 0 0 1.1rem;
  font-size: 0.98rem;
  line-height: 1.4;
  color: #4a463f;
  white-space: pre-wrap;
}

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

.subnav-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.subnav-pills .btn.active {
  background: var(--brand-accent-soft);
  border-color: var(--brand-primary);
  color: var(--brand-text);
}

.form-card {
  padding: 1.5rem;
  max-width: 820px;
}

.form-section + .form-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--brand-border);
}

.form-section-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-muted);
  margin-bottom: 1rem;
}

.visit-form-visit-section {
  margin-bottom: 2rem;
  padding-bottom: 0.25rem;
}

.visit-payment-pricing-hint {
  line-height: 1.5;
}

.visit-extras-list {
  margin-bottom: 0.75rem;
}

.app-form .form-label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--brand-text);
}

.glot-up-size-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  padding-top: 0.35rem;
}

.glot-up-size-options .form-check {
  margin-bottom: 0;
}

@media (max-width: 767px) {
  .glot-up-size-options {
    gap: 0.5rem 1.25rem;
  }
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--brand-border);
}

@media (max-width: 991px) {
  .app-sidebar {
    transform: translateX(-100%);
  }

  .app-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop.show {
    display: block;
  }

  .sidebar-toggle {
    display: inline-flex;
    width: 44px;
    height: 44px;
    font-size: 1.45rem;
  }

  .topbar-logo {
    height: 52px;
    max-width: min(280px, 52vw);
  }

  .app-main {
    margin-left: 0;
  }

  .app-content {
    padding: 1rem;
  }

  .page-header-actions .btn {
    width: 100%;
  }
}

/* Patient detail page */
.patient-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.patient-summary-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--brand-accent-soft);
  color: var(--brand-text);
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.patient-summary-item i {
  color: var(--brand-primary);
}

.patient-key-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 991px) {
  .patient-key-facts {
    grid-template-columns: 1fr;
  }
}

.patient-key-fact {
  padding: 1rem 1.15rem;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
  background: var(--brand-surface);
}

.patient-key-fact-label {
  display: block;
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-muted);
  margin-bottom: 0.45rem;
}

.patient-key-fact-value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--brand-text);
}

.patient-key-fact-value.is-empty {
  color: var(--brand-muted);
  font-weight: 400;
}

.patient-key-fact-main {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.patient-key-fact-main i {
  color: var(--brand-primary);
}

.session-type-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #eef1f4;
  color: #4b5563;
  line-height: 1.3;
  white-space: nowrap;
}

.patients-next-appointment {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.patient-key-fact--appointment {
  display: flex;
  flex-direction: column;
}

.patient-key-fact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--brand-border);
}

.patient-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.patient-layout--full {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 991px) {
  .patient-layout {
    grid-template-columns: 1fr;
  }
}

.patient-notes-section .patient-section-header {
  margin-bottom: 1.25rem;
}

.patient-notes-section .patient-section-header--status-only {
  justify-content: flex-end;
  min-height: 1.25rem;
  margin-bottom: 0.5rem;
}

.patient-notes-editor {
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--brand-border);
}

.patient-all-notes {
  margin-bottom: 0;
}

.patient-note-entry {
  margin-bottom: 1rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
  background: #e8e2d8;
}

.patient-note-entry:last-child {
  margin-bottom: 0;
}

.patient-note-entry.is-general {
  background: #e8e2d8;
}

.patient-note-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.patient-note-entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.patient-note-entry-date {
  margin: 0;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--brand-text);
}

.patient-note-entry-motivo {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--brand-muted);
  line-height: 1.45;
}

.patient-note-entry-motivo-label {
  font-weight: 500;
  color: var(--brand-text);
}

.patient-note-entry-body {
  white-space: pre-wrap;
  margin: 0;
  font-size: var(--font-size-sm);
  line-height: 1.55;
}

.patient-motivo-block {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--brand-border);
}

.patient-note-date {
  max-width: 14rem;
}

.patient-motivo-view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.patient-motivo-label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--brand-text);
}

.patient-motivo-text {
  padding: 0.85rem 1rem;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
  background: var(--brand-bg);
  min-height: 3.2rem;
  white-space: pre-wrap;
  line-height: 1.55;
}

.patient-motivo-input {
  min-height: 3.2rem;
  resize: vertical;
  line-height: 1.55;
}

.patient-motivo-view.is-hidden,
.patient-motivo-edit.is-hidden {
  display: none;
}

.patient-session-notes {
  min-height: 280px;
  resize: vertical;
  line-height: 1.55;
}

.patient-save-status.is-saving {
  color: var(--brand-muted);
}

.patient-save-status.is-saved {
  color: var(--brand-success);
}

.patient-save-status.is-error {
  color: var(--brand-danger);
}

/* Contabilidad */
.contabilidad-practice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 1199px) {
  .contabilidad-practice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 599px) {
  .contabilidad-practice-grid {
    grid-template-columns: 1fr;
  }
}

.contabilidad-practice-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand-border);
  background: var(--brand-surface);
  color: inherit;
  text-decoration: none;
  min-height: 180px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.contabilidad-practice-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(74, 69, 56, 0.08);
  color: inherit;
}

.contabilidad-practice-card.practice-barcelona {
  border-left: 4px solid #607d9b;
}

.contabilidad-practice-card.practice-vilanova {
  border-left: 4px solid #827b5d;
}

.contabilidad-practice-card.practice-privada {
  border-left: 4px solid #4b8341;
}

.contabilidad-practice-card--all {
  border-left: 4px solid var(--brand-primary);
  background: linear-gradient(180deg, var(--brand-surface) 0%, var(--brand-accent-soft) 100%);
}

.contabilidad-all-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  min-height: 1.5rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: var(--brand-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.contabilidad-stat-card--highlight {
  border-color: var(--brand-primary);
  background: var(--brand-accent-soft);
}

.contabilidad-section-header {
  background: var(--brand-accent-soft);
  border-bottom: 1px solid var(--brand-border);
}

.contabilidad-breakdown-total td {
  background: var(--brand-bg);
  border-top: 2px solid var(--brand-border);
}

.contabilidad-practice-card-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.contabilidad-practice-name {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
}

.contabilidad-practice-meta {
  color: var(--brand-muted);
  font-size: var(--font-size-sm);
}

.contabilidad-practice-link {
  margin-top: auto;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--brand-primary);
}

.contabilidad-summary {
  padding-top: 0.5rem;
  border-top: 1px solid var(--brand-border);
}

.contabilidad-month-header {
  background: var(--brand-accent-soft);
  border-bottom: 1px solid var(--brand-border);
}

.contabilidad-table th,
.contabilidad-table td {
  padding: 0.85rem 1.1rem;
}

.contabilidad-table th {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--brand-muted);
  white-space: nowrap;
}

.contabilidad-table td {
  vertical-align: middle;
  font-size: var(--font-size-sm);
}

.contabilidad-table tbody tr + tr td {
  border-top-width: 1px;
}

.contabilidad-desc {
  max-width: 280px;
  white-space: pre-line;
}

.today-week-nav {
  padding: 1.25rem 1.5rem;
}

.today-week-nav-header {
  margin-bottom: 1rem;
}

.contabilidad-pending-home {
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--brand-primary);
}

.contabilidad-pending-section {
  padding: 1.25rem 1.5rem;
}

.contabilidad-pending-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.contabilidad-pending-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--brand-border);
}

.contabilidad-pending-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.contabilidad-pending-item-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}

.is-scheduled-row {
  opacity: 0.92;
}

.is-scheduled-row td {
  background: #f8f9fb;
}

.is-scheduled-row .scheduled-money-cell {
  color: #c5cad3;
}

.contabilidad-scheduled-note {
  padding-left: 0.15rem;
  border-left: 2px solid #e2e6ed;
  padding-left: 0.65rem;
}

.contabilidad-pending-date {
  font-variant-numeric: tabular-nums;
  color: var(--brand-muted);
  font-size: var(--font-size-sm);
}

.today-week-contabilidad {
  padding: 1.25rem 1.5rem;
}

.today-week-contabilidad-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.today-week-day-tabs {
  flex-wrap: wrap;
}

.today-week-day-tabs .btn {
  min-width: 3.25rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  line-height: 1.1;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.today-week-day-num {
  font-size: 11px;
  opacity: 0.85;
}

.today-week-practice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 991px) {
  .today-week-practice-grid {
    grid-template-columns: 1fr;
  }
}

.today-week-practice-card {
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  background: var(--brand-bg);
}

.today-week-practice-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
  font-size: 0.95rem;
}

.today-week-practice-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.today-week-stat {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.today-week-stat-label {
  color: var(--brand-muted);
  font-size: 11px;
}

.today-week-stat-value {
  font-size: 0.95rem;
  font-weight: 600;
}

.today-week-stat-value--net {
  color: var(--brand-success);
}

.today-week-due {
  color: var(--brand-danger);
}

.today-week-practice-link {
  display: inline-block;
  margin-top: 0.35rem;
  color: var(--brand-primary);
  text-decoration: none;
}

.today-week-practice-link:hover {
  text-decoration: underline;
}

.today-week-visit-types {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  color: var(--brand-muted);
}

.today-week-visit-type--new {
  font-weight: 600;
  color: var(--brand-primary);
}

.today-week-visit-list {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--brand-border);
}

.today-week-visit-list-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-muted);
  margin-bottom: 0.75rem;
}

.today-week-visit-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--brand-border);
}

.today-week-visit-item:last-child {
  border-bottom: none;
}

.today-week-visit-item-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
}

.today-week-visit-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--brand-muted);
}

.today-week-visit-tag--new {
  color: var(--brand-primary);
}

.today-week-no-visits {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--brand-border);
}

.contabilidad-practice-tabs {
  flex-wrap: wrap;
}

.contabilidad-practice-tabs .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.contabilidad-practice-tabs .glotup-tab-icon {
  flex-shrink: 0;
  display: block;
}

/* Resumen-style contabilidad (like invoicing owner report) */
.contabilidad-resumen {
  font-size: 13px;
  padding: 1.25rem 1.5rem;
}

.contabilidad-resumen-header {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--brand-border);
}

.contabilidad-resumen-title {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.contabilidad-resumen-meta {
  line-height: 1.55;
}

.contabilidad-resumen-section {
  margin: 1.25rem 0 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--brand-border);
  font-weight: 600;
}

.contabilidad-resumen-section:first-of-type {
  margin-top: 0;
}

.contabilidad-resumen-note {
  color: var(--brand-muted);
  font-size: 12px;
  margin-bottom: 0.65rem;
}

.contabilidad-resumen-desc {
  font-size: 11px;
  margin-top: 0.15rem;
}

.contabilidad-resumen-table {
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.contabilidad-resumen-table th,
.contabilidad-resumen-table td {
  border: 1px solid var(--brand-border);
  padding: 0.35rem 0.5rem;
  vertical-align: middle;
  font-size: 13px;
}

.contabilidad-resumen-table th {
  background: #f5f5f5;
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--brand-text);
  white-space: nowrap;
}

.contabilidad-resumen-table tfoot td {
  background: #f8f8f8;
  font-weight: 600;
}

.contabilidad-resumen-table tbody tr:hover td {
  background: rgba(131, 122, 94, 0.04);
}

.contabilidad-resumen-empty {
  font-size: 12px;
}

.contabilidad-resumen-totals {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--brand-border);
}

.contabilidad-resumen-totals-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  margin: 0.75rem 0 1rem;
}

@media (max-width: 767px) {
  .contabilidad-resumen-totals-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.contabilidad-resumen-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.contabilidad-resumen-stat-label {
  color: var(--brand-muted);
  font-size: 12px;
}

.contabilidad-resumen-stat-value {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.2;
}

.contabilidad-resumen-stat-hint {
  color: var(--brand-muted);
  font-size: 11px;
}

.contabilidad-resumen-net {
  background: #f0f4f8;
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
}

.contabilidad-resumen-net-label {
  display: block;
  color: var(--brand-muted);
  font-size: 12px;
  margin-bottom: 0.35rem;
}

.contabilidad-resumen-net-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.patient-section {
  padding: 1.25rem 1.5rem;
}

.patient-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.patient-section-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-muted);
  margin: 0;
}

.visit-card,
.note-card {
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  background: var(--brand-bg);
}

.visit-card.is-past-appointment {
  opacity: 0.85;
  background: #f3f4f6;
  border-color: #e5e7eb;
}

.appointment-list-item.is-past {
  background: #f3f4f6;
  border-radius: 6px;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  opacity: 1;
  filter: none;
}

.is-past-row {
  background: #f8f9fa;
  opacity: 1;
}

.visit-card + .visit-card,
.note-card + .note-card {
  margin-top: 0.75rem;
}

.visit-card.is-latest {
  background: var(--brand-surface);
  border-color: var(--brand-primary);
  box-shadow: inset 0 0 0 1px rgba(131, 122, 94, 0.15);
}

.visit-card-header,
.note-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.visit-card-title {
  font-weight: 600;
  margin: 0;
  font-size: 0.95rem;
}

.visit-card-meta,
.note-card-meta {
  font-size: var(--font-size-xs);
  color: var(--brand-muted);
}

.visit-card-body {
  display: grid;
  gap: 0.65rem;
}

.visit-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.visit-stat {
  font-size: var(--font-size-sm);
}

.visit-stat-label {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--brand-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.15rem;
}

.visit-stat-value {
  font-weight: 600;
}

.visit-stat-value.is-due {
  color: var(--brand-danger);
}

.text-block {
  white-space: pre-line;
  font-size: var(--font-size-sm);
  line-height: 1.55;
  margin: 0;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--brand-border);
}

.note-form {
  margin-bottom: 1.25rem;
}

.note-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.patient-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--brand-border);
}

.patient-actions-bar .btn-link-danger {
  color: var(--brand-danger);
  border-color: rgba(169, 68, 66, 0.25);
}

.patient-actions-bar .btn-link-danger:hover {
  background: rgba(169, 68, 66, 0.08);
  color: var(--brand-danger);
  border-color: rgba(169, 68, 66, 0.35);
}

.patient-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(74, 69, 56, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 1050;
}

.patient-drawer-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.patient-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(100%, 420px);
  height: 100vh;
  background: var(--brand-surface);
  border-left: 1px solid var(--brand-border);
  box-shadow: var(--shadow-md);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  z-index: 1060;
  display: flex;
  flex-direction: column;
}

.patient-drawer.open {
  transform: translateX(0);
}

.patient-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--brand-border);
}

.patient-drawer-title {
  margin: 0;
  font-size: 1.05rem;
}

.patient-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.patient-drawer-footer {
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid var(--brand-border);
}

.detail-section + .detail-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--brand-border);
}

.detail-section-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-muted);
  margin-bottom: 1rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1rem;
}

.detail-grid .detail-field.span-2 {
  grid-column: 1 / -1;
}

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

.detail-field {
  min-width: 0;
}

.detail-label {
  display: block;
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--brand-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.2rem;
}

.detail-value {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--brand-text);
  word-break: break-word;
}

.detail-value.empty {
  color: var(--brand-muted);
  font-style: italic;
}

.detail-alert {
  margin-top: 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
}

.detail-alert.is-warning {
  background: rgba(184, 134, 11, 0.1);
  border: 1px solid rgba(184, 134, 11, 0.25);
  color: #8a6508;
}

.detail-alert.is-danger {
  background: rgba(169, 68, 66, 0.08);
  border: 1px solid rgba(169, 68, 66, 0.2);
  color: var(--brand-danger);
}

.detail-alert.is-success {
  background: rgba(90, 122, 94, 0.1);
  border: 1px solid rgba(90, 122, 94, 0.2);
  color: var(--brand-success);
}

.collapse-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  margin-top: 0.75rem;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
  background: var(--brand-surface);
  color: var(--brand-text);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

.collapse-toggle::-webkit-details-marker {
  display: none;
}

details[open] .collapse-toggle i {
  transform: rotate(180deg);
}

.collapse-toggle:hover {
  background: var(--brand-accent-soft);
}

.visually-hidden-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.collapse-panel {
  margin-top: 0.75rem;
}

.today-balances-toggle {
  margin-top: 0;
  font-size: var(--font-size-base);
  font-weight: 600;
}

.practice-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  vertical-align: middle;
  border: none;
}

.practice-badge.practice-barcelona {
  background: var(--practice-bcn);
  color: var(--practice-on-solid);
  border: 1px solid var(--practice-bcn);
}

.practice-badge.practice-vilanova {
  background: var(--practice-vng);
  color: var(--practice-on-solid);
  border: 1px solid var(--practice-vng);
}

.practice-badge.practice-privada {
  background: var(--practice-prv);
  color: var(--practice-on-solid);
  border: 1px solid var(--practice-prv);
}

.day-appointment-chip.practice-chip,
.week-appointment-chip.practice-chip,
.week-grid-event.practice-chip,
.day-hour-appointment.practice-chip {
  border: none;
}

.day-appointment-chip.practice-barcelona,
.week-appointment-chip.practice-barcelona,
.week-grid-event.practice-barcelona,
.day-hour-appointment.practice-barcelona {
  box-shadow: inset 4px 0 0 0 var(--practice-bcn-accent);
  background: var(--practice-bcn);
  color: var(--practice-on-solid);
}

.day-appointment-chip.practice-vilanova,
.week-appointment-chip.practice-vilanova,
.week-grid-event.practice-vilanova,
.day-hour-appointment.practice-vilanova {
  box-shadow: inset 4px 0 0 0 var(--practice-vng-accent);
  background: var(--practice-vng);
  color: var(--practice-on-solid);
}

.day-appointment-chip.practice-privada,
.week-appointment-chip.practice-privada,
.week-grid-event.practice-privada,
.day-hour-appointment.practice-privada {
  box-shadow: inset 4px 0 0 0 var(--practice-prv-accent);
  background: var(--practice-prv);
  color: var(--practice-on-solid);
}

.day-appointment-chip.practice-barcelona a:not(.btn),
.week-appointment-chip.practice-barcelona a:not(.btn),
.day-hour-appointment.practice-barcelona a:not(.btn),
.day-appointment-chip.practice-vilanova a:not(.btn),
.week-appointment-chip.practice-vilanova a:not(.btn),
.day-hour-appointment.practice-vilanova a:not(.btn),
.day-appointment-chip.practice-privada a:not(.btn),
.week-appointment-chip.practice-privada a:not(.btn),
.day-hour-appointment.practice-privada a:not(.btn) {
  color: var(--practice-on-solid);
}

.practice-filter.btn {
  font-weight: 600;
  border-width: 1px;
  border-style: solid;
}

.practice-filter.practice-filter-barcelona:not(.active) {
  border-color: var(--practice-bcn);
  color: var(--practice-bcn);
  background: transparent;
}

.practice-filter.practice-filter-barcelona.active {
  background: var(--practice-bcn);
  border-color: var(--practice-bcn);
  color: var(--practice-on-solid);
}

.practice-filter.practice-filter-vilanova:not(.active) {
  border-color: var(--practice-vng);
  color: var(--practice-vng);
  background: transparent;
}

.practice-filter.practice-filter-vilanova.active {
  background: var(--practice-vng);
  border-color: var(--practice-vng);
  color: var(--practice-on-solid);
}

.practice-filter.practice-filter-privada:not(.active) {
  border-color: var(--practice-prv);
  color: var(--practice-prv);
  background: transparent;
}

.practice-filter.practice-filter-privada.active {
  background: var(--practice-prv);
  border-color: var(--practice-prv);
  color: var(--practice-on-solid);
}

.practice-filter.active .practice-badge {
  border-color: var(--practice-on-solid);
}

.day-appointment-chip.practice-barcelona:hover,
.week-appointment-chip.practice-barcelona:hover,
.week-grid-event.practice-barcelona:hover,
.day-hour-appointment.practice-barcelona:hover {
  box-shadow: inset 4px 0 0 0 var(--practice-bcn-accent);
  background: var(--practice-bcn);
  color: var(--practice-on-solid);
}

.day-appointment-chip.practice-vilanova:hover,
.week-appointment-chip.practice-vilanova:hover,
.week-grid-event.practice-vilanova:hover,
.day-hour-appointment.practice-vilanova:hover {
  box-shadow: inset 4px 0 0 0 var(--practice-vng-accent);
  background: var(--practice-vng);
  color: var(--practice-on-solid);
}

.day-appointment-chip.practice-privada:hover,
.week-appointment-chip.practice-privada:hover,
.week-grid-event.practice-privada:hover,
.day-hour-appointment.practice-privada:hover {
  box-shadow: inset 4px 0 0 0 var(--practice-prv-accent);
  background: var(--practice-prv);
  color: var(--practice-on-solid);
}

.day-appointment-chip.practice-barcelona:hover a:not(.btn),
.week-appointment-chip.practice-barcelona:hover a:not(.btn),
.day-hour-appointment.practice-barcelona:hover a:not(.btn),
.day-appointment-chip.practice-vilanova:hover a:not(.btn),
.week-appointment-chip.practice-vilanova:hover a:not(.btn),
.day-hour-appointment.practice-vilanova:hover a:not(.btn),
.day-appointment-chip.practice-privada:hover a:not(.btn),
.week-appointment-chip.practice-privada:hover a:not(.btn),
.day-hour-appointment.practice-privada:hover a:not(.btn) {
  color: var(--practice-on-solid);
}

.first-visit-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  vertical-align: middle;
  margin-left: 0.25rem;
  background: #e67e22;
  color: #fff;
  border: 1px solid #c4650f;
  white-space: nowrap;
}

.day-appointment-chip.practice-barcelona.is-first-visit,
.week-grid-event.practice-barcelona.is-first-visit {
  box-shadow: inset 4px 0 0 0 var(--practice-bcn-accent), inset -4px 0 0 0 #e67e22;
}

.day-appointment-chip.practice-vilanova.is-first-visit,
.week-grid-event.practice-vilanova.is-first-visit {
  box-shadow: inset 4px 0 0 0 var(--practice-vng-accent), inset -4px 0 0 0 #e67e22;
}

.day-appointment-chip.practice-privada.is-first-visit,
.week-grid-event.practice-privada.is-first-visit {
  box-shadow: inset 4px 0 0 0 var(--practice-prv-accent), inset -4px 0 0 0 #e67e22;
}

.day-hour-appointment.practice-barcelona.is-first-visit {
  box-shadow: inset 4px 0 0 0 var(--practice-bcn-accent), inset -4px 0 0 0 #e67e22;
}

.day-hour-appointment.practice-vilanova.is-first-visit {
  box-shadow: inset 4px 0 0 0 var(--practice-vng-accent), inset -4px 0 0 0 #e67e22;
}

.day-hour-appointment.practice-privada.is-first-visit {
  box-shadow: inset 4px 0 0 0 var(--practice-prv-accent), inset -4px 0 0 0 #e67e22;
}

.year-mini-day.has-first-visit {
  box-shadow: inset -3px 0 0 0 #e67e22;
}

.day-hour-appointment.practice-chip {
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.35rem;
}

.day-hour-appointment.practice-chip .day-hour-appointment-main > a {
  color: inherit;
  text-decoration: none;
  background: transparent;
  border-left: none;
}

.day-hour-appointment.practice-chip .day-hour-appointment-main > a:hover {
  text-decoration: underline;
}

.day-hour-appointment.practice-chip .btn {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  --bs-btn-color: var(--practice-on-solid);
  --bs-btn-border-color: rgba(255, 255, 255, 0.9);
  --bs-btn-bg: transparent;
  --bs-btn-hover-bg: rgba(255, 255, 255, 0.14);
  --bs-btn-hover-border-color: var(--practice-on-solid);
  --bs-btn-hover-color: var(--practice-on-solid);
  --bs-btn-active-bg: rgba(255, 255, 255, 0.2);
  --bs-btn-active-border-color: var(--practice-on-solid);
  background-color: transparent;
  border-style: solid;
  border-width: 1px;
  border-color: rgba(255, 255, 255, 0.9);
  color: var(--practice-on-solid);
}

.day-hour-appointment.practice-chip .day-hour-time {
  color: inherit;
  opacity: 0.92;
  font-weight: 500;
}

.day-hour-appointment:not(.practice-chip) .day-hour-time {
  color: #6c757d;
}

.day-session-type-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.28);
  line-height: 1.2;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: var(--font-size-xs);
  color: var(--brand-muted);
}

.calendar-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.booking-tip {
  margin-bottom: 1.25rem;
  padding: 1rem 1.15rem;
  background: linear-gradient(135deg, rgba(61, 90, 128, 0.08), rgba(111, 101, 79, 0.06));
  border: 1px solid rgba(61, 90, 128, 0.12);
}

.booking-tip-body {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.booking-tip-icon {
  font-size: 1.25rem;
  color: var(--brand-primary, #3d5a80);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.booking-tip-text {
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--brand-text, #2c2c2c);
}

.booking-tip-link {
  font-size: var(--font-size-sm, 0.875rem);
  font-weight: 500;
  text-decoration: none;
}

.booking-tip-link:hover {
  text-decoration: underline;
}

.booking-guide,
.user-guide {
  display: grid;
  gap: 1rem;
  max-width: 42rem;
}

.user-guide {
  max-width: 46rem;
}

.booking-guide-section {
  padding: 1.25rem 1.35rem;
}

.booking-guide-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.booking-guide-heading .bi {
  color: var(--brand-primary, #3d5a80);
}

.booking-guide-steps,
.booking-guide-notes {
  padding-left: 1.2rem;
}

.booking-guide-steps li + li,
.booking-guide-notes li + li {
  margin-top: 0.45rem;
}

.feed-url-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.feed-url-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
}

.feed-copy-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

@media (max-width: 576px) {
  .feed-url-row {
    flex-direction: column;
  }
}
