/* ReservasYa design system
   Shared visual tokens and low-risk component primitives. */
:root {
  --ry-mobile-nav-height: 68px;
  --ry-color-primary-50: #eff6ff;
  --ry-color-primary-100: #dbeafe;
  --ry-color-primary-500: #2563eb;
  --ry-color-primary-600: #1a5dba;
  --ry-color-primary-700: #174f9d;
  --ry-color-primary-800: #0f3e7a;
  --ry-color-accent-500: #ff6600;
  --ry-color-accent-600: #d95300;
  --ry-color-success-50: #ecfdf5;
  --ry-color-success-600: #059669;
  --ry-color-warning-50: #fffbeb;
  --ry-color-warning-600: #d97706;
  --ry-color-danger-50: #fef2f2;
  --ry-color-danger-600: #dc2626;
  --ry-color-surface: #ffffff;
  --ry-color-canvas: #f6f8fc;
  --ry-color-border: #e2e8f0;
  --ry-color-text: #172033;
  --ry-color-muted: #64748b;

  --ry-font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ry-radius-sm: 0.5rem;
  --ry-radius-md: 0.75rem;
  --ry-radius-lg: 1rem;
  --ry-radius-xl: 1.25rem;
  --ry-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --ry-shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
  --ry-focus-ring: 0 0 0 0.25rem rgba(37, 99, 235, 0.2);

  /* Backwards-compatible aliases used by the existing stylesheets. */
  --principal: var(--ry-color-primary-600);
  --principal-claro: var(--ry-color-primary-100);
  --principal-oscuro: var(--ry-color-primary-800);
  --secundario: var(--ry-color-accent-500);
  --secundario-claro: #f59e0b;
  --secundario-oscuro: var(--ry-color-accent-600);
  --fondo: var(--ry-color-canvas);
  --fondo2: var(--ry-color-primary-50);
  --font1: #ffffff;
  --font2: var(--ry-color-text);
  --oscuro: var(--ry-color-text);
}

.ry-shell {
  color: var(--ry-color-text);
  font-family: var(--ry-font-family);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.ry-shell-dashboard {
  background: var(--ry-color-canvas);
}

.ry-shell .card {
  border-color: var(--ry-color-border);
}

.ry-shell .rounded-4 {
  border-radius: var(--ry-radius-lg) !important;
}

.ry-shell .shadow-sm {
  box-shadow: var(--ry-shadow-sm) !important;
}

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

.ry-shell .form-control,
.ry-shell .form-select,
.ry-shell .input-group-text {
  border-color: var(--ry-color-border);
  border-radius: var(--ry-radius-md);
  min-height: 42px;
}

.ry-shell .input-group > :not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.ry-shell .input-group > :not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.ry-shell .form-control:focus,
.ry-shell .form-select:focus,
.ry-shell .form-check-input:focus,
.ry-shell .btn:focus-visible,
.ry-shell a:focus-visible,
.ry-shell button:focus-visible {
  border-color: var(--ry-color-primary-500);
  box-shadow: var(--ry-focus-ring);
  outline: 0;
}

.ry-shell .btn:not(.btn-sm) {
  min-height: 42px;
  border-radius: var(--ry-radius-md);
  font-weight: 600;
}

.ry-shell .btn-primary,
.ry-shell .btn-custom {
  background-color: var(--ry-color-primary-600);
  border-color: var(--ry-color-primary-600);
  color: #fff;
}

.ry-shell .btn-primary:hover,
.ry-shell .btn-custom:hover {
  background-color: var(--ry-color-primary-700);
  border-color: var(--ry-color-primary-700);
  color: #fff;
}

.ry-shell .btn.btn-outline-custom {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border: 1px solid var(--ry-color-primary-600);
  border-radius: var(--ry-radius-md);
  background: transparent;
  color: var(--ry-color-primary-600);
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
}

.ry-shell .btn.btn-outline-custom.btn-sm {
  min-height: 36px;
  padding: 0.375rem 0.75rem;
  border-radius: var(--ry-radius-sm);
  font-size: 0.875rem;
}

.ry-shell .btn.btn-outline-custom:hover,
.ry-shell .btn.btn-outline-custom:focus-visible,
.ry-shell .btn.btn-outline-custom.active,
.ry-shell .btn-check:checked + .btn.btn-outline-custom {
  border-color: var(--ry-color-primary-600);
  background: var(--ry-color-primary-600);
  color: #fff;
}

.ry-shell .btn.btn-outline-custom:disabled,
.ry-shell .btn.btn-outline-custom.disabled {
  border-color: var(--ry-color-border);
  background: transparent;
  color: var(--ry-color-muted);
  opacity: 0.65;
}

.ry-shell .btn-danger {
  background-color: var(--ry-color-danger-600);
  border-color: var(--ry-color-danger-600);
}

.ry-shell .alert {
  border: 1px solid transparent;
  border-radius: var(--ry-radius-lg);
}

.ry-feedback-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 3rem 0.9rem 1rem;
  box-shadow: var(--ry-shadow-sm);
}

.ry-feedback-icon {
  flex: 0 0 auto;
  font-size: 1.05rem;
  line-height: 1.4;
}

.ry-shell .modal-content {
  overflow: hidden;
  border: 1px solid var(--ry-color-border);
  border-radius: var(--ry-radius-xl);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.2);
}

.ry-shell .modal-header {
  padding: 1rem 1.25rem;
  border-bottom-color: var(--ry-color-border);
}

.ry-shell .modal-body {
  padding: 1.25rem;
}

.ry-shell .modal-footer {
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top-color: var(--ry-color-border);
}

.ry-confirm-modal .modal-dialog {
  max-width: 460px;
}

.ry-shell .is-invalid,
.ry-shell .was-validated .form-control:invalid,
.ry-shell .was-validated .form-select:invalid {
  border-color: var(--ry-color-danger-600);
}

.ry-shell .invalid-feedback,
.ry-shell .errorlist,
.ry-shell .text-danger.small {
  font-size: 0.8rem;
  line-height: 1.4;
}

.ry-shell .errorlist {
  margin: 0.35rem 0 0;
  padding: 0;
  color: var(--ry-color-danger-600);
  list-style: none;
}

.ry-is-loading {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  pointer-events: none;
}

.ry-shell .badge {
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.ry-page-header {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  overflow: hidden;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--ry-radius-xl);
  background-color: var(--ry-color-primary-800);
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.16) 1.2px, transparent 1.4px),
    linear-gradient(135deg, #0b2f5c 0%, #1558a8 55%, #2f7bd6 100%);
  background-position: 0 0, center;
  background-size: 22px 22px, cover;
  box-shadow: 0 18px 40px rgba(15, 62, 122, 0.18);
}

.ry-page-header::after,
.ry-shell .ry-dashboard-hero::after {
  position: absolute;
  z-index: -1;
  right: -4rem;
  bottom: -6rem;
  width: 15rem;
  height: 15rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  content: "";
  filter: blur(2px);
}

.ry-page-title {
  margin: 0;
  color: var(--ry-color-text);
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  font-weight: 750;
  line-height: 1.2;
}

.ry-page-header .ry-page-title,
.ry-page-header h1,
.ry-page-header h2,
.ry-page-header h3,
.ry-page-header strong {
  color: #fff;
}

.ry-page-subtitle {
  max-width: 65ch;
  margin: 0.35rem 0 0;
  color: var(--ry-color-muted);
}

.ry-page-header .ry-page-subtitle,
.ry-page-header p,
.ry-page-header .text-muted {
  color: rgba(255, 255, 255, 0.76) !important;
}

.ry-eyebrow {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--ry-color-primary-600);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ry-page-header .ry-eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 0.3rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
}

.ry-page-header .btn-primary,
.ry-page-header .btn-custom {
  border-color: #fff;
  background: #fff;
  color: var(--ry-color-primary-700);
}

.ry-page-header .btn-primary:hover,
.ry-page-header .btn-custom:hover {
  border-color: var(--ry-color-primary-50);
  background: var(--ry-color-primary-50);
  color: var(--ry-color-primary-800);
}

.ry-page-header .btn-outline-secondary,
.ry-page-header .btn-outline-danger {
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}

.ry-page-header .btn-outline-secondary:hover,
.ry-page-header .btn-outline-danger:hover {
  border-color: #fff;
  background: #fff;
  color: var(--ry-color-primary-800);
}

.ry-page-header .clientes-results-chip {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  backdrop-filter: blur(8px);
}

.ry-shell .ry-dashboard-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background-color: var(--ry-color-primary-800);
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.16) 1.2px, transparent 1.4px),
    linear-gradient(135deg, #0b2f5c 0%, #1558a8 55%, #2f7bd6 100%);
  background-position: 0 0, center;
  background-size: 22px 22px, cover;
  box-shadow: 0 18px 40px rgba(15, 62, 122, 0.18);
}

.ry-shell .ry-dashboard-hero h1,
.ry-shell .ry-dashboard-hero h2,
.ry-shell .ry-dashboard-hero h3 {
  color: #fff;
}

.ry-shell .ry-dashboard-hero p,
.ry-shell .ry-dashboard-hero .text-muted {
  color: rgba(255, 255, 255, 0.76) !important;
}

.ry-shell .ry-dashboard-hero .clientes-eyebrow {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
}

.ry-shell .ry-dashboard-hero .clientes-results-chip {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  backdrop-filter: blur(8px);
}

.ry-shell .ry-dashboard-hero .btn-primary,
.ry-shell .ry-dashboard-hero .btn-custom {
  border-color: #fff;
  background: #fff;
  color: var(--ry-color-primary-700);
}

.ry-shell .ry-dashboard-hero .btn-outline-secondary,
.ry-shell .ry-dashboard-hero .btn-outline-danger {
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}

.ry-shell .ry-dashboard-hero .btn-outline-secondary:hover,
.ry-shell .ry-dashboard-hero .btn-outline-danger:hover {
  border-color: #fff;
  background: #fff;
  color: var(--ry-color-primary-800);
}

.ry-card {
  border: 1px solid var(--ry-color-border);
  border-radius: var(--ry-radius-lg);
  background: var(--ry-color-surface);
  box-shadow: var(--ry-shadow-sm);
}

.ry-card-interactive {
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.ry-card-interactive:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: var(--ry-shadow-md);
}

.ry-form-card {
  padding: clamp(1.25rem, 3vw, 2rem);
}

.ry-form-card .form-label {
  color: var(--ry-color-text);
  font-size: 0.875rem;
  font-weight: 650;
}

.ry-form-card .form-text {
  color: var(--ry-color-muted);
}

.ry-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

.ry-entity-media {
  width: 88px;
  height: 88px;
  border: 1px solid var(--ry-color-border);
  border-radius: var(--ry-radius-md);
  background: var(--ry-color-primary-50);
  object-fit: cover;
}

.ry-entity-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  color: var(--ry-color-muted);
  font-size: 0.875rem;
}

.ry-scroll-options {
  max-height: 300px;
  overflow-y: auto;
  padding: 0.75rem;
  border: 1px solid var(--ry-color-border);
  border-radius: var(--ry-radius-md);
  background: var(--ry-color-surface);
}

.ry-settings-stack {
  display: grid;
  gap: 1rem;
}

.ry-settings-section {
  padding: clamp(1rem, 2.5vw, 1.5rem);
}

.ry-settings-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.ry-settings-icon {
  display: inline-grid;
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 0.75rem;
  background: var(--ry-color-primary-50);
  color: var(--ry-color-primary-600);
  font-size: 1.1rem;
}

.ry-setting-row {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 0;
  border-top: 1px solid var(--ry-color-border);
}

.ry-setting-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.ry-setting-row .form-check {
  flex: 0 0 auto;
  margin: 0;
}

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

.ry-schedule-day {
  padding: 1rem;
}

.ry-schedule-fields {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 0.75rem;
}

.ry-step-number {
  display: inline-grid;
  width: 1.75rem;
  height: 1.75rem;
  place-items: center;
  border-radius: 999px;
  background: var(--ry-color-primary-600);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 750;
}

.ry-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.ry-metric {
  padding: 1rem;
  border: 1px solid var(--ry-color-border);
  border-radius: var(--ry-radius-md);
  background: var(--ry-color-canvas);
}

.ry-metric-label {
  color: var(--ry-color-muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.ry-metric-value {
  margin-top: 0.25rem;
  font-size: 1.2rem;
  font-weight: 750;
}

.ry-table-card {
  overflow: hidden;
}

.ry-table-card .table {
  margin-bottom: 0;
}

.ry-table-card .table > :not(caption) > * > * {
  padding: 0.9rem 1rem;
  border-bottom-color: var(--ry-color-border);
  vertical-align: middle;
}

.ry-table-card thead th {
  background: var(--ry-color-canvas);
  color: var(--ry-color-muted);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ry-danger-card {
  max-width: 640px;
  margin-inline: auto;
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid #fecaca;
  border-radius: var(--ry-radius-lg);
  background: var(--ry-color-surface);
  box-shadow: var(--ry-shadow-sm);
}

.ry-danger-icon {
  display: inline-grid;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  place-items: center;
  border-radius: 999px;
  background: var(--ry-color-danger-50);
  color: var(--ry-color-danger-600);
  font-size: 1.25rem;
}

.ry-detail-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.ry-detail-list > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--ry-color-border);
}

.ry-detail-list > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.ry-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ry-empty-state {
  padding: clamp(2rem, 7vw, 4rem) 1.25rem;
  border: 1px dashed #cbd5e1;
  border-radius: var(--ry-radius-lg);
  background: var(--ry-color-surface);
  text-align: center;
}

.ry-empty-state-icon {
  display: inline-grid;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  place-items: center;
  border-radius: 999px;
  background: var(--ry-color-primary-50);
  color: var(--ry-color-primary-600);
  font-size: 1.35rem;
}

.ry-dashboard-navbar {
  min-height: 64px;
  background: var(--ry-color-primary-800);
}

.ry-dashboard-navbar .navbar-brand,
.ry-dashboard-navbar .nav-link {
  color: #fff;
}

.ry-dashboard-navbar .nav-link:hover,
.ry-dashboard-navbar .nav-link:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--ry-radius-sm);
}

.ry-dashboard-navbar .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.35);
}

.ry-mobile-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1040;
  display: flex;
  min-height: calc(var(--ry-mobile-nav-height) + env(safe-area-inset-bottom));
  gap: 0.25rem;
  padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--ry-color-border);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(12px);
}

.ry-mobile-nav-item {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.3rem 0.2rem;
  border: 0;
  border-radius: var(--ry-radius-sm);
  background: transparent;
  color: var(--ry-color-muted);
  font-size: 0.7rem;
  font-weight: 650;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
}

.ry-mobile-nav-item i {
  font-size: 1.25rem;
  line-height: 1;
}

.ry-mobile-nav-item:hover,
.ry-mobile-nav-item:focus-visible,
.ry-mobile-nav-item.active {
  background: var(--ry-color-primary-50);
  color: var(--ry-color-primary-700);
}

.ry-mobile-menu {
  width: min(88vw, 360px);
  background: var(--ry-color-primary-800);
  color: #fff;
}

.ry-mobile-menu .offcanvas-header {
  min-height: 88px;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.ry-mobile-menu .offcanvas-body {
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom) !important;
}

.ry-mobile-menu .sidebar {
  min-height: 100%;
  padding: 0.75rem;
}

.ry-mobile-menu-eyebrow {
  margin-bottom: 0.15rem;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ry-mobile-menu-role {
  margin-top: 0.15rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
}

@media (max-width: 767.98px) {
  .ry-shell-dashboard .dashboard-content {
    padding: 0.75rem 0 calc(var(--ry-mobile-nav-height) + env(safe-area-inset-bottom) + 1rem);
  }

  .ry-shell-dashboard .dashboard-content > .container,
  .ry-shell-dashboard .dashboard-content > .container-fluid {
    padding-right: 0.875rem;
    padding-left: 0.875rem;
  }

  .ry-dashboard-navbar {
    min-height: 56px;
  }

  .ry-dashboard-navbar .navbar-brand {
    font-size: 1rem;
  }

  .ry-dashboard-navbar .navbar-collapse {
    padding: 0.5rem 0 1rem;
  }

  .ry-dashboard-navbar .nav-link {
    display: flex;
    min-height: 44px;
    align-items: center;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }

  .ry-page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .ry-actions,
  .ry-actions .btn {
    width: 100%;
  }

  .ry-form-actions {
    flex-direction: column-reverse;
  }

  .ry-form-actions .btn {
    width: 100%;
  }

  .ry-entity-media {
    width: 72px;
    height: 72px;
  }

  .ry-settings-section-header,
  .ry-setting-row {
    align-items: flex-start;
  }

  .ry-setting-row {
    min-height: 64px;
  }

  .ry-schedule-grid,
  .ry-metric-grid {
    grid-template-columns: 1fr;
  }

  .ry-schedule-fields {
    grid-template-columns: 1fr;
  }

  .ry-schedule-separator {
    display: none;
  }

  .ry-table-card {
    overflow-x: auto;
  }

  .ry-table-card .table {
    min-width: 680px;
  }

  .ry-detail-list > div {
    flex-direction: column;
    gap: 0.2rem;
  }

  .ry-shell .btn-sm {
    min-height: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ry-shell *,
  .ry-shell *::before,
  .ry-shell *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
