/* ReverseGreen desk — ERPNext / Frappe layout */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --rg-ink: #1f272e;
  --rg-ink-soft: #383838;
  --rg-forest: #2490ef;
  --rg-leaf: #2490ef;
  --rg-mint: #edf6fd;
  --rg-mist: #f4f5f6;
  --rg-line: #ededed;
  --rg-sand: #f8f8f8;
  --rg-amber: #e86c13;
  --rg-coral: #e24c4c;
  --rg-sky: #2490ef;
  --rg-violet: #6846c4;
  --rg-muted: #8d99a6;
  --rg-radius: 8px;
  --rg-shadow: none;
  --rg-shadow-sm: none;
  --rg-sidebar: 240px;
  --rg-navbar: 68px;
  --bs-primary: #2490ef;
  --bs-primary-rgb: 36, 144, 239;
}

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

body {
  background-image: none !important;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6,
.card-title, .card .card-title,
.rg-page-title, .rg-ticket-val, .rg-grade-qty-val,
.rg-kpi-val, .rg-ai-title, .rg-la-title, .rg-la-inline-title,
.rg-block-title {
  font-family: Inter, system-ui, sans-serif !important;
}

/* —— Desk shell: sidebar + navbar —— */
.erp-desk .horizontal-menu {
  height: 0;
  min-height: 0;
  overflow: visible;
}

.erp-desk .page-wrapper {
  margin-left: 0;
  padding-top: var(--rg-navbar);
  min-height: 100vh;
  background:
    radial-gradient(circle at 0% 0%, rgba(29, 111, 232, 0.14), transparent 42%),
    radial-gradient(circle at 100% 0%, rgba(46, 160, 67, 0.1), transparent 36%),
    radial-gradient(circle at 100% 100%, rgba(232, 93, 4, 0.12), transparent 40%),
    #f4f7fb;
}

.horizontal-menu .navbar.top-navbar {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  height: var(--rg-navbar) !important;
  min-height: var(--rg-navbar) !important;
  background: #fff !important;
  border-bottom: 0 !important;
  box-shadow: 0 8px 24px rgba(16, 40, 80, 0.06) !important;
  z-index: 1030;
  padding: 0 !important;
}

.horizontal-menu .navbar.top-navbar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, #1d6fe8, #2ea043 32%, #f0b429 58%, #e85d04 78%, #e23b3b);
}

.horizontal-menu .top-navbar .navbar-menu-wrapper.erp-header {
  display: grid !important;
  grid-template-columns: auto minmax(180px, 520px) auto;
  justify-content: space-between;
  align-items: center;
  height: calc(var(--rg-navbar) - 4px) !important;
  width: 100% !important;
  padding: 0 22px !important;
  gap: 18px;
}

.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: var(--rg-ink) !important;
}

.horizontal-menu .top-navbar .navbar-menu-wrapper .navbar-nav .nav-item {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.horizontal-menu .top-navbar .navbar-nav.navbar-nav-right {
  margin-left: 0 !important;
  justify-self: end;
}

.horizontal-menu .top-navbar .nav-item.nav-profile > .nav-link {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px !important;
  border-radius: 999px;
  background: #f4f7fb;
  border: 1px solid #e4eaf2;
}

.horizontal-menu .top-navbar .nav-profile-img img {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  object-fit: cover;
}

.horizontal-menu .top-navbar .nav-profile-text p {
  font-size: 13px !important;
  font-weight: 500 !important;
}

.erp-user-chevron {
  color: var(--rg-muted);
  font-size: 16px;
  margin-left: 2px;
}

.erp-sidebar-toggle {
  border: 0;
  background: transparent;
  color: var(--rg-ink);
  font-size: 20px;
  padding: 4px 8px;
  line-height: 1;
}

.online-color { color: #29a36a !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;
}

.rg-header-search {
  display: flex;
  align-items: center;
  justify-self: center;
  width: 100%;
  max-width: 520px;
  height: 40px;
  margin: 0;
  background: #f4f7fb;
  border: 1px solid #e4eaf2;
  border-radius: 999px;
  overflow: hidden;
  padding: 0 14px;
  gap: 8px;
}

.rg-header-search .fa-search {
  color: var(--rg-muted);
  font-size: 12px;
}

.rg-header-search .form-control {
  background: transparent !important;
  border: 0 !important;
  color: var(--rg-ink) !important;
  min-height: 30px;
  height: 30px;
  width: 100%;
  padding: 0 !important;
  font-size: 13px !important;
  box-shadow: none !important;
}

.rg-header-search .form-control::placeholder {
  color: var(--rg-muted);
}

.rg-header-search:focus-within {
  background: #fff;
  border-color: var(--rg-forest);
  box-shadow: 0 0 0 2px rgba(36, 144, 239, 0.18);
}

/* —— Sidebar —— */
.horizontal-menu .bottom-navbar {
  position: fixed !important;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rg-sidebar);
  background: #fff !important;
  border-right: 1px solid var(--rg-line);
  box-shadow: none !important;
  display: flex !important;
  flex-direction: column;
  z-index: 1040 !important;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.erp-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 16px;
  text-decoration: none;
  color: var(--rg-ink);
  flex: 0 0 auto;
}

.erp-sidebar-brand:hover {
  color: var(--rg-ink);
  text-decoration: none;
}

.erp-sidebar-brand img {
  width: auto;
  height: 36px;
  max-width: 168px;
  border-radius: 6px;
  object-fit: contain;
  background: #fff;
}

.erp-sidebar-brand span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.erp-top-brand {
  display: flex;
  align-items: center;
  margin-right: 0;
  flex: 0 0 auto;
  justify-self: start;
}

.erp-top-brand img {
  height: 52px;
  width: auto;
  max-width: 240px;
}

.erp-sidebar-hidden {
  display: none !important;
}

body.erp-home .navbar.top-navbar {
  left: 0 !important;
}

body.erp-home .page-wrapper {
  margin-left: 0 !important;
}

body.erp-home .erp-sidebar-toggle {
  display: none !important;
}

body.erp-home .erp-top-brand {
  display: flex;
}

body.erp-menu .page-wrapper,
body.erp-menu .content-wrapper,
body.erp-menu .page-body-wrapper,
body.erp-home .page-wrapper,
body.erp-home .content-wrapper,
body.erp-home .page-body-wrapper {
  background:
    radial-gradient(circle at 0% 0%, rgba(29, 111, 232, 0.16), transparent 42%),
    radial-gradient(circle at 100% 100%, rgba(232, 93, 4, 0.14), transparent 40%),
    #f6f8fc !important;
}

.rg-app-menu {
  max-width: 980px;
  margin: 8px auto 32px;
}

.rg-app-section {
  margin-bottom: 28px;
}

.rg-app-section h2 {
  margin: 0 0 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 500;
  font-size: 26px;
  letter-spacing: 0;
  color: #2b2b2b;
}

.rg-menu-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 18px;
  margin-bottom: 0;
}

.rg-home-wrap {
  padding-top: 0 !important;
}

.rg-home-hero {
  display: flex;
  align-items: flex-end;
  gap: 22px;
  min-height: 240px;
  margin: -16px -20px 28px;
  padding: 36px 40px;
  color: #fff;
  background:
    linear-gradient(115deg, rgba(12, 90, 219, 0.88) 0%, rgba(32, 168, 92, 0.5) 42%, rgba(240, 180, 41, 0.45) 68%, rgba(232, 93, 4, 0.78) 100%),
    url('../../images/rdaps-banner.jpg') center/cover no-repeat;
}

.rg-home-logo {
  width: min(240px, 46vw);
  height: auto;
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 14px 32px rgba(7, 20, 51, 0.28);
}

.rg-home-hero-copy h1 {
  margin: 0 0 6px;
  font-family: Inter, system-ui, sans-serif;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
}

.rg-home-hero-copy p {
  margin: 0;
  max-width: 36ch;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.94);
}

.rg-menu-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 12px;
  min-height: 168px;
  padding: 16px;
  border: 0;
  border-radius: 16px;
  text-decoration: none;
  color: #fff;
  overflow: hidden;
  background:
    linear-gradient(165deg, color-mix(in srgb, var(--mc, #1d6fe8) 28%, transparent), color-mix(in srgb, var(--mc, #1d6fe8) 82%, #071433)),
    url('../../images/rdaps-banner.jpg') center/cover no-repeat;
  box-shadow: 0 10px 24px rgba(16, 40, 80, 0.16);
}

.rg-menu-card:hover {
  transform: translateY(-3px);
  text-decoration: none;
  color: #fff;
  box-shadow: 0 16px 30px rgba(16, 40, 80, 0.22);
}

.rg-menu-card-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 26px;
  flex: 0 0 auto;
}

.rg-menu-card-label {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
}

@media (max-width: 900px) {
  .rg-menu-cards {
    grid-template-columns: 1fr;
  }

  .rg-home-hero {
    flex-direction: column;
    align-items: flex-start;
    min-height: 0;
    margin-left: -12px;
    margin-right: -12px;
    padding: 24px 18px;
  }

  .rg-home-hero-copy h1 {
    font-size: 26px;
  }
}

.erp-sidebar-brand span {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.erp-sidebar-label {
  flex: 0 0 auto;
  padding: 8px 18px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rg-muted);
}

.horizontal-menu .bottom-navbar .page-navigation {
  justify-content: flex-start !important;
  align-items: stretch !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  gap: 1px;
  padding: 4px 0 16px;
  margin: 0;
  width: 100%;
  display: flex !important;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.horizontal-menu .bottom-navbar .page-navigation > .nav-item {
  border: none !important;
  display: block !important;
  width: 100%;
  line-height: 1;
}

.horizontal-menu .bottom-navbar .page-navigation > .nav-item > .nav-link {
  color: var(--rg-ink) !important;
  font-weight: 450;
  font-size: 13px !important;
  letter-spacing: 0;
  padding: 7px 10px !important;
  margin: 0 8px;
  border-radius: 8px;
  transition: background .15s;
  display: flex !important;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  text-decoration: none;
  transform: none !important;
}

.horizontal-menu .bottom-navbar .page-navigation > .nav-item > .nav-link .menu-title {
  color: inherit !important;
  display: inline !important;
  font-size: 13px !important;
  font-weight: inherit !important;
}

.horizontal-menu .bottom-navbar .page-navigation > .nav-item > .nav-link:hover {
  background: #f3f3f3 !important;
  color: var(--rg-ink) !important;
}

.horizontal-menu .bottom-navbar .page-navigation > .nav-item.active > .nav-link {
  background: #f0f1f2 !important;
  color: var(--rg-ink) !important;
  font-weight: 600;
}

.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: inherit !important;
}

.horizontal-menu .bottom-navbar .menu-icon,
.horizontal-menu .bottom-navbar .page-navigation > .nav-item > .nav-link i {
  color: var(--rg-muted) !important;
  display: inline-block !important;
  margin: 0 !important;
  width: 18px;
  font-size: 16px;
  text-align: center;
}

.horizontal-menu .bottom-navbar .page-navigation > .nav-item.active > .nav-link i {
  color: var(--rg-forest) !important;
}

.erp-sidebar-backdrop {
  display: none;
}

@media (max-width: 991.98px) {
  .erp-desk .page-wrapper {
    margin-left: 0;
  }

  .horizontal-menu .navbar.top-navbar {
    left: 0;
  }

  .horizontal-menu .bottom-navbar {
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: none !important;
  }

  .horizontal-menu .bottom-navbar.header-toggled {
    transform: translateX(0);
    display: flex !important;
    background: #fff !important;
    max-height: none;
    overflow: hidden;
  }

  .erp-sidebar-backdrop.show {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1035;
  }

  .rg-header-search .form-control {
    width: 100%;
  }
}

@media (max-width: 575.98px) {
  .horizontal-menu .top-navbar .nav-profile-text {
    display: none;
  }
}

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

.page-body-wrapper {
  padding-top: 0 !important;
}

.content-wrapper {
  padding: 16px 20px 28px !important;
}

.container-scroller .content-wrapper {
  min-height: calc(100vh - var(--rg-navbar));
}

.page-header p,
.page-header .header-right p {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

.content-wrapper > .page-header,
.rg-dash-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  padding: 22px 24px;
  border-radius: 16px;
  color: #fff;
  background:
    linear-gradient(115deg, rgba(12, 90, 219, 0.88) 0%, rgba(32, 168, 92, 0.55) 46%, rgba(240, 180, 41, 0.42) 72%, rgba(232, 93, 4, 0.78) 100%),
    url('../../images/rdaps-banner.jpg') center/cover no-repeat;
  box-shadow: 0 12px 28px rgba(16, 40, 80, 0.16);
}

.content-wrapper > .page-header .rg-page-title,
.content-wrapper > .page-header h3,
.rg-dash-hero .rg-page-title {
  color: #fff !important;
  margin: 0 0 4px;
}

.content-wrapper > .page-header .rg-page-sub,
.content-wrapper > .page-header small,
.rg-dash-hero .rg-page-sub,
.rg-dash-hero-date {
  color: rgba(255, 255, 255, 0.94) !important;
}

.rg-dash-hero-date {
  font-weight: 600;
  font-size: 14px;
}

.content-wrapper > .page-header .breadcrumb {
  display: none;
}

.card {
  border: 1px solid var(--rg-line) !important;
  border-top: 4px solid #1d6fe8 !important;
  border-radius: var(--rg-radius) !important;
  box-shadow: 0 8px 22px rgba(16, 40, 80, 0.05) !important;
  background: #fff !important;
}

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

.card-title,
.card .card-title {
  font-family: Inter, system-ui, sans-serif;
  font-weight: 600;
  color: var(--rg-ink);
  font-size: 14px;
}

.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: Inter, system-ui, sans-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: linear-gradient(90deg, #1d6fe8, #1a9b63) !important;
  color: #fff !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  letter-spacing: 0;
  text-transform: none;
  padding: 10px !important;
  border: none !important;
  border-bottom: 0 !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: transparent;
}

.flot-chart-wrapper table tr:hover td,
.table tbody tr:hover td {
  background: #f8f8f8 !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-forest) !important;
  box-shadow: 0 0 0 2px rgba(36, 144, 239, 0.18) !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: var(--rg-forest) !important;
  border: 1px solid var(--rg-forest) !important;
  border-radius: 8px !important;
  font-weight: 500 !important;
  letter-spacing: 0;
  box-shadow: none !important;
  color: #fff !important;
}

.btn-primary:hover,
.auth-form-btn:hover {
  background: #1476cf !important;
  border-color: #1476cf !important;
  box-shadow: none !important;
}

.btn-success {
  background: #29a36a !important;
  border: none !important;
  border-radius: 8px !important;
  font-weight: 500;
}

.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: 8px;
  background: #fff;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(16, 40, 80, 0.06);
}

.rg-dash-tabs .rg-tab {
  appearance: none;
  border: none;
  border-bottom: 0;
  background: #f4f7fb;
  color: #1f3b73;
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  margin-bottom: 0;
}

.rg-dash-tabs .rg-tab:hover {
  background: #e7f1ff;
  color: #1d6fe8;
  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(90deg, #1d6fe8, #1a9b63);
  color: #fff !important;
  border-bottom-color: transparent;
  font-weight: 600;
  box-shadow: 0 6px 14px rgba(29, 111, 232, 0.28);
}

.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: Inter, system-ui, sans-serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  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: Inter, system-ui, sans-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: 1.15fr 0.85fr;
  background: #071433;
  padding: 0;
}

.rg-login-visual {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  padding: 48px 44px;
  color: #fff;
  background:
    linear-gradient(160deg, rgba(12, 90, 219, 0.88) 0%, rgba(32, 168, 92, 0.55) 38%, rgba(240, 180, 41, 0.42) 62%, rgba(232, 93, 4, 0.72) 100%),
    url('../../images/rdaps-banner.jpg') center/cover no-repeat;
  overflow: hidden;
}

.rg-login-visual::before {
  content: '';
  position: absolute;
  width: 280px;
  height: 280px;
  right: -60px;
  top: -70px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 10, 0.55), rgba(232, 93, 4, 0) 70%);
  pointer-events: none;
}

.rg-login-visual::after {
  content: '';
  position: absolute;
  width: 220px;
  height: 220px;
  left: -40px;
  bottom: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(46, 160, 67, 0.45), rgba(29, 111, 232, 0) 70%);
  pointer-events: none;
}

.rg-login-visual-inner {
  position: relative;
  z-index: 1;
  max-width: 460px;
}

.rg-login-logo {
  display: block;
  width: min(320px, 100%);
  height: auto;
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 16px 40px rgba(7, 20, 51, 0.28);
  margin-bottom: 22px;
}

.rg-login-visual h2 {
  margin: 0 0 8px;
  font-family: Inter, system-ui, sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
}

.rg-login-visual p {
  margin: 0;
  max-width: 34ch;
  font-size: 16px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
}

.rg-login-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  width: 100%;
  background:
    radial-gradient(circle at 0% 0%, rgba(29, 111, 232, 0.16), transparent 42%),
    radial-gradient(circle at 100% 100%, rgba(232, 93, 4, 0.14), transparent 40%),
    #f6f8fc;
}

.rg-login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 0;
  border-radius: 18px;
  padding: 28px 28px 22px;
  box-shadow: 0 18px 50px rgba(12, 40, 90, 0.12);
  position: relative;
  overflow: hidden;
}

.rg-login-card::before {
  content: '';
  display: block;
  height: 6px;
  margin: -28px -28px 22px;
  background: linear-gradient(90deg, #1d6fe8, #2ea043 32%, #f0b429 62%, #e85d04 82%, #e23b3b);
}

.rg-login-card-logo {
  display: block;
  width: 210px;
  max-width: 100%;
  height: auto;
  margin-bottom: 18px;
}

.rg-login-card h1 {
  font-family: Inter, system-ui, sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #172033;
  margin: 0 0 4px;
  text-align: left;
}

.rg-login-card .rg-login-lead {
  text-align: left;
  color: #6b7689;
  margin-bottom: 18px;
  font-size: 14px;
}

.rg-login-card .form-control,
.rg-login-card .input-group-text {
  min-height: 42px;
  font-size: 14px;
  border-radius: 10px !important;
}

.rg-login-card .btn-primary {
  height: 44px;
  min-height: 44px;
  padding: 8px 12px !important;
  font-size: 15px;
  font-weight: 600 !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: linear-gradient(90deg, #1d6fe8, #1a9b63 55%, #e85d04) !important;
  box-shadow: 0 8px 18px rgba(29, 111, 232, 0.28) !important;
}

.rg-login-card .btn-primary:hover {
  filter: brightness(1.05);
  background: linear-gradient(90deg, #1d6fe8, #1a9b63 55%, #e85d04) !important;
}

@media (max-width: 900px) {
  .rg-login-page {
    grid-template-columns: 1fr;
  }

  .rg-login-visual {
    min-height: 240px;
    padding: 28px 20px;
    align-items: flex-end;
  }

  .rg-login-logo {
    width: 180px;
    margin-bottom: 12px;
    padding: 8px 10px;
  }

  .rg-login-visual h2 {
    font-size: 22px;
  }

  .rg-login-visual p {
    font-size: 14px;
  }
}

.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;
}

/* Same-day, same-location tracking count, round avatar on the left */
.rg-trk-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rg-trk-row-txt {
  min-width: 0;
}
.rg-trk-occ {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e10600;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 700;
  line-height: 1 !important;
  text-align: center;
}
.rg-trk-occ-multi {
  background: #e10600;
}

/* 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: 8px;
  padding: 0.9rem 1rem;
  color: var(--rg-ink);
  background: #fff;
  border: 1px solid var(--rg-line);
  border-top: 3px solid var(--rg-forest);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rg-ticket-upload { background: #fff; border-top-color: #2490ef; }
.rg-ticket-recv { background: #fff; border-top-color: #29a36a; }
.rg-ticket-grade { background: #fff; border-top-color: #e86c13; }
.rg-ticket-val {
  font-family: Inter, system-ui, sans-serif;
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--rg-ink);
}
.rg-ticket-lbl {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 1;
  color: var(--rg-muted);
  line-height: 1.25;
  white-space: normal;
}
.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, #2490ef);
  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: Inter, system-ui, sans-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: #fff;
  color: var(--rg-ink);
  border: 1px solid var(--rg-line);
  border-top: 3px solid var(--rg-forest);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  box-shadow: none;
}

.rg-kpi-val {
  display: block;
  font-family: Inter, system-ui, sans-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: #fff; border-top-color: #2490ef; }
.rg-kpi-ok { background: #fff; border-top-color: #29a36a; }
.rg-kpi-bad { background: #fff; border-top-color: 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: linear-gradient(90deg, #1d6fe8, #1a9b63) !important;
  color: #fff !important;
  padding: 10px 8px !important;
  text-align: center !important;
  white-space: nowrap;
  font-size: 12px !important;
  font-weight: 500 !important;
  text-transform: none;
}

.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: transparent;
}

.rg-summary-table tbody tr:hover td {
  background: #f8f8f8 !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: #fff;
  color: var(--rg-ink);
  border: 1px solid var(--rg-line);
  border-left: 3px solid var(--rg-forest);
  border-radius: 8px;
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.25rem;
  box-shadow: none;
}

.rg-ai-title {
  font-family: Inter, system-ui, sans-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: Inter, system-ui, sans-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: Inter, system-ui, sans-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: Inter, system-ui, sans-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: Inter, system-ui, sans-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 + OK/Cancel) —— */
.card:has(.rg-multi-filters),
.card:has(.rg-att-station-wrap),
.card:has(.rg-client-la-toolbar),
.card:has(.rg-ms) {
  overflow: visible !important;
}

.rg-multi-filters,
.rg-att-station-wrap,
.rg-client-la-toolbar {
  overflow: visible;
  position: relative;
  z-index: 40;
}

.rg-multi-filters .SumoSelect,
.rg-att-station-wrap .SumoSelect {
  position: relative;
  overflow: visible;
}

.rg-multi-wrap.is-sumo-open,
.rg-att-station-wrap.is-sumo-open {
  z-index: 10050;
}

.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: 2;
}

.rg-multi-filters .SumoSelect.open .search-txt,
.rg-att-station-wrap .SumoSelect.open .search-txt {
  z-index: 3;
  height: 36px;
  max-height: 36px;
  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: 4;
  background: #fff;
  opacity: 1;
  overflow: hidden;
  min-width: 220px;
  pointer-events: auto;
}

.rg-multi-filters .SumoSelect.open > .optWrapper > .options,
.rg-att-station-wrap .SumoSelect.open > .optWrapper > .options {
  max-height: 180px;
  pointer-events: auto;
}

.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;
  pointer-events: auto;
}

.rg-multi-filters .SumoSelect.open > .optWrapper.multiple > .MultiControls,
.rg-att-station-wrap .SumoSelect.open > .optWrapper.multiple > .MultiControls {
  display: flex !important;
  visibility: visible !important;
  position: relative;
  z-index: 1;
  border-top: 1px solid #d0d7d3;
}

.rg-multi-filters .SumoSelect.open > .optWrapper.multiple > .MultiControls > p.btnOk,
.rg-multi-filters .SumoSelect.open > .optWrapper.multiple > .MultiControls > p.btnCancel,
.rg-att-station-wrap .SumoSelect.open > .optWrapper.multiple > .MultiControls > p.btnOk,
.rg-att-station-wrap .SumoSelect.open > .optWrapper.multiple > .MultiControls > p.btnCancel {
  display: inline-block !important;
  visibility: visible !important;
  width: 50%;
  margin: 0;
  padding: 10px 6px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}

.rg-multi-filters .SumoSelect.open > .optWrapper.multiple > .MultiControls > p.btnOk,
.rg-att-station-wrap .SumoSelect.open > .optWrapper.multiple > .MultiControls > p.btnOk {
  background: #2490ef;
  color: #fff;
}

.rg-multi-filters .SumoSelect.open > .optWrapper.multiple > .MultiControls > p.btnCancel,
.rg-att-station-wrap .SumoSelect.open > .optWrapper.multiple > .MultiControls > p.btnCancel {
  background: #f4f6f5;
  color: var(--rg-ink);
}

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

body.rg-sumo-open #listing_table,
body.rg-sumo-open .table-responsive {
  pointer-events: none;
}

body.rg-sumo-open .SumoSelect.open,
body.rg-sumo-open .SumoSelect.open * {
  pointer-events: auto;
}

.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-shift-filter {
  width: 240px;
  min-width: 220px;
  max-width: 280px;
}

.rg-att-page .rg-att-user-filter {
  width: 180px;
  min-width: 160px;
}

.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: #29a36a;
}

.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: #fff;
  color: var(--rg-ink);
  border: 1px solid var(--rg-line);
  border-left: 3px solid var(--rg-forest);
  border-radius: 8px;
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.1rem;
  box-shadow: none;
}

.rg-ai-summary-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--rg-mint);
  color: var(--rg-forest);
  font-size: 0.78rem;
  font-weight: 600;
  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: var(--rg-ink);
}

.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;
  }
}

