/* ReverseGreen Grading — optimized theme overlay */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Fraunces:opsz,wght@9..144,600;9..144,700&display=swap');

:root {
  --rg-ink: #0f2a22;
  --rg-ink-soft: #1a3d32;
  --rg-forest: #1b6b4a;
  --rg-leaf: #2d9a68;
  --rg-mint: #e8f5ef;
  --rg-mist: #f3f7f5;
  --rg-line: #d5e3dc;
  --rg-sand: #f7f3eb;
  --rg-amber: #c47a1a;
  --rg-coral: #c44536;
  --rg-sky: #1a6f9c;
  --rg-violet: #6b4ea3;
  --rg-radius: 12px;
  --rg-shadow: 0 8px 28px rgba(15, 42, 34, 0.08);
  --rg-shadow-sm: 0 2px 10px rgba(15, 42, 34, 0.06);
  --bs-primary: #1b6b4a;
  --bs-primary-rgb: 27, 107, 74;
}

html, body {
  font-family: 'DM Sans', system-ui, sans-serif !important;
  color: var(--rg-ink);
  background: var(--rg-mist) !important;
}

body {
  background-image:
    radial-gradient(ellipse 80% 50% at 0% 0%, rgba(45, 154, 104, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(26, 111, 156, 0.08), transparent 50%),
    linear-gradient(180deg, #eef5f1 0%, var(--rg-mist) 40%, #eef2f0 100%) !important;
  background-attachment: fixed;
  min-height: 100vh;
}

/* —— Top bar —— */
.horizontal-menu .navbar.top-navbar {
  background: linear-gradient(105deg, var(--rg-ink) 0%, var(--rg-ink-soft) 55%, #163d4f 100%) !important;
  min-height: 72px !important;
  box-shadow: 0 4px 24px rgba(15, 42, 34, 0.25);
  border-bottom: 3px solid var(--rg-leaf);
}

.horizontal-menu .navbar.top-navbar .navbar-brand img {
  max-height: 48px;
  width: auto !important;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.25));
  border-radius: 6px;
}

.horizontal-menu .top-navbar .navbar-nav .nav-link,
.horizontal-menu .top-navbar .nav-profile-text p,
.horizontal-menu .top-navbar .nav-profile-text span {
  color: #e8f5ef !important;
}

.horizontal-menu .top-navbar .nav-profile-img img {
  border: 2px solid var(--rg-leaf);
  border-radius: 50%;
}

.online-color { color: #7ddea8 !important; }

/* Profile dropdown + header logout (bottom nav is z-index 1030; default dropdown is 1000) */
.horizontal-menu .top-navbar,
.horizontal-menu .top-navbar .navbar-menu-wrapper,
.horizontal-menu .top-navbar .navbar-menu-wrapper .navbar-nav .nav-item.dropdown {
  overflow: visible !important;
}

.horizontal-menu .top-navbar .navbar-menu-wrapper .navbar-nav .nav-item.dropdown .dropdown-menu.navbar-dropdown {
  z-index: 1050 !important;
  top: calc(100% + 2px) !important;
  right: 0 !important;
  left: auto !important;
  margin-top: 0 !important;
}

.horizontal-menu .top-navbar .navbar-menu-wrapper .navbar-nav .nav-item.dropdown .navbar-dropdown .dropdown-item {
  color: var(--rg-ink) !important;
}

.horizontal-menu .top-navbar .navbar-menu-wrapper .navbar-nav .nav-item.dropdown .navbar-dropdown .dropdown-item:hover {
  background: var(--rg-mint) !important;
  color: var(--rg-forest) !important;
}

.horizontal-menu .top-navbar .rg-header-logout {
  color: #e8f5ef !important;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.4rem 0.75rem !important;
  border-radius: 8px;
  border: 1px solid rgba(125, 222, 168, 0.45);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.horizontal-menu .top-navbar .rg-header-logout:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff !important;
}

@media (max-width: 575.98px) {
  .horizontal-menu .top-navbar .rg-header-logout .rg-logout-label {
    display: none;
  }

  .horizontal-menu .top-navbar .rg-header-logout {
    padding: 0.45rem !important;
    border-radius: 50%;
    line-height: 1;
  }

  .horizontal-menu .top-navbar .rg-header-logout .mdi-logout {
    margin-right: 0 !important;
  }
}

/* —— Bottom nav — always visible, high contrast —— */
.horizontal-menu .bottom-navbar {
  background: linear-gradient(90deg, #0f2a22 0%, #1b6b4a 100%) !important;
  backdrop-filter: none;
  border-bottom: none;
  box-shadow: 0 6px 20px rgba(15, 42, 34, 0.28) !important;
  display: flex !important;
  position: relative !important;
  z-index: 1030 !important;
  min-height: 52px;
}

.horizontal-menu .bottom-navbar .page-navigation {
  justify-content: flex-start;
  gap: 2px;
  flex-wrap: wrap;
  padding: 4px 0;
  display: flex !important;
}

.horizontal-menu .bottom-navbar .page-navigation > .nav-item {
  border-right: none !important;
  display: block !important;
}

.horizontal-menu .bottom-navbar .page-navigation > .nav-item > .nav-link {
  color: #e8f5ef !important;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  padding: 12px 14px !important;
  border-radius: 8px;
  transition: background .2s, color .2s, transform .15s;
  display: flex !important;
  align-items: center;
  white-space: nowrap;
}

.horizontal-menu .bottom-navbar .page-navigation > .nav-item > .nav-link .menu-title {
  color: #e8f5ef !important;
  display: inline !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
}

.horizontal-menu .bottom-navbar .page-navigation > .nav-item > .nav-link:hover,
.horizontal-menu .bottom-navbar .page-navigation > .nav-item.active > .nav-link {
  background: rgba(255,255,255,0.16) !important;
  color: #fff !important;
  transform: translateY(-1px);
}

.horizontal-menu .bottom-navbar .page-navigation > .nav-item > .nav-link:hover .menu-title,
.horizontal-menu .bottom-navbar .page-navigation > .nav-item.active > .nav-link .menu-title {
  color: #fff !important;
}

.horizontal-menu .bottom-navbar .menu-icon,
.horizontal-menu .bottom-navbar .page-navigation > .nav-item > .nav-link i {
  color: #7ddea8 !important;
  display: inline-block !important;
  margin-right: 6px;
}

@media (max-width: 767.98px) {
  .horizontal-menu .bottom-navbar {
    display: none !important;
  }
  .horizontal-menu .bottom-navbar.header-toggled {
    display: block !important;
    background: #0f2a22 !important;
    max-height: calc(100vh - 70px);
    overflow: auto;
  }
}

/* —— Page shell —— */
.page-wrapper,
.container-fluid.page-body-wrapper,
.content-wrapper {
  background: transparent !important;
}

.content-wrapper {
  padding: 1.25rem 1.5rem 2rem !important;
}

.page-header p,
.page-header .header-right p {
  font-weight: 600;
  color: var(--rg-ink-soft);
}

/* —— Cards —— */
.card {
  border: 1px solid var(--rg-line) !important;
  border-radius: var(--rg-radius) !important;
  box-shadow: var(--rg-shadow-sm) !important;
  background: #fff !important;
  overflow: hidden;
}

.card-body { padding: 1.15rem 1.25rem !important; }

.card-title,
.card .card-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  color: var(--rg-ink);
  font-size: 1.15rem;
}

.card-hover .box {
  border-radius: 10px;
  padding: 1rem 0.75rem;
  margin: 0.25rem;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.12);
  transition: transform .2s ease, box-shadow .2s;
}

.card-hover:hover .box {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(15,42,34,.15);
}

.card-hover .box h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.card-hover .box h6 {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.95;
}

/* —— Tables —— */
.table,
table.table,
.table-responsive table,
.flot-chart-wrapper table {
  border-collapse: separate !important;
  border-spacing: 0;
  width: 100%;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
}

.flot-chart-wrapper table,
.table {
  border: 1px solid var(--rg-line) !important;
}

.flot-chart-wrapper table th,
.table thead th,
table th {
  background: var(--rg-ink) !important;
  color: #e8f5ef !important;
  font-weight: 600 !important;
  font-size: 0.78rem !important;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 12px 10px !important;
  border: none !important;
  white-space: nowrap;
}

.flot-chart-wrapper table td,
.table td,
table td {
  padding: 10px !important;
  border-bottom: 1px solid var(--rg-line) !important;
  font-size: 0.875rem;
  vertical-align: middle;
}

.flot-chart-wrapper table tr:nth-child(even) td,
.table tbody tr:nth-child(even) td {
  background: rgba(232, 245, 239, 0.45);
}

.flot-chart-wrapper table tr:hover td,
.table tbody tr:hover td {
  background: rgba(45, 154, 104, 0.1) !important;
}

/* —— Forms —— */
.form-control,
select.form-control,
textarea.form-control {
  border: 1px solid var(--rg-line) !important;
  border-radius: 8px !important;
  padding: 0.55rem 0.75rem !important;
  font-size: 0.9rem !important;
  background: #fff !important;
  transition: border-color .15s, box-shadow .15s;
}

.form-control:focus {
  border-color: var(--rg-leaf) !important;
  box-shadow: 0 0 0 3px rgba(45, 154, 104, 0.2) !important;
  outline: none;
}

label { font-weight: 600; color: var(--rg-ink-soft); font-size: 0.85rem; }

/* —— Buttons —— */
.btn-primary,
.btn.btn-primary,
.auth-form-btn {
  background: linear-gradient(135deg, var(--rg-forest), var(--rg-leaf)) !important;
  border: none !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 14px rgba(27, 107, 74, 0.35);
  transition: transform .15s, box-shadow .15s;
}

.btn-primary:hover,
.auth-form-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(27, 107, 74, 0.45);
}

.btn-success {
  background: var(--rg-forest) !important;
  border: none !important;
  border-radius: 8px !important;
  font-weight: 600;
}

.btn-danger {
  background: var(--rg-coral) !important;
  border: none !important;
  border-radius: 8px !important;
  font-weight: 600;
}

.btn-warning {
  background: var(--rg-amber) !important;
  border: none !important;
  color: #fff !important;
  border-radius: 8px !important;
}

.btn-info {
  background: var(--rg-sky) !important;
  border: none !important;
  border-radius: 8px !important;
}

.btn-secondary,
.btn-outline-secondary {
  border-radius: 8px !important;
}

/* —— Badges / grades —— */
.badge {
  border-radius: 6px !important;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* —— Footer —— */
.footer {
  background: transparent !important;
  border-top: 1px solid var(--rg-line);
  padding: 1.25rem 0;
  margin-top: 1rem;
}

.footer .text-muted { color: #5a7268 !important; font-size: 0.85rem; }

/* —— Dashboard tabs —— */
.rg-dash-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.25rem;
  padding: 6px;
  background: rgba(255,255,255,0.75);
  border: 1px solid var(--rg-line);
  border-radius: 14px;
  box-shadow: var(--rg-shadow-sm);
}

.rg-dash-tabs .rg-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--rg-ink-soft);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, color .2s, box-shadow .2s;
}

.rg-dash-tabs .rg-tab:hover {
  background: var(--rg-mint);
  color: var(--rg-forest);
  text-decoration: none;
}

.rg-dash-tabs .rg-tab i {
  font-size: 1rem;
  margin-right: 4px;
  vertical-align: -2px;
}

.rg-dash-tabs .rg-tab.active {
  background: linear-gradient(135deg, var(--rg-forest), var(--rg-leaf));
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(27, 107, 74, 0.3);
}

.rg-dash-panel { display: none; animation: rgFade .35s ease; }
.rg-dash-panel.active { display: block; }

@keyframes rgFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.rg-page-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--rg-ink);
  margin: 0 0 0.25rem;
}

.rg-page-sub {
  color: #5a7268;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.rg-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 1rem;
}

.rg-stat-row > [class*="col-"] {
  float: none !important;
  flex: 1 1 140px;
  max-width: 180px;
  padding: 0 !important;
}

.rg-section-card {
  margin-bottom: 1.25rem;
}

.rg-audit-box {
  border: 1px solid var(--rg-line);
  border-radius: var(--rg-radius);
  background: linear-gradient(180deg, #fff 0%, var(--rg-sand) 100%);
  padding: 1.25rem;
  margin-top: 1rem;
}

.rg-audit-box h3 {
  font-family: 'Fraunces', Georgia, serif;
  color: var(--rg-ink);
  text-align: left !important;
  margin: 0 0 0.75rem !important;
}

/* —— Login —— */
.rg-login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--rg-mist);
}

@media (max-width: 991px) {
  .rg-login-page { grid-template-columns: 1fr; }
  .rg-login-visual { min-height: 220px; order: -1; }
}

.rg-login-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
}

.rg-login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--rg-line);
  border-radius: 16px;
  padding: 2rem 1.75rem;
  box-shadow: var(--rg-shadow);
}

.rg-login-card .brand-logo {
  text-align: center;
  margin-bottom: 1.25rem;
}

.rg-login-card .brand-logo img {
  max-height: 64px;
  width: auto;
  border-radius: 8px;
}

.rg-login-card h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.75rem;
  color: var(--rg-ink);
  margin: 0 0 0.35rem;
  text-align: center;
}

.rg-login-card .rg-login-lead {
  text-align: center;
  color: #5a7268;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.rg-login-visual {
  background:
    linear-gradient(145deg, rgba(15, 42, 34, 0.88), rgba(27, 107, 74, 0.75)),
    url('../../images/logo.jpg') center/cover;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2.5rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.rg-login-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(125, 222, 168, 0.35), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(26, 111, 156, 0.3), transparent 40%);
  pointer-events: none;
}

.rg-login-visual-inner {
  position: relative;
  z-index: 1;
}

.rg-login-visual h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 2.1rem;
  margin: 0 0 0.5rem;
  font-weight: 700;
}

.rg-login-visual p {
  margin: 0;
  opacity: 0.9;
  max-width: 28ch;
  line-height: 1.5;
}

.rg-login-error {
  color: var(--rg-coral);
  font-size: 0.88rem;
  margin-top: 0.75rem;
  display: none;
}

#btnSave.rg-login-btn-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  pointer-events: none;
  opacity: 0.85;
  cursor: wait !important;
}

#btnSave.rg-login-btn-loading .rg-login-btn-icon {
  flex-shrink: 0;
}

.text-primary { color: var(--rg-forest) !important; }

.mdi.text-primary { color: var(--rg-leaf) !important; }

/* Filter / toolbars on inner pages */
.rg-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 1rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid var(--rg-line);
  border-radius: var(--rg-radius);
  box-shadow: var(--rg-shadow-sm);
}

/* —— Dashboard async toolbar / loader —— */
.rg-dash-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rg-line);
}

.rg-date-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  flex: 1 1 auto;
  min-width: 0;
}

.rg-date-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.rg-date-row .rg-date-group {
  min-width: 0;
  flex: 0 0 auto;
}

.rg-date-row .rg-date-group.rg-presets {
  min-width: 0;
}

.rg-la-label-wrap {
  min-width: 0;
  flex: 0 0 auto;
}

.rg-date-group label {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5a7268;
}

.rg-date-group .form-control {
  min-height: 38px;
}

.rg-date-row .rg-date-group .form-control[type="date"] {
  width: 11.5rem;
  max-width: 100%;
}

.rg-preset-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rg-range-hint {
  font-size: 0.8rem;
  color: #5a7268;
  white-space: nowrap;
}

.rg-dash-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 14px;
}

.rg-dash-refresh {
  white-space: nowrap;
}

/* Listing row action buttons (View / Delete) — 3x prior spacing */
.rg-list-actions,
#listing_table .rg-list-actions,
#listing_table td.rg-list-actions {
  display: flex !important;
  align-items: center !important;
  gap: 66px !important;
  flex-wrap: nowrap !important;
}

#listing_table .rg-list-actions .rg-list-action-view,
.rg-list-actions .rg-list-action-view {
  display: inline-flex;
  align-items: center;
}

#listing_table .rg-list-actions .rg-list-action-delete,
.rg-list-actions .rg-list-action-delete {
  margin-left: 60px !important;
  color: #dc3545 !important;
  cursor: pointer;
}

@supports (gap: 1px) {
  #listing_table .rg-list-actions .rg-list-action-delete,
  .rg-list-actions .rg-list-action-delete {
    margin-left: 0 !important;
  }
}

.rg-dash-loader {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--rg-ink-soft);
}

.rg-dash-loader p {
  margin: 0.75rem 0 0;
  font-weight: 600;
}

.rg-spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  border: 3px solid var(--rg-line);
  border-top-color: var(--rg-leaf);
  border-radius: 50%;
  animation: rgSpin 0.7s linear infinite;
}

@keyframes rgSpin {
  to { transform: rotate(360deg); }
}

.rg-dash-error {
  background: #fdecea;
  color: var(--rg-coral);
  border: 1px solid #f5c4bf;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.rg-dash-content {
  min-height: 180px;
  transition: opacity 0.2s ease;
}

.rg-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #5a7268;
  font-weight: 500;
}

/* LA top ticket + grade qty */
.rg-ticket-block {
  margin-bottom: 1rem;
}
.rg-ticket-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.rg-ticket-box {
  border-radius: 12px;
  padding: 1rem 1.1rem;
  color: #fff;
  box-shadow: var(--rg-shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rg-ticket-upload { background: linear-gradient(135deg, #0f3d32, #1b6b4a); }
.rg-ticket-recv { background: linear-gradient(135deg, #1a4a6f, #2563eb); }
.rg-ticket-grade { background: linear-gradient(135deg, #5b3a12, #c27a1e); }
.rg-ticket-val {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
}
.rg-ticket-lbl {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.9;
}
.rg-grade-qty-row {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}
.rg-grade-qty {
  background: #fff;
  border: 1px solid var(--rg-line);
  border-top: 3px solid var(--gq, #1b6b4a);
  border-radius: 10px;
  padding: 0.65rem 0.5rem;
  text-align: center;
  box-shadow: var(--rg-shadow-sm);
}
.rg-grade-qty-val {
  display: block;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--rg-ink);
  line-height: 1.15;
}
.rg-grade-qty-lbl {
  display: block;
  margin-top: 2px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #5a7268;
}
@media (max-width: 900px) {
  .rg-ticket-row { grid-template-columns: 1fr; }
  .rg-grade-qty-row { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 480px) {
  .rg-grade-qty-row { grid-template-columns: repeat(2, 1fr); }
}

.rg-kpi-row {
  margin-bottom: 1.25rem !important;
  gap: 10px !important;
}

.rg-kpi {
  flex: 1 1 120px;
  max-width: 180px;
  background: var(--rg-ink);
  color: #e8f5ef;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  box-shadow: var(--rg-shadow-sm);
}

.rg-kpi-val {
  display: block;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.1;
}

.rg-kpi-lbl {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-top: 0.25rem;
}

.rg-kpi-pending { background: #1a6f9c; }
.rg-kpi-ok { background: var(--rg-forest); }
.rg-kpi-bad { background: var(--rg-coral); }

.rg-summary-table {
  width: 100%;
  border-collapse: separate !important;
  border-spacing: 0;
  border: 1px solid var(--rg-line);
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.85rem;
}

.rg-summary-table th {
  background: var(--rg-ink) !important;
  color: #e8f5ef !important;
  padding: 10px 8px !important;
  text-align: center !important;
  white-space: nowrap;
  font-size: 0.72rem !important;
}

.rg-summary-table td {
  text-align: center;
  padding: 9px 8px !important;
  border-bottom: 1px solid var(--rg-line) !important;
}

.rg-summary-table td.rg-loc {
  text-align: left;
  font-weight: 700;
  color: var(--rg-ink);
  white-space: nowrap;
}

.rg-summary-table tbody tr:nth-child(even) td {
  background: rgba(232, 245, 239, 0.45);
}

.rg-summary-table tbody tr:hover td {
  background: rgba(45, 154, 104, 0.1) !important;
}

.rg-summary-table .rg-total-row td {
  background: var(--rg-mint) !important;
  border-top: 2px solid var(--rg-leaf);
}

.rg-audit-pending { color: #1a6f9c; font-weight: 600; }
.rg-audit-ok { color: var(--rg-forest); font-weight: 600; }
.rg-audit-bad { color: var(--rg-coral); font-weight: 600; }

.rg-subcount {
  font-size: 0.68rem;
  color: #6a8076;
  font-weight: 500;
  margin-top: 2px;
}

.rg-pct-badge {
  display: inline-block;
  background: var(--rg-mint);
  color: var(--rg-forest);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  vertical-align: middle;
}

.rg-ai-box {
  background: linear-gradient(135deg, #0f2a22 0%, #1b6b4a 55%, #163d4f 100%);
  color: #e8f5ef;
  border-radius: 14px;
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--rg-shadow);
}

.rg-ai-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.rg-ai-list {
  margin: 0;
  padding-left: 1.15rem;
}

.rg-ai-list li {
  margin-bottom: 0.45rem;
  line-height: 1.45;
  font-size: 0.92rem;
}

.rg-ai-box-lg {
  padding: 1.35rem 1.5rem 1.2rem;
}
.rg-ai-box-lg .rg-ai-list li {
  margin-bottom: 0.65rem;
  font-size: 0.94rem;
  line-height: 1.5;
}

.rg-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 1rem;
}

.rg-loc-chart-card {
  background: #fff;
  border: 1px solid var(--rg-line);
  border-radius: 12px;
  padding: 0.85rem 0.9rem 0.5rem;
  box-shadow: var(--rg-shadow-sm);
}

.rg-loc-chart-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 0.5rem;
}

.rg-loc-chart-head strong {
  color: var(--rg-ink);
  font-size: 0.95rem;
}

.rg-loc-chart-head span {
  font-size: 0.72rem;
  color: #5a7268;
}

.rg-chart-single {
  background: #fff;
  border: 1px solid var(--rg-line);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.rg-la-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 1rem;
}
.rg-la-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--rg-ink);
}
.rg-la-sub { color: #5a7268; font-size: 0.9rem; }
.rg-la-inline-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--rg-ink);
  line-height: 38px;
}

.rg-block {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px dashed var(--rg-line);
}
.rg-block:last-child { border-bottom: none; }
.rg-block-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--rg-ink);
  margin: 0 0 0.85rem;
}
.rg-block-title span { color: #5a7268; font-weight: 500; font-size: 0.95rem; }

.rg-block-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.85rem;
}

.rg-day-toggle {
  display: inline-flex;
  background: var(--rg-mint);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.rg-day-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--rg-ink-soft);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.rg-day-btn.active {
  background: var(--rg-forest);
  color: #fff;
}

.rg-day-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 0.85rem;
}
.rg-day-kpis .rg-kpi { max-width: 160px; }

.rg-day-panel { display: none; }
.rg-day-panel.active { display: block; }

.rg-snap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.rg-snap-card {
  background: #fff;
  border: 1px solid var(--rg-line);
  border-radius: 10px;
  padding: 0.85rem;
  box-shadow: var(--rg-shadow-sm);
}
.rg-snap-name { font-weight: 700; color: var(--rg-ink); font-size: 0.9rem; }
.rg-snap-n { font-size: 0.72rem; color: #6a8076; margin-bottom: 0.45rem; }
.rg-snap-metrics { display: flex; flex-direction: column; gap: 3px; font-size: 0.8rem; font-weight: 600; }
.rg-snap-metrics .ok { color: var(--rg-forest); }
.rg-snap-metrics .bad { color: #222; }
.rg-snap-metrics .pend { color: #1a6f9c; }

.rg-detail-block summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--rg-forest);
  margin-bottom: 0.75rem;
}
.rg-detail-block details[open] summary { margin-bottom: 0.85rem; }

/* —— Ticket detail page —— */
.rg-detail-page {
  width: 100%;
  clear: both;
}
.rg-detail-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 1rem;
}
.rg-detail-hero-main {
  flex: 1 1 280px;
  background: #fff;
  border: 1px solid var(--rg-line, #e2e8f0);
  border-radius: 10px;
  padding: 14px 16px;
  min-width: 0;
}
.rg-detail-hero-ids {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 8px;
}
.rg-detail-hero-ids .rg-id-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  display: block;
}
.rg-detail-hero-ids .rg-id-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--rg-ink, #0f172a);
  word-break: break-all;
}
.rg-detail-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.rg-detail-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 7px 12px;
  border-radius: 8px;
  background: #0f3d2e;
  color: #fff !important;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none !important;
  border: 1px solid #0f3d2e;
  white-space: nowrap;
}
.rg-detail-pdf-btn:hover {
  background: #145c44;
  color: #fff !important;
}
.rg-detail-pdf-btn i { font-size: 1rem; line-height: 1; }
.rg-detail-chip {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
}
.rg-detail-chip.is-ok { background: #dcfce7; color: #166534; }
.rg-detail-chip.is-warn { background: #fef3c7; color: #92400e; }
.rg-detail-chip.is-bad { background: #fee2e2; color: #991b1b; }
.rg-detail-hero-grade {
  flex: 0 1 200px;
  min-width: 140px;
  display: flex;
  align-items: stretch;
}
.rg-detail-hero-grade .rg-grade-block,
.rg-detail-hero-grade .rg-grade-badge {
  width: 100%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 10px !important;
  font-size: 1.75rem !important;
  min-height: 72px;
  margin: 0;
}
.rg-detail-card {
  background: #fff;
  border: 1px solid var(--rg-line, #e2e8f0);
  border-radius: 10px;
  margin-bottom: 1rem;
  overflow: hidden;
}
.rg-detail-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rg-line, #e2e8f0);
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
.rg-detail-card-head h3 {
  margin: 0 !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  text-align: left !important;
  color: var(--rg-ink, #0f172a) !important;
}
.rg-detail-card-body {
  padding: 14px 16px;
}
.rg-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}
@media (max-width: 575px) {
  .rg-detail-grid { grid-template-columns: 1fr; }
}
.rg-detail-field {
  min-width: 0;
}
.rg-detail-field.is-full {
  grid-column: 1 / -1;
}
.rg-detail-field-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 2px;
}
.rg-detail-field-val {
  font-size: 0.92rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
  word-break: break-word;
}
.rg-detail-field-val.is-empty {
  color: #94a3b8;
  font-weight: 500;
}
.rg-detail-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.rg-detail-table-wrap .table {
  margin-bottom: 0;
}
.rg-detail-table-wrap .table th {
  white-space: nowrap;
  background: #f8fafc;
  font-weight: 700;
}
.rg-detail-img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.rg-detail-img-grid a {
  display: block;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
}
.rg-detail-img-grid img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}
.rg-detail-empty {
  padding: 18px;
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
}

.mt-3 { margin-top: 1rem !important; }

/* IBQC location cards (wp new_app style) */
.rg-loc-badge {
  display: inline-block;
  background: #eef2ff;
  color: #2563eb;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
}
.rg-loc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.rg-loc-cell {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 10px 8px;
  display: flex;
  flex-direction: column;
  min-height: 250px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.rg-loc-cell-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
  min-height: 36px;
}
.rg-loc-cell-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.rg-loc-cell-total {
  font-size: 0.9rem;
  font-weight: 800;
  color: #2563eb;
  flex-shrink: 0;
}
.rg-loc-mini { height: 130px; flex: 1; position: relative; }
.rg-loc-mini canvas { width: 100% !important; height: 100% !important; }
.rg-loc-cell-legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #6b7280;
}
.rg-loc-cell-legend .leg {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}
.rg-loc-cell-legend .leg.accept { background: #16a34a; }
.rg-loc-cell-legend .leg.reject { background: #9ca3af; }
.rg-loc-audit {
  margin-top: 8px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}
.rg-loc-audit-title {
  background: #ede9fe;
  color: #5b21b6;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 8px;
}
.rg-loc-audit-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff;
}
.rg-loc-audit-col {
  padding: 7px 8px;
  border-right: 1px solid #f3f4f6;
}
.rg-loc-audit-col:last-child { border-right: none; }
.rg-loc-audit-day {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: #4b5563;
  margin-bottom: 3px;
}
.rg-loc-audit-metrics {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 0.72rem;
  font-weight: 600;
}
.rg-loc-audit-metrics .done { color: #16a34a; }
.rg-loc-audit-metrics .pend { color: #2563eb; }
.rg-trend-wrap { min-height: 220px; }
.rg-box-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.rg-grade-box {
  background: #fff;
  border: 1px solid var(--rg-line);
  border-radius: 12px;
  padding: 10px 10px 8px;
  box-shadow: var(--rg-shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 360px;
}
.rg-grade-box-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
  min-height: 34px;
}
.rg-grade-box-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--rg-ink);
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.rg-grade-box-total {
  font-size: 0.9rem;
  font-weight: 800;
  color: #2563eb;
  flex-shrink: 0;
}
.rg-grade-box-chart {
  flex: 1;
  position: relative;
  min-height: 280px;
}
.rg-grade-box-chart canvas {
  width: 100% !important;
  height: 280px !important;
}
.rg-box-audit {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--rg-line);
}
.rg-box-audit-col {
  background: #eef7fb;
  border-radius: 8px;
  padding: 6px 8px;
  text-align: center;
}
.rg-box-audit-yest {
  background: #fff4e8;
}
.rg-box-audit-val {
  display: block;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--rg-ink);
  line-height: 1.15;
}
.rg-box-audit-lbl {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #5a7268;
  margin-top: 2px;
}
.rg-box-audit-sub {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  color: #16a34a;
  margin-top: 2px;
}

@media (max-width: 1100px) {
  .rg-box-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
  .rg-box-grid { grid-template-columns: 1fr; }
}

@media (max-width: 576px) {
  .rg-loc-grid { grid-template-columns: 1fr 1fr; }
}

.ms-auto { margin-left: auto; }

@media (max-width: 768px) {
  .rg-dash-toolbar { flex-direction: column; align-items: stretch; }
  .ms-auto { margin-left: 0; }
  .rg-kpi { max-width: none; }
}

/* Soften Star Admin leftovers */
.horizontal-menu .bottom-navbar .page-navigation > .nav-item {
  line-height: 1.2;
}

.dropdown-menu {
  border-radius: 10px !important;
  border: 1px solid var(--rg-line) !important;
  box-shadow: var(--rg-shadow) !important;
}

/* —— Data summary pages (LA / IBQC) —— */
.card:has(.la-summary-page),
.card:has(.ibqc-summary-page) {
  overflow: visible !important;
}

.la-summary-page .box,
.ibqc-summary-page .box,
.la-summary-page .box-header,
.ibqc-summary-page .box-header,
.la-summary-page .box-body,
.ibqc-summary-page .box-body {
  overflow: visible;
}

.la-summary-page .box-header,
.ibqc-summary-page .box-header {
  position: relative;
  z-index: 30;
  padding-bottom: 0;
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 0;
}

.la-summary-page .box-body,
.ibqc-summary-page .box-body {
  position: relative;
  z-index: 1;
}

.la-summary-page .box-header .filter-toolbar,
.ibqc-summary-page .box-header .filter-toolbar {
  justify-content: flex-end;
}

.la-summary-page .filter-toolbar .rg-multi-filters,
.ibqc-summary-page .filter-toolbar .rg-multi-filters {
  align-items: center;
}

/* —— SumoSelect multi-filter layout (search + options stacking) —— */
.rg-multi-filters .SumoSelect,
.rg-att-station-wrap .SumoSelect {
  position: relative;
}

.rg-multi-filters .SumoSelect > .CaptionCont,
.rg-att-station-wrap .SumoSelect > .CaptionCont {
  position: relative;
  z-index: 2;
  background: #fff;
}

.rg-multi-filters .SumoSelect.open > .CaptionCont.search,
.rg-att-station-wrap .SumoSelect.open > .CaptionCont.search {
  z-index: 3;
}

.rg-multi-filters .SumoSelect.open .search-txt,
.rg-att-station-wrap .SumoSelect.open .search-txt {
  z-index: 4;
  background: #fff;
}

.rg-multi-filters .SumoSelect > .optWrapper,
.rg-multi-filters .SumoSelect.open > .optWrapper,
.rg-att-station-wrap .SumoSelect > .optWrapper,
.rg-att-station-wrap .SumoSelect.open > .optWrapper {
  top: 100%;
  margin-top: 2px;
  z-index: 1;
  background: #fff;
  opacity: 1;
}

.rg-multi-filters .SumoSelect.open > .optWrapper .select-all,
.rg-multi-filters .SumoSelect.open > .optWrapper > .options,
.rg-multi-filters .SumoSelect.open > .optWrapper > .MultiControls,
.rg-att-station-wrap .SumoSelect.open > .optWrapper .select-all,
.rg-att-station-wrap .SumoSelect.open > .optWrapper > .options,
.rg-att-station-wrap .SumoSelect.open > .optWrapper > .MultiControls {
  background: #fff;
}

.rg-multi-filters .SumoSelect.open,
.rg-att-station-wrap .SumoSelect.open {
  z-index: 1050;
}

.la-summary-page .rg-multi-wrap,
.ibqc-summary-page .rg-multi-wrap {
  position: relative;
  z-index: 40;
}

.la-summary-page .SumoSelect.open,
.ibqc-summary-page .SumoSelect.open {
  z-index: 1050;
}

.la-summary-page #listing_table.table-responsive,
.ibqc-summary-page #listing_table.table-responsive {
  width: 100%;
  overflow: visible;
}

.la-summary-page #listing_table table,
.ibqc-summary-page #listing_table table {
  width: 100% !important;
  overflow: visible;
  table-layout: auto;
}

/* —— Attendance page: right-aligned filter toolbar + user avatars —— */
.rg-att-short td { background-color: #ffcdd2 !important; }

.rg-att-page .box-header {
  position: relative;
  z-index: 30;
  padding-bottom: 0;
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 0;
}

.rg-att-page .box-header .filter-toolbar,
.rg-att-page .rg-att-filters {
  justify-content: flex-end;
}

.rg-att-page .filter-toolbar .rg-multi-filters,
.rg-att-page .rg-att-filters .rg-multi-filters {
  float: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.rg-att-page .rg-multi-wrap {
  position: relative;
  z-index: 40;
}

.rg-att-page .SumoSelect.open {
  z-index: 1050;
}

.rg-att-page .rg-att-filter {
  width: 120px;
  min-width: 120px;
  min-height: 38px;
}

.rg-att-page .rg-att-date-input.input-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  width: auto;
  min-width: 170px;
}

.rg-att-page .rg-att-date-range {
  gap: 0.5rem;
}

.rg-att-page .rg-att-date-range .rg-att-date-input {
  min-width: 190px;
}

.rg-att-page .rg-att-date-range .input-group-text {
  font-size: 12px;
  white-space: nowrap;
}

.rg-att-page .rg-att-date-range #att_apply_dates {
  min-height: 38px;
}

.rg-att-page .rg-att-date-input .form-control {
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
  min-height: 38px;
}

.rg-att-page .rg-att-date-input .btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
}

.rg-att-page .rg-att-rec-perpage table {
  width: auto !important;
  margin: 0;
  border: 0;
}

.rg-att-page .rg-att-rec-perpage td {
  background: transparent !important;
  padding: 0;
  border: 0;
}

.rg-att-page .rg-att-rec-perpage .form-control {
  min-height: 38px;
}

.rg-att-page .rg-att-export-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.rg-att-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.rg-att-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 32px;
  background: #e9ecef;
  cursor: pointer;
  transition: box-shadow 0.15s ease;
}

.rg-att-user-avatar:hover,
.rg-att-user-avatar:focus {
  box-shadow: 0 0 0 2px rgba(45, 154, 104, 0.45);
  outline: none;
}

.rg-att-user-name {
  min-width: 0;
  word-break: break-word;
}

.rg-att-avatar-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.rg-att-avatar-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  cursor: pointer;
}

.rg-att-avatar-lightbox-dialog {
  position: relative;
  z-index: 1;
  max-width: min(90vw, 520px);
  max-height: 90vh;
}

.rg-att-avatar-lightbox-dialog img {
  display: block;
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  background: #fff;
}

.rg-att-avatar-lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #3e5569;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@media (max-width: 1300px) {
  .rg-att-page .dttt3 {
    display: none !important;
  }
}

/* —— View Deleted Data page: right-aligned filter toolbar —— */
.card:has(.la-delete-data-page) {
  overflow: visible !important;
}

.la-delete-data-page .box,
.la-delete-data-page .box-header,
.la-delete-data-page .box-body {
  overflow: visible;
}

.la-delete-data-page .box-header {
  position: relative;
  z-index: 30;
  padding-bottom: 0;
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 0;
}

.la-delete-data-page .box-body {
  position: relative;
  z-index: 1;
}

.la-delete-data-page .box-header .filter-toolbar {
  justify-content: flex-end;
}

.la-delete-data-page .rg-dd-search {
  width: auto;
  min-width: 180px;
}

.la-delete-data-page .rg-dd-search .form-control {
  min-height: 38px;
  width: 150px;
}

.la-delete-data-page .rg-dd-search .btn {
  min-height: 38px;
}

.la-delete-data-page .rg-dd-rec-perpage table {
  width: auto !important;
  margin: 0;
  border: 0;
}

.la-delete-data-page .rg-dd-rec-perpage td {
  background: transparent !important;
  padding: 0;
  border: 0;
}

.la-delete-data-page .rg-dd-rec-perpage .form-control {
  min-height: 38px;
}

.la-delete-data-page .rg-dd-export-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.la-delete-data-page #listing_table.table-responsive {
  width: 100%;
  overflow: visible;
}

.la-delete-data-page #listing_table table {
  width: 100% !important;
  overflow: visible;
  table-layout: auto;
}

@media (max-width: 1300px) {
  .la-delete-data-page .dttt3 {
    display: none !important;
  }
}

/* —— Furniture listing page: right-aligned filter toolbar —— */
.card:has(.fur-listing-page) {
  overflow: visible !important;
}

.fur-listing-page .box,
.fur-listing-page .box-header,
.fur-listing-page .box-body {
  overflow: visible;
}

.fur-listing-page .box-header {
  position: relative;
  z-index: 30;
  padding-bottom: 0;
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 0;
}

.fur-listing-page .box-header .filter-toolbar {
  justify-content: flex-end;
}

.fur-listing-page .filter-toolbar .rg-multi-filters {
  float: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.fur-listing-page .rg-multi-wrap {
  position: relative;
  z-index: 40;
}

.fur-listing-page .SumoSelect.open {
  z-index: 1050;
}

.fur-listing-page .rg-fur-loc-filter {
  width: 164px;
  min-width: 164px;
  min-height: 38px;
}

.fur-listing-page .rg-fur-search {
  width: auto;
  min-width: 180px;
}

.fur-listing-page .rg-fur-search .form-control {
  min-height: 38px;
  width: 150px;
}

.fur-listing-page .rg-fur-search .btn {
  min-height: 38px;
}

.fur-listing-page .filter-toolbar .btn-default {
  min-height: 38px;
}

.fur-listing-page .rg-fur-rec-perpage table {
  width: auto !important;
  margin: 0;
  border: 0;
}

.fur-listing-page .rg-fur-rec-perpage td {
  background: transparent !important;
  padding: 0;
  border: 0;
}

.fur-listing-page .rg-fur-rec-perpage .form-control {
  min-height: 38px;
}

.fur-listing-page .rg-fur-export-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.fur-listing-page #listing_table.table-responsive {
  width: 100%;
  overflow: visible;
}

.fur-listing-page #listing_table table {
  width: 100% !important;
  overflow: visible;
  table-layout: auto;
}

@media (max-width: 1300px) {
  .fur-listing-page .dttt3 {
    display: none !important;
  }
}

/* —— Profile admin (Manage Location / Manage Users) —— */
.rg-profile-card {
  border-radius: var(--rg-radius);
  box-shadow: var(--rg-shadow-sm);
}

.rg-profile-table th {
  white-space: nowrap;
  font-size: 0.8125rem;
}

.rg-profile-table th.rg-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.rg-profile-table th.rg-sortable:hover {
  color: var(--rg-forest);
}

.rg-profile-table th.rg-sortable .rg-sort-icon {
  opacity: 0.45;
  font-size: 0.95rem;
  vertical-align: middle;
}

.rg-profile-table th.rg-sort-asc .rg-sort-icon,
.rg-profile-table th.rg-sort-desc .rg-sort-icon {
  opacity: 1;
  color: var(--rg-forest);
}

.rg-profile-pagination .rg-profile-perpage {
  width: auto;
  min-width: 4.5rem;
}

.rg-profile-pagination .pagination .page-link {
  color: var(--rg-forest);
}

.rg-profile-pagination .pagination .page-item.active .page-link {
  background-color: var(--rg-forest);
  border-color: var(--rg-forest);
  color: #fff;
}

.rg-profile-coords {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8125rem;
}

.rg-profile-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.rg-profile-badge.rg-badge-active {
  background: #d4edda;
  color: #1b6b4a;
}

.rg-profile-badge.rg-badge-inactive {
  background: #f8d7da;
  color: #842029;
}

/* AI Audit Suggestion (advisory only) */
.rg-audit-ai-box {
  border: 1px solid #cfe2ff;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 48%);
  border-radius: var(--rg-radius, 8px);
}

.rg-audit-ai-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.rg-audit-ai-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #084298;
  background: #cfe2ff;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
}

.rg-audit-ai-sub {
  font-size: 0.875rem;
}

.rg-audit-ai-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.rg-audit-ai-pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: #eef2f6;
  color: #334155;
}

.rg-audit-ai-pill.rg-audit-ai-outcome {
  background: #fff3cd;
  color: #664d03;
}

.rg-audit-ai-field {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem;
  background: #fff;
  min-height: 100%;
}

.rg-audit-ai-field-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.rg-audit-ai-field-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
}

.rg-audit-ai-remark {
  border: 1px dashed #93c5fd;
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  background: #f8fbff;
}

.rg-audit-ai-remark-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #1d4ed8;
  margin-bottom: 0.35rem;
}

.rg-audit-ai-remark-body {
  font-size: 0.875rem;
  color: #334155;
  line-height: 1.45;
}

.rg-audit-ai-reasons {
  padding-left: 1.1rem;
  color: #475569;
  font-size: 0.875rem;
}

.rg-audit-ai-reasons li {
  margin-bottom: 0.25rem;
}

.rg-profile-readonly-field {
  padding: 0.5rem 0.75rem;
  background: var(--rg-mist);
  border: 1px solid var(--rg-line);
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--rg-ink-soft);
  word-break: break-word;
}

.rg-profile-search-form .input-group {
  min-width: 280px;
}

.rg-profile-modal .modal-header {
  border-bottom: 1px solid var(--rg-line);
}

.rg-profile-modal .modal-footer {
  border-top: 1px solid var(--rg-line);
}

.rg-edit-user-btn,
.rg-toggle-location-btn {
  border-radius: 8px;
}

.rg-toggle-location-btn .rg-toggle-label {
  margin-left: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
}

/* —— Dashboard AI tab —— */
.rg-ai-wrap { animation: rgFade .35s ease; }

.rg-ai-summary-card {
  background: linear-gradient(135deg, #0f2a22 0%, #1b6b4a 55%, #163d4f 100%);
  color: #fff;
  border-radius: 14px;
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--rg-shadow);
}

.rg-ai-summary-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.65rem;
}

.rg-ai-summary-text {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.55;
  font-weight: 500;
  color: rgba(255,255,255,0.95);
}

.rg-ai-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 1.1rem;
}

.rg-ai-kpi {
  background: #fff;
  border: 1px solid var(--rg-line);
  border-left: 4px solid var(--ak, var(--rg-forest));
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  box-shadow: var(--rg-shadow-sm);
}

.rg-ai-kpi-val {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--rg-ink);
  line-height: 1.1;
}

.rg-ai-kpi-lbl {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--rg-ink-soft);
}

.rg-ai-kpi-sub {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  color: #64748b;
}

.rg-ai-insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  margin-bottom: 1.25rem;
}

.rg-ai-insight-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--rg-line);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--rg-shadow-sm);
}

.rg-ai-insight-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.15rem;
}

.rg-ai-level-ok .rg-ai-insight-icon { background: #dcfce7; color: #166534; }
.rg-ai-level-warn .rg-ai-insight-icon { background: #fee2e2; color: #991b1b; }
.rg-ai-level-info .rg-ai-insight-icon { background: #dbeafe; color: #1e40af; }
.rg-ai-level-ok { border-left: 4px solid #059669; }
.rg-ai-level-warn { border-left: 4px solid #dc2626; }
.rg-ai-level-info { border-left: 4px solid #2563eb; }

.rg-ai-insight-body h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 700;
}

.rg-ai-insight-body p {
  margin: 0;
  color: #4b6358;
  font-size: 0.86rem;
  line-height: 1.45;
}

.rg-ai-bucket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.rg-ai-fc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.rg-ai-bucket-card,
.rg-ai-fc-card {
  background: #fff;
  border: 1px solid var(--rg-line);
  border-radius: 12px;
  padding: 14px 16px 16px;
  box-shadow: var(--rg-shadow-sm);
}

.rg-ai-bucket-card { border-top: 3px solid var(--ak, var(--rg-forest)); }

.rg-ai-bucket-head,
.rg-ai-fc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.rg-ai-bucket-head h4,
.rg-ai-fc-head h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  flex: 1;
}

.rg-ai-mixbar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #eef2f0;
  margin-bottom: 8px;
}

.rg-ai-mixbar span { display: block; height: 100%; }
.rg-ai-mix-p, .rg-ai-mix-acc { background: #2d9a68; }
.rg-ai-mix-m { background: #c47a1a; }
.rg-ai-mix-w, .rg-ai-mix-rej { background: #c44536; }
.rg-ai-mix-n { background: #94a3b8; }

.rg-ai-mix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #4b6358;
  margin-bottom: 10px;
}

.rg-ai-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.rg-ai-dot.p, .rg-ai-dot.acc { background: #2d9a68; }
.rg-ai-dot.m { background: #c47a1a; }
.rg-ai-dot.w, .rg-ai-dot.rej { background: #c44536; }
.rg-ai-dot.n { background: #94a3b8; }

.rg-ai-qty-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rg-ai-qty-row .rg-grade-qty {
  min-width: 52px;
  padding: 6px 8px;
}

.rg-ai-chart-wrap {
  position: relative;
  min-height: 220px;
}

.rg-ai-chart-sm { min-height: 260px; }

.rg-ai-fc-sum {
  margin: 0 0 8px;
  font-size: 0.86rem;
  color: #4b6358;
}

.rg-ai-conf,
.rg-ai-trend {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}

.rg-ai-conf-high { background: #dcfce7; color: #166534; }
.rg-ai-conf-medium { background: #fef3c7; color: #92400e; }
.rg-ai-conf-low { background: #fee2e2; color: #991b1b; }
.rg-ai-trend-up { background: #dbeafe; color: #1e40af; }
.rg-ai-trend-down { background: #fee2e2; color: #991b1b; }
.rg-ai-trend-stable { background: var(--rg-mint); color: var(--rg-forest); }

.rg-ai-fc-table-wrap {
  max-height: 320px;
  overflow-y: auto;
}

.rg-ai-fc-table th,
.rg-ai-fc-table td {
  padding: 5px 6px;
  border-bottom: 1px solid var(--rg-line);
}

.rg-ai-fc-table th {
  font-weight: 700;
  color: var(--rg-ink-soft);
}

@media (max-width: 1100px) {
  .rg-ai-fc-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .rg-ai-insights-grid,
  .rg-ai-bucket-grid,
  .rg-ai-fc-grid {
    grid-template-columns: 1fr;
  }
}

