/**
 * Layout-specific CSS - BEM Methodology
 * Uses CSS variables from theme.css for consistent theming
 */

@import url("/public/css/theme.css");

/* ========================================
 * PAGINATION
 * ======================================== */

.pagination {
  display: flex;
  /* justify-content: center; */
  align-items: center;
  /* margin-top: 1rem; */
  padding: 0 1rem;
}

.pagination__buttons,
.pagination__controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.pagination__btn {
  padding: 0.5rem 0.75rem;
  background-color: var(--gt-white);
  border: 1px solid var(--gt-surface-300);
  border-radius: 0.25rem;
  color: var(--gt-surface-700);
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.pagination__btn:hover {
  background-color: var(--gt-surface-100);
}

.pagination__btn--active {
  background-color: var(--gt-primary);
  color: var(--gt-white);
  border-color: var(--gt-primary);
}

.island-page {
  padding-bottom: 30px;
}
/* ========================================
 * LAYOUT CONTAINER
 * ======================================== */

.layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.layout__header {
  background-color: var(--gt-white);
  border-bottom: 1px solid var(--gt-surface-200);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--gt-header-height, 60px);
}

.layout__header-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gt-primary);
  margin: 0;
}

.layout__main {
  flex: 1;
  padding: var(--gt-padding, 20px);
  max-width: var(--gt-content-max-width, 1400px);
  width: 100%;
  margin: 0 auto;
}

.layout__footer {
  background-color: var(--gt-surface-100);
  border-top: 1px solid var(--gt-surface-200);
  padding: 1rem 2rem;
  text-align: center;
  color: var(--gt-surface-600);
  font-size: var(--gt-font-sm, 12px);
}

/* ========================================
 * ADMIN LAYOUT (with sidebar)
 * ======================================== */

.layout--admin {
  display: flex;
  flex-direction: row;
}

.layout__sidebar {
  width: var(--gt-sidebar-width, 350px);
  background-color: var(--gt-surface-100);
  border-right: 1px solid var(--gt-surface-200);
  padding: 1rem;
  padding-bottom: 40px;
  overflow-y: auto;
  height: 100vh;
  position: sticky;
  top: 0;
}

.layout__sidebar--collapsed {
  width: var(--gt-sidebar-collapsed, 0px);
  padding: 0;
  overflow: hidden;
}

.layout__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  height: 100vh;
  padding-bottom: 40px;
}

/* ========================================
 * NAVIGATION
 * ======================================== */

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav__item {
  padding: 0.75rem 1rem;
  border-radius: 4px;
  color: var(--gt-surface-700);
  text-decoration: none;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav__item:hover {
  background-color: var(--gt-surface-200);
  color: var(--gt-primary);
}

.nav__item--active {
  background-color: var(--gt-primarybg);
  color: var(--gt-primary);
  font-weight: 600;
}

.nav__section {
  font-size: var(--gt-font-sm, 12px);
  font-weight: 600;
  color: var(--gt-surface-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1rem 0 0.5rem 0;
  padding-left: 0.5rem;
}

/* ========================================
 * BREADCRUMBS
 * ======================================== */

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  /* margin-bottom: 1rem; */
  font-size: var(--gt-font-sm, 12px);
}

.breadcrumbs__item {
  color: var(--gt-crumb-lower, #808080);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumbs__item:hover {
  color: var(--gt-primary);
}

.breadcrumbs__item--current {
  color: var(--gt-crumb-current, black);
  font-weight: 600;
}

.breadcrumbs__separator {
  color: var(--gt-crumb-separator, #ff0000);
}

@media (max-width: 767px) {
  .breadcrumbs {
    display: none;
  }
}
/* ========================================
 * PAGE HEADER
 * ======================================== */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* margin-bottom: 2rem; */
  /* padding-bottom: 1rem; */
  border-bottom: 2px solid var(--gt-surface-200);
}

.page-header__title {
  font-size: 2rem;
  margin: 0 0 0 1.5rem;
  font-weight: 700;
  color: var(--gt-surface-900);
}

.page-header__actions {
  display: flex;
  gap: 0.5rem;
}

/* ========================================
 * ACTION BAR (for list pages)
 * ======================================== */

.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 1rem;
  gap: 0 4px;
  background-color: var(--gt-white);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.action-bar__search {
  flex: 1;
  max-width: 400px;
}

.action-bar__search input {
  width: 100%;
  padding: 0.5rem 1rem;
  border: 1px solid var(--gt-surface-300);
  border-radius: 4px;
  font-size: var(--gt-font-base, 14px);
}

.action-bar__actions {
  display: flex;
  gap: 0.5rem;
}

@media (max-width: 767px) {
  .action-bar__label {
    display: none;
  }

  .action-bar--buttons {
    flex-direction: row;
    gap: 0.25rem;
    flex-wrap: wrap;
  }
}

/* ========================================
 * DETAIL VIEW (key-value pairs)
 * ======================================== */

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

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

.detail-view__section {
  background-color: var(--gt-white);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.detail-view__section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gt-primary);
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gt-surface-200);
}

.detail-view__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gt-surface-100);
}

.detail-view__row:last-child {
  border-bottom: none;
}

.detail-view__label {
  font-weight: 600;
  color: var(--gt-detail-label, #666666);
  font-size: var(--gt-font-base, 14px);
}

.detail-view__value {
  color: var(--gt-detail-value, #aaaaaa);
  font-size: var(--gt-font-base, 14px);
  text-align: right;
}

.detail-view__value--highlight {
  background-color: var(--gt-detail-highlight-bg, #fecaca);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

/* ========================================
 * MED LAYOUT (List + Detail Split)
 * ======================================== */

.layout--split {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background-color: var(--fg-surface, #ffffff);
}

.panel--list {
  flex: 0 0 400px;
  border-right: 1px solid var(--fg-border, #e2e8f0);
  overflow-y: auto;
  padding: var(--fg-padding-normal, 16px);
  padding-bottom: 40px;
  background-color: var(--fg-surface-50, #f8f9fa);
}

.panel--detail {
  flex: 1;
  overflow-y: auto;
  padding: var(--fg-padding-normal, 16px);
  padding-bottom: 40px;
  background-color: var(--gt-surface-50);
}

/* ========================================
 * RESPONSIVE DETAIL PANEL STRATEGY
 * ======================================== */

/* Mobile: < 768px - Detail panel hidden by default, overlays when active */
@media (max-width: 767px) {
  .layout--split {
    display: grid;
    grid-template-columns: 1fr;
  }

  .panel--detail {
    display: none;
  }

  .panel--detail.active {
    display: block;
    position: fixed;
    top: 64px; /* header height */
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-surface, #fff);
    z-index: 100;
    padding: 1rem;
    padding-bottom: 40px;
    overflow-y: auto;
  }

  .layout--split.detail-active .list-panel {
    display: none;
  }

  .detail-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-bottom: 1rem;
    color: var(--gt-primary2);
    background: #fff;
    border: 1px solid var(--fg-border, #e2e8f0);
    border-radius: var(--fg-border-radius-sm, 4px);
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
  }

  .detail-back-btn:hover {
    background: var(--fg-surface-50, #f8f9fa);
    border-color: var(--fg-slate-300, #cbd5e1);
  }
}

/* Desktop: >= 768px - Detail panel always visible in split layout */
@media (min-width: 768px) {
  .layout--split {
    display: grid;
    grid-template-columns: 450px 1fr;
  }

  .panel--detail {
    display: block;
  }

  .detail-back-btn {
    display: none;
  }
}

/* Wide mode: >= 1280px - 2-column detail grid */
@media (min-width: 1280px) {
  .detail-card__grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ========================================
 * DETAIL LAYOUT (EntityDetailLayout helper)
 * ======================================== */

.detail-card--layout {
  background: var(--gt-white);
  border-radius: var(--fg-border-radius, 8px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.detail-card__header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--fg-border, #e2e8f0);
  /* background: var(--gt-surface-50); */
}

.detail-card__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fg-slate-900, #0f172a);
}

.detail-layout__section {
  padding: 0.5rem 0.5rem;
  border-bottom: 1px solid var(--fg-border, #e2e8f0);
  background: var(--gt-white);
}

.detail-layout__section:last-child {
  border-bottom: none;
}

.detail-layout__section-title {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg-primary, #0167ab);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-layout__row {
  margin-bottom: 1rem;
}

.detail-layout__row:last-child {
  margin-bottom: 0;
}

.detail-layout__item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-layout__label {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--gt-primary2);
}

.detail-layout__rows {
  background: var(--gt-white);
}

.detail-layout__value {
  font-size: 0.95rem;
  color: var(--fg-slate-900, #0f172a);
  word-break: break-word;
}

@media(max-width: 767px) {
  .detail-card__header {
    /* margin: 8px; */
    margin-left: 8px;
  }
}
/* ========================================
 * PROPERTY CHIP LAYOUT (Responsive)
 * ======================================== */

.property-group {
  display: flex;
  flex-wrap: wrap;
  /* gap: 16px; */
}

.prop-chip {
  flex: 1 240px;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  margin: 4px 8px;
}

.prop-chip__box {
  padding: 6px;
  border: 1px solid #eeeeee;
  border-radius: 5px;
  background: var(--gt-surface-50);
}

.prop-chip.full-width {
  flex: 1 1 100%;
  min-width: 100%;
}

.prop-label {
  font-size: 14px;
  /* text-transform: uppercase; */
  color: var(--gt-surface-900);
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
  padding-left: 8px;
}

.prop-value {
  font-size: 15px;
  font-weight: 400;
  color: var(--gt-surface-600);
  background: var(--gt-surface-50);
}

.prop-value--link {
  color: #2563eb;
  text-decoration: underline;
  cursor: pointer;
}

.prop-value--link:hover {
  color: #1d4ed8;
}

/* Narrow screen: single column for detail layout */
@media (max-width: 1279px) {
  .detail-layout__row {
    grid-template-columns: 1fr !important;
  }

  .detail-layout__item {
    grid-column: span 1 !important;
  }
}

/* Legacy responsive fallback (for non-grid layouts) */
@media (max-width: 767px) {
  .detail-card__header {
    padding: 0px;
  }

  .detail-layout__section {
    padding: 8px;
  }

  .prop-chip {
    margin: 4px 4px;
    flex: 1 1 230px;
    min-width: 230px;
  }

  .prop-chip__box {
    padding: 4px;
  }

  .layout--split {
    flex-direction: column;
  }

  .list-panel__pagination {
    background: var(--gt-white) !important;
  }

  .panel--list {
    flex: 0 0 auto;
    max-height: 50vh;
    border-right: none;
    border-bottom: 1px solid var(--fg-border, #e2e8f0);
  }
}

@media (max-width: 500px) {
  .prop-chip {
    margin: 4px 0;
    flex: 1 230px;
    min-width: 230px;
  }
}
/* ========================================
 * MAIN CONTAINER (App layout wrapper)
 * ======================================== */

.main-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--fg-surface, #ffffff);
}

.view-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: var(--fg-padding-normal, 16px);
}

.crumb-vertical {
  margin-top: 5px;
}

/* ========================================
 * TOP NAV (Header navigation)
 * ======================================== */

.top-nav {
  height: 90px;
  background-color: var(--fg-surface, #ffffff);
  border-bottom: 1px solid var(--fg-border, #e2e8f0);
  padding: 0 var(--fg-padding-normal, 16px);
}

.top-nav__wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: 100%;
  position: relative;
}

.top-nav__left,
.top-nav__right {
  display: flex;
  align-items: center;
  gap: var(--fg-gap-normal, 16px);
}

.top-nav__logo {
  height: 56px;
  cursor: pointer;
  margin-left: -11px;
  margin-right: 11px;
}

/* User Section */
.top-nav__user {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--fg-border-radius-sm, 4px);
}

.top-nav__user:hover {
  background-color: var(--fg-surface-50, #f8f9fa);
}

.top-nav__avatar {
  background-color: var(--fg-accent, #db812e);
  color: var(--fg-surface, #ffffff);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--fg-font-body, 14px);
}

.top-nav__user-details {
  display: flex;
  flex-direction: column;
  text-align: left;
  margin-left: 0.75rem;
  line-height: 1.2;
}

.top-nav__user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--fg-slate-900, #0f172a);
}

.top-nav__user-role {
  font-size: 0.75rem;
  color: var(--fg-slate-500, #64748b);
}

/* Help Button */
.top-nav__help {
  color: var(--fg-primary, #0167ab);
  background-color: var(--fg-primarybg, #e6f2ff);
}

.top-nav__help:hover {
  background-color: var(--fg-primary, #0167ab);
  color: var(--fg-primarybg, #e6f2ff);
}

/* Responsive */
@media (max-width: 767px) {
  .top-nav {
    height: 48px;
    padding: 0 8px;
    border-bottom: none;
  }

  .top-nav__logo {
    height: 24px;
  }

  .top-nav__left,
  .top-nav__right {
    gap: 8px;
  }
}

/* ========================================
 * BREADCRUMBS (Navigation breadcrumbs)
 * ======================================== */

.breadcrumb-container {
  margin-left: 20px;
  margin-bottom: 12px;
}

.breadcrumb {
  background: transparent;
  border: none;
  padding: 0;
}

.breadcrumb__list {
  font-size: var(--fg-font-meta, 12px);
  align-items: center;
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumb__item {
  display: flex;
  align-items: center;
}

.breadcrumb__link {
  text-decoration: none;
  transition: opacity 0.2s;
  color: var(--fg-primary, #0167ab);
}

.breadcrumb__link:hover {
  opacity: 0.8;
}

.breadcrumb__separator {
  margin: 0 4px;
  display: flex;
  align-items: center;
  color: var(--fg-surface-300, #e2e2e2);
  font-weight: 300;
  font-size: 1.1rem;
}

.breadcrumb__tag {
  font-weight: 700;
  color: var(--fg-surface-700, #505050);
}

.breadcrumb__name {
  color: var(--fg-primary, #0167ab);
  font-weight: 500;
}

.breadcrumb__item--current .breadcrumb__tag {
  color: var(--fg-slate-900, #0f172a);
}

.breadcrumb__item--current .breadcrumb__name {
  color: var(--fg-primary, #0167ab);
  font-weight: 700;
}

/* ========================================
 * LIST PANEL
 * ======================================== */

.list-panel {
  display: flex;
  flex-direction: column;
  background: var(--fg-surface, #ffffff);
  border: 1px solid var(--fg-border, #e2e8f0);
  /* border-radius: var(--fg-border-radius, 8px); */
  overflow: hidden;
  min-height: 0;
}

/* Narrow mode: list panel takes full height */
@media (max-width: 767px) {
  .list-panel {
    height: 100%;
  }
}

.list-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--fg-border, #e2e8f0);
  background: var(--gt-surface-100, #ffffff);
}

.list-panel__search {
  background: var(--gt-surface-100);
}
.list-panel__header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.list-panel__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--fg-slate-900, #0f172a);
}

.list-panel__header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.list-panel__search-bar {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--fg-border, #e2e8f0);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.list-panel__search-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--fg-border, #e2e8f0);
  border-radius: var(--fg-border-radius-sm, 4px);
  font-size: 0.875rem;
  background: var(--fg-surface, #ffffff);
  color: var(--fg-slate-900, #0f172a);
}

.list-panel__search-input:focus {
  outline: none;
  border-color: var(--fg-primary, #0167ab);
  box-shadow: 0 0 0 3px var(--fg-primarybg, #e6f2ff);
}

.list-panel__content {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--gt-surface-50);
  min-height: 0;
}

.list-panel__pagination {
  display: flex;
  /* align-items: center; */
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--fg-border, #e2e8f0);
  flex-shrink: 0;
  /* background: var(--gt-surface-100, #f8f9fa); */
}

/* Narrow mode: show back button */
@media (max-width: 767px) {
  .list-panel__back-btn {
    display: inline-flex;
  }
}

.list-panel__back-btn {
  display: none;
  padding: 0.5rem 0.75rem;
  background: var(--fg-surface-50, #f8f9fa);
  border: 1px solid var(--fg-border, #e2e8f0);
  border-radius: var(--fg-border-radius-sm, 4px);
  color: var(--fg-slate-700, #334155);
  font-size: 0.875rem;
  cursor: pointer;
}

.list-panel__back-btn:hover {
  background: var(--fg-surface-100, #f1f5f9);
}

/* Responsive */
@media (max-width: 767px) {
  .list-panel__header {
    padding: 1rem;
  }

  .list-panel__search-bar {
    padding: 0.75rem 1rem;
  }

  .list-panel__content {
    padding: 1rem;
    padding-bottom: 40px;
  }
}

/* ========================================
 * MAIN MENU (Checkbox hack for navigation)
 * ======================================== */

.main-menu-checkbox {
  display: none;
}

.main-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 8px;
  background: transparent;
  color: var(--fg-slate-600, #475569);
  border: none;
  border-radius: var(--fg-border-radius-sm, 4px);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.main-menu-button:hover {
  background-color: var(--fg-surface-100, #f1f5f9);
  color: var(--fg-slate-900, #0f172a);
}

.main-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 999;
}

.main-menu-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 320px;
  max-width: 90vw;
  max-height: 80vh;
  background: var(--fg-surface, #ffffff);
  border-radius: var(--fg-border-radius-lg, 12px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.main-menu-checkbox:checked ~ .main-menu-overlay {
  visibility: visible;
  opacity: 1;
}

.main-menu-checkbox:checked ~ .main-menu-card {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.main-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--fg-border, #e2e8f0);
  background: var(--fg-surface-50, #f8f9fa);
}

.main-menu-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg-slate-900, #0f172a);
}

.main-menu-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--fg-slate-500, #64748b);
  cursor: pointer;
  border-radius: var(--fg-border-radius-sm, 4px);
  transition: background-color 0.2s ease;
}

.main-menu-close:hover {
  background-color: var(--fg-surface-200, #e2e8f0);
  color: var(--fg-slate-900, #0f172a);
}

.main-menu-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
}

.main-menu-section {
  margin-bottom: 1rem;
}

.main-menu-section:last-child {
  margin-bottom: 0;
}

.main-menu-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gt-primary2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.5rem 0;
  padding: 0 1.5rem;
}

.main-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.main-menu-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: var(--fg-slate-700, #334155);
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.main-menu-link:hover {
  background-color: var(--fg-surface-50, #f8f9fa);
  color: var(--fg-primary, #0167ab);
}

.main-menu-icon {
  font-size: 1rem;
  color: var(--fg-slate-400, #94a3b8);
  width: 1rem;
  text-align: center;
}

.main-menu-link:hover .main-menu-icon {
  color: var(--fg-primary, #0167ab);
}

@media (max-width: 767px) {
  .main-menu-checkbox:checked ~ .main-menu-card {
    visibility: visible;
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }

  .main-menu-card {
    position: absolute;
    top: 45px;
    left: 130px;
    transform: translate(-50%, 0) scale(0.9);
    width: 240px;
    /* max-width: 90vw;
    max-height: 80vh; */
    background: var(--fg-surface, #ffffff);
    border-radius: var(--fg-border-radius-lg, 12px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
}
/* ========================================
 * USER MENU (Checkbox hack for user menu)
 * ======================================== */

.user-menu-checkbox {
  display: none;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-radius: var(--fg-border-radius-sm, 4px);
  transition: background-color 0.2s ease;
}

.user-menu-trigger:hover {
  background-color: var(--fg-surface-50, #f8f9fa);
}

.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: var(--fg-accent, #db812e);
  color: var(--fg-surface, #ffffff);
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.875rem;
}

/* .user-details {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
} */

.user-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--fg-slate-900, #0f172a);
}

.user-role {
  font-size: 0.75rem;
  color: var(--fg-slate-500, #64748b);
}

.user-lang {
  font-size: 0.7rem;
  color: var(--fg-slate-400, #94a3b8);
}

.user-menu-chevron {
  font-size: 0.75rem;
  color: var(--fg-slate-400, #94a3b8);
}

.user-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 999;
}

.user-menu-card {
  position: fixed;
  top: 72px;
  right: 1rem;
  width: 200px;
  background: var(--fg-surface, #ffffff);
  border-radius: var(--fg-border-radius, 8px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  overflow: hidden;
}

.user-menu-info-narrow {
  display: none;
}

.user-menu-info-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gt-primary2);
}

.user-menu-info-meta {
  font-size: 0.75rem;
  color: var(--gt-primary2);
  opacity: 0.8;
}

.user-menu-checkbox:checked ~ .user-menu-overlay {
  visibility: visible;
  opacity: 1;
}

.user-menu-checkbox:checked ~ .user-menu-card {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.user-menu-list {
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
}

.user-menu-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  color: var(--fg-slate-700, #334155);
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.user-menu-link:hover {
  background-color: var(--fg-surface-50, #f8f9fa);
  color: var(--fg-slate-900, #0f172a);
}

.user-menu-link--danger {
  color: var(--fg-danger, #dc2626);
}

.user-menu-link--danger:hover {
  background-color: var(--fg-dangerbg, #fef2f2);
  color: var(--fg-danger, #dc2626);
}

.user-menu-icon {
  font-size: 0.875rem;
  color: var(--fg-slate-400, #94a3b8);
  width: 1rem;
  text-align: center;
}

.user-menu-link:hover .user-menu-icon {
  color: var(--fg-slate-600, #475569);
}

.user-menu-separator {
  height: 1px;
  background-color: var(--fg-border, #e2e8f0);
  margin: 0.25rem 0;
}

/* ========================================
 * TOP NAVIGATION (Desktop wide mode)
 * ======================================== */

.top-nav {
  height: 90px;
  background: var(--fg-surface, #ffffff);
  border-bottom: 1px solid var(--fg-border, #e2e8f0);
  padding: 0 1.5rem;
}

.top-nav__wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: 100%;
}

.top-nav__left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.top-nav__center {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  justify-content: center;
}

.top-nav__logo {
  cursor: pointer;
}

.top-nav__logo-image {
  height: 72px;
}

.top-nav__menus {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.top-nav__right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

/* ========================================
 * DROPDOWN MENU (Checkbox hack)
 * ======================================== */

.dropdown-menu {
  position: relative;
  display: inline-block;
}

.dropdown-menu__checkbox {
  display: none;
}

.dropdown-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: transparent;
  color: var(--fg-slate-800, #334155);
  border: none;
  border-radius: var(--fg-border-radius-sm, 4px);
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: 1rem;
  font-weight: 500;
}

.dropdown-menu__trigger:hover {
  background-color: var(--fg-surface-50, #f8f9fa);
  color: var(--fg-slate-900, #0f172a);
}

.dropdown-menu__chevron {
  font-size: 0.625rem;
  color: var(--fg-slate-400, #94a3b8);
  transition: transform 0.2s ease;
}

.dropdown-menu__checkbox:checked
  ~ .dropdown-menu__trigger
  .dropdown-menu__chevron {
  transform: rotate(180deg);
}

.dropdown-menu__overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* background: rgba(0, 0, 0, 0.5); */
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 999;
}

.dropdown-menu__card {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.5rem;
  min-width: 180px;
  background: var(--fg-surface, #ffffff);
  border-radius: var(--fg-border-radius, 8px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  overflow: hidden;
}

.dropdown-menu__checkbox:checked ~ .dropdown-menu__overlay {
  visibility: visible;
  opacity: 1;
}

.dropdown-menu__checkbox:checked ~ .dropdown-menu__card {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  border: 1px solid #aaa;
}

.dropdown-menu__list {
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
}

.dropdown-menu__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  color: var(--fg-slate-700, #334155);
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
  font-size: 0.875rem;
}

.dropdown-menu__link:hover {
  background-color: var(--fg-surface-50, #f8f9fa);
  color: var(--fg-slate-900, #0f172a);
}

.dropdown-menu__link--danger {
  color: var(--fg-danger, #dc2626);
}

.dropdown-menu__link--danger:hover {
  background-color: var(--fg-dangerbg, #fef2f2);
  color: var(--fg-danger, #dc2626);
}

.dropdown-menu__icon {
  font-size: 0.875rem;
  color: var(--fg-slate-400, #94a3b8);
  width: 1rem;
  text-align: center;
}

.dropdown-menu__link:hover .dropdown-menu__icon {
  color: var(--fg-slate-600, #475569);
}

/* Inline search inside dropdown menu */
.dropdown-menu__search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--fg-border, #e2e8f0);
}

.dropdown-menu__search-input {
  flex: 1;
  min-width: 160px;
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  border: 1px solid var(--fg-border, #e2e8f0);
  border-radius: 4px;
  background: var(--fg-surface, #ffffff);
  color: var(--fg-slate-900, #0f172a);
}

.dropdown-menu__search-input:focus {
  outline: none;
  border-color: var(--fg-primary, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.dropdown-menu__separator {
  height: 1px;
  background-color: var(--fg-border, #e2e8f0);
  margin: 0.25rem 0;
}

/* User menu specific styles */
.dropdown-menu__trigger--user {
  padding: 0.5rem 0.75rem;
  gap: 0.75rem;
}

.dropdown-menu__card--user {
  right: 0;
  left: auto;
}

.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: var(--fg-accent, #db812e);
  color: var(--fg-surface, #ffffff);
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.875rem;
}

.user-details {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--fg-slate-900, #0f172a);
}

.user-role {
  font-size: 0.75rem;
  color: var(--fg-slate-500, #64748b);
}

.user-lang {
  font-size: 0.7rem;
  color: var(--fg-slate-400, #94a3b8);
}

/* Narrow mode: center logo, hide desktop menus, show hamburger */
@media (max-width: 767px) {
  .top-nav__center {
    justify-content: center;
  }

  .top-nav__menus {
    display: none;
  }

  .main-menu-container {
    display: block;
  }

  .top-nav__user-wrapper {
    display: block;
  }

  .help-btn span {
    display: none;
  }

  .user-details,
  .user-menu-chevron {
    display: none;
  }

  .user-menu-info-narrow {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--fg-surface-100, #f1f5f9);
  }

  .user-menu-card {
    top: 56px;
    right: 0.5rem;
  }

  .top-nav__logo-image {
    height: 45px;
    margin-top: -7px;
  }
}

/* Wide mode: logo to left, show desktop menus, hide hamburger */
@media (min-width: 767px) {
  .top-nav__center {
    justify-content: flex-start;
  }

  .main-menu-container {
    display: none;
  }

  .top-nav__user-wrapper {
    display: block;
  }

  .help-btn span {
    display: inline;
  }

  .user-details,
  .user-menu-chevron {
    display: flex;
  }
}
/* Help button */
.help-btnx {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--fg-primarybg, #e6f2ff);
  color: var(--fg-primary, #0167ab);
  border: none;
  border-radius: var(--fg-border-radius-sm, 4px);
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
  font-size: 0.875rem;
  font-weight: 500;
}

.help-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--fg-primarybg, #e6f2ff);
  color: var(--fg-primary, #0167ab);
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.875rem;
}
.help-btn:hover {
  background: var(--fg-primary, #0167ab);
  color: var(--fg-primarybg, #e6f2ff);
}

/* ========================================
 * SHELL LAYOUT (Info bar + main content)
 * ======================================== */

.shell__info-bar {
  padding: var(--fg-padding-normal, 12px) var(--fg-padding-loose, 24px);
  border-bottom: 1px solid var(--fg-border, #e2e8f0);
  flex-shrink: 0;
  background: var(--fg-surface, #ffffff);
}

.shell__main-content {
  flex: 1;
  display: flex;
  overflow: hidden;
  background: var(--fg-slate-100, #f1f5f9);
}

/* ========================================
 * CARD GRID (for list views)
 * ======================================== */

.card-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(var(--gt-card-min-width, 300px), 1fr)
  );
  gap: var(--gt-gap, 20px);
}

/* ========================================
 * MODAL
 * ======================================== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal--open {
  display: flex !important;
}

.modal__content {
  position: relative;
  z-index: 10;
  background-color: var(--gt-white);
  border-radius: 8px;
  max-width: 1024px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal__header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--gt-surface-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gt-primary2);
  margin: 0;
}

.modal__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gt-surface-500);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__close:hover {
  color: var(--gt-error);
}

.modal__body {
  padding: 1.25rem;
  background: var(--gt-white);
}

.modal__footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--gt-surface-200);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

@media (max-width: 767px) {
  .modal__content {
    width: 95%;
    max-height: 96vh;
  }
  .modal__header {
    padding: 1rem;
  }

  .modal__body {
    padding: 1rem;
  }

  .modal__footer {
    padding: 1rem;
  }
}

/* ========================================
 * RESPONSIVE UTILITIES
 * ======================================== */

@media (max-width: 767px) {
  .layout--admin {
    flex-direction: column;
  }

  .layout__sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--gt-surface-200);
  }

  .layout__content {
    height: auto;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .action-bar {
    flex-direction: row;
    align-items: stretch;
    gap: .2rem;
    align-items: center;
    justify-content: space-between;
    margin: auto 0;
  }

  .action-bar__search {
    max-width: 100%;
  }

  .action-bar .btn {
    padding: 8px;
  }
}

/* =============================================================================
   Breadcrumbs (Cabbage L2 chrome — rendered by MedLayout below top-nav).
   Admin layouts intentionally omit this row.
   ============================================================================= */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--fg-slate-600, #475569);
  /* background: var(--bg-base-100, #f8fafc); */
  border-bottom: 1px solid var(--border-slate-200, #e2e8f0);
}

.breadcrumbs__crumb {
  color: var(--fg-slate-600, #475569);
  text-decoration: none;
}

.breadcrumbs__crumb:hover {
  color: var(--fg-primary, #2563eb);
  text-decoration: underline;
}

.breadcrumbs__crumb--current {
  color: var(--fg-slate-900, #0f172a);
  font-weight: 700;
  background: var(--gt-surface-50, #f1f5f9);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

/* Two-part crumb: dim entity-type prefix, emphasize the name. */
.breadcrumbs__type {
  /* color: var(--fg-slate-500, #64748b); */
  color: var(--gt-primary2);
  text-transform: uppercase;
  font-weight: 400;
}

.breadcrumbs__name {
  /* color: inherit; */
  color: var(--gt-primary);
  font-weight: 500;
}

.breadcrumbs__sep {
  color: var(--fg-slate-400, #94a3b8);
  margin: 0 0.125rem;
}

/* =============================================================================
   Single Panel Layout
   ============================================================================= */
.layout--single-panel {
  max-width: var(--gt-content-max-width, 1400px);
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem; /* 1 */
  padding-bottom: 40px;
  display: flex;
  flex-direction: column;
  /* gap: 1.5rem; */
}

.single-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  /* padding-bottom: 1rem; */
  border-bottom: 1px solid var(--fg-border, #e2e8f0);
}

.single-panel__title {
  font-size: 2rem !important;
  font-weight: 400; /* 700 */
  color: var(--fg-slate-900, #0f172a);
  margin: 0;
}

.single-panel__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.single-panel__content {
  /* background: var(--gt-surface-50); */
  border: 1px solid var(--fg-border, #e2e8f0);
  border-radius: var(--fg-border-radius, 8px);
  padding: 1rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tab-content {
  padding-bottom: 100px;
}

@media(max-width: 767px) {
  .detail-card__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    padding: 10px 0;
    color: var(--fg-slate-900, #0f172a);
  }

  .layout--single-panel {
    max-width: var(--gt-content-max-width, 1400px);
    width: 100%;
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    /* gap: 0.5rem; */
  }
  
  .single-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    /* padding-bottom: 1rem; */
    border-bottom: 1px solid var(--fg-border, #e2e8f0);
  }
  
  .single-panel__title {
    font-weight: 700;
    color: var(--fg-slate-900, #0f172a);
    margin-left: 10px;
    font-size: 1.25rem !important;
    padding: 10px 0;
  }
  
  .single-panel__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .single-panel__content {
    /* background: var(--gt-surface-50); */
    border: 1px solid var(--fg-border, #e2e8f0);
    border-radius: var(--fg-border-radius, 8px);
    /* padding: 1rem 1.5rem; */
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  }
}
/* =============================================================================
   Enhanced Responsive Breadcrumbs
   ============================================================================= */
.breadcrumbs {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--fg-surface, #ffffff);
  border-bottom: 1px solid var(--fg-border, #e2e8f0);
  padding: 0.75rem 1rem;
}

/* Mobile View (< 768px) */
.breadcrumbs__mobile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
}

/* Desktop View (>= 768px) */
.breadcrumbs__desktop {
  display: none;
}

@media (min-width: 768px) {
  .breadcrumbs__mobile {
    display: none;
  }
  
  .breadcrumbs__desktop {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.25rem 0.5rem;
  }
  
  .breadcrumbs__line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 0.925rem;
    color: var(--fg-slate-600, #475569);
    transition: color 0.15s ease;
  }
  
  .breadcrumbs__line-link:hover {
    color: var(--fg-primary, #0167ab);
  }
  
  .breadcrumbs__line--current {
    background: var(--gt-surface-50, #f1f5f9);
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
    border-left: 3px solid var(--gt-primary2);
    font-weight: 600;
  }
  
  .breadcrumbs__line-icon {
    font-size: 0.75rem;
    color: var(--fg-slate-400, #94a3b8);
    width: 12px;
  }
  
  .breadcrumbs__label-text {
    font-weight: 500;
    color: var(--gt-primary2);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
  }
  
  .breadcrumbs__value-text {
    color: var(--gt-primary);
    font-weight: 600;
  }
  
  .breadcrumbs__details {
    font-size: 0.825rem;
    color: var(--fg-slate-500, #64748b);
    font-style: italic;
    margin-left: 0.25rem;
  }
}

@media(min-width: 767px) {
  .breadcrumbs__label-text {
    font-weight: 500;
    color: var(--gt-primary2);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
  }
  
  .breadcrumbs__value-text {
    color: var(--gt-primary);
    font-weight: 600;
  }
}
