/* Ynex-inspired admin shell for SilyAssur
   Modern dashboard shell for SilyAssur insurance admin */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

:root {
  --yx-primary: #845adf;
  --yx-primary-rgb: 132, 90, 223;
  --yx-secondary: #23b7e5;
  --yx-success: #26bf94;
  --yx-info: #49b6f5;
  --yx-warning: #f5b849;
  --yx-danger: #e6533c;
  --yx-orange: #ff5d1f;
  --yx-pink: #e354d4;
  --yx-teal: #0ca3e0;

  --yx-body: #f0f1f7;
  --yx-surface: #ffffff;
  --yx-border: #f3f3f3;
  --yx-text: #333335;
  --yx-text-muted: #8c9097;
  --yx-sidebar-bg: #111c43;
  --yx-sidebar-text: #a3aed1;
  --yx-sidebar-w: 16.25rem;
  --yx-header-h: 4.25rem;
  --yx-radius: 0.7rem;
  --yx-radius-sm: 0.5rem;
  --yx-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
  --yx-shadow-card: 0 0.15rem 1.75rem 0 rgba(var(--yx-primary-rgb), 0.06);
  --yx-font: 'Montserrat', system-ui, -apple-system, sans-serif;
}

html, body {
  font-family: var(--yx-font) !important;
  background: var(--yx-body) !important;
  color: var(--yx-text) !important;
  font-size: 16px !important;
  line-height: 1.5;
  margin: 0;
  min-height: 100%;
}

body.ynex-app {
  padding: 0 !important;
  font-size: 16px !important;
}

/* ========== SIDEBAR ========== */
aside.aside-menu,
.aside-menu {
  position: fixed !important;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--yx-sidebar-w) !important;
  background: var(--yx-sidebar-bg) !important;
  border-right: 0 !important;
  box-shadow: none !important;
  z-index: 1050 !important;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  margin: 0 !important;
  transition: transform 0.25s ease, width 0.25s ease;
  color: var(--yx-sidebar-text);
}

.aside-menu .branding {
  height: var(--yx-header-h);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  position: relative;
}

.aside-menu .branding .ui.image,
.aside-menu .branding img {
  max-height: 2.35rem !important;
  width: auto !important;
  max-width: 11.5rem !important;
  margin: 0 !important;
  /* logov2.png has a black plate — knock it out on the navy sidebar */
  mix-blend-mode: lighten;
}

.aside-menu .branding a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
}

.ynex-sidebar-brand-text {
  display: inline-block;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.ynex-header-brand-text,
.ynex-auth-brand-text {
  display: inline-block;
  font-weight: 700;
  color: var(--yx-text);
  line-height: 1.2;
}

.aside-menu .close-aside {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
}

.aside-menu > .scrollbar {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem 1.5rem !important;
  height: auto !important;
  max-height: none !important;
}

.aside-menu .ui.link.list {
  margin: 0 !important;
  padding: 0 !important;
}

.aside-menu .ui.link.list > .item,
.aside-menu a.item {
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem;
  padding: 0.75rem 0.95rem !important;
  margin: 0.15rem 0 !important;
  border-radius: var(--yx-radius-sm) !important;
  color: #a3aed1 !important;
  font-weight: 500 !important;
  font-size: 0.875rem !important;
  border: none !important;
  border-left: none !important;
  background: transparent !important;
  transition: background 0.2s ease, color 0.2s ease;
}

.aside-menu .ui.link.list > .item:hover,
.aside-menu a.item:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #fff !important;
}

.aside-menu .ui.link.list > .item.active,
.aside-menu a.item.active {
  background: linear-gradient(90deg, #845adf 0%, #5b8def 100%) !important;
  color: #fff !important;
  font-weight: 600 !important;
  box-shadow: 0 0.35rem 1rem rgba(132, 90, 223, 0.35);
}

.aside-menu .ui.link.list > .item .icon,
.aside-menu a.item .icon,
.aside-menu a.item i,
.aside-menu .ui.link.list > .item i.icon,
.aside-menu .ui.link.list > .item > i {
  margin: 0 !important;
  font-size: 1.35rem !important;
  width: 1.5rem !important;
  min-width: 1.5rem !important;
  height: auto !important;
  text-align: center !important;
  opacity: 1 !important;
  color: #c5cbe3 !important;
  float: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.aside-menu .ui.link.list > .item .icon::before,
.aside-menu a.item .icon::before,
.aside-menu a.item i::before,
.aside-menu .ui.link.list > .item i::before {
  color: #c5cbe3 !important;
  opacity: 1 !important;
}

.aside-menu .ui.link.list > .item:hover .icon,
.aside-menu a.item:hover .icon,
.aside-menu .ui.link.list > .item:hover i,
.aside-menu a.item:hover i,
.aside-menu .ui.link.list > .item:hover .icon::before,
.aside-menu a.item:hover i::before {
  color: #fff !important;
  opacity: 1 !important;
}

.aside-menu .ui.link.list > .item.active .icon,
.aside-menu a.item.active .icon,
.aside-menu .ui.link.list > .item.active i,
.aside-menu a.item.active i,
.aside-menu .ui.link.list > .item.active .icon::before,
.aside-menu a.item.active i::before {
  color: #fff !important;
  opacity: 1 !important;
}

.aside-menu .ui.link.list > .item .content {
  margin: 0 !important;
  padding: 0 !important;
  color: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
}

.aside-menu .ui.red.circular.label {
  background: var(--yx-danger) !important;
  margin-left: auto !important;
  float: none !important;
}

/* ========== HEADER ========== */
.ynex-header {
  position: fixed !important;
  top: 0;
  left: var(--yx-sidebar-w) !important;
  right: 0 !important;
  width: auto !important;
  max-width: none !important;
  height: var(--yx-header-h) !important;
  background: var(--yx-surface) !important;
  border-bottom: 1px solid var(--yx-border) !important;
  box-shadow: none !important;
  z-index: 1045 !important;
  padding: 0 1.25rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin: 0 !important;
  overflow: visible !important;
  box-sizing: border-box !important;
  transition: left 0.25s ease;
}

.ynex-header-left,
.ynex-header-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.ynex-header-right {
  margin-left: auto;
}

.ynex-header-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: var(--yx-radius-sm);
  color: var(--yx-text);
  background: var(--yx-body);
  font-size: 1.35rem;
  text-decoration: none !important;
  cursor: pointer;
  position: relative;
  z-index: 1050;
  border: 0;
}

.ynex-header-brand {
  display: none;
  align-items: center;
}

.ynex-header-brand img {
  max-height: 2rem;
  width: auto;
  max-width: 10rem;
}

.ynex-header-icon {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--yx-body);
  color: var(--yx-text) !important;
  font-size: 1.2rem;
  cursor: pointer;
  text-decoration: none !important;
  flex-shrink: 0;
}

.ynex-header-icon:hover {
  color: var(--yx-primary) !important;
  background: rgba(var(--yx-primary-rgb), 0.1);
}

.ynex-header-badge {
  position: absolute;
  top: -0.1rem;
  right: -0.1rem;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--yx-danger);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.05rem;
  text-align: center;
  z-index: 1;
}

.ynex-header-badge.is-hidden {
  display: none !important;
}

.ynex-header-user.ui.dropdown {
  display: inline-flex !important;
  align-items: center;
}

.ynex-header-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0.65rem 0.2rem 0.2rem;
  border-radius: 2rem;
  background: var(--yx-body);
  color: var(--yx-text);
  cursor: pointer;
  user-select: none;
}

.ynex-header-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.ynex-header-avatar-fallback {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  --yx-avatar-bg: rgba(var(--yx-primary-rgb), 0.15);
  --yx-avatar-fg: var(--yx-primary);
  background: var(--yx-avatar-bg);
  color: var(--yx-avatar-fg);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
}

.ynex-header-username {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--yx-text);
  line-height: 1;
  white-space: nowrap;
}

.ynex-header-user-trigger > i {
  font-size: 0.85rem;
  color: var(--yx-text-muted);
}

/* ========== HEADER DROPDOWNS ========== */
.ynex-header .ynex-header-dropdown.ui.dropdown {
  position: relative !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  overflow: visible !important;
  display: inline-flex !important;
  align-items: center !important;
  color: inherit !important;
}

.ynex-header .ynex-header-dropdown.ui.dropdown > .menu {
  display: none !important;
  margin: 0.55rem 0 0 !important;
  border: 1px solid #eef0f6 !important;
  border-radius: 0.85rem !important;
  box-shadow: 0 1rem 2.5rem rgba(17, 28, 67, 0.14) !important;
  background: #fff !important;
  font-family: 'Montserrat', sans-serif !important;
  overflow: hidden !important;
  z-index: 1300 !important;
  position: absolute !important;
  top: 100% !important;
  right: 0 !important;
  left: auto !important;
}

.ynex-header .ynex-header-dropdown.ui.dropdown.active > .menu,
.ynex-header .ynex-header-dropdown.ui.dropdown.visible > .menu,
.ynex-header .ynex-header-dropdown.ui.dropdown > .menu.visible,
.ynex-header .ynex-header-dropdown.ui.dropdown > .menu.animating {
  display: block !important;
}

.ynex-header .ui.pointing.dropdown > .menu::before,
.ynex-header .ui.pointing.dropdown > .menu::after,
.ynex-header .ui.dropdown > .dropdown.icon {
  display: none !important;
}

/* Notifications panel
   Semantic sets `.ui.dropdown .menu > * { white-space: nowrap }` which
   truncates empty-state copy unless we force wrap on ynex panels. */
.ynex-header .ui.dropdown > .menu.ynex-notif,
.ynex-header .notifications-menu.ynex-notif {
  width: 24rem !important;
  min-width: 24rem !important;
  max-width: calc(100vw - 1.25rem) !important;
  padding: 0 !important;
}

.ynex-header .ui.dropdown > .menu.ynex-notif > *,
.ynex-header .ui.dropdown > .menu.ynex-user-menu > * {
  white-space: normal !important;
}

.ynex-notif__head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.85rem !important;
  padding: 1.2rem 1.35rem !important;
  border-bottom: 1px solid #eef0f6 !important;
  background: #fff !important;
}

.ynex-notif__title {
  display: flex !important;
  align-items: center !important;
  gap: 0.55rem !important;
  min-width: 0 !important;
}

.ynex-notif__title strong {
  margin: 0 !important;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  color: #1f2937 !important;
  font-family: 'Montserrat', sans-serif !important;
  line-height: 1.2 !important;
}

.ynex-notif__count {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 1.4rem !important;
  height: 1.25rem !important;
  padding: 0 0.4rem !important;
  border-radius: 999px !important;
  background: #845adf !important;
  color: #fff !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
}

.ynex-notif__mark {
  flex-shrink: 0 !important;
  border: 0 !important;
  border-radius: 0.45rem !important;
  background: rgba(132, 90, 223, 0.1) !important;
  color: #845adf !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  font-family: 'Montserrat', sans-serif !important;
  padding: 0.5rem 0.85rem !important;
  line-height: 1.2 !important;
  cursor: pointer !important;
  box-shadow: none !important;
  white-space: nowrap !important;
}

.ynex-header .ui.dropdown > .menu.ynex-notif > .ynex-notif__head {
  white-space: normal !important;
}

.ynex-notif__mark:hover {
  background: rgba(132, 90, 223, 0.16) !important;
}

.ynex-notif__list {
  max-height: 18rem !important;
  overflow-y: auto !important;
  padding: 0.35rem 0 !important;
}

.ynex-notif .notification-item,
.ynex-notif .item.notification-item {
  display: block !important;
  padding: 0.95rem 1.35rem !important;
  margin: 0 !important;
  border: 0 !important;
  border-bottom: 1px solid #f3f4f8 !important;
  border-radius: 0 !important;
  background: transparent !important;
  cursor: pointer !important;
  min-width: 0 !important;
  transition: background 0.15s ease;
}

.ynex-notif .notification-item:last-child {
  border-bottom: 0 !important;
}

.ynex-notif .notification-item:hover {
  background: #f8f9fc !important;
  color: inherit !important;
}

.ynex-notif .notification-item.unread {
  background: rgba(132, 90, 223, 0.05) !important;
}

.ynex-notif__item-title {
  display: block !important;
  margin: 0 0 0.25rem !important;
  padding: 0 !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  color: #1f2937 !important;
  text-decoration: none !important;
  font-family: 'Montserrat', sans-serif !important;
  line-height: 1.35 !important;
}

.ynex-notif__item-msg {
  margin: 0 0 0.3rem !important;
  font-size: 0.85rem !important;
  color: #6b7280 !important;
  line-height: 1.45 !important;
  white-space: normal !important;
}

.ynex-notif__item-time {
  display: block !important;
  font-size: 0.78rem !important;
  color: #9ca3af !important;
}

.ynex-header .ui.dropdown .menu.ynex-notif > .item.ynex-notif__empty,
.ynex-notif__empty,
.ynex-notif .item.ynex-notif__empty,
.ynex-notif .item.disabled.ynex-notif__empty {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.55rem !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 2rem 1.5rem 2.15rem !important;
  margin: 0 !important;
  text-align: center !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  opacity: 1 !important;
  pointer-events: none !important;
  cursor: default !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  min-width: 0 !important;
  color: inherit !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: normal !important;
}

.ynex-notif__empty.is-hidden,
.ynex-notif .item.ynex-notif__empty.is-hidden,
.ynex-header .ui.dropdown .menu.ynex-notif > .item.ynex-notif__empty.is-hidden,
.ynex-header .ui.dropdown > .menu.ynex-notif > .item.disabled.ynex-notif__empty.is-hidden,
.ynex-notif .item.disabled.ynex-notif__empty.is-hidden {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
}

.ynex-notif__empty-icon {
  flex: 0 0 3.25rem !important;
  width: 3.25rem !important;
  min-width: 3.25rem !important;
  max-width: 3.25rem !important;
  height: 3.25rem !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: center !important;
  background: rgba(132, 90, 223, 0.12) !important;
  color: #845adf !important;
  font-size: 1.5rem !important;
  margin: 0 0 0.15rem !important;
  padding: 0 !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

.ynex-notif__empty-icon i {
  color: #845adf !important;
  font-size: 1.5rem !important;
  opacity: 1 !important;
  margin: 0 !important;
  float: none !important;
}

.ynex-notif__empty strong {
  display: block !important;
  width: 100% !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: #1f2937 !important;
  font-family: 'Montserrat', sans-serif !important;
  white-space: normal !important;
  line-height: 1.35 !important;
  overflow: visible !important;
}

.ynex-notif__empty > span:not(.ynex-notif__empty-icon) {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 0 0.35rem !important;
  font-size: 0.875rem !important;
  color: #8c9097 !important;
  line-height: 1.5 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

/* User dropdown — beat style.css `.ui.dropdown .menu>.item { padding: 0 !important }` */
.ynex-header .ui.dropdown.ynex-header-user > .menu.ynex-user-menu,
.ynex-header .ynex-header-user > .menu.ynex-user-menu {
  min-width: 14.5rem !important;
  padding: 0.55rem 0 !important;
  overflow: hidden !important;
}

.ynex-header-user.ui.dropdown {
  display: inline-flex !important;
  align-items: center;
}

.ynex-header .ui.dropdown .menu.ynex-user-menu > .item,
.ynex-header .ui.dropdown .menu.ynex-user-menu > a.item,
.ynex-header .ui.dropdown .menu.ynex-user-menu > a.item.ynex-user-menu__link,
.ynex-header .ynex-user-menu > .item,
.ynex-header .ynex-user-menu > a.item.ynex-user-menu__link {
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 0.8rem 1.25rem !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #333335 !important;
  text-decoration: none !important;
  font-size: 0.925rem !important;
  font-weight: 500 !important;
  font-family: 'Montserrat', sans-serif !important;
  min-width: 0 !important;
  line-height: 1.3 !important;
  float: none !important;
  white-space: nowrap !important;
}

.ynex-user-menu__label {
  padding: 0.55rem 1.2rem 0.4rem !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  color: #8c9097 !important;
}

.ynex-user-menu__ico {
  width: 1.25rem !important;
  height: 1.25rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.ynex-header .ui.dropdown .menu.ynex-user-menu > .item i,
.ynex-header .ui.dropdown .menu.ynex-user-menu .ynex-user-menu__ico i,
.ynex-header .ynex-user-menu > .item i,
.ynex-header .ynex-user-menu .ynex-user-menu__ico i,
.ynex-user-menu__link i {
  position: static !important;
  float: none !important;
  display: inline-block !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #6b7280 !important;
  font-size: 1.15rem !important;
  opacity: 1 !important;
  line-height: 1 !important;
  vertical-align: middle !important;
}

.ynex-header .ynex-user-menu > .item:hover,
.ynex-header .ynex-user-menu > a.item.ynex-user-menu__link:hover {
  background: #f8f9fc !important;
  color: #845adf !important;
}

.ynex-header .ynex-user-menu > .item:hover i,
.ynex-header .ynex-user-menu > a.item:hover .ynex-user-menu__ico i {
  color: #845adf !important;
}

.ynex-user-menu__link--danger,
.ynex-header .ynex-user-menu > a.item.ynex-user-menu__link--danger {
  color: #e6533c !important;
}

.ynex-user-menu__link--danger i,
.ynex-header .ynex-user-menu > a.item.ynex-user-menu__link--danger i {
  color: #e6533c !important;
}

.ynex-header .ynex-user-menu > a.item.ynex-user-menu__link--danger:hover {
  background: rgba(230, 83, 60, 0.08) !important;
  color: #e6533c !important;
}

.ynex-user-menu__sep {
  height: 1px !important;
  margin: 0.4rem 0 !important;
  background: #eef0f6 !important;
  border: 0 !important;
}

/* ========== MAIN CONTENT ========== */
.page-content {
  margin-left: var(--yx-sidebar-w) !important;
  margin-top: var(--yx-header-h) !important;
  padding: 1.5rem !important;
  min-height: calc(100vh - var(--yx-header-h));
  background: var(--yx-body) !important;
  width: auto !important;
  max-width: none !important;
  transition: margin-left 0.25s ease;
}

/* Desktop: hamburger collapses sidebar */
body.ynex-sidebar-collapsed aside.aside-menu {
  transform: translateX(-105%);
  pointer-events: none;
}

body.ynex-sidebar-collapsed .ynex-header {
  left: 0 !important;
  transition: left 0.25s ease;
}

body.ynex-sidebar-collapsed .page-content {
  margin-left: 0 !important;
}

.page-title.with-desc {
  margin: 0 0 1.25rem !important;
  padding: 0 !important;
  border: none !important;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1rem;
}

.ynex-page-heading {
  min-width: 0;
  flex: 1 1 auto;
}

.page-title.with-desc h2,
.ynex-page-heading h2 {
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  color: var(--yx-text) !important;
  margin: 0 !important;
  letter-spacing: -0.01em;
}

.page-title.with-desc p,
.ynex-page-heading p {
  width: auto;
  margin: 0.25rem 0 0 !important;
  color: var(--yx-text-muted) !important;
  font-size: 0.8125rem !important;
}

.ynex-page-actions-wrap {
  flex: 0 1 auto;
  margin-left: auto;
}

.ynex-page-actions,
.page-actions {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  width: auto !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Don't turn toolbar wrappers into white cards */
.ui.segment.transparent,
.ui.segment.page-actions,
.page-title .ui.segment.transparent {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.ynex-btn-group {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--yx-border);
  border-radius: var(--yx-radius-sm);
  overflow: hidden;
  background: var(--yx-surface);
}

.ynex-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.35rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--yx-radius-sm);
  border: 1px solid transparent;
  font-family: var(--yx-font);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none !important;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.ynex-btn i {
  margin: 0 !important;
  font-size: 0.95rem;
  line-height: 1;
}

.ynex-btn-group .ynex-btn {
  border-radius: 0;
  border: 0;
  border-right: 1px solid var(--yx-border);
  background: transparent;
  color: var(--yx-text-muted);
  min-height: 2.25rem;
  padding: 0.4rem 0.85rem;
}

.ynex-btn-group .ynex-btn:last-child {
  border-right: 0;
}

.ynex-btn-group .ynex-btn:hover {
  background: rgba(var(--yx-primary-rgb), 0.06);
  color: var(--yx-primary);
}

.ynex-btn-group .ynex-btn.is-active {
  background: rgba(var(--yx-primary-rgb), 0.12);
  color: var(--yx-primary);
}

.ynex-btn-soft {
  background: var(--yx-body);
  color: var(--yx-text);
  border-color: var(--yx-border);
}

.ynex-btn-soft:hover {
  background: rgba(var(--yx-primary-rgb), 0.08);
  color: var(--yx-primary);
}

.ynex-btn-primary {
  background: var(--yx-primary) !important;
  color: #fff !important;
  border-color: var(--yx-primary) !important;
  box-shadow: 0 0.15rem 0.65rem rgba(var(--yx-primary-rgb), 0.28);
}

.ynex-btn-primary:hover {
  filter: brightness(1.05);
  color: #fff !important;
}

.ynex-btn-success {
  background: var(--yx-success) !important;
  color: #fff !important;
  border-color: var(--yx-success) !important;
  box-shadow: 0 0.15rem 0.65rem rgba(38, 191, 148, 0.28);
}

.ynex-btn-success:hover {
  filter: brightness(1.05);
  color: #fff !important;
}

.ynex-btn-secondary {
  background: var(--yx-secondary) !important;
  color: #fff !important;
  border-color: var(--yx-secondary) !important;
}

@media (max-width: 767px) {
  .ynex-page-actions-wrap,
  .ynex-page-actions {
    width: 100%;
    justify-content: stretch;
  }
  .ynex-page-actions .ynex-btn-group {
    width: 100%;
  }
  .ynex-page-actions .ynex-btn-group .ynex-btn {
    flex: 1;
  }
  .ynex-page-actions > .ynex-btn {
    flex: 1 1 calc(50% - 0.55rem);
  }
}

/* ========== CARDS / SEGMENTS ========== */
.ui.segment,
.ui.segment.white {
  background: var(--yx-surface) !important;
  border: 1px solid var(--yx-border) !important;
  border-radius: var(--yx-radius) !important;
  box-shadow: var(--yx-shadow-card) !important;
  padding: 1.25rem !important;
}

.segment-header h3 {
  font-size: 1rem !important;
  font-weight: 600 !important;
  color: var(--yx-text) !important;
  margin: 0 0 1rem !important;
}

.ui.striped.table {
  border: none !important;
  box-shadow: none !important;
}

/* Ynex tables: horizontal rules only (kill Semantic .celled vertical lines) */
.ui.table,
.ui.celled.table,
.ui.striped.table,
.ui.compact.table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border: 1px solid #f3f3f3 !important;
  border-radius: 0.5rem !important;
  box-shadow: none !important;
  background: #fff !important;
  margin: 0 !important;
  font-family: var(--yx-font) !important;
}

.ui.celled.table tr td,
.ui.celled.table tr th,
.ui.table tr td,
.ui.table tr th {
  border-left: 0 !important;
  border-right: 0 !important;
}

.ui.table thead th,
.ui.celled.table thead th {
  background: #fff !important;
  color: #8c9097 !important;
  font-weight: 600 !important;
  font-size: 0.75rem !important;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid #f3f3f3 !important;
  border-top: 0 !important;
  padding: 0.9rem 1.15rem !important;
  white-space: nowrap !important;
}

.ui.table td,
.ui.celled.table td {
  border-top: 0 !important;
  border-bottom: 1px solid #f3f3f3 !important;
  color: #333335 !important;
  font-size: 0.8125rem !important;
  font-weight: 500 !important;
  padding: 0.95rem 1.15rem !important;
  vertical-align: middle !important;
}

.ui.table tbody tr:last-child td,
.ui.celled.table tbody tr:last-child td {
  border-bottom: 0 !important;
}

.ui.table tbody tr:hover,
.ui.celled.table tbody tr:hover {
  background: #fafbfd !important;
}

.ui.striped.table tbody tr:nth-child(2n),
.ui.celled.striped.table tbody tr:nth-child(2n) {
  background: transparent !important;
}

.ui.table tfoot th,
.ui.table tfoot td,
.ui.celled.table tfoot th,
.ui.celled.table tfoot td {
  background: #fff !important;
  border-top: 1px solid #f3f3f3 !important;
  border-bottom: 0 !important;
  border-left: 0 !important;
  border-right: 0 !important;
  color: #8c9097 !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  padding: 0.95rem 1.15rem !important;
}

.ui.table .ynex-empty,
.ui.table td.ynex-empty,
.ui.table td.center.aligned.text-center {
  text-align: center !important;
  color: #8c9097 !important;
  font-weight: 500 !important;
  font-size: 0.875rem !important;
  padding: 2.5rem 1rem !important;
  border-bottom: 0 !important;
}

/* Table card shell (matches webapp ynex-table-card) */
.ynex-table-card {
  width: 100%;
  background: #fff;
  border: 1px solid #f3f3f3;
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.03);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: var(--yx-font);
  color: #333335;
}

.ynex-table-card.ui.segment,
.ynex-table-card.ui.segment.white {
  padding: 0 !important;
  border: 1px solid #f3f3f3 !important;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.03) !important;
}

.ynex-table-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid #f3f3f3;
  background: #fff;
}

.ynex-table-card__title {
  margin: 0 !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  color: #333335 !important;
  position: relative;
  padding-inline-start: 0.7rem;
  font-family: var(--yx-font) !important;
  line-height: 1.3 !important;
}

.ynex-table-card__title::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0.15rem;
  bottom: 0.15rem;
  width: 0.2rem;
  border-radius: 999px;
  background: #845adf;
}

.ynex-table-card__tools {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.ynex-table-card__search {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 2.25rem;
  min-width: 11rem;
  padding: 0 0.75rem;
  border: 1px solid #e9edf6;
  border-radius: 0.35rem;
  background: #fff;
}

.ynex-table-card__search i {
  color: #8c9097;
  font-size: 1.05rem;
  margin: 0 !important;
}

.ynex-table-card__search input {
  border: 0 !important;
  outline: none !important;
  background: transparent !important;
  width: 100%;
  font-size: 0.78rem !important;
  font-family: var(--yx-font) !important;
  color: #333335 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

.ynex-table-card__search input::placeholder {
  color: #8c9097;
}

.ynex-table-card__btn {
  display: inline-flex !important;
  align-items: center;
  gap: 0.3rem;
  height: 2.25rem;
  padding: 0 0.9rem !important;
  border: 0 !important;
  border-radius: 0.35rem !important;
  background: #845adf !important;
  color: #fff !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  font-family: var(--yx-font) !important;
  cursor: pointer;
  box-shadow: 0 0.2rem 0.65rem rgba(132, 90, 223, 0.28) !important;
  text-decoration: none !important;
  white-space: nowrap;
  margin: 0 !important;
}

.ynex-table-card__btn:hover {
  background: #7349d6 !important;
  color: #fff !important;
}

.ynex-table-card__btn i {
  font-size: 0.9rem !important;
  margin: 0 0 0 0.15rem !important;
  color: #fff !important;
}

.ynex-table-card__body {
  width: 100%;
  overflow-x: auto;
  padding: 0;
}

.ynex-table-card__body > .ui.table,
.ynex-table-card__body > .ui.celled.table,
.ynex-table-card .ui.table {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.ynex-table-card .ynex-data-table thead th {
  background: #fff !important;
  color: #8c9097 !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  padding: 0.85rem 1.15rem !important;
  border-bottom: 1px solid #f3f3f3 !important;
}

.ynex-table-card .ynex-data-table tbody td {
  padding: 0.95rem 1.15rem !important;
  font-size: 0.8125rem !important;
  border-bottom: 1px solid #f3f3f3 !important;
}

.ynex-table-card .ynex-data-table tbody tr:last-child td {
  border-bottom: 0 !important;
}

.ynex-table-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.95rem 1.25rem 1.15rem;
  border-top: 1px solid #f3f3f3;
  background: #fff;
}

.ynex-table-card__meta {
  font-size: 0.75rem;
  color: #8c9097;
  font-weight: 500;
  font-family: var(--yx-font);
}

.ynex-table-card__footer .ynex-pagination-wrap {
  width: auto;
  margin: 0;
  justify-content: flex-end;
}

.ynex-table-card__footer .ui.pagination.menu,
.ynex-table-card__footer .ynex-pagination,
.ynex-table-card__footer .pagination {
  box-shadow: none !important;
  border: 0 !important;
  background: transparent !important;
  min-height: 0 !important;
  overflow: visible !important;
  gap: 0.35rem;
  border-radius: 0 !important;
}

.ynex-table-card__footer .ynex-pagination > .item,
.ynex-table-card__footer .ynex-pagination > a.item,
.ynex-table-card__footer .ynex-pagination > span.item {
  min-width: 2rem !important;
  height: 2rem !important;
  padding: 0 0.55rem !important;
  border: 0 !important;
  border-right: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: #536485 !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
}

.ynex-table-card__footer .ynex-pagination > a.item:hover {
  background: #f3f6f9 !important;
  color: #845adf !important;
}

.ynex-table-card__footer .ynex-pagination > .item.active,
.ynex-table-card__footer .ynex-pagination > a.item.active {
  background: #845adf !important;
  color: #fff !important;
  box-shadow: 0 0.15rem 0.5rem rgba(132, 90, 223, 0.3) !important;
}

.ynex-table-card__footer .ynex-pagination > .item.disabled,
.ynex-table-card__footer .ynex-pagination > span.item.disabled {
  opacity: 0.45;
  background: transparent !important;
  color: #8c9097 !important;
}

.ui.segment.white:has(> .ui.table),
.ui.segment.white:has(> .ui.celled.table) {
  padding: 0 !important;
  overflow: hidden;
}

.ui.segment.white > .ui.table,
.ui.segment.white > .ui.celled.table {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.ynex-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  height: 1.85rem;
  padding: 0 0.75rem;
  border-radius: 0.3rem;
  background: rgba(132, 90, 223, 0.1);
  color: #845adf !important;
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none !important;
  font-family: var(--yx-font);
  white-space: nowrap;
}

.ynex-action-link:hover {
  background: rgba(132, 90, 223, 0.16);
  color: #7349d6 !important;
}

.ynex-action-link--success {
  background: rgba(38, 191, 148, 0.12);
  color: #26bf94 !important;
}

.ynex-action-link--success:hover {
  background: rgba(38, 191, 148, 0.18);
  color: #1fa67f !important;
}

.ynex-empty {
  text-align: center !important;
  color: #8c9097 !important;
  font-weight: 500 !important;
  padding: 2.5rem 1rem !important;
}

.ynex-table-card .is-hidden,
.ynex-table-card [hidden] {
  display: none !important;
}

.ui.button.primary,
.ui.primary.button {
  background: var(--yx-primary) !important;
  border-radius: var(--yx-radius-sm) !important;
}

.ui.button {
  border-radius: var(--yx-radius-sm) !important;
  font-family: var(--yx-font) !important;
  font-weight: 500 !important;
}

/* ========== LEGACY WIDGET CARDS → YNEX ========== */
.widgets .card,
.widgets .box {
  border-radius: var(--yx-radius) !important;
  border: none !important;
  overflow: hidden;
  box-shadow: var(--yx-shadow-card) !important;
}

.widgets .box {
  padding: 1.15rem !important;
  text-align: left !important;
}

.widgets .box h1 {
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  margin: 0 0 0.25rem !important;
}

.widgets .box h6 {
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  opacity: 0.9;
  margin: 0 !important;
}

.bg-primary, .bg-info { background: linear-gradient(135deg, #845adf, #6b3fd4) !important; }
.bg-purple { background: linear-gradient(135deg, #e354d4, #c53db8) !important; }
.bg-success { background: linear-gradient(135deg, #26bf94, #1a9f7a) !important; }
.bg-danger { background: linear-gradient(135deg, #e6533c, #c93d28) !important; }
.bg-warning { background: linear-gradient(135deg, #f5b849, #d9982a) !important; }

/* ========== DASHBOARD HOME ========== */
.ynex-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ========== CRM DASHBOARD (match webapp) ========== */
.ynex-crm-welcome {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.ynex-crm-welcome-title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--yx-text);
  line-height: 1.35;
}

.ynex-crm-welcome-title span {
  font-weight: 700;
}

.ynex-crm-welcome-sub {
  margin: 0.25rem 0 0;
  color: var(--yx-text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
}

.ynex-crm-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.25rem;
}

.ynex-crm-target {
  grid-column: span 4;
  min-height: 11.5rem;
  border-radius: 0.5rem;
  padding: 1.35rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: #fff;
  background:
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.18), transparent 40%),
    linear-gradient(135deg, #845adf 0%, #6f42c1 100%);
  box-shadow: 0 0.35rem 1rem rgba(132, 90, 223, 0.28);
  overflow: hidden;
}

.ynex-crm-target-copy {
  max-width: 14rem;
  z-index: 1;
}

.ynex-crm-target-copy h2 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

.ynex-crm-target-copy p {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  line-height: 1.45;
  opacity: 0.92;
  color: #fff;
}

.ynex-crm-target-link {
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: underline;
}

.ynex-crm-target-ring {
  position: relative;
  width: 6.5rem;
  height: 6.5rem;
  flex-shrink: 0;
}

.ynex-crm-target-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ynex-crm-target-ring span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.ynex-crm-target-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 10;
}

.ynex-crm-target-progress {
  fill: none;
  stroke: #fff;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dasharray 0.4s ease;
}

.ynex-crm-stat {
  grid-column: span 4;
  background: #fff;
  border: 1px solid var(--yx-border);
  border-radius: 0.5rem;
  box-shadow: var(--yx-shadow);
  padding: 1.15rem 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 11.5rem;
}

.ynex-crm-stat-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.ynex-crm-stat-icon {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.ynex-crm-stat-icon.primary { background: rgba(var(--yx-primary-rgb), 0.12); color: var(--yx-primary); }
.ynex-crm-stat-icon.secondary { background: rgba(35, 183, 229, 0.12); color: var(--yx-secondary); }
.ynex-crm-stat-icon.success { background: rgba(38, 191, 148, 0.12); color: var(--yx-success); }
.ynex-crm-stat-icon.warning { background: rgba(245, 184, 73, 0.15); color: var(--yx-warning); }

.ynex-crm-stat-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--yx-text-muted);
}

.ynex-crm-stat-value {
  margin: 0.15rem 0 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--yx-text);
  line-height: 1.2;
}

.ynex-crm-spark {
  width: 100%;
  height: 2.25rem;
  color: var(--yx-primary);
  margin-top: auto;
}

.ynex-crm-stat.accent-secondary .ynex-crm-spark { color: var(--yx-secondary); }
.ynex-crm-stat.accent-success .ynex-crm-spark { color: var(--yx-success); }
.ynex-crm-stat.accent-warning .ynex-crm-spark { color: var(--yx-warning); }

.ynex-crm-stat-foot {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.ynex-crm-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.ynex-crm-trend.up { color: var(--yx-success); }
.ynex-crm-trend.down { color: var(--yx-danger); }

.ynex-crm-trend-label {
  font-size: 0.72rem;
  color: var(--yx-text-muted);
}

.ynex-crm-stat-link {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--yx-primary);
  text-decoration: none;
}

.ynex-crm-panel {
  background: #fff;
  border: 1px solid var(--yx-border);
  border-radius: 0.5rem;
  box-shadow: var(--yx-shadow);
  display: flex;
  flex-direction: column;
  min-height: 11.5rem;
}

.ynex-crm-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.1rem 1.2rem 0.35rem;
}

.ynex-crm-panel-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--yx-text);
}

.ynex-crm-panel-head p {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: var(--yx-text-muted);
}

.ynex-crm-panel-body {
  padding: 0.65rem 1.2rem 1.15rem;
  flex: 1;
}

.ynex-crm-donut {
  grid-column: span 4;
}

.ynex-crm-donut-chart {
  min-height: 160px;
}

.ynex-crm-activity-panel {
  grid-column: span 4;
}

.ynex-crm-activity {
  list-style: none;
  margin: 0;
  padding: 0.35rem 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ynex-crm-activity li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.ynex-crm-activity-avatar {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.ynex-crm-activity-avatar.primary { background: rgba(var(--yx-primary-rgb), 0.12); color: var(--yx-primary); }
.ynex-crm-activity-avatar.secondary { background: rgba(35, 183, 229, 0.12); color: var(--yx-secondary); }
.ynex-crm-activity-avatar.success { background: rgba(38, 191, 148, 0.12); color: var(--yx-success); }
.ynex-crm-activity-avatar.warning { background: rgba(245, 184, 73, 0.15); color: var(--yx-warning); }

.ynex-crm-activity-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ynex-crm-activity-meta strong {
  font-size: 0.8125rem;
  color: var(--yx-text);
}

.ynex-crm-activity-meta small {
  font-size: 0.7rem;
  color: var(--yx-text-muted);
}

.ynex-crm-activity-value {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--yx-text);
  white-space: nowrap;
}

.ynex-crm-chart-panel {
  grid-column: span 12;
}

.ynex-crm-table-card {
  margin-top: 0;
}

@media (max-width: 1199px) {
  .ynex-crm-target,
  .ynex-crm-stat,
  .ynex-crm-donut,
  .ynex-crm-activity-panel {
    grid-column: span 6;
  }
}

@media (max-width: 767px) {
  .ynex-crm-target,
  .ynex-crm-stat,
  .ynex-crm-donut,
  .ynex-crm-activity-panel,
  .ynex-crm-chart-panel {
    grid-column: span 12;
  }
}

.ynex-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
  width: 100%;
  align-items: stretch;
}

.ynex-dashboard-grid {
  display: grid;
  gap: 1.25rem;
  width: 100%;
  align-items: stretch;
}

.ynex-dashboard-grid-charts {
  grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr);
}

.ynex-dashboard-grid-bottom {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}

.ynex-dashboard .custom-card {
  background: var(--yx-surface);
  border: 1px solid var(--yx-border);
  border-radius: var(--yx-radius);
  box-shadow: var(--yx-shadow-card);
  height: 100%;
  min-height: 0;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.ynex-dashboard .custom-card:hover {
  box-shadow: 0 0.35rem 1.75rem rgba(var(--yx-primary-rgb), 0.1);
}

.ynex-dashboard-kpi {
  margin: 0 !important;
  height: 100%;
  overflow: hidden;
}

.ynex-dashboard-kpi.custom-card {
  padding: 0 !important;
}

.ynex-dashboard-kpi-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 1.25rem 1.35rem;
  min-height: 6rem;
  height: 100%;
  box-sizing: border-box;
}

.ynex-dashboard-kpi-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
}

.ynex-dashboard-kpi-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--yx-text-muted);
  margin: 0;
  line-height: 1.2;
}

.ynex-dashboard-kpi-value {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--yx-text);
  line-height: 1.15;
  word-break: break-word;
}

.ynex-dashboard-kpi-icon {
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.ynex-dashboard-kpi-icon.primary { background: rgba(var(--yx-primary-rgb), 0.12); color: var(--yx-primary); }
.ynex-dashboard-kpi-icon.secondary { background: rgba(35, 183, 229, 0.12); color: var(--yx-secondary); }
.ynex-dashboard-kpi-icon.success { background: rgba(38, 191, 148, 0.12); color: var(--yx-success); }
.ynex-dashboard-kpi-icon.warning { background: rgba(245, 184, 73, 0.15); color: var(--yx-warning); }
.ynex-dashboard-kpi-icon.danger { background: rgba(230, 83, 60, 0.12); color: var(--yx-danger); }

/* Panels */
.ynex-dashboard-panel {
  display: flex;
  flex-direction: column;
}

.ynex-dashboard-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.15rem 1.25rem 0.35rem;
}

.ynex-dashboard-panel-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--yx-text);
}

.ynex-dashboard-panel-sub {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: var(--yx-text-muted);
}

.ynex-dashboard-panel-body {
  padding: 0.75rem 1.25rem 1.25rem;
  flex: 1;
}

.ynex-dashboard-panel-body.p-0 {
  padding: 0.5rem 0 0 !important;
}

.ynex-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  border-radius: 0.4rem;
  background: rgba(var(--yx-primary-rgb), 0.08);
  color: var(--yx-primary);
  font-size: 0.72rem;
  font-weight: 600;
}

.ynex-chart {
  min-height: 220px;
}

.ynex-chart.tall {
  min-height: 300px;
}

.ynex-dashboard-legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
}

.ynex-dashboard-legend-item {
  flex: 1;
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.65rem 0.75rem;
  border-radius: var(--yx-radius-sm);
  background: #f8f9fb;
}

.ynex-dashboard-legend-item .dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  margin-top: 0.3rem;
  flex-shrink: 0;
}

.ynex-dashboard-legend-item .dot.success { background: var(--yx-success); }
.ynex-dashboard-legend-item .dot.danger { background: var(--yx-danger); }

.ynex-dashboard-legend-item .lbl {
  display: block;
  font-size: 0.7rem;
  color: var(--yx-text-muted);
}

.ynex-dashboard-legend-item strong {
  font-size: 0.85rem;
  color: var(--yx-text);
}

/* Overview summary list */
.ynex-dashboard-summary {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ynex-dashboard-summary li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.35rem;
  border-bottom: 1px solid var(--yx-border);
}

.ynex-dashboard-summary li:last-child {
  border-bottom: none;
}

.summary-icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.summary-icon.primary { background: rgba(var(--yx-primary-rgb), 0.12); color: var(--yx-primary); }
.summary-icon.secondary { background: rgba(35, 183, 229, 0.12); color: var(--yx-secondary); }
.summary-icon.success { background: rgba(38, 191, 148, 0.12); color: var(--yx-success); }
.summary-icon.warning { background: rgba(245, 184, 73, 0.15); color: var(--yx-warning); }

.summary-meta {
  flex: 1;
  min-width: 0;
}

.summary-meta strong {
  display: block;
  font-size: 0.8125rem;
  color: var(--yx-text);
}

.summary-value {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--yx-text);
  white-space: nowrap;
}

/* Dashboard table extras */
.ynex-table-wrap {
  overflow-x: auto;
}

.ynex-table {
  width: 100%;
  border-collapse: collapse;
}

.ynex-dashboard-table th {
  text-align: left;
  padding: 0.85rem 1.15rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--yx-text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--yx-border);
  background: #fafbff;
  white-space: nowrap;
}

.ynex-dashboard-table td {
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--yx-border);
  font-size: 0.8125rem;
  color: var(--yx-text);
  vertical-align: middle;
}

.ynex-dashboard-table tr:last-child td {
  border-bottom: none;
}

.ynex-dashboard-table tr:hover td {
  background: rgba(var(--yx-primary-rgb), 0.03);
}

.ynex-ref {
  font-weight: 600;
  color: var(--yx-primary);
}

.ynex-user-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.ynex-user-avatar {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  --yx-avatar-bg: rgba(var(--yx-primary-rgb), 0.12);
  --yx-avatar-fg: var(--yx-primary);
  background: var(--yx-avatar-bg);
  color: var(--yx-avatar-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  flex-shrink: 0;
}

.ynex-user-avatar.tone-primary { --yx-avatar-bg: rgba(var(--yx-primary-rgb), 0.12); --yx-avatar-fg: var(--yx-primary); }
.ynex-user-avatar.tone-secondary { --yx-avatar-bg: rgba(35, 183, 229, 0.14); --yx-avatar-fg: var(--yx-secondary); }
.ynex-user-avatar.tone-success { --yx-avatar-bg: rgba(38, 191, 148, 0.14); --yx-avatar-fg: var(--yx-success); }
.ynex-user-avatar.tone-info { --yx-avatar-bg: rgba(73, 182, 245, 0.16); --yx-avatar-fg: var(--yx-info); }
.ynex-user-avatar.tone-warning { --yx-avatar-bg: rgba(245, 184, 73, 0.18); --yx-avatar-fg: #d49a1f; }
.ynex-user-avatar.tone-danger { --yx-avatar-bg: rgba(230, 83, 60, 0.14); --yx-avatar-fg: var(--yx-danger); }
.ynex-user-avatar.tone-orange { --yx-avatar-bg: rgba(255, 93, 31, 0.14); --yx-avatar-fg: var(--yx-orange); }
.ynex-user-avatar.tone-teal { --yx-avatar-bg: rgba(12, 163, 224, 0.14); --yx-avatar-fg: var(--yx-teal); }
.ynex-user-avatar.tone-pink { --yx-avatar-bg: rgba(227, 84, 212, 0.14); --yx-avatar-fg: var(--yx-pink); }

/* Ynex soft initials avatars (CRM-style) */
.text-avatar,
.ynex-avatar {
  --yx-avatar-bg: rgba(var(--yx-primary-rgb), 0.12);
  --yx-avatar-fg: var(--yx-primary);
  background: var(--yx-avatar-bg) !important;
  color: var(--yx-avatar-fg) !important;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: var(--yx-font) !important;
  font-size: 1.55rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em;
  line-height: 1 !important;
  text-transform: uppercase;
  padding: 0 !important;
  margin: 0 auto;
  box-shadow: none !important;
  border: 0 !important;
  overflow: hidden;
  flex-shrink: 0;
  -webkit-font-smoothing: antialiased;
}

.text-avatar.small,
.text-avatar.w-h-70,
.ynex-avatar.small {
  width: 4.375rem !important;
  height: 4.375rem !important;
  font-size: 1.25rem !important;
}

.text-avatar.tone-primary,
.ynex-avatar.tone-primary,
.ynex-header-avatar-fallback.tone-primary {
  --yx-avatar-bg: rgba(var(--yx-primary-rgb), 0.12);
  --yx-avatar-fg: var(--yx-primary);
}
.text-avatar.tone-secondary,
.ynex-avatar.tone-secondary,
.ynex-header-avatar-fallback.tone-secondary {
  --yx-avatar-bg: rgba(35, 183, 229, 0.14);
  --yx-avatar-fg: var(--yx-secondary);
}
.text-avatar.tone-success,
.ynex-avatar.tone-success,
.ynex-header-avatar-fallback.tone-success {
  --yx-avatar-bg: rgba(38, 191, 148, 0.14);
  --yx-avatar-fg: var(--yx-success);
}
.text-avatar.tone-info,
.ynex-avatar.tone-info,
.ynex-header-avatar-fallback.tone-info {
  --yx-avatar-bg: rgba(73, 182, 245, 0.16);
  --yx-avatar-fg: var(--yx-info);
}
.text-avatar.tone-warning,
.ynex-avatar.tone-warning,
.ynex-header-avatar-fallback.tone-warning {
  --yx-avatar-bg: rgba(245, 184, 73, 0.18);
  --yx-avatar-fg: #d49a1f;
}
.text-avatar.tone-danger,
.ynex-avatar.tone-danger,
.ynex-header-avatar-fallback.tone-danger {
  --yx-avatar-bg: rgba(230, 83, 60, 0.14);
  --yx-avatar-fg: var(--yx-danger);
}
.text-avatar.tone-orange,
.ynex-avatar.tone-orange,
.ynex-header-avatar-fallback.tone-orange {
  --yx-avatar-bg: rgba(255, 93, 31, 0.14);
  --yx-avatar-fg: var(--yx-orange);
}
.text-avatar.tone-teal,
.ynex-avatar.tone-teal,
.ynex-header-avatar-fallback.tone-teal {
  --yx-avatar-bg: rgba(12, 163, 224, 0.14);
  --yx-avatar-fg: var(--yx-teal);
}
.text-avatar.tone-pink,
.ynex-avatar.tone-pink,
.ynex-header-avatar-fallback.tone-pink {
  --yx-avatar-bg: rgba(227, 84, 212, 0.14);
  --yx-avatar-fg: var(--yx-pink);
}

.user-profile .text-avatar {
  margin-top: 2rem;
}

.ynex-icon-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 0.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--yx-text-muted);
  background: #f5f6fa;
  text-decoration: none;
  font-size: 1.05rem;
}

.ynex-icon-btn:hover {
  color: var(--yx-primary);
  background: rgba(var(--yx-primary-rgb), 0.1);
}

.ynex-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.65rem;
  border-radius: 2rem;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.ynex-badge.paid,
.ynex-badge--success { background: rgba(38, 191, 148, 0.12); color: var(--yx-success); }
.ynex-badge.partial { background: rgba(245, 184, 73, 0.15); color: #c9891a; }
.ynex-badge.unpaid,
.ynex-badge--danger { background: rgba(230, 83, 60, 0.12); color: var(--yx-danger); }
.ynex-badge.free { background: rgba(73, 182, 245, 0.15); color: var(--yx-info); }

.ynex-link {
  color: var(--yx-primary);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  padding: 1.15rem 1.25rem 0 0;
}

.ynex-link:hover {
  text-decoration: underline;
}

.ynex-empty {
  text-align: center !important;
  color: #8c9097 !important;
  font-weight: 500 !important;
  padding: 2.5rem 1rem !important;
}

/* Morris chart polish */
.ynex-dashboard svg text {
  font-family: var(--yx-font) !important;
}

@media (max-width: 1199px) {
  .ynex-dashboard-grid-charts,
  .ynex-dashboard-grid-bottom {
    grid-template-columns: 1fr;
  }
  .ynex-dashboard-kpi-value {
    font-size: 1.4rem;
  }
}

/* Keep 4 KPIs in one row on typical laptop widths; stack at tablet */
@media (max-width: 991px) {
  .ynex-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575px) {
  .ynex-kpi-grid {
    grid-template-columns: 1fr;
  }
  .ynex-dashboard-kpi-body {
    min-height: 5.5rem;
    padding: 1.15rem 1.2rem;
  }
}

@media (max-width: 767px) {
  .ynex-dashboard {
    gap: 1rem;
  }
  .ynex-chart.tall {
    min-height: 240px;
  }
}

/* Legacy modern-dashboard dual shell (disabled) */
body.dashboard-modern-active header,
body.dashboard-modern-active aside.aside-menu {
  display: none !important;
}

body:not(.dashboard-modern-active) .dashboard-modern-shell {
  display: none;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1199px) {
  .ynex-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ynex-panel-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 991px) {
  aside.aside-menu {
    transform: translateX(-105%);
    pointer-events: none;
  }
  aside.aside-menu.show {
    transform: translateX(0);
    pointer-events: auto;
    box-shadow: 0 0 2rem rgba(0, 0, 0, 0.18) !important;
  }
  .ynex-header {
    left: 0 !important;
    width: 100% !important;
  }
  .page-content {
    margin-left: 0 !important;
  }
  .ynex-header-brand {
    display: inline-flex;
  }

  /* Backdrop only on mobile drawer */
  body.ynex-sidebar-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1035;
  }

  body.ynex-sidebar-collapsed aside.aside-menu {
    transform: translateX(-105%);
  }
}

@media (max-width: 575px) {
  .ynex-stat-grid {
    grid-template-columns: 1fr;
  }
  .page-content {
    padding: 1rem !important;
  }
  .ynex-header-username {
    display: none;
  }
}

/* ========== FORMS (Ynex radius / inputs) ========== */
.ui.form .field > label,
.ui.form .fields .field > label {
  color: var(--yx-text) !important;
  font-weight: 600 !important;
  font-size: 0.78rem !important;
  margin-bottom: 0.45rem !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.ui.form input[type="text"],
.ui.form input[type="email"],
.ui.form input[type="password"],
.ui.form input[type="number"],
.ui.form input[type="tel"],
.ui.form input[type="url"],
.ui.form input[type="search"],
.ui.form input[type="date"],
.ui.form textarea,
.ui.form select,
.ui.input > input {
  border-radius: var(--yx-radius-sm) !important;
  border: 1px solid #e9edf6 !important;
  background: #fff !important;
  min-height: 2.55rem !important;
  height: 2.55rem !important;
  padding: 0.55rem 0.9rem !important;
  line-height: 1.35 !important;
  font-size: 0.85rem !important;
  font-family: var(--yx-font) !important;
  color: var(--yx-text) !important;
  box-shadow: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ui.form textarea {
  height: auto !important;
  min-height: 6rem !important;
}

/* Semantic selection dropdowns — fix clipped text */
.ui.selection.dropdown,
.ui.form .ui.selection.dropdown,
.ui.fluid.dropdown.selection {
  border-radius: var(--yx-radius-sm) !important;
  border: 1px solid #e9edf6 !important;
  background: #fff !important;
  min-height: 2.55rem !important;
  height: 2.55rem !important;
  padding: 0 2.4rem 0 0.9rem !important;
  display: inline-flex !important;
  align-items: center !important;
  line-height: 1.35 !important;
  font-size: 0.85rem !important;
  font-family: var(--yx-font) !important;
  color: var(--yx-text) !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.ui.selection.dropdown > .text,
.ui.selection.dropdown > .default.text {
  display: block !important;
  max-width: 100%;
  line-height: 1.35 !important;
  font-size: 0.85rem !important;
  color: var(--yx-text) !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  margin: 0 !important;
  padding: 0 !important;
}

.ui.selection.dropdown > .default.text {
  color: #8c9097 !important;
}

.ui.selection.dropdown > .dropdown.icon {
  top: 50% !important;
  transform: translateY(-50%) !important;
  right: 0.85rem !important;
  margin: 0 !important;
  padding: 0 !important;
  height: auto !important;
  line-height: 1 !important;
  color: #8c9097 !important;
}

.ui.selection.dropdown .menu {
  border-radius: var(--yx-radius-sm) !important;
  border-color: #e9edf6 !important;
  box-shadow: 0 0.65rem 1.75rem rgba(17, 28, 67, 0.12) !important;
  margin-top: 0.25rem !important;
}

.ui.selection.dropdown .menu > .item {
  font-size: 0.85rem !important;
  padding: 0.7rem 0.95rem !important;
  line-height: 1.35 !important;
  white-space: normal !important;
}

.ui.form input:focus,
.ui.form textarea:focus,
.ui.form select:focus,
.ui.input > input:focus,
.ui.selection.dropdown:focus,
.ui.selection.dropdown.active,
.ui.dropdown.active {
  border-color: rgba(var(--yx-primary-rgb), 0.55) !important;
  box-shadow: 0 0 0 0.2rem rgba(var(--yx-primary-rgb), 0.12) !important;
}

.ui.form .field.error input,
.ui.form .field.error textarea,
.ui.form .field.error .dropdown {
  border-color: var(--yx-danger) !important;
}

/* Filter panels above tables */
.ynex-filter-bar,
.ui.segment.white.ynex-filter-bar,
#clientFilter.ui.segment,
#policyFilter.ui.segment {
  background: #fff !important;
  border: 1px solid #f3f3f3 !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.03) !important;
  padding: 1.1rem 1.25rem !important;
  margin: 0 0 1rem !important;
}

.ynex-filter-bar .ui.form,
#clientFilter .ui.form,
#policyFilter .ui.form {
  margin: 0 !important;
}

.ynex-filter-bar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.85rem 1rem;
}

.ynex-filter-bar__field {
  flex: 1 1 14rem;
  min-width: 12rem;
  max-width: 22rem;
  margin: 0 !important;
}

.ynex-filter-bar__field.field > label {
  display: block;
  margin-bottom: 0.4rem !important;
  color: #536485 !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  text-transform: none !important;
}

.ynex-filter-bar__actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 0 0 auto;
  margin: 0 !important;
  padding-bottom: 0 !important;
}

.ynex-filter-bar__actions .m-t-25 {
  margin-top: 0 !important;
}

.ynex-filter-bar .ynex-btn,
.ynex-filter-bar .ui.button,
#clientFilter .ynex-btn,
#clientFilter .ui.button,
#policyFilter .ynex-btn,
#policyFilter .ui.button {
  height: 2.55rem !important;
  min-height: 2.55rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.4rem;
  margin: 0 !important;
  padding: 0 1.05rem !important;
  border-radius: 0.35rem !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  position: relative !important;
}

/* Kill Semantic labeled-icon absolute icon (causes overlap with flex) */
.ynex-filter-bar .ui.labeled.icon.button,
#clientFilter .ui.labeled.icon.button,
#policyFilter .ui.labeled.icon.button {
  padding-left: 1.05rem !important;
  padding-right: 1.05rem !important;
}

.ynex-filter-bar .ui.labeled.icon.button > .icon,
#clientFilter .ui.labeled.icon.button > .icon,
#policyFilter .ui.labeled.icon.button > .icon {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  line-height: 1 !important;
  font-size: 0.95rem !important;
  opacity: 1 !important;
  color: inherit !important;
}

.ynex-filter-bar .ui.black.button,
#clientFilter .ui.black.button,
#policyFilter .ui.black.button,
.ynex-filter-bar .ynex-btn-primary {
  background: #845adf !important;
  color: #fff !important;
  box-shadow: 0 0.2rem 0.65rem rgba(132, 90, 223, 0.28) !important;
  border: 0 !important;
}

.ynex-filter-bar .ui.black.button:hover,
#clientFilter .ui.black.button:hover,
#policyFilter .ui.black.button:hover,
.ynex-filter-bar .ynex-btn-primary:hover {
  background: #7349d6 !important;
  color: #fff !important;
}

/* Labeled inputs (currency / calendar) inside filter bars */
.ynex-filter-bar .ui.labeled.input,
#policyFilter .ui.labeled.input {
  width: 100%;
}

.ynex-filter-bar .ui.labeled.input > .ui.label,
#policyFilter .ui.labeled.input > .ui.label {
  height: 2.55rem !important;
  display: inline-flex !important;
  align-items: center !important;
  border-radius: var(--yx-radius-sm) 0 0 var(--yx-radius-sm) !important;
  border: 1px solid #e9edf6 !important;
  border-right: 0 !important;
  background: #f8f9fc !important;
  color: #536485 !important;
  margin: 0 !important;
  padding: 0 0.75rem !important;
}

.ynex-filter-bar .ui.labeled.input > input,
#policyFilter .ui.labeled.input > input {
  border-radius: 0 var(--yx-radius-sm) var(--yx-radius-sm) 0 !important;
}

/* ========== BUTTONS ========== */
.ui.button,
.ui.buttons .button {
  border-radius: var(--yx-radius-sm) !important;
  font-family: var(--yx-font) !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
}

.ui.primary.button,
.ui.button.primary {
  background: var(--yx-primary) !important;
  box-shadow: 0 0.15rem 0.65rem rgba(var(--yx-primary-rgb), 0.28) !important;
}

.ui.primary.button:hover,
.ui.button.primary:hover {
  background: #7143d8 !important;
}

.ui.basic.button {
  border-radius: var(--yx-radius-sm) !important;
  box-shadow: 0 0 0 1px #e9edf6 inset !important;
}

.ui.green.button { background: var(--yx-success) !important; }
.ui.red.button { background: var(--yx-danger) !important; }
.ui.orange.button,
.ui.yellow.button { background: var(--yx-warning) !important; color: #fff !important; }
.ui.teal.button,
.ui.blue.button { background: var(--yx-secondary) !important; }

/* Soft action buttons (Send Text / Send Email) */
.ui.button.primarish,
.right-bar-profile .ui.button.primarish {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.45rem !important;
  width: calc(100% - 2.5rem) !important;
  max-width: 16rem !important;
  margin: 0 auto 0.55rem !important;
  padding: 0.72rem 1rem !important;
  background: rgba(132, 90, 223, 0.12) !important;
  color: #5b35c5 !important;
  border: 1px solid rgba(132, 90, 223, 0.18) !important;
  box-shadow: none !important;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
  line-height: 1.2 !important;
}

.ui.button.primarish .icon,
.right-bar-profile .ui.button.primarish .icon {
  margin: 0 !important;
  opacity: 1 !important;
  color: inherit !important;
}

.ui.button.primarish:hover,
.right-bar-profile .ui.button.primarish:hover {
  background: rgba(132, 90, 223, 0.18) !important;
  color: #4c28b8 !important;
}

.ui.button.primarish:disabled,
.ui.button.primarish.disabled,
.right-bar-profile .ui.button.primarish:disabled,
.right-bar-profile .ui.button.primarish.disabled {
  opacity: 1 !important;
  background: #f3f4f8 !important;
  color: #6b7280 !important;
  border-color: #e5e7eb !important;
  cursor: not-allowed !important;
}

.right-bar-profile .user-profile .m-t-25 {
  margin-top: 1.1rem !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.right-bar-profile .edit-profile-btn.ui.button,
.right-bar-profile .circular.ui.icon.button.edit-profile-btn {
  width: 2.15rem !important;
  height: 2.15rem !important;
  padding: 0 !important;
  border-radius: 0.45rem !important;
  background: #f3f4f8 !important;
  color: #6b7280 !important;
  box-shadow: none !important;
  right: 1rem !important;
  top: 1rem !important;
}

.right-bar-profile .edit-profile-btn.ui.button:hover,
.right-bar-profile .circular.ui.icon.button.edit-profile-btn:hover {
  background: rgba(132, 90, 223, 0.12) !important;
  color: #845adf !important;
}

.right-bar-profile .user-profile h3 {
  padding: 0 1rem;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
  max-width: 100%;
}

.right-bar-profile .user-profile > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0 1rem;
  white-space: normal;
  max-width: 100%;
}

/* Detail fields: prevent long emails overlapping neighbors */
.policy-details .row > [class*="col-"],
.user-contact > div {
  min-width: 0;
  overflow: hidden;
}

.policy-details p,
.user-contact p,
.ynex-break-text {
  margin: 0.2rem 0 0 !important;
  color: #333335 !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  line-height: 1.35 !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  white-space: normal !important;
  max-width: 100%;
}

.policy-details span:not(.ui.label):not(.ynex-policy-type):not(.ynex-badge),
.user-contact span {
  color: #8c9097 !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  margin-bottom: 0.15rem;
}

.ynex-policy-type-wrap {
  text-align: right;
  min-width: 0;
}

.ynex-policy-type {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem !important;
  border-radius: 999px !important;
  background: rgba(35, 183, 229, 0.14) !important;
  color: #0b91b8 !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  white-space: nowrap;
  margin: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
}

.segment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.segment-header .ui.dropdown.button,
.segment-header .ui.button.successish {
  margin: 0 !important;
  float: none !important;
}

.ynex-policy-type::before,
.ynex-policy-type::after {
  display: none !important;
  content: none !important;
}

.ynex-policy-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-top: 0.55rem;
}

.ynex-policy-tags .ui.tag.label,
.policy-details .ui.tag.label {
  margin: 0 !important;
  border-radius: 0.35rem !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  padding: 0.45rem 0.75rem 0.45rem 1.1rem !important;
}

.policy-details .row {
  margin-bottom: 1.15rem !important;
}

.right-bar-profile .ui.button.positive {
  background: rgba(38, 191, 148, 0.14) !important;
  color: #1a9f78 !important;
  border: 1px solid rgba(38, 191, 148, 0.2) !important;
  box-shadow: none !important;
  font-weight: 600 !important;
}

.right-bar-profile .ui.button.positive:hover {
  background: rgba(38, 191, 148, 0.22) !important;
  color: #158a68 !important;
}

/* ========== TABLES / TRANSACTIONS LISTS ========== */
.ui.table thead th {
  background: #fff !important;
  padding: 0.9rem 1.15rem !important;
}

.ui.table td {
  padding: 0.95rem 1.15rem !important;
}

.ui.table tbody tr:hover {
  background: #fafbfd !important;
}

.ui.label,
.ui.labels .label {
  border-radius: 2rem !important;
  font-weight: 600 !important;
}

.ui.green.label { background: rgba(38, 191, 148, 0.12) !important; color: var(--yx-success) !important; border: none !important; }
.ui.red.label { background: rgba(230, 83, 60, 0.12) !important; color: var(--yx-danger) !important; border: none !important; }
.ui.orange.label,
.ui.yellow.label { background: rgba(245, 184, 73, 0.15) !important; color: #c9891a !important; border: none !important; }
.ui.blue.label,
.ui.teal.label { background: rgba(35, 183, 229, 0.12) !important; color: var(--yx-secondary) !important; border: none !important; }
.ui.purple.label { background: rgba(var(--yx-primary-rgb), 0.12) !important; color: var(--yx-primary) !important; border: none !important; }

/* ========== MODALS / DROPDOWNS / CARDS ========== */
.ui.modal {
  border-radius: var(--yx-radius) !important;
  box-shadow: 0 0.75rem 2rem rgba(15, 23, 42, 0.18) !important;
  overflow: hidden;
}

.ui.modal > .header {
  background: #fff !important;
  border-bottom: 1px solid var(--yx-border) !important;
  font-family: var(--yx-font) !important;
  font-weight: 700 !important;
  color: var(--yx-text) !important;
  border-radius: 0 !important;
}

.ui.modal > .actions {
  background: #fafbff !important;
  border-top: 1px solid var(--yx-border) !important;
}

.ui.dropdown .menu {
  border-radius: 0.55rem !important;
  border: 1px solid var(--yx-border) !important;
  box-shadow: 0 0.65rem 1.75rem rgba(17, 28, 67, 0.12) !important;
  font-family: var(--yx-font) !important;
  padding: 0.4rem 0 !important;
  overflow: hidden !important;
}

.ui.dropdown .menu > .item {
  font-family: var(--yx-font) !important;
  font-size: 0.875rem !important;
  color: var(--yx-text) !important;
}

.ui.dropdown .menu > .item:hover {
  background: #f8f9fb !important;
  color: var(--yx-primary) !important;
}

/* Header dropdowns: kill Semantic nowrap + legacy zero padding that clip icons/text */
.ynex-header .ui.dropdown > .menu.ynex-notif > *,
.ynex-header .ui.dropdown > .menu.ynex-user-menu > * {
  white-space: normal !important;
}

.ynex-header .ui.dropdown > .menu.ynex-notif > .item,
.ynex-header .ui.dropdown > .menu.ynex-user-menu > .item,
.ynex-header .ui.dropdown > .menu.ynex-user-menu > a.item {
  min-width: 0 !important;
}

.ynex-header .ui.dropdown > .menu.ynex-user-menu > a.item.ynex-user-menu__link {
  padding: 0.8rem 1.25rem !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  white-space: nowrap !important;
}

.ynex-header .ui.dropdown > .menu.ynex-notif > .item.ynex-notif__empty {
  padding: 2rem 1.5rem 2.15rem !important;
  white-space: normal !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  overflow: visible !important;
}

.ynex-header .ui.dropdown > .menu.ynex-notif > .item.ynex-notif__empty > .ynex-notif__empty-icon {
  width: 3.25rem !important;
  min-width: 3.25rem !important;
  max-width: 3.25rem !important;
  height: 3.25rem !important;
  flex: 0 0 3.25rem !important;
}

.ynex-header .ui.dropdown > .menu.ynex-notif > .item.ynex-notif__empty > span:not(.ynex-notif__empty-icon) {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  max-width: 100% !important;
}

.ui.pointing.dropdown > .menu::before,
.ui.pointing.dropdown > .menu::after {
  display: none !important;
}

.ui.card,
.ui.cards > .card {
  border-radius: var(--yx-radius) !important;
  box-shadow: var(--yx-shadow-card) !important;
  border: 1px solid var(--yx-border) !important;
}

.ui.message {
  border-radius: var(--yx-radius-sm) !important;
  box-shadow: none !important;
}

.ui.menu,
.ui.tabular.menu .item {
  border-radius: var(--yx-radius-sm) !important;
}

.ui.pagination.menu,
.ynex-pagination {
  box-shadow: none !important;
  border: 1px solid var(--yx-border) !important;
  border-radius: var(--yx-radius-sm) !important;
  overflow: hidden;
  display: inline-flex !important;
  flex-wrap: wrap;
  align-items: stretch;
  margin: 0 !important;
  background: var(--yx-surface) !important;
  min-height: 2.35rem;
}

.ynex-pagination-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 1.25rem 0 0.25rem;
}

.ui.pagination.menu > .item,
.ynex-pagination > .item,
.ynex-pagination > a.item,
.ynex-pagination > span.item {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  height: 2.35rem;
  padding: 0 0.75rem !important;
  margin: 0 !important;
  border: 0 !important;
  border-right: 1px solid var(--yx-border) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--yx-text) !important;
  font-family: var(--yx-font) !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  float: none !important;
}

.ui.pagination.menu > .item:last-child,
.ynex-pagination > .item:last-child {
  border-right: 0 !important;
}

.ui.pagination.menu > .item:hover,
.ynex-pagination > a.item:hover {
  background: rgba(var(--yx-primary-rgb), 0.08) !important;
  color: var(--yx-primary) !important;
}

.ui.pagination.menu .item.active,
.ynex-pagination > .item.active,
.ynex-pagination > a.item.active {
  background: var(--yx-primary) !important;
  color: #fff !important;
}

.ui.pagination.menu .item.disabled,
.ynex-pagination > .item.disabled,
.ynex-pagination > span.item.disabled {
  opacity: 0.45;
  pointer-events: none;
  color: var(--yx-text-muted) !important;
  background: var(--yx-body) !important;
}

/* Legacy Bootstrap-style ul.pagination fallback */
ul.pagination {
  list-style: none !important;
  display: inline-flex !important;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid var(--yx-border);
  border-radius: var(--yx-radius-sm);
  overflow: hidden;
  background: var(--yx-surface);
}

ul.pagination > li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  display: inline-flex !important;
}

ul.pagination > li > a,
ul.pagination > li > span {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  height: 2.35rem;
  padding: 0 0.75rem;
  border-right: 1px solid var(--yx-border);
  color: var(--yx-text);
  font-weight: 600;
  font-size: 0.8125rem;
  text-decoration: none !important;
  background: transparent;
}

ul.pagination > li:last-child > a,
ul.pagination > li:last-child > span {
  border-right: 0;
}

ul.pagination > li.active > a,
ul.pagination > li.active > span {
  background: var(--yx-primary) !important;
  color: #fff !important;
}

ul.pagination > li.disabled > a,
ul.pagination > li.disabled > span {
  opacity: 0.45;
  pointer-events: none;
}

/* Filter bars / action toolbars */
.page-title .ui.button,
.action-buttons .ui.button {
  border-radius: var(--yx-radius-sm) !important;
}

.ui.segment .ui.form,
.ui.segment .ui.table {
  margin-top: 0.25rem;
}

/* Payments / transaction-like rows */
.ui.divided.list > .item,
.ui.relaxed.list > .item {
  padding: 0.85rem 0 !important;
}

.ui.statistic > .value,
.ui.statistics .statistic > .value {
  font-family: var(--yx-font) !important;
  color: var(--yx-text) !important;
}

/* Search boxes */
.ui.search .prompt,
.ui.icon.input > input {
  border-radius: var(--yx-radius-sm) !important;
}

/* Progress / switchery soft edges */
.ui.progress {
  border-radius: 2rem !important;
  overflow: hidden;
}

.ui.progress .bar {
  border-radius: 2rem !important;
  background: var(--yx-primary) !important;
}

/* ========== AUTH / LOGIN (Ynex) ========== */
html:has(body.ynex-auth),
body.ynex-auth {
  height: 100% !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

body.ynex-auth {
  min-height: 100vh !important;
  min-height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  padding-top: 0 !important;
  background: var(--yx-body) !important;
  font-family: var(--yx-font) !important;
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
}

body.ynex-auth .ynex-auth-shell {
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(320px, 1fr);
  height: 100% !important;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden !important;
}

body.ynex-auth .ynex-auth-aside {
  position: relative;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.18), transparent 45%),
    linear-gradient(145deg, #845adf 0%, #5b35c5 48%, #23b7e5 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  overflow: hidden !important;
  height: 100%;
  min-height: 0;
}

body.ynex-auth .ynex-auth-aside::after {
  content: '';
  position: absolute;
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  bottom: -6rem;
  right: -4rem;
}

body.ynex-auth .ynex-auth-aside-inner {
  position: relative;
  z-index: 1;
  max-width: 26rem;
}

body.ynex-auth .ynex-auth-aside-logo {
  max-height: 2.75rem;
  width: auto;
  margin-bottom: 1.75rem;
  filter: brightness(0) invert(1);
}

body.ynex-auth .ynex-auth-aside h2 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.85rem;
  color: #fff;
}

body.ynex-auth .ynex-auth-aside p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
}

body.ynex-auth .ynex-auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: var(--yx-body);
  height: 100%;
  min-height: 0;
  overflow: hidden !important;
}

body.ynex-auth .auth-card,
body.ynex-auth .ynex-auth-card {
  width: 100%;
  max-width: 28rem;
  max-height: calc(100vh - 2.5rem);
  max-height: calc(100dvh - 2.5rem);
  margin: 0 auto !important;
  background: #fff !important;
  border: 1px solid var(--yx-border) !important;
  border-radius: var(--yx-radius) !important;
  box-shadow: var(--yx-shadow-card) !important;
  padding: 2rem 1.75rem 1.5rem !important;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

body.ynex-auth .auth-branding {
  text-align: center;
  margin-bottom: 1.25rem;
}

body.ynex-auth .auth-branding img {
  max-height: 2.5rem !important;
  width: auto !important;
}

body.ynex-auth .auth-card h3 {
  font-family: var(--yx-font) !important;
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  color: var(--yx-text) !important;
  margin: 0 0 0.35rem !important;
  text-align: left !important;
}

body.ynex-auth .auth-card > .sign-in > p,
body.ynex-auth .auth-card > .sign-up > p,
body.ynex-auth .auth-card > .forgot-password > p,
body.ynex-auth .auth-card > .reset > p,
body.ynex-auth .auth-card > .activate > p {
  color: var(--yx-text-muted) !important;
  font-size: 0.85rem !important;
  margin: 0 0 1.25rem !important;
  text-align: left !important;
}

body.ynex-auth .auth-card form + p,
body.ynex-auth .auth-card .sign-in > p:last-child,
body.ynex-auth .auth-card .sign-up > p:last-child {
  text-align: center !important;
  margin-top: 1rem !important;
  color: var(--yx-text-muted) !important;
}

body.ynex-auth .auth-card a,
body.ynex-auth .auth-action,
body.ynex-auth .text-primary {
  color: var(--yx-primary) !important;
  font-weight: 600;
}

body.ynex-auth .ui.form .field {
  margin-bottom: 1rem !important;
}

body.ynex-auth .ui.button.fluid.primary,
body.ynex-auth .ynex-auth-submit,
body.ynex-auth .ui.button.fluid.positive {
  background: var(--yx-primary) !important;
  color: #fff !important;
  border-radius: var(--yx-radius-sm) !important;
  height: 2.65rem;
  font-weight: 600 !important;
  box-shadow: 0 0.2rem 0.75rem rgba(var(--yx-primary-rgb), 0.3) !important;
}

body.ynex-auth .ui.toggle.checkbox label {
  color: var(--yx-text-muted) !important;
  font-size: 0.8125rem !important;
}

body.ynex-auth .ui.toggle.checkbox input:checked ~ .box:before,
body.ynex-auth .ui.toggle.checkbox input:checked ~ label:before {
  background: var(--yx-primary) !important;
}

body.ynex-auth .ynex-auth-lang {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--yx-border);
  text-align: center;
}

body.ynex-auth .ynex-auth-lang-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--yx-text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.55rem;
}

body.ynex-auth .ynex-auth-lang-options {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
}

body.ynex-auth .ynex-auth-lang-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--yx-radius-sm);
  border: 1px solid var(--yx-border);
  background: var(--yx-body);
  color: var(--yx-text);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

body.ynex-auth .ynex-auth-lang-link:hover {
  background: rgba(var(--yx-primary-rgb), 0.08);
  color: var(--yx-primary);
  border-color: rgba(var(--yx-primary-rgb), 0.25);
}

body.ynex-auth .ynex-auth-lang-link.is-active {
  background: rgba(var(--yx-primary-rgb), 0.12);
  color: var(--yx-primary);
  border-color: rgba(var(--yx-primary-rgb), 0.25);
  font-weight: 700;
}

body.ynex-auth[dir='rtl'] .auth-card,
body.ynex-auth[dir='rtl'] .ynex-auth-card {
  text-align: right;
}

body.ynex-auth[dir='rtl'] .ynex-auth-aside-inner {
  text-align: right;
}

body.ynex-auth[dir='rtl'] .ynex-auth-aside::after {
  right: auto;
  left: -4rem;
}

body.ynex-auth[dir='rtl'] .field.text-right {
  text-align: left !important;
}

body.ynex-auth[dir='rtl'] .ynex-auth-lang-options {
  direction: rtl;
}

body.ynex-auth[dir='rtl'] .ui.form .field > label {
  text-align: right;
}

@media (max-width: 991px) {
  body.ynex-auth .ynex-auth-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  body.ynex-auth .ynex-auth-aside {
    min-height: 0;
    height: auto;
    max-height: 28vh;
    padding: 1.25rem 1.5rem;
  }
  body.ynex-auth .ynex-auth-aside h2 {
    font-size: 1.25rem;
    margin-bottom: 0.35rem;
  }
  body.ynex-auth .ynex-auth-aside p {
    font-size: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  body.ynex-auth .ynex-auth-aside-logo {
    max-height: 1.75rem;
    margin-bottom: 0.65rem;
  }
  body.ynex-auth .ynex-auth-main {
    padding: 0.75rem 1rem 1rem;
  }
  body.ynex-auth .auth-card,
  body.ynex-auth .ynex-auth-card {
    max-height: 100%;
  }
}
