#__next {
  height: 100%;
}

@keyframes rivia-page-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Staggered bar-rise animation — spring pop, same feel as ApexCharts bar entry */
@keyframes rivia-rise {
  0%   { opacity: 0; transform: translateY(14px) scale(0.94); }
  55%  { opacity: 1; transform: translateY(-3px) scale(1.018); }
  100% { opacity: 1; transform: translateY(0)    scale(1); }
}
.rivia-stagger {
  animation: rivia-rise 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
/* Vista Previa fade-in when tab becomes visible */
@keyframes rivia-fade-scale {
  from { opacity: 0; transform: scale(0.985); }
  to   { opacity: 1; transform: scale(1); }
}
.rivia-preview-enter {
  animation: rivia-fade-scale 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
/* OmniBar entrance */
@keyframes omni-in {
  from { opacity: 0; transform: scale(0.96) translateY(-10px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}
/* Icon pop — slides in from the left with a spring bounce */
@keyframes rivia-pop-x {
  0%   { opacity: 0; transform: translateX(-10px) scale(0.6); }
  60%  { opacity: 1; transform: translateX(2px)   scale(1.2); }
  100% { opacity: 1; transform: translateX(0)     scale(1); }
}
.rivia-stagger-icon {
  display: inline-flex;
  animation: rivia-pop-x 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes rivia-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 79, 0.5); transform: scale(1); }
  50%       { box-shadow: 0 0 0 6px rgba(255, 77, 79, 0);  transform: scale(1.05); }
}
.rivia-pulse-tag {
  animation: rivia-pulse 1.6s ease-in-out infinite;
}
.rivia-pulse-tag:hover {
  transform: scale(1.12) !important;
  box-shadow: 0 2px 12px rgba(255, 77, 79, 0.4) !important;
  animation: none;
}
@keyframes rivia-pulse-blue {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22, 119, 255, 0.4); }
  60%       { box-shadow: 0 0 0 8px rgba(22, 119, 255, 0); }
}
.rivia-approval-banner {
  animation: rivia-pulse-blue 2s ease-in-out infinite;
  border-radius: 8px;
}
.pareto .ant-card-body {
  height: 400px;
}
/* Main scroll area: fine grid + 320px major module + subtle film noise */
.app-content {
  margin-top: 0;
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background-color: #eceff4;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.2'/%3E%3C/svg%3E"),
    linear-gradient(rgba(15, 23, 42, 0.038) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.038) 1px, transparent 1px),
    linear-gradient(rgba(15, 23, 42, 0.065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.065) 1px, transparent 1px);
  background-size:
    96px 96px,
    20px 20px,
    20px 20px,
    320px 320px,
    320px 320px;
  background-position: 0 0;
}

@media print {
  .app-content {
    background: #fff;
    background-image: none;
  }
  .rivia-no-print {
    display: none !important;
  }
  .main-navigation,
  .app-nav-header,
  .app-nav-header-primary {
    display: none !important;
  }
}
.side-nav {
  height: 100vh;
  position: fixed;
  box-shadow: 0 1px 4px -1px rgba(0, 0, 0, 0.15);
  z-index: 999;
  background-color: #fff;
}
.ant-layout {
  background: 0 0;
}
.app-nav-header {
  margin-bottom: 61px;
}
.app-nav-header.secondary-nav {
  margin-bottom: 0;
}
.app-nav-header-primary {
  position: fixed;
  left: 250px;
  top: 0;
  right: 0;
  z-index: 1000;
  border-bottom: 1px solid #edf2f9;
  border-left: 1px solid #edf2f9;
  background-color: #ffffff;
}
/* Mobile: the sidebar auto-collapses to the 80px icon rail, so the fixed
   header must start at 80px (not 250px) to stay aligned and use full width. */
@media (max-width: 767px) {
  .app-nav-header-primary {
    left: 80px;
  }
}
/* .ant-page-header {
  display: flex;
  align-items: center;
} */
.ant-page-header .ant-page-header-heading {
  width: 100%;
}
.app-nav-header-secondary {
  margin-top: 50px;
}
.main-navigation {
  border-right: none;
}
.main-navigation .ant-layout-sider-children {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}
/* First nav menu fills remaining space — no dark gap */
.main-navigation .ant-layout-sider-children > .ant-menu:first-of-type {
  flex: 1;
}
.main-navigation .ant-menu-inline,
.main-navigation .ant-menu-vertical {
  border: none;
}
.app-nav-header-secondary .ant-page-header {
  padding: 16px 0;
}
.logo {
  margin-top: 16px;
  height: auto;
  justify-content: center;
}
.logo.logo-sm {
  margin-bottom: 40px;
  margin-top: 20px;
}

.sheet .ant-drawer-header {
  padding: 32px;
}
.sheet .ant-drawer-title {
  font-size: 28px;
}
.sheet .ant-drawer-close {
  top: 14px;
}
.sheet .custom-ant-drawer-footer {
  background-color: rgb(248, 249, 250);
  margin: 0 -24px;
  padding: 16px;
}
.ant-form-item-control-input-content .ant-picker {
  width: 100%;
}
.dynamic-delete-button {
  position: relative;
  top: 4px;
  margin: 0 8px;
  color: #999;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s;
}
.dynamic-delete-button:hover {
  color: #777;
}
.dynamic-delete-button[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
}
.client-email-form-with-label {
  margin-bottom: 10px;
}
.client-email-form {
  margin-bottom: 10px;
  height: 45px;
}

.completeForm .ant-form-item-label label {
  font-weight: 300;
}

.bordered {
  display: flex;
  align-items: center;
}
.bordered .ant-typography {
  border: 1px solid #edf2f9;
  height: 35px;
  margin-bottom: 24px;
  width: 100%;
  line-height: 2.3;
  padding: 0 8px;
}
.bordered .ant-tag {
  margin-bottom: 22px;
  margin-left: 6px;
}
/* .bordered_row .ant-col {
  border-right: 1px solid #edf2f9;
} */

.float-label .ant-input,
.float-label .ant-input-affix-wrapper {
  padding: 8px 12px 4px 11px;
  border-radius: 0;
}

.float-label .ant-select .ant-select-selector {
  padding: 8px 10px 4px 11px;
  border-radius: 0;
}

.float-label
  .ant-select-single:not(.ant-select-customize-input)
  .ant-select-selector {
  padding: 8px 10px 4px 11px;
  height: 35px;
}

.float-label
  .ant-select-single
  .ant-select-selector
  .ant-select-selection-search {
  top: 7px;
}
.float-label
  .ant-select-single
  .ant-select-selector
  .ant-select-selection-item {
  line-height: 1.5;
}

.float-label {
  position: relative;
}

.label.as-placeholder,
.label.as-label {
  font-weight: normal;
  position: absolute;
  pointer-events: none;
  left: 12px;
  top: 7px;
  transition: 0.2s ease all;
  z-index: 1;
}

.as-placeholder {
  color: gray;
}

label.label.as-label {
  top: -8px;
  font-size: 12px !important;
  background: white;
  padding: 0 4px;
  margin-left: -4px;
}
.ant-divider.small {
  margin: 8px 0;
}
/* Locked/disabled inputs: readable text, subtle locked look */
.ant-input[disabled],
.ant-input-number-disabled .ant-input-number-input,
.ant-select-disabled .ant-select-selection-item,
.ant-select-disabled .ant-select-selector {
  color: rgba(0, 0, 0, 0.72) !important;
  background-color: #f7f8fa !important;
  border-color: #e6e8ed !important;
  cursor: default !important;
}
.ant-input-affix-wrapper-disabled {
  background-color: #f7f8fa !important;
  border-color: #e6e8ed !important;
}
.ant-input-affix-wrapper-disabled .ant-input[disabled] {
  background-color: transparent !important;
}

.analysis-report-analysis-type small {
  font-size: 90%;
  margin-bottom: 4px;
  margin-right: 16px;
  display: inline-block;
  font-weight: bold;
  width: 150px;
}
.analysis-report-analysis-type .ant-form-item {
  margin-bottom: 4px;
}

.analysis-card-title p {
  margin: 0;
  color: #000000d9;
  margin-right: 16px;
}
.analysis-report-analysis-type .ant-tag {
  margin-left: 8px;
  margin-top: 0.4rem !important;
}
.with-dependencies .ant-form-item {
  margin-bottom: 0;
}
.custom-tab {
  overflow: initial;
}
.custom-tab .ant-tabs-nav {
  background-color: rgba(255,255,255,0.85);
  backdrop-filter: blur(6px);
}
.custom-tab .ant-tabs-content-holder {
  padding: 25px;
  min-height: 50vh;  /* prevent scroll/layout collapse during tab remounts */
}
.app-content.no-padding {
  padding: 0;
}
.ant-statistic-content {
  font-size: 18px;
}

.dependency-form {
  margin-left: 165px;
}
.site-page-header-ghost-wrapper {
  padding: 24px;
  background-color: #f5f5f5;
}
.ant-page-header.card-page-header {
  padding: 0;
  padding-bottom: 4px;
}
.ant-descriptions-small .ant-descriptions-row > td {
  padding-bottom: 0;
}
.ant-descriptions-item-label,
.ant-descriptions-item-content {
  font-size: 12.6px;
  line-height: 1.1;
}
.ant-descriptions-view {
  border-radius: 0;
}
.app-content .ant-statistic-content {
  font-size: 14.6px;
}
.custom-tab .ant-divider {
  margin: 12px 0;
}
.ant-space-item small {
  font-size: 85%;
}
.custom-button-color {
  background-color: #333;
}
.print-modal .ant-radio-group,
.print-modal .ant-checkbox-group {
  display: flex;
  flex-direction: column;
}
.print-modal .ant-radio-group label,
.print-modal .ant-checkbox-group label {
  margin-bottom: 8px;
}
.ant-space.full {
  width: 100%;
}
/* .ant-space {
  width: 100%;
} */

.toLowerCase {
  text-transform: lowercase;
}
.ant-page-header-content {
  padding-top: 0px;
}

.image-container {
  width: 100%;
  max-width: 250px;
}

.image-container > span {
  position: unset !important;
}

.image-container .image {
  object-fit: contain;
  width: 100% !important;
  position: relative !important;
  height: unset !important;
}
.ant-form-item-row {
  flex-direction: column;
}
.ant-form .ant-page-header {
  height: auto;
}
.ant-table-content {
  overflow-x: auto;
}
.ant-badge-status {
  margin-right: 8px;
}
.ant-form-item.floating-label {
  position: relative;
}
.floating-label .ant-form-item-label {
  position: absolute;
  top: -20px;
  z-index: 1;
  left: 4px;
  background: white;
  padding: 0;
  height: 30px;
  padding-left: 4px;
}
.floating-label .ant-form-item-label label {
  font-size: 12px;
}

.sample-edit-table .ant-spin-nested-loading,
.sample-edit-table .ant-spin-container,
.sample-edit-table .ant-table,
.sample-edit-table .ant-table-container,
.sample-edit-table .ant-table-content {
  height: 100%;
}

.sample-edit-table .ant-table-cell {
  text-align: center;
  /* padding: 0%; */
}
.sample-edit-table .ant-table-row .ant-table-cell {
  padding: 0;
}
.sample-edit-table .ant-table-row .ant-table-cell {
  position: unset;
}
.sample-edit-table .ant-input,
.sample-edit-table .ant-picker {
  border: none;
  border-radius: 0;
}

.sample-edit-table .ant-table-thead .ant-table-cell {
  background-color: #f1f1f17d;
}
tr:hover .ant-btn.tiny-button {
  opacity: 1;
}
.ant-btn.tiny-button {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 2px;
  margin-top: 7px;
  position: absolute;
  left: -15px;
  z-index: 1;
  opacity: 0;
}
.ant-btn.tiny-button .anticon {
  font-size: 12px;
}
.ant-tooltip-inner {
  background-color: #0d2b6e;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 29, 110, 0.25);
}
.ant-tooltip-arrow-content {
  background-color: #0d2b6e;
}
.ant-tooltip-arrow-content::before {
  background: #0d2b6e;
}
.light-tooltip {
  color: #fff;
}

/* ══ Estadísticos — unified card surface (Dashboard + Reportes) ══════════════
   Single visual language for every stats card: same radius, border, shadow and
   header type-scale. Theme-aware via --rv-* tokens (works in all light/dark
   themes). No !important so per-component inline styles (e.g. DeliveryDays
   overflow, the day-summary highlight card) still win where intentional. */
.rivia-stats > .ant-row > .ant-col { display: flex; }
.rivia-stats > .ant-row > .ant-col > * { width: 100%; }

.rivia-stats .ant-card {
  height: 100%;
  border-radius: 12px;
  border: 1px solid var(--rv-border, #e8e8e8);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.05);
  transition: box-shadow 0.18s ease;
}
.rivia-stats .ant-card:hover {
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06), 0 10px 28px rgba(15, 23, 42, 0.09);
}
.rivia-stats .ant-card-head {
  min-height: 46px;
  border-bottom: 1px solid var(--rv-border, #f0f0f0);
}
.rivia-stats .ant-card-head-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--rv-text, #0a0e1a);
  letter-spacing: 0.1px;
}

/* ══ Sidebar — modern blue navigation ════════════════════════════════════════
   A deep-blue gradient rail with rounded "pill" items, an accent-colored active
   state and soft hover. Applied across themes (sidebar stays blue while content
   follows the active theme). Scoped to .main-navigation + !important so it wins
   over the per-theme .ant-layout-sider / .ant-menu-dark overrides in themes.css. */
.main-navigation.ant-layout-sider {
  background: linear-gradient(195deg, #14365f 0%, #0c2444 55%, #081a33 100%) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
  box-shadow: 2px 0 16px rgba(8, 20, 40, 0.28);
}
.main-navigation .ant-menu.ant-menu-dark,
.main-navigation .ant-menu-dark .ant-menu-sub {
  background: transparent !important;
}
/* Group headers */
.main-navigation .ant-menu-item-group-title {
  color: rgba(255, 255, 255, 0.42) !important;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 16px 24px 6px;
}
/* Items — rounded pills with breathing room */
.main-navigation .ant-menu-dark .ant-menu-item,
.main-navigation .ant-menu-dark .ant-menu-submenu-title {
  width: auto !important;
  margin: 3px 12px !important;
  border-radius: 10px !important;
  color: rgba(255, 255, 255, 0.72) !important;
  transition: background 0.16s ease, color 0.16s ease !important;
}
.main-navigation .ant-menu-dark .ant-menu-item a,
.main-navigation .ant-menu-dark .ant-menu-item .ant-menu-title-content,
.main-navigation .ant-menu-dark .ant-menu-submenu-title .ant-menu-title-content {
  color: rgba(255, 255, 255, 0.72) !important;
}
.main-navigation .ant-menu-dark .ant-menu-item .anticon,
.main-navigation .ant-menu-dark .ant-menu-submenu-title .anticon {
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: 17px;
  transition: color 0.16s ease;
}
/* Hover */
.main-navigation .ant-menu-dark .ant-menu-item:hover,
.main-navigation .ant-menu-dark .ant-menu-submenu-title:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  color: #ffffff !important;
}
.main-navigation .ant-menu-dark .ant-menu-item:hover a,
.main-navigation .ant-menu-dark .ant-menu-item:hover .ant-menu-title-content,
.main-navigation .ant-menu-dark .ant-menu-item:hover .anticon,
.main-navigation .ant-menu-dark .ant-menu-submenu-title:hover .anticon {
  color: #ffffff !important;
}
/* Selected — accent pill with glow + left indicator */
.main-navigation .ant-menu-dark .ant-menu-item-selected {
  background: var(--rv-accent, #1677ff) !important;
  box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--rv-accent, #1677ff) 60%, transparent) !important;
  position: relative;
}
.main-navigation .ant-menu-dark .ant-menu-item-selected::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: #ffffff;
}
.main-navigation .ant-menu-dark .ant-menu-item-selected a,
.main-navigation .ant-menu-dark .ant-menu-item-selected .ant-menu-title-content,
.main-navigation .ant-menu-dark .ant-menu-item-selected .anticon {
  color: #ffffff !important;
}
/* Collapsed rail: keep pills tidy + centered */
.main-navigation.ant-layout-sider-collapsed .ant-menu-dark .ant-menu-item,
.main-navigation.ant-layout-sider-collapsed .ant-menu-dark .ant-menu-submenu-title {
  margin: 3px 8px !important;
  border-radius: 10px !important;
}
.main-navigation.ant-layout-sider-collapsed .ant-menu-item-selected::before { display: none; }
/* Bottom profile divider */
.main-navigation .ant-menu-dark[style*="margin-top: auto"],
.main-navigation .ant-menu-dark[style*="marginTop"] {
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}
/* Brand / logo + collapse trigger on the blue rail */
.main-navigation .brand,
.main-navigation .logo,
.main-navigation .ant-layout-sider-trigger {
  color: #ffffff !important;
}
.main-navigation .ant-layout-sider-trigger {
  background: rgba(255, 255, 255, 0.06) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}
/* Scrollbar within the rail */
.main-navigation .ant-layout-sider-children::-webkit-scrollbar { width: 6px; }
.main-navigation .ant-layout-sider-children::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 3px;
}

/* ══ Page header — stop cropping the title ═══════════════════════════════════
   antd PageHeader clips .ant-page-header-heading-title (nowrap + overflow
   hidden) when the right-side actions (date filter bar, buttons) are wide.
   Let the heading wrap and the title show in full instead of "Reporte de anál…". */
.app-header-bar .ant-page-header-heading {
  flex-wrap: wrap;
  row-gap: 8px;
}
.app-header-bar .ant-page-header-heading-left {
  overflow: visible;
  min-width: 0;
  margin-right: 12px;
}
.app-header-bar .ant-page-header-heading-title {
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
}
.app-header-bar .ant-page-header-heading-extra {
  white-space: normal;
}

/* ══ Page header — let the bar grow when the actions wrap ════════════════════
   .ant-layout-header is locked to a fixed height (64px in layout.css, 70px in
   the theme sheets) with a matching line-height. On narrow viewports the extra
   (date presets + range picker + "Nueva solicitud") wraps to a second row that
   overflows that height and gets clipped — the filter bar disappeared behind
   the content area. Let the height follow the content, keeping 70px as the
   floor so the unwrapped bar looks exactly as before. */
.app-header-bar.ant-layout-header {
  height: auto;
  min-height: 70px;
  line-height: normal;
  padding-top: 8px;
  padding-bottom: 8px;
  /* the fixed line-height was what centred the row vertically; with it gone,
     centre the heading block explicitly so the unwrapped bar is unchanged. */
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.app-header-bar .ant-page-header-heading-extra {
  margin: 0;
}

/* Aviso del zip de certificados: abajo a la derecha y a color, porque el
   proceso puede tardar minutos y el mensaje de arriba tapaba la tabla.
   Antd pinta el título y la descripción con sus propios colores, así que hay
   que forzarlos a blanco sobre el degradado. */
.rivia-zip-notification .ant-notification-notice-message,
.rivia-zip-notification .ant-notification-notice-description,
.rivia-zip-notification .ant-notification-notice-close {
  color: #fff;
}
.rivia-zip-notification .ant-notification-notice-message {
  font-weight: 600;
  margin-bottom: 2px;
}
.rivia-zip-notification .ant-notification-notice-description {
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
}
.rivia-zip-notification .ant-notification-notice-close:hover {
  color: #fff;
  opacity: 0.75;
}

/* ══ Solicitud urgente — la barra superior avisa ═════════════════════════════
   El asistente de nueva solicitud marca <body class="rivia-urgent"> mientras
   el switch "Urgente" está encendido: la barra la pinta el layout, muy por
   encima del formulario, y sin esto el aviso solo se veía en el switch.
   themes.css fija el fondo con !important, así que aquí hace falta también. */
body.rivia-urgent .app-header-bar {
  background: linear-gradient(135deg, #ad4e00 0%, #fa8c16 100%) !important;
  border-bottom-color: #ad4e00 !important;
}
body.rivia-urgent .app-header-bar .ant-page-header-heading-title,
body.rivia-urgent .app-header-bar .ant-page-header-heading-sub-title,
body.rivia-urgent .app-header-bar .ant-page-header-back-button {
  color: #fff !important;
}
