/* ==========================================================================
   Rich Bakers — Modern Admin Design System
   Mobile-first, professional, consistent design language.
   Loaded AFTER the legacy theme so every rule here wins the cascade.
   ========================================================================== */

:root {
  --rb-primary: #0369a1;
  --rb-primary-dark: #075985;
  --rb-primary-soft: #e0f2fe;
  --rb-secondary: #0284c7;
  --rb-success: #16a34a;
  --rb-success-soft: #ecfdf3;
  --rb-danger: #dc2626;
  --rb-danger-soft: #fef2f2;
  --rb-warning: #d97706;
  --rb-warning-soft: #fffbeb;
  --rb-info: #0891b2;
  --rb-info-soft: #ecfeff;
  --rb-bg: #f1f5f9;
  --rb-surface: #ffffff;
  --rb-surface-2: #f8fafc;
  --rb-text: #0f172a;
  --rb-muted: #64748b;
  --rb-border: #e2e8f0;
  --rb-border-strong: #cbd5e1;
  --rb-radius-lg: 14px;
  --rb-radius: 10px;
  --rb-radius-sm: 8px;
  --rb-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px -1px rgba(2, 84, 128, 0.05);
  --rb-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 3px 8px -2px rgba(2, 84, 128, 0.08);
  --rb-shadow-md: 0 6px 16px -6px rgba(2, 84, 128, 0.18), 0 2px 6px -2px rgba(15, 23, 42, 0.06);
  --rb-shadow-lg: 0 18px 40px -14px rgba(2, 84, 128, 0.32), 0 8px 18px -8px rgba(15, 23, 42, 0.12);
  --rb-topbar-h: 64px;
  --rb-sidebar-w: 264px;
  --rb-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--rb-font);
  background-color: var(--rb-bg);
  color: var(--rb-text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6, .card-title {
  color: var(--rb-text);
  font-weight: 650;
  letter-spacing: -0.01em;
}
a { color: var(--rb-primary); }
a:hover { color: var(--rb-primary-dark); }

::selection { background: var(--rb-primary-soft); color: var(--rb-primary-dark); }

/* ---------- App shell (master) ---------- */
.rb-app { min-height: 100vh; display: flex; flex-direction: column; }

.rb-topbar {
  position: sticky;
  top: 0;
  z-index: 1040;
  height: var(--rb-topbar-h);
  background: var(--rb-surface);
  border-bottom: 1px solid var(--rb-border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 6px 18px -10px rgba(2, 84, 128, 0.18);
}
.rb-topbar .rb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}
.rb-topbar .rb-brand .rb-brand-logo {
  height: 44px;
  width: auto;
  max-width: 110px;
  object-fit: contain;
}
.rb-topbar .rb-brand .rb-brand-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--rb-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.02em;
}
.rb-topbar .rb-brand .rb-brand-sub {
  font-size: 11px;
  color: var(--rb-muted);
  display: block;
  font-weight: 500;
  letter-spacing: 0;
}

.rb-menu-btn {
  background: none;
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-radius-sm);
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--rb-text);
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.rb-menu-btn:hover { background: var(--rb-surface-2); border-color: var(--rb-border-strong); }
.rb-menu-btn svg { width: 20px; height: 20px; }

.rb-topbar-spacer { flex: 1 1 auto; }

.rb-user-menu { position: relative; }
.rb-user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 10px 4px 4px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.rb-user-btn:hover { background: var(--rb-surface-2); border-color: var(--rb-border); }
.rb-user-btn img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--rb-primary-soft);
}
.rb-user-btn .rb-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--rb-text);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rb-user-btn .rb-user-role { font-size: 11px; color: var(--rb-muted); display: block; }

.rb-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 230px;
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-radius);
  box-shadow: var(--rb-shadow-md);
  padding: 6px;
  display: none;
  z-index: 1050;
}
.rb-dropdown.open { display: block; }
.rb-dropdown .rb-dd-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rb-border);
  margin-bottom: 6px;
}
.rb-dropdown .rb-dd-head img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
}
.rb-dropdown .rb-dd-head .rb-dd-name { font-weight: 650; font-size: 14px; }
.rb-dropdown .rb-dd-head .rb-dd-sub { font-size: 12px; color: var(--rb-muted); }
.rb-dropdown a.rb-dd-item, .rb-dropdown button.rb-dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--rb-radius-sm);
  background: none;
  color: var(--rb-text);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}
.rb-dropdown a.rb-dd-item:hover, .rb-dropdown button.rb-dd-item:hover {
  background: var(--rb-surface-2);
  color: var(--rb-primary-dark);
}
.rb-dropdown .rb-dd-sep { height: 1px; background: var(--rb-border); margin: 6px 8px; }

/* ---------- Sidebar ---------- */
.rb-sidebar {
  position: fixed;
  top: var(--rb-topbar-h);
  left: 0;
  bottom: 0;
  width: var(--rb-sidebar-w);
  background: var(--rb-surface);
  border-right: 1px solid var(--rb-border);
  overflow-y: auto;
  padding: 16px 12px 24px;
  z-index: 1030;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
}
.rb-sidebar.open { transform: translateX(0); }

.rb-nav-group { margin-bottom: 20px; }
.rb-nav-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rb-muted);
  padding: 0 10px 6px;
}
.rb-nav-item { display: block; }
.rb-nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--rb-radius-sm);
  color: #334155;
  font-size: 13.5px;
  font-weight: 550;
  text-decoration: none;
  margin-bottom: 2px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.rb-nav-link:hover {
  background: rgba(3, 105, 161, 0.07);
  color: var(--rb-primary-dark);
  text-decoration: none;
}
.rb-nav-link:hover svg { color: var(--rb-primary); }
.rb-nav-link.active {
  background: var(--rb-primary-soft);
  color: var(--rb-primary-dark);
  font-weight: 650;
  box-shadow: inset 0 0 0 1px rgba(3, 105, 161, 0.18);
}
.rb-nav-link svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--rb-muted);
  transition: color 0.15s ease, transform 0.15s ease;
}
.rb-nav-link:hover svg { transform: translateX(1px); }
.rb-nav-link.active svg { color: var(--rb-primary); }
.rb-nav-link .rb-nav-caret { margin-left: auto; font-size: 11px; color: var(--rb-muted); }

.rb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1029;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.rb-overlay.show { opacity: 1; pointer-events: auto; }

/* ---------- Main content ---------- */
.rb-main {
  flex: 1 1 auto;
  padding: 20px 16px 60px;
  min-width: 0;
}
.rb-footer {
  text-align: center;
  color: var(--rb-muted);
  font-size: 12.5px;
  padding: 18px 16px;
  border-top: 1px solid var(--rb-border);
  background: var(--rb-surface);
}

/* ---------- Page header (used on every content page) ---------- */
.rb-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}
.rb-page-header h1 {
  font-size: 22px;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.rb-page-header .rb-page-sub { color: var(--rb-muted); font-size: 13px; margin-top: 2px; }
.rb-page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.rb-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--rb-muted);
  margin-bottom: 6px;
}
.rb-breadcrumb a { color: var(--rb-muted); text-decoration: none; }
.rb-breadcrumb a:hover { color: var(--rb-primary); }
.rb-breadcrumb .rb-bc-sep { opacity: 0.5; }

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-radius-lg);
  background: var(--rb-surface);
  box-shadow: var(--rb-shadow);
  margin-bottom: 20px;
}
.card .card-body { padding: 20px; }
.card-title {
  font-size: 16px;
  margin-bottom: 4px;
  font-weight: 650;
}
.card-header {
  background: var(--rb-surface-2);
  border-bottom: 1px solid var(--rb-border);
  border-radius: calc(var(--rb-radius-lg) - 1px) calc(var(--rb-radius-lg) - 1px) 0 0;
  padding: 14px 20px;
}
.card-footer {
  background: var(--rb-surface-2);
  border-top: 1px solid var(--rb-border);
  border-radius: 0 0 calc(var(--rb-radius-lg) - 1px) calc(var(--rb-radius-lg) - 1px);
}

/* Legacy "blue strip" page headers used by old pages → replaced by modern toolbar strip */
.rb-toolbar {
  background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%);
  border-radius: var(--rb-radius-lg) var(--rb-radius-lg) 0 0;
  padding: 14px 20px;
}
.rb-toolbar h4 { color: #fff; margin: 0; font-weight: 650; font-size: 16px; }
.rb-toolbar .rb-toolbar-sub { color: rgba(255, 255, 255, 0.85); font-size: 12.5px; }

/* ---------- Stat cards (dashboard) ---------- */
.rb-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.rb-stat {
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-radius-lg);
  box-shadow: var(--rb-shadow);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.rb-stat .rb-stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.rb-stat .rb-stat-icon svg { width: 22px; height: 22px; color: #fff; }
.rb-stat .rb-stat-val { font-size: 24px; font-weight: 750; line-height: 1.1; letter-spacing: -0.02em; color: var(--rb-text); }
.rb-stat .rb-stat-lbl { font-size: 12.5px; color: var(--rb-muted); font-weight: 550; }
.rb-icon-primary { background: linear-gradient(135deg, #0284c7 0%, #7dd3fc 100%); }
.rb-icon-success { background: linear-gradient(135deg, #22c55e 0%, #10b981 100%); }
.rb-icon-danger { background: linear-gradient(135deg, #ef4444 0%, #f43f5e 100%); }
.rb-icon-warning { background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%); }
.rb-icon-info { background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%); }
.rb-stat .rb-stat-icon, .rb-stat-tile .rb-stat-icon {
  position: relative;
  border-radius: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -1px 0 rgba(15, 23, 42, 0.12), 0 8px 16px -6px rgba(15, 23, 42, 0.35);
}
.rb-stat .rb-stat-icon::after, .rb-stat-tile .rb-stat-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.38), transparent 55%);
  pointer-events: none;
}
.rb-stat .rb-stat-icon svg { position: relative; }
.rb-stat-tile:hover .rb-stat-icon {
  transform: scale(1.08) rotate(-3deg);
  transition: transform 0.2s ease;
}
.rb-stat-tile .rb-stat-icon svg { stroke-width: 2.2; }

/* ---------- Quick action cards (dashboard) ---------- */
.rb-quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.rb-quick {
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-radius-lg);
  box-shadow: var(--rb-shadow);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.rb-quick:hover { text-decoration: none; color: inherit; transform: translateY(-2px); box-shadow: var(--rb-shadow-md); border-color: var(--rb-border-strong); }
.rb-quick .rb-quick-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.rb-quick .rb-quick-icon svg { width: 21px; height: 21px; color: #fff; }
.rb-quick .rb-quick-title { font-weight: 650; font-size: 14px; color: var(--rb-text); }
.rb-quick .rb-quick-sub { font-size: 12px; color: var(--rb-muted); margin-top: 1px; }

/* ---------- Buttons ---------- */
.btn {
  border-radius: var(--rb-radius-sm);
  font-weight: 600;
  font-size: 13.5px;
  padding: 8px 16px;
  border-width: 1px;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn-xs { padding: 4px 10px; font-size: 12px; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn-rounded { border-radius: 999px; }
.btn-primary { background: var(--rb-primary); border-color: var(--rb-primary); color: #fff; }
.btn-primary:hover { background: var(--rb-primary-dark); border-color: var(--rb-primary-dark); color: #fff; }
.btn-info { background: var(--rb-info); border-color: var(--rb-info); color: #fff; }
.btn-info:hover { background: #0e7490; border-color: #0e7490; color: #fff; }
.btn-success { background: var(--rb-success); border-color: var(--rb-success); color: #fff; }
.btn-success:hover { background: #15803d; border-color: #15803d; color: #fff; }
.btn-danger { background: var(--rb-danger); border-color: var(--rb-danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn-warning { background: var(--rb-warning); border-color: var(--rb-warning); color: #fff; }
.btn-warning:hover { background: #b45309; border-color: #b45309; color: #fff; }
.btn-dark, .btn-secondary { background: #334155; border-color: #334155; color: #fff; }
.btn-dark:hover, .btn-secondary:hover { background: #1e293b; border-color: #1e293b; color: #fff; }
.btn-outline-primary { border-color: var(--rb-primary); color: var(--rb-primary); background: transparent; }
.btn-outline-primary:hover { background: var(--rb-primary); color: #fff; }
.btn:disabled, .btn.disabled { opacity: 0.6; cursor: not-allowed; }

/* ---------- Forms ---------- */
.form-control {
  border: 1px solid var(--rb-border-strong);
  border-radius: var(--rb-radius-sm);
  padding: 8px 12px;
  font-size: 14px;
  color: var(--rb-text);
  background: var(--rb-surface);
  height: auto;
  line-height: 1.5;
  transition: border-color 0.13s ease, box-shadow 0.13s ease;
}
.form-control:focus {
  border-color: var(--rb-primary);
  box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.16);
  outline: 0;
}
.form-control-sm { padding: 6px 10px; font-size: 13px; border-radius: 7px; }
select.form-control { cursor: pointer; }
textarea.form-control { min-height: 80px; }
label { font-weight: 600; font-size: 13px; color: #334155; margin-bottom: 6px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; }
.control-label { font-weight: 600; }
.input-group .input-group-text {
  background: var(--rb-surface-2);
  border: 1px solid var(--rb-border-strong);
  border-radius: var(--rb-radius-sm);
  color: var(--rb-muted);
  font-size: 14px;
}
.input-group-prepend .input-group-text { border-radius: var(--rb-radius-sm) 0 0 var(--rb-radius-sm); }
.input-group-sm .form-control, .input-group-sm .input-group-text { border-radius: 7px; }
.border-left { border-left: 1px solid var(--rb-border) !important; }
.form-control[readonly] { background: var(--rb-surface-2); }

/* Checkboxes (legacy filled-in style) */
.checkbox label, .filled-in { font-weight: 500; }

/* ---------- Tables ---------- */
.table-responsive { border-radius: var(--rb-radius); }
.table {
  margin-bottom: 0;
  font-size: 13.5px;
  color: var(--rb-text);
}
.table thead th {
  background: var(--rb-surface-2);
  color: #334155;
  font-weight: 650;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--rb-border);
  padding: 11px 12px;
  white-space: nowrap;
  vertical-align: middle;
}
.table td { padding: 10px 12px; border-top: 1px solid var(--rb-border); vertical-align: middle; }
.table tbody tr { transition: background 0.15s ease; }
.table-hover tbody tr:hover { background: rgba(3, 105, 161, 0.06); }
.table-striped tbody tr:nth-of-type(odd) { background: var(--rb-surface-2); }
.table-bordered { border: 1px solid var(--rb-border); }
.table-bordered th, .table-bordered td { border: 1px solid var(--rb-border); }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-responsive table { min-width: 640px; }

/* ---------- Badges / status chips ---------- */
.rb-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.6;
  white-space: nowrap;
}
.rb-chip-green { background: var(--rb-success-soft); color: var(--rb-success); }
.rb-chip-red { background: var(--rb-danger-soft); color: var(--rb-danger); }
.rb-chip-amber { background: var(--rb-warning-soft); color: var(--rb-warning); }
.rb-chip-blue { background: var(--rb-primary-soft); color: var(--rb-primary-dark); }
.rb-chip-gray { background: #f1f5f9; color: #475569; }

/* ---------- Modals ---------- */
.modal-content {
  border: 0;
  border-radius: var(--rb-radius-lg);
  box-shadow: var(--rb-shadow-md);
}
.modal-header {
  border-bottom: 1px solid var(--rb-border);
  padding: 16px 20px;
  align-items: center;
}
.modal-header .modal-title { font-size: 16px; font-weight: 650; }
.modal-header .close { font-size: 24px; font-weight: 400; opacity: 0.6; color: var(--rb-text); text-shadow: none; }
.modal-header .close:hover { opacity: 1; }
.modal-body { padding: 20px; }
.modal-footer { border-top: 1px solid var(--rb-border); padding: 14px 20px; }
.modal-dialog-centered { display: flex; align-items: center; min-height: calc(100% - 3.5rem); }
.modal-backdrop.show { opacity: 0.5; }
@media (max-width: 575.98px) {
  .modal-dialog { margin: 0.6rem; }
  .modal-body { padding: 16px; }
}

/* Custom JS-driven modals that bypass Bootstrap (class fade1, shown via .show()) */
.modal.fade1 { display: none; }
.modal.fade1.show, .modal.fade1.in { display: block !important; background: rgba(15, 23, 42, 0.55); }
.modal.fade1.show .modal-dialog, .modal.fade1.in .modal-dialog { margin: 30px auto; }
.modal.fade1.show .modal-content, .modal.fade1.in .modal-content { box-shadow: 0 25px 60px rgba(15, 23, 42, 0.35); }

/* ---------- Dropdowns ---------- */
.dropdown-menu {
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-radius);
  box-shadow: var(--rb-shadow-md);
  padding: 6px;
  font-size: 13.5px;
}
.dropdown-menu .dropdown-item { border-radius: 7px; padding: 8px 12px; font-weight: 500; }
.dropdown-menu .dropdown-item:hover { background: var(--rb-surface-2); color: var(--rb-primary-dark); }
.dropdown-menu .dropdown-divider { border-color: var(--rb-border); margin: 6px 8px; }

/* ---------- Nav tabs ---------- */
.nav-tabs { border-bottom: 1px solid var(--rb-border); }
.nav-tabs .nav-link {
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--rb-muted);
  font-weight: 600;
  font-size: 13.5px;
  padding: 10px 16px;
  background: none;
}
.nav-tabs .nav-link.active, .nav-tabs .nav-link:hover {
  border-bottom-color: var(--rb-primary);
  color: var(--rb-primary-dark);
  background: none;
}
.nav-pills .nav-link { border-radius: 999px; color: var(--rb-muted); font-weight: 600; }
.nav-pills .nav-link.active { background: var(--rb-primary-soft); color: var(--rb-primary-dark); }

/* ---------- Toasts (toastr containers + custom toasts) ---------- */
.toast-container { z-index: 99999 !important; }
.toast-container .toast {
  border-radius: var(--rb-radius) !important;
  box-shadow: var(--rb-shadow-md) !important;
  border: 0 !important;
  font-family: var(--rb-font);
  opacity: 1 !important;
}
.toast-container .toast-success { background: var(--rb-success) !important; }
.toast-container .toast-error { background: var(--rb-danger) !important; }
.toast-container .toast-info { background: var(--rb-info) !important; }
.toast-container .toast-warning { background: var(--rb-warning) !important; }
.toast-container .toast-message { font-weight: 600; font-size: 13.5px; padding: 14px 18px; }

/* ---------- Preloader ---------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: var(--rb-surface);
  display: flex;
  align-items: center;
  justify-content: center;
}
.rb-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid var(--rb-border);
  border-top-color: var(--rb-primary);
  border-radius: 50%;
  animation: rbSpin 0.7s linear infinite;
}
@keyframes rbSpin { to { transform: rotate(360deg); } }
.lds-ripple { position: relative; width: 64px; height: 64px; }
.lds-ripple .lds-pos { position: absolute; border: 3px solid var(--rb-primary); opacity: 1; border-radius: 50%; animation: ldsRipple 1.2s cubic-bezier(0, 0.2, 0.8, 1) infinite; }
.lds-ripple .lds-pos:nth-child(2) { animation-delay: -0.6s; }
@keyframes ldsRipple { 0% { top: 28px; left: 28px; width: 0; height: 0; opacity: 1; } 100% { top: -1px; left: -1px; width: 58px; height: 58px; opacity: 0; } }

/* ---------- Skeleton loaders ---------- */
.rb-map { height: 220px; width: 100%; border: 1px solid var(--rb-border); border-radius: 10px; padding: 4px; }

.rb-canvas { border: 1px solid var(--rb-border); border-radius: 8px; max-width: 100%; height: auto; }

/* ============ GPS Loader ============ */
.gps-loader {
  position: fixed; inset: 0; z-index: 99999;
  display: none; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.gps-loader-box {
  width: min(90%, 380px); background: #fff; border-radius: 20px;
  padding: 30px 25px; text-align: center; box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
}
.gps-spinner {
  width: 55px; height: 55px; margin: 0 auto 20px;
  border: 5px solid #e5e7eb; border-top-color: #dc2626; border-radius: 50%;
  animation: gpsSpin 0.9s linear infinite;
}
@keyframes gpsSpin { to { transform: rotate(360deg); } }
.gps-loader-title { font-size: 20px; font-weight: 700; color: #111827; margin-bottom: 8px; }
.gps-loader-text { font-size: 14px; line-height: 1.5; color: #6b7280; margin-bottom: 15px; }
.gps-loader-accuracy {
  display: inline-block; padding: 7px 14px; border-radius: 20px;
  background: #fef2f2; color: #dc2626; font-size: 13px; font-weight: 600;
}
.gps-progress-track {
  height: 8px; border-radius: 4px; background: #e5e7eb; margin-top: 15px; overflow: hidden;
}
.gps-progress-bar { height: 100%; width: 0%; background: #dc2626; border-radius: 4px; transition: width 0.3s ease; }
.gps-progress-text { font-size: 12px; color: #6b7280; margin-top: 8px; }

.rb-skeleton {
  background: linear-gradient(90deg, #eef2f7 25%, #e2e8f0 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: rbShimmer 1.4s ease infinite;
  border-radius: 6px;
}
@keyframes rbShimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Empty / error / info states ---------- */
.rb-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--rb-muted);
}
.rb-empty .rb-empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--rb-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.rb-empty .rb-empty-icon svg { width: 30px; height: 30px; color: var(--rb-border-strong); }
.rb-empty h5 { color: var(--rb-text); margin-bottom: 6px; }
.rb-empty p { font-size: 13px; max-width: 320px; margin: 0 auto; }

.rb-alert {
  border-radius: var(--rb-radius);
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 550;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.rb-alert-danger { background: var(--rb-danger-soft); border-color: #fecaca; color: #991b1b; }
.rb-alert-success { background: var(--rb-success-soft); border-color: #bbf7d0; color: #166534; }
.rb-alert-info { background: var(--rb-info-soft); border-color: #a5f3fc; color: #155e75; }
.rb-alert-warning { background: var(--rb-warning-soft); border-color: #fde68a; color: #92400e; }

/* ---------- jsgrid (legacy grids on Staff / MText) ---------- */
.jsgrid-table { font-size: 13.5px; }
.jsgrid-header-row > .jsgrid-header-cell {
  background: var(--rb-surface-2);
  color: #334155;
  font-weight: 650;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--rb-border);
}
.jsgrid-row > .jsgrid-cell { border-bottom: 1px solid var(--rb-border); padding: 10px 12px; }
.jsgrid-edit-row > .jsgrid-cell, .jsgrid-insert-row > .jsgrid-cell { background: var(--rb-warning-soft); }
.jsgrid-button { opacity: 0.8; }
.jsgrid-button:hover { opacity: 1; }

/* ---------- Login page (split-panel) ---------- */
.rb-auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background:
    radial-gradient(1000px 500px at 85% -10%, rgba(3, 105, 161, 0.18), transparent 60%),
    radial-gradient(800px 400px at -10% 110%, rgba(56, 189, 248, 0.16), transparent 55%),
    var(--rb-bg);
}
.rb-auth-shell {
  width: 100%;
  max-width: 1000px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-radius: 22px;
  box-shadow: 0 30px 70px -20px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

/* Brand showcase panel */
.rb-auth-showcase {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #075985 0%, #0369a1 50%, #38bdf8 100%);
  color: #fff;
  padding: 44px 38px;
  display: flex;
  flex-direction: column;
  animation: rbFadeInLeft 0.55s ease both;
}
.rb-float-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  animation: rbFloat 9s ease-in-out infinite alternate;
}
.rb-blob-a { width: 300px; height: 300px; background: rgba(56, 189, 248, 0.5); top: -120px; right: -80px; }
.rb-blob-b { width: 240px; height: 240px; background: rgba(2, 132, 199, 0.4); bottom: -110px; left: -70px; animation-delay: -4s; }
.rb-float-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  pointer-events: none;
  animation: rbFloat 11s ease-in-out infinite alternate;
}
.rb-ring-a { width: 130px; height: 130px; top: 16%; right: 10%; animation-delay: -2s; }
.rb-ring-b { width: 60px; height: 60px; bottom: 18%; left: 12%; border-width: 3px; animation-delay: -6s; }
.rb-showcase-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 34px;
}
.rb-showcase-logo {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.35);
}
.rb-showcase-logo img { max-width: 40px; max-height: 40px; object-fit: contain; }
.rb-showcase-brand { display: flex; flex-direction: column; min-width: 0; }
.rb-showcase-name { font-size: 19px; font-weight: 750; letter-spacing: -0.02em; }
.rb-showcase-tag { font-size: 12px; color: rgba(255, 255, 255, 0.78); font-weight: 500; }
.rb-showcase-title {
  position: relative;
  z-index: 1;
  font-size: 24px;
  font-weight: 750;
  color: #fff;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.rb-showcase-sub {
  position: relative;
  z-index: 1;
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 26px;
  max-width: 360px;
}
.rb-feature-list {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.rb-feature-list li { display: flex; align-items: flex-start; gap: 13px; font-size: 13px; line-height: 1.5; color: rgba(255, 255, 255, 0.9); }
.rb-feature-list li strong { color: #fff; font-weight: 650; }
.rb-feature-ico {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.rb-feature-ico svg { width: 19px; height: 19px; color: #fff; }
.rb-showcase-foot {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 28px;
}

/* Login card (right panel) */
.rb-auth-card {
  background: var(--rb-surface);
  padding: 44px 42px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: rbFadeInUp 0.55s ease 0.12s both;
}
.rb-auth-logo { display: flex; justify-content: center; margin-bottom: 18px; }
.rb-auth-logo img { max-height: 64px; max-width: 180px; object-fit: contain; }
.rb-auth-card h1 { font-size: 23px; text-align: center; letter-spacing: -0.02em; margin-bottom: 4px; }
.rb-auth-card .rb-auth-sub { text-align: center; color: var(--rb-muted); font-size: 13px; margin-bottom: 26px; }
.rb-auth-card .form-control { padding: 11px 14px; font-size: 14.5px; }
.rb-auth-card .input-group-text { padding: 0 14px; }
.rb-auth-card .btn-block { width: 100%; padding: 12px; font-size: 14.5px; border-radius: 10px; }
.rb-auth-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  font-size: 11.5px;
  color: var(--rb-muted);
}
.rb-auth-foot svg { flex: 0 0 auto; opacity: 0.7; }

/* Auth — error alert */
.rb-auth-error {
  display: flex; align-items: center; gap: 8px;
  background: var(--rb-danger-soft); border: 1px solid #fecaca;
  color: #991b1b; border-radius: 10px; padding: 10px 14px;
  font-size: 13px; font-weight: 600; margin-bottom: 18px;
}

/* Auth — input field group */
.rb-auth-label {
  font-size: 12.5px; font-weight: 650; color: #334155;
  display: block; margin-bottom: 6px;
}
.rb-auth-input-group {
  position: relative; display: flex; align-items: center;
}
.rb-auth-input-group .rb-auth-icon {
  position: absolute; left: 14px; z-index: 1;
  display: flex; align-items: center; color: var(--rb-muted);
}
.rb-auth-input-group .rb-auth-icon svg { width: 18px; height: 18px; }
.rb-auth-field {
  padding-left: 44px !important; height: 48px !important;
  font-size: 14.5px !important; border-radius: 12px !important;
}

/* Auth — sign-in button */
.rb-auth-btn {
  width: 100%; padding: 13px; font-size: 15px; font-weight: 700;
  border-radius: 12px; border: 0; margin-top: 4px;
  background: linear-gradient(135deg, #0369a1 0%, #0284c7 50%, #38bdf8 100%);
  color: #fff; letter-spacing: 0.01em;
  box-shadow: 0 8px 22px -6px rgba(3, 105, 161, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative; overflow: hidden;
}
.rb-auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -8px rgba(2, 84, 128, 0.6);
}
.rb-auth-btn:active { transform: translateY(0); }
.rb-auth-btn .rb-btn-label { display: inline-flex; align-items: center; gap: 8px; }
/* Loading state */
.rb-auth-btn.rb-btn-loading { pointer-events: none; opacity: 0.92; }
.rb-auth-btn.rb-btn-loading .rb-btn-label { visibility: hidden; }
.rb-auth-btn.rb-btn-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 20px; height: 20px; border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: #fff; border-radius: 50%;
  animation: rbSpin 0.6s linear infinite;
}

/* Sign-in button loading spinner */
.rb-btn-loading { position: relative; pointer-events: none; opacity: 0.9; }
.rb-btn-loading .rb-btn-label { visibility: hidden; }
.rb-btn-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: rbSpin 0.6s linear infinite;
}

/* Login entrance + ambient animations */
@keyframes rbFadeInLeft { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: translateX(0); } }
@keyframes rbFadeInUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rbFloat { from { transform: translateY(0) scale(1); } to { transform: translateY(-16px) scale(1.05); } }
@media (prefers-reduced-motion: reduce) {
  .rb-auth-showcase, .rb-auth-card { animation: none; }
  .rb-float-blob, .rb-float-ring { animation: none; }
}

/* =====================================================================
   Login responsive — attractive mobile-first refinements
   ===================================================================== */

/* Tablets & small laptops */
@media (max-width: 991.98px) {
  .rb-auth-shell { max-width: 860px; }
  .rb-auth-showcase { padding: 36px 28px; }
  .rb-auth-card { padding: 38px 30px 32px; }
  .rb-showcase-title { font-size: 20px; }
}

/* ------------------------------------------------------------------
   Mobile — full-width single column, attractive design
   ------------------------------------------------------------------ */
@media (max-width: 767.98px) {
  .rb-auth {
    align-items: stretch;
    padding: 0;
    min-height: auto;
    min-height: 100dvh;
    background: var(--rb-bg);
  }
  .rb-auth-shell {
    grid-template-columns: 1fr;
    max-width: 100%;
    border-radius: 0;
    min-height: 100vh;
    min-height: 100dvh;
    border: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
  }

  /* ── Compact brand header ── */
  .rb-auth-showcase {
    padding: 20px 20px 16px;
    animation: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: linear-gradient(135deg, #075985 0%, #0369a1 40%, #38bdf8 100%);
    position: relative;
    overflow: hidden;
  }
  /* Subtle decorative circle */
  .rb-auth-showcase::after {
    content: "";
    position: absolute;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    top: -80px; right: -60px;
    pointer-events: none;
  }
  .rb-showcase-top { margin-bottom: 0; justify-content: center; gap: 12px; }
  .rb-showcase-logo {
    width: 48px; height: 48px;
    border-radius: 14px;
    box-shadow: 0 6px 16px -4px rgba(0, 0, 0, 0.4);
  }
  .rb-showcase-logo img { max-width: 34px; max-height: 34px; }
  .rb-showcase-brand { gap: 1px; }
  .rb-showcase-name { font-size: 15px; font-weight: 700; text-align: center; color: #fff; }
  .rb-showcase-tag { font-size: 11px; color: rgba(255,255,255,0.75); text-align: center; }
  .rb-showcase-title,
  .rb-showcase-sub,
  .rb-feature-list,
  .rb-showcase-foot,
  .rb-float-blob,
  .rb-float-ring { display: none; }

  /* ── Login card — attractive with accent top border ── */
  .rb-auth-card {
    position: relative;
    padding: 28px 24px 24px;
    animation: none;
    justify-content: center;
    flex: 1 1 auto;
    overflow: hidden;
  }
  .rb-auth-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #075985, #0369a1, #38bdf8);
    z-index: 1;
  }
  .rb-auth-logo {
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
  }
  .rb-auth-logo img {
    max-height: 50px;
    max-width: 140px;
    filter: drop-shadow(0 2px 6px rgba(3, 105, 161, 0.25));
  }
  .rb-auth-card h1 {
    font-size: 22px;
    font-weight: 750;
    text-align: center;
    letter-spacing: -0.02em;
    margin-bottom: 2px;
    color: #1e293b;
  }
  .rb-auth-card .rb-auth-sub {
    font-size: 12.5px;
    text-align: center;
    color: #94a3b8;
    margin-bottom: 24px;
  }

  /* ── Touch-friendly inputs — 16px prevents iOS auto-zoom ── */
  .rb-auth-field {
    height: 50px !important;
    font-size: 16px !important;
    border-radius: 12px !important;
    border: 1.5px solid #e2e8f0 !important;
    background: #f8fafc !important;
    box-shadow: none !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease !important;
  }
  .rb-auth-field:focus,
  .rb-auth-field:focus-visible {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.18) !important;
    background: #fff !important;
    outline: none !important;
  }
  .rb-auth-label {
    font-size: 13px;
    font-weight: 650;
    color: #475569;
    margin-bottom: 6px;
  }
  .rb-auth-input-group .rb-auth-icon {
    color: #94a3b8;
  }
  .form-group { margin-bottom: 16px !important; }

  /* ── Attractive gradient button ── */
  .rb-auth-btn {
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 14px;
    min-height: 52px;
    background: linear-gradient(135deg, #0369a1 0%, #0284c7 50%, #38bdf8 100%) !important;
    box-shadow: 0 8px 24px -6px rgba(3, 105, 161, 0.3) !important;
    border: 0 !important;
    color: #fff !important;
    letter-spacing: 0.01em;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    position: relative;
    overflow: hidden;
  }
  .rb-auth-btn::before {
    content: "";
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
    z-index: 1;
  }
  .rb-auth-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 28px -6px rgba(3, 105, 161, 0.45) !important; }
  .rb-auth-btn:active { transform: scale(0.97); }
  .rb-auth-btn:active::before { left: 100%; }
  .rb-auth-btn .rb-btn-label { position: relative; z-index: 2; }

  /* ── Error alert ── */
  .rb-auth-error {
    font-size: 12.5px;
    padding: 10px 14px;
    margin-bottom: 16px;
    border-radius: 12px;
  }

  /* ── Footer ── */
  .rb-auth-foot {
    font-size: 10.5px;
    gap: 5px;
    padding: 12px 16px 0;
    text-align: center;
    margin-top: 16px;
    color: #94a3b8;
    border-top: 1px solid #f1f5f9;
  }
  .rb-auth-foot span { line-height: 1.4; }
  .rb-auth-foot svg { opacity: 0.5; }

  /* ── Safe area for notched phones ── */
  .rb-auth-card {
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
}

/* ------------------------------------------------------------------
   Small phones (< 375px)
   ------------------------------------------------------------------ */
@media (max-width: 374.98px) {
  .rb-auth-showcase { padding: 16px 14px 12px; }
  .rb-showcase-logo { width: 42px; height: 42px; border-radius: 12px; }
  .rb-showcase-logo img { max-width: 30px; max-height: 30px; }
  .rb-showcase-name { font-size: 14px; }
  .rb-auth-card {
    padding: 22px 18px 20px;
    border-top-width: 2.5px;
  }
  .rb-auth-card h1 { font-size: 19px; }
  .rb-auth-card .rb-auth-sub { font-size: 12px; margin-bottom: 20px; }
  .rb-auth-logo { margin-bottom: 10px; }
  .rb-auth-logo img { max-height: 44px; max-width: 120px; }
  .rb-auth-field { height: 48px !important; font-size: 15px !important; }
  .rb-auth-btn { padding: 13px; font-size: 15px; min-height: 48px; }
  .form-group { margin-bottom: 14px !important; }
  .rb-auth-foot { font-size: 10px; }
}

/* ------------------------------------------------------------------
   Landscape phones — ultra-compact
   ------------------------------------------------------------------ */
@media (max-height: 600px) and (max-width: 767.98px) {
  .rb-auth-shell { min-height: auto; }
  .rb-auth-showcase { padding: 10px 14px; }
  .rb-auth-showcase::after { display: none; }
  .rb-auth-card::before { height: 2.5px; }
  .rb-showcase-logo { width: 36px; height: 36px; }
  .rb-showcase-logo img { max-width: 26px; max-height: 26px; }
  .rb-showcase-name { font-size: 13px; }
  .rb-auth-card { padding: 14px 20px 12px; }
  .rb-auth-card h1 { font-size: 17px; margin-bottom: 1px; }
  .rb-auth-card .rb-auth-sub { margin-bottom: 10px; font-size: 11.5px; }
  .rb-auth-logo { margin-bottom: 6px; }
  .rb-auth-logo img { max-height: 36px; }
  .form-group { margin-bottom: 8px !important; }
  .rb-auth-label { margin-bottom: 3px; font-size: 11px; }
  .rb-auth-field { height: 42px !important; font-size: 14px !important; }
  .rb-auth-btn { padding: 10px; font-size: 14px; min-height: 40px; margin-top: 2px; }
  .rb-auth-foot { margin-top: 8px; font-size: 10px; }
}

/* ------------------------------------------------------------------
   Tablets in landscape — keep two-column but narrower
   ------------------------------------------------------------------ */
@media (min-width: 768px) and (max-width: 991.98px) and (orientation: landscape) {
  .rb-auth-showcase { padding: 28px 22px; }
  .rb-showcase-title { font-size: 18px; }
  .rb-showcase-sub { font-size: 12px; }
  .rb-feature-list li { font-size: 12px; gap: 10px; }
  .rb-auth-card { padding: 28px 24px 22px; }
}

/* ------------------------------------------------------------------
   Very tall phones — allow scroll instead of stretching
   ------------------------------------------------------------------ */
@media (max-width: 767.98px) and (min-height: 800px) {
  .rb-auth-shell { min-height: auto; }
  .rb-auth-card { flex: 0 0 auto; }
}
/* Safe area for notched phones */
@supports (padding: env(safe-area-inset-top)) {
  .rb-auth-shell { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
}

/* ---------- Misc legacy component overrides ---------- */
.bg-primary { background-color: var(--rb-primary) !important; }
.bg-info { background-color: var(--rb-info) !important; }
.bg-success { background-color: var(--rb-success) !important; }
.bg-danger { background-color: var(--rb-danger) !important; }
.bg-warning { background-color: var(--rb-warning) !important; }
.bg-secondary { background-color: #64748b !important; }
.text-primary { color: var(--rb-primary) !important; }
.text-info { color: var(--rb-info) !important; }
.text-success { color: var(--rb-success) !important; }
.text-danger { color: var(--rb-danger) !important; }
.text-warning { color: var(--rb-warning) !important; }
.text-muted { color: var(--rb-muted) !important; }
.text-dark { color: var(--rb-text) !important; }

.round { border-radius: 50% !important; }
.rounded-circle { border-radius: 50% !important; }

/* ---------- Responsive ---------- */
@media (min-width: 992px) {
  .rb-sidebar { transform: translateX(0); }
  .rb-main { margin-left: var(--rb-sidebar-w); padding: 24px 28px 60px; }
  .rb-menu-btn { display: none; }
  .rb-overlay { display: none; }
}
@media (max-width: 991.98px) {
  .rb-main { padding: 16px 12px 56px; }
}
@media (max-width: 575.98px) {
  .rb-page-header h1 { font-size: 19px; }
  .rb-stat { padding: 13px; }
  .rb-stat .rb-stat-val { font-size: 20px; }
  .rb-user-btn .rb-user-name { display: none; }
  .card .card-body { padding: 16px; }
  .table thead th { padding: 9px 10px; }
  .table td { padding: 8px 10px; }
}

/* ==========================================================================
   Dashboard (Home.aspx) — hero, stats, donut, feeds, department bars
   ========================================================================== */

/* ---------- Hero welcome banner ---------- */
.rb-hero {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(120deg, #075985 0%, #0369a1 45%, #38bdf8 100%);
  color: #fff;
  padding: 26px 26px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: 0 14px 34px -10px rgba(3, 105, 161, 0.3);
}
.rb-hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  pointer-events: none;
}
.rb-hero-glow-a { width: 300px; height: 300px; background: #7dd3fc; top: -140px; right: 8%; }
.rb-hero-glow-b { width: 260px; height: 260px; background: #38bdf8; bottom: -160px; left: -60px; opacity: 0.35; }
.rb-hero-body { position: relative; z-index: 1; min-width: 0; }
.rb-hero-greet { font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.85); text-transform: uppercase; letter-spacing: 0.06em; }
.rb-hero-title { font-size: 26px; font-weight: 750; margin: 2px 0 4px; color: #fff; letter-spacing: -0.02em; }
.rb-hero-sub { font-size: 13px; color: rgba(255, 255, 255, 0.82); }
.rb-hero-sub strong { color: #fff; }
.rb-hero-side { position: relative; z-index: 1; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.rb-hero-chip {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  padding: 10px 16px;
  min-width: 168px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.rb-hero-chip-lbl { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255, 255, 255, 0.8); }
.rb-hero-chip-val { font-size: 22px; font-weight: 750; line-height: 1.15; }
.rb-hero-chip-bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.25); margin-top: 7px; overflow: hidden; }
.rb-hero-chip-bar span { display: block; height: 100%; border-radius: 999px; background: #fff; transition: width 0.8s ease; }
.rb-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: #0369a1 !important;
  font-weight: 700;
  font-size: 13.5px;
  border-radius: 12px;
  padding: 11px 18px;
  text-decoration: none;
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.35);
  transition: transform 0.13s ease, box-shadow 0.13s ease;
}
.rb-hero-cta:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -6px rgba(0, 0, 0, 0.4); text-decoration: none; color: #0369a1 !important; }
.rb-hero-cta svg { width: 17px; height: 17px; }

/* ---------- Stat cards (enriched) ---------- */
.rb-stats { grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); }
.rb-stat {
  position: relative;
  overflow: hidden;
  padding: 18px 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.rb-stat::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(3, 105, 161, 0.07), transparent 70%);
  pointer-events: none;
}
.rb-stat:hover { transform: translateY(-3px); box-shadow: var(--rb-shadow-md); border-color: var(--rb-border-strong); }
.rb-stat .rb-stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  box-shadow: 0 6px 14px -4px rgba(15, 23, 42, 0.25);
  position: relative;
}
.rb-stat .rb-stat-info { display: flex; flex-direction: column; min-width: 0; }
.rb-stat .rb-stat-val { font-size: 25px; }
.rb-stat .rb-stat-lbl { font-size: 12.5px; }
.rb-stat .rb-stat-sub { font-size: 11.5px; color: var(--rb-muted); margin-top: 1px; opacity: 0.85; }
.rb-stat .rb-stat-arrow {
  position: absolute;
  right: 14px;
  bottom: 10px;
  font-size: 15px;
  color: var(--rb-border-strong);
  transition: transform 0.15s ease, color 0.15s ease;
}
.rb-stat:hover .rb-stat-arrow { transform: translateX(3px); color: var(--rb-primary); }
.rb-icon-mcn { background: linear-gradient(135deg, #64748b, #475569); }

/* ---------- Dashboard cards ---------- */
.rb-dash-card { transition: box-shadow 0.15s ease; }
.rb-dash-card:hover { box-shadow: var(--rb-shadow-md); }
.rb-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.rb-card-head .card-title { margin-bottom: 0; }
.rb-card-head .rb-card-sub { font-size: 12.5px; color: var(--rb-muted); margin-top: 2px; }
.rb-card-link { font-size: 12.5px; font-weight: 650; text-decoration: none; }
.rb-card-link:hover { text-decoration: underline; }
.rb-list-body { padding-top: 8px !important; padding-bottom: 8px !important; }
.rb-live-chip { display: inline-flex; align-items: center; gap: 6px; }
.rb-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rb-success);
  position: relative;
  flex: 0 0 auto;
}
.rb-pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--rb-success);
  opacity: 0.6;
  animation: rbPulse 1.8s ease-out infinite;
}
@keyframes rbPulse { 0% { transform: scale(0.6); opacity: 0.7; } 100% { transform: scale(1.6); opacity: 0; } }

/* ---------- Attendance donut ---------- */
.rb-donut-row { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; justify-content: center; }
.rb-donut-wrap { position: relative; width: 190px; height: 190px; flex: 0 0 auto; }
.rb-donut { width: 100%; height: 100%; transform: rotate(-90deg); }
.rb-donut-seg {
  fill: none;
  stroke-width: 3.2;
  stroke-linecap: butt;
  transition: stroke-dasharray 0.8s ease;
}
.rb-seg-present { stroke: var(--rb-success); }
.rb-seg-absent { stroke: var(--rb-danger); }
.rb-seg-leave { stroke: var(--rb-warning); }
.rb-seg-nomark { stroke: #e2e8f0; }
.rb-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.rb-donut-val { font-size: 30px; font-weight: 780; letter-spacing: -0.03em; line-height: 1; color: var(--rb-text); }
.rb-donut-lbl { font-size: 12px; color: var(--rb-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }
.rb-donut-legend { flex: 1 1 200px; min-width: 200px; display: flex; flex-direction: column; gap: 9px; }
.rb-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding: 7px 12px;
  border: 1px solid var(--rb-border);
  border-radius: 10px;
  background: var(--rb-surface-2);
}
.rb-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.rb-dot-green { background: var(--rb-success); }
.rb-dot-red { background: var(--rb-danger); }
.rb-dot-amber { background: var(--rb-warning); }
.rb-dot-gray { background: #cbd5e1; }
.rb-legend-lbl { font-weight: 600; color: #334155; }
.rb-legend-val { margin-left: auto; font-weight: 750; color: var(--rb-text); }
.rb-legend-pct { width: 44px; text-align: right; font-size: 12px; color: var(--rb-muted); }

/* ---------- Feed lists (punches / leaves) ---------- */
.rb-feed { display: flex; flex-direction: column; }
.rb-feed-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--rb-border);
}
.rb-feed-item:last-child { border-bottom: 0; }
.rb-feed-item:hover { background: var(--rb-surface-2); border-radius: 10px; padding-left: 10px; padding-right: 10px; margin: 0 -6px; border-bottom-color: transparent; }
.rb-av {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 750;
  flex: 0 0 auto;
}
.rb-feed-txt { min-width: 0; flex: 1 1 auto; }
.rb-feed-name { font-weight: 650; font-size: 13.5px; color: var(--rb-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-feed-sub { font-size: 12px; color: var(--rb-muted); }
.rb-feed-rt { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.rb-time {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 9px;
  font-variant-numeric: tabular-nums;
}
.rb-time-green { background: var(--rb-success-soft); color: var(--rb-success); }
.rb-time-blue { background: var(--rb-primary-soft); color: var(--rb-primary-dark); }
.rb-time-muted { background: #f1f5f9; color: var(--rb-muted); }
.rb-empty-sm { padding: 30px 16px; }
.rb-empty-sm .rb-empty-icon { width: 52px; height: 52px; }
.rb-empty-sm h5 { font-size: 14px; }
.rb-empty-sm p { font-size: 12.5px; }

/* ---------- Department bars ---------- */
.rb-bars { display: flex; flex-direction: column; gap: 14px; }
.rb-bar-row { }
.rb-bar-lbl { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 5px; }
.rb-bar-cnt { color: var(--rb-muted); font-weight: 650; }
.rb-bar-track { height: 9px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.rb-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--rb-primary), #7dd3fc);
  transition: width 0.7s ease;
}
.rb-bar-row:nth-child(6n+2) .rb-bar-fill { background: linear-gradient(90deg, var(--rb-success), #4ade80); }
.rb-bar-row:nth-child(6n+3) .rb-bar-fill { background: linear-gradient(90deg, var(--rb-info), #38bdf8); }
.rb-bar-row:nth-child(6n+4) .rb-bar-fill { background: linear-gradient(90deg, var(--rb-warning), #fbbf24); }
.rb-bar-row:nth-child(6n+5) .rb-bar-fill { background: linear-gradient(90deg, var(--rb-danger), #f87171); }
.rb-bar-row:nth-child(6n+6) .rb-bar-fill { background: linear-gradient(90deg, #38bdf8, #a5d8f8); }

/* ---------- Skeleton rows for lists ---------- */
.rb-skel-row { height: 46px; margin: 8px 0; }

/* ---------- Quick action tiles (enriched) ---------- */
.rb-quick { position: relative; overflow: hidden; padding: 16px 14px; }
.rb-quick .rb-quick-icon { width: 46px; height: 46px; box-shadow: 0 6px 14px -4px rgba(15, 23, 42, 0.22); }
.rb-quick .rb-quick-txt { display: flex; flex-direction: column; min-width: 0; }
.rb-quick .rb-quick-title, .rb-quick .rb-quick-sub { display: block; }
.rb-quick .rb-quick-go {
  margin-left: auto;
  font-size: 18px;
  color: var(--rb-border-strong);
  font-weight: 600;
  transition: transform 0.15s ease, color 0.15s ease;
}
.rb-quick:hover .rb-quick-go { transform: translateX(3px); color: var(--rb-primary); }
.rb-quick:hover .rb-quick-icon { transform: scale(1.06); }
.rb-quick .rb-quick-icon { transition: transform 0.15s ease; }

/* ---------- Global polish ---------- */
.rb-nav-link.active {
  position: relative;
  background: linear-gradient(100deg, var(--rb-primary-dark) 0%, var(--rb-primary) 55%, var(--rb-secondary) 100%);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 10px 20px -10px rgba(2, 84, 128, 0.55);
}
.rb-nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 27%;
  bottom: 27%;
  width: 3px;
  border-radius: 999px;
  background: #fff;
  opacity: 0.92;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}
.rb-nav-link.active svg { color: #fff; filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.35)); }
.rb-nav-link.active:hover { color: #fff; }
.rb-nav-group-label { display: flex; align-items: center; gap: 8px; }
.rb-nav-group-label::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--rb-border); }
.rb-brand-name { background: linear-gradient(90deg, var(--rb-primary), #38bdf8); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.rb-brand-sub { -webkit-text-fill-color: var(--rb-muted); }
.btn-primary { box-shadow: 0 5px 12px -5px rgba(3, 105, 161, 0.3); }
.btn-primary:hover { box-shadow: 0 7px 16px -5px rgba(3, 105, 161, 0.45); }
.card { transition: box-shadow 0.15s ease, border-color 0.15s ease; }

/* Dashboard responsive tweaks */
@media (max-width: 991.98px) {
  .rb-hero { padding: 22px 20px; }
  .rb-hero-title { font-size: 22px; }
}
@media (max-width: 575.98px) {
  .rb-hero { border-radius: 14px; }
  .rb-hero-title { font-size: 20px; }
  .rb-hero-side { width: 100%; }
  .rb-hero-chip { flex: 1 1 auto; min-width: 0; }
  .rb-donut-wrap { width: 160px; height: 160px; }
  .rb-donut-row { gap: 18px; }
  .rb-stat { padding: 14px 13px; }
  .rb-stat .rb-stat-icon { width: 44px; height: 44px; border-radius: 12px; }
  .rb-stat .rb-stat-val { font-size: 21px; }
  .rb-feed-rt { flex-direction: column; align-items: flex-end; gap: 3px; }
  .rb-card-head { padding: 12px 14px; }
  .card .card-body { padding: 14px; }
}

/* ==========================================================================
   Staff form (StfAdd) — sectioned cards, action panel, checkboxes, upload tiles
   ========================================================================== */

.rb-field { margin-bottom: 15px; }
.rb-field:last-child { margin-bottom: 0; }

.rb-sec-card { margin-bottom: 18px; overflow: hidden; }
.rb-sec-card .card-body { padding-top: 18px; }
.rb-sec-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--rb-border);
  background: linear-gradient(180deg, var(--rb-surface-2), var(--rb-surface));
}
.rb-sec-ico {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-shadow: 0 4px 10px -4px rgba(15, 23, 42, 0.3);
}
.rb-sec-ico svg { width: 19px; height: 19px; color: #fff; }
.rb-sec-title { font-size: 14.5px; font-weight: 700; color: var(--rb-text); }
.rb-sec-sub { font-size: 12px; color: var(--rb-muted); }

.rb-req { color: var(--rb-danger); font-weight: 700; }

.rb-group-lbl { font-size: 13px; font-weight: 600; color: #334155; display: block; margin-bottom: 8px; }
.rb-check { accent-color: var(--rb-primary); width: 17px; height: 17px; margin: 0; flex: 0 0 auto; }
.rb-check-lbl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  margin-bottom: 0;
  font-size: 13.5px;
}
.rb-check-lbl:hover { color: var(--rb-primary-dark); }

.rb-form-hint {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--rb-warning-soft);
  color: #92400e;
  border: 1px solid #fde68a;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: var(--rb-shadow-sm);
}

.rb-action-stack .btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
}
.rb-action-stack .btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.rb-act-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--rb-border);
  background: var(--rb-surface-2);
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 10px;
  transition: border-color 0.13s ease, color 0.13s ease, background 0.13s ease;
}
.rb-act-link:hover {
  border-color: var(--rb-primary);
  color: var(--rb-primary-dark);
  background: var(--rb-primary-soft);
  text-decoration: none;
}
.rb-act-link svg { width: 16px; height: 16px; color: var(--rb-muted); flex: 0 0 auto; }
.rb-act-link:hover svg { color: var(--rb-primary); }
.rb-act-sep { height: 1px; background: var(--rb-border); margin: 14px 0; }

.rb-photo-tile {
  border: 2px dashed var(--rb-border-strong);
  border-radius: 14px;
  padding: 18px 14px;
  background: var(--rb-surface-2);
}
.rb-photo-tile strong { font-size: 13px; color: #334155; }
.rb-photo-img {
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: var(--rb-shadow-sm);
}

@media (min-width: 992px) {
  .rb-sticky { position: sticky; top: calc(var(--rb-topbar-h) + 18px); }
}

/* ==========================================================================
   Attendance sheet (upAttn) + Master pages (Dep / Post)
   ========================================================================== */

/* Buttons: center icon + label */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn svg { flex: 0 0 auto; }

/* Filter toolbar button alignment */
.rb-field-btn { margin-bottom: 0; }
.rb-field-btn .btn { margin-top: 25px; }

/* Summary chips row (Present / Absent / Miss) + status filter */
.rb-summary-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rb-summary-chips .rb-chip { padding: 5px 14px; font-size: 12.5px; }
.rb-summary-chips .rb-chip b { font-size: 13px; }
.rb-sts-filter {
  width: 150px !important;
  margin-left: auto;
  padding: 5px 10px !important;
  font-size: 12.5px !important;
  height: auto !important;
}
@media (max-width: 575.98px) {
  .rb-sts-filter { width: 100% !important; margin-left: 0; }
}

/* Status cells written by upstfA.js (color-coded badges) */
#tblSData td.rb-sts {
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  border-radius: 0;
}
#tblSData td.rb-sts-P, #tblSData td.rb-sts-p { background: var(--rb-success-soft) !important; color: var(--rb-success) !important; }
#tblSData td.rb-sts-A, #tblSData td.rb-sts-a { background: var(--rb-danger-soft) !important; color: var(--rb-danger) !important; }
#tblSData td.rb-sts-MISS, #tblSData td.rb-sts-miss { background: var(--rb-warning-soft) !important; color: var(--rb-warning) !important; }

/* Row action buttons on Dep / Post lists */
.btn-circle {
  width: 34px;
  height: 34px;
  border-radius: 50% !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 3px 8px -3px rgba(15, 23, 42, 0.35);
}
.btn-circle .fa, .btn-circle i { font-size: 13px; line-height: 1; }
.contact-list tbody tr:hover { background: var(--rb-primary-soft); }

/* Mstr quick tiles sit inside a plain grid without Bootstrap row */
.rb-quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 4px; }

/* ---------- Print ---------- */
@media print {
  .rb-topbar, .rb-sidebar, .rb-overlay, .rb-footer, .rb-page-actions, .no-print, .btn, .modal, .toast-container { display: none !important; }
  .rb-main { margin-left: 0 !important; padding: 0 !important; }
  body { background: #fff !important; }
  .card { border: 0; box-shadow: none; }
  .table thead th { background: #f1f5f9 !important; color: #000 !important; }
}

/* ---------- Utility helpers ---------- */
.rb-mt-1 { margin-top: 8px; } .rb-mt-2 { margin-top: 16px; } .rb-mt-3 { margin-top: 24px; }
.rb-mb-1 { margin-bottom: 8px; } .rb-mb-2 { margin-bottom: 16px; } .rb-mb-3 { margin-bottom: 24px; }
.rb-text-center { text-align: center; }
.rb-d-flex { display: flex; align-items: center; gap: 8px; }
.rb-gap-2 { gap: 12px; }
.rb-wrap { flex-wrap: wrap; }
.rb-hide { display: none !important; }
.rb-w-100 { width: 100%; }
.rb-muted { color: var(--rb-muted); }
.rb-fs-12 { font-size: 12px; }
.rb-fs-13 { font-size: 13px; }

/* ---------- OAtten: punch station ---------- */
.rb-punch-card { overflow: hidden; margin-bottom: 18px; }
.rb-punch-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px 18px;
  background: linear-gradient(120deg, var(--rb-primary-dark), var(--rb-primary) 55%, #38bdf8);
  color: #fff;
}
.rb-punch-head-l { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rb-punch-ico {
  width: 42px; height: 42px; border-radius: 12px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.rb-punch-ico svg { width: 21px; height: 21px; color: #fff; }
.rb-punch-title { font-size: 15.5px; font-weight: 720; line-height: 1.2; }
.rb-punch-sub { font-size: 12px; color: rgba(255, 255, 255, 0.82); }
.rb-live-clock {
  font-size: 19px; font-weight: 750; letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px; padding: 5px 12px;
}
.rb-station-row { margin-bottom: 16px; }
.rb-station-lbl {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 650; color: #334155;
  margin-bottom: 7px;
}
.rb-station-lbl svg { width: 15px; height: 15px; color: var(--rb-primary); flex: 0 0 auto; }
.rb-dist-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.rb-dist-row .form-control { max-width: 150px; font-weight: 650; }
.rb-dist-badge {
  font-size: 12px; font-weight: 650; color: var(--rb-primary-dark);
  background: var(--rb-primary-soft); border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 999px; padding: 5px 12px; white-space: nowrap;
}
.rb-btn-locate {
  width: 100%; padding: 11px 14px; border-radius: 10px; font-weight: 650;
  background: var(--rb-primary-soft); color: var(--rb-primary-dark);
  border: 1px solid rgba(16, 185, 129, 0.35); margin-bottom: 18px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.rb-btn-locate svg { width: 16px; height: 16px; }
.rb-btn-locate:hover { background: var(--rb-primary); color: #fff; box-shadow: 0 8px 18px -6px rgba(5, 150, 105, 0.5); transform: translateY(-1px); }
.rb-upload-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  padding: 18px 14px; margin-bottom: 10px; text-align: center; cursor: pointer;
  border: 2px dashed var(--rb-border-strong); border-radius: 12px;
  color: var(--rb-muted); font-size: 12.5px; font-weight: 550;
  background: var(--rb-surface-2); transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.rb-upload-tile:hover { border-color: var(--rb-primary); color: var(--rb-primary-dark); background: var(--rb-primary-soft); }
.rb-upload-tile svg { width: 22px; height: 22px; color: var(--rb-primary); }
.rb-file-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rb-canvas-lg { width: 100%; height: auto; margin-top: 2px; }
.rb-punch-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rb-punch-btns .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 10px; border-radius: 12px; font-weight: 700; font-size: 14.5px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.rb-punch-btns .btn svg { width: 17px; height: 17px; }
.rb-punch-btns .btn:hover { transform: translateY(-1px); }
.rb-btn-in { background: linear-gradient(135deg, var(--rb-success), #059669); border: 0; color: #fff; box-shadow: 0 8px 18px -8px rgba(16, 185, 129, 0.65); }
.rb-btn-in:hover, .rb-btn-in:focus { background: linear-gradient(135deg, #16a34a, #15803d); color: #fff; }
.rb-btn-out { background: linear-gradient(135deg, #ef4444, #b91c1c); border: 0; color: #fff; box-shadow: 0 8px 18px -8px rgba(239, 68, 68, 0.65); }
.rb-btn-out:hover, .rb-btn-out:focus { background: linear-gradient(135deg, #b91c1c, #991b1b); color: #fff; }
.rb-punch-alert { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 0; }
.rb-records-card .card-body { padding-top: 16px; }
.rb-filter-row { display: flex; align-items: stretch; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.rb-filter-date { position: relative; flex: 1 1 220px; min-width: 200px; }
.rb-filter-date .form-control { padding: 10px 12px 10px 40px; font-size: 14px; border-radius: 10px; }
.rb-filter-ico {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  display: inline-flex; pointer-events: none; color: var(--rb-muted);
}
.rb-filter-ico svg { width: 17px; height: 17px; }
.rb-btn-go {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--rb-success), #059669); color: #fff;
  border: 0; border-radius: 10px; padding: 10px 18px; font-weight: 650;
  box-shadow: 0 8px 18px -8px rgba(16, 185, 129, 0.6);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.rb-btn-go svg { width: 16px; height: 16px; }
.rb-btn-go:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 10px 22px -8px rgba(16, 185, 129, 0.7); }

@media (max-width: 575.98px) {
  .rb-punch-head { padding: 14px 16px; }
  .rb-live-clock { font-size: 16px; }
  .rb-punch-btns { gap: 10px; }
  .rb-filter-row { flex-direction: column; }
  .rb-btn-go { justify-content: center; width: 100%; }
}

/* ---------- Cal: salary calendar ---------- */
.rb-filter-card { margin-bottom: 16px; }
.rb-filter-card .rb-field label { font-size: 12.5px; font-weight: 650; color: #334155; margin-bottom: 6px; }
.rb-filter-card .form-control { border-radius: 9px; padding: 9px 12px; font-size: 13.5px; }
.rb-cal-legend {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 10px 14px; margin-bottom: 16px;
  background: var(--rb-surface-2); border: 1px solid var(--rb-border);
  border-radius: 12px;
}
.rb-legend-title {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; color: var(--rb-text);
  text-transform: uppercase; letter-spacing: 0.04em; margin-right: 4px;
}
.rb-legend-title svg { width: 14px; height: 14px; color: var(--rb-primary); }
.rb-legend-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: #475569;
  background: #fff; border: 1px solid var(--rb-border);
  border-radius: 999px; padding: 4px 11px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.rb-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.rb-stats-strip { margin-bottom: 16px; }
.rb-stats-strip .col-6 { margin-bottom: 10px; }
.rb-stat-tile { border: 0; box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.08); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.rb-stat-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -8px rgba(15, 23, 42, 0.18); }
.rb-stat-tile .card-body { padding: 13px 14px; border-radius: var(--rb-radius); }
.rb-stat-tile .rb-stat-icon { width: 40px; height: 40px; box-shadow: 0 6px 14px -6px rgba(15, 23, 42, 0.35); }
.rb-stat-tile .rb-stat-val { font-size: 20px; letter-spacing: -0.02em; }
.rb-stat-tile .rb-stat-lbl { font-size: 11.5px; }
.rb-tile-info .card-body { background: linear-gradient(135deg, #f0fdfa, #ccfbf1); }
.rb-tile-info .rb-stat-val { color: #0d9488; }
.rb-tile-success .card-body { background: linear-gradient(135deg, #f0fdf4, #dcfce7); }
.rb-tile-success .rb-stat-val { color: #15803d; }
.rb-tile-warning .card-body { background: linear-gradient(135deg, #fffbeb, #fef3c7); }
.rb-tile-warning .rb-stat-val { color: #b45309; }
.rb-tile-primary .card-body { background: linear-gradient(135deg, #e0f2fe, #bae6fd); }
.rb-tile-primary .rb-stat-val { color: #0369a1; }
.rb-tile-danger .card-body { background: linear-gradient(135deg, #fef2f2, #fee2e2); }
.rb-tile-danger .rb-stat-val { color: #b91c1c; }
.rb-stat-tile-sal .card-body { background: linear-gradient(135deg, #e0f2fe, #a5d8f8) !important; }
.rb-stat-tile-sal .rb-stat-val { color: #0369a1 !important; }
#IdSC::before { content: "\20B9"; font-size: 0.8em; margin-right: 2px; opacity: 0.85; }
.rb-cal-card { margin-bottom: 4px; }
.rb-cal-card .card-body { padding-top: 16px; }
.rb-cal-table { font-size: 13px; }
.rb-cal-table thead th {
  text-align: center; font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.03em; text-transform: uppercase;
  background: linear-gradient(180deg, #f8fafc, #eef2f7);
  color: #334155; border-bottom: 2px solid var(--rb-border-strong);
  padding: 10px 6px;
}
.rb-cal-table thead th:last-child { color: #075985; background: linear-gradient(180deg, #eff8fe, #e0f2fe); }
.rb-cal-table tbody.btnrow td,
.rb-cal-table .btnrow td {
  text-align: center; font-weight: 700; font-size: 14px;
  padding: 8px 4px; min-height: 44px; line-height: 1.15;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.rb-cal-table .btnrow td:hover {
  transform: scale(1.05); box-shadow: 0 6px 16px -5px rgba(15, 23, 42, 0.3);
  position: relative; z-index: 1;
}
.rb-cal-table .btnrow td:empty { background: #fbfcfe; }
.rb-cal-table .btnrow td:nth-child(7):empty { background: #eff8fe; }
.rb-day-sts {
  display: block;
  font-size: 9px; font-weight: 800; letter-spacing: 0.06em;
  opacity: 0.95; margin-top: 2px;
  font-family: inherit;
}

/* ==========================================================================
   Staff leave page (StfLeave) — status pills, summary tiles, modals
   ========================================================================== */
.rb-leave-table thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--rb-muted); background: var(--rb-surface-2); }
.rb-leave-table tbody tr.jsgrid-row td { padding: 11px 12px; }
.rb-sts-pill {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 650; white-space: nowrap;
}
.rb-sts-pending { background: var(--rb-warning-soft); color: #b45309; border: 1px solid rgba(217, 119, 6, 0.25); }
.rb-sts-approved { background: var(--rb-success-soft); color: #15803d; border: 1px solid rgba(22, 163, 74, 0.25); }
.rb-sts-rejected { background: var(--rb-danger-soft); color: #b91c1c; border: 1px solid rgba(220, 38, 38, 0.25); }
.rb-sts-other { background: var(--rb-surface-2); color: var(--rb-muted); border: 1px solid var(--rb-border); }
.rb-leave-table a[data-target='#AttachModal'] {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 650; color: var(--rb-primary-dark);
  background: var(--rb-primary-soft); border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 11px; border-radius: 8px; transition: background 0.15s ease, color 0.15s ease;
}
.rb-leave-table a[data-target='#AttachModal']:hover { background: var(--rb-primary); color: #fff; text-decoration: none; }
.rb-leave-table a[data-target='#AttachModal']::before { content: "\f0c6"; font-family: "Font Awesome 5 Free"; font-weight: 900; font-size: 11px; }
.rb-leave-empty { padding: 0 !important; border: 0 !important; }
.rb-check-line {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 13.5px; font-weight: 600; color: var(--rb-text);
  background: var(--rb-surface-2); border: 1px solid var(--rb-border);
  border-radius: 10px; padding: 9px 14px; cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.rb-check-line:hover { border-color: var(--rb-primary); background: var(--rb-primary-soft); }
.rb-check-line .rb-check {
  width: 18px; height: 18px; margin: 0; cursor: pointer;
  accent-color: var(--rb-primary);
}
.rb-mb-0 { margin-bottom: 0 !important; }
.rb-detail-rows { padding-top: 6px; }
.rb-detail-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px 2px; border-bottom: 1px dashed var(--rb-border);
  font-size: 13.5px;
}
.rb-detail-row:last-child { border-bottom: 0; }
.rb-detail-lbl { width: 90px; flex: 0 0 90px; font-weight: 650; color: var(--rb-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.rb-detail-val { font-weight: 650; color: var(--rb-text); }
#AttachId .col-md-6 {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--rb-surface-2); border: 1px solid var(--rb-border);
  border-radius: 8px; padding: 6px 10px; margin: 0 6px 8px 0; font-size: 12.5px;
}
#AttachId .col-md-6 a { font-weight: 650; color: var(--rb-success); }
#AttachId .col-md-6 a:hover { color: var(--rb-success); text-decoration: underline; }
@media (max-width: 575px) {
  .rb-leave-table thead th { font-size: 10.5px; padding: 8px 8px; }
  .rb-sts-pill { font-size: 11px; padding: 3px 9px; }
}

/* ==========================================================================
   Dashboard — 14-day attendance trend + hero live clock
   ========================================================================== */
.rb-hero-chip-clock { min-width: 132px; }
.rb-hero-clock-val { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.rb-trend-card { margin-bottom: 16px; }
.rb-trend {
  display: flex; align-items: flex-end; gap: clamp(4px, 1.1vw, 14px);
  padding-top: 6px; min-height: 172px;
}
.rb-trend-col {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; gap: 6px;
  border-radius: 10px; padding: 8px 2px 6px;
  transition: background 0.15s ease, transform 0.15s ease;
  position: relative;
}
.rb-trend-col:hover { background: var(--rb-surface-2); transform: translateY(-2px); }
.rb-trend-col.rb-trend-today {
  background: var(--rb-primary-soft);
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.25);
}
.rb-trend-val { font-size: 12px; font-weight: 750; color: var(--rb-text); line-height: 1; }
.rb-trend-track {
  width: 100%; max-width: 34px; height: 96px;
  background: #eef2f7; border-radius: 8px; overflow: hidden;
  display: flex; align-items: flex-end;
}
.rb-trend-fill {
  width: 100%; border-radius: 8px;
  background: linear-gradient(180deg, #0284c7, #7dd3fc);
  min-height: 3px;
  transition: height 0.6s ease;
}
.rb-trend-today .rb-trend-fill { background: linear-gradient(180deg, #0369a1, #38bdf8); box-shadow: 0 4px 10px -4px rgba(3, 105, 161, 0.45); }
.rb-trend-lbl {
  font-size: 10.5px; font-weight: 650; color: var(--rb-muted);
  text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.rb-trend-today .rb-trend-lbl { color: var(--rb-primary-dark); }
.rb-skel-bar { height: 150px; border-radius: 10px; flex: 1 1 0; }
@media (max-width: 575px) {
  .rb-trend { gap: 3px; min-height: 150px; }
  .rb-trend-track { height: 82px; }
  .rb-trend-val { font-size: 10.5px; }
  .rb-trend-lbl { font-size: 9px; }
}

/* ==========================================================================
   Dashboard — weekly summary (grouped vertical bars)
   ========================================================================== */
.rb-chart-legend { display: flex; gap: 12px; flex-wrap: wrap; }
.rb-weekly-chart { min-height: 200px; }
.rb-weekly-inner {
  display: flex; align-items: flex-end; gap: clamp(4px, 1.2vw, 16px);
  height: 200px; padding-top: 6px;
}
.rb-weekly-col {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; gap: 4px;
  border-radius: 10px; padding: 6px 2px 4px;
  transition: background 0.15s ease;
}
.rb-weekly-col:hover { background: var(--rb-surface-2); }
.rb-weekly-today { background: var(--rb-primary-soft); box-shadow: inset 0 0 0 1px rgba(16,185,129,0.2); }
.rb-weekly-vals {
  display: flex; gap: 6px; font-size: 11px; font-weight: 700;
}
.rb-weekly-pv { color: var(--rb-success); }
.rb-weekly-av { color: var(--rb-danger); }
.rb-weekly-bars {
  display: flex; align-items: flex-end; gap: 3px;
  height: 130px; width: 100%; justify-content: center;
}
.rb-weekly-bar {
  width: 14px; border-radius: 6px 6px 2px 2px;
  min-height: 3px; transition: height 0.5s ease;
}
.rb-weekly-present { background: linear-gradient(180deg, #22c55e, #4ade80); }
.rb-weekly-absent { background: linear-gradient(180deg, #ef4444, #f87171); }
.rb-weekly-today .rb-weekly-present { box-shadow: 0 4px 10px -4px rgba(34,197,94,0.6); }
.rb-weekly-lbl {
  font-size: 10.5px; font-weight: 650; color: var(--rb-muted);
  text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.rb-weekly-today .rb-weekly-lbl { color: var(--rb-primary-dark); }

/* ==========================================================================
   Dashboard — punch time distribution (horizontal histogram)
   ========================================================================== */
.rb-punch-dist { min-height: 200px; }
.rb-punch-inner { display: flex; flex-direction: column; gap: 5px; }
.rb-punch-row {
  display: flex; align-items: center; gap: 8px;
}
.rb-punch-lbl {
  width: 52px; flex: 0 0 auto; font-size: 11px; font-weight: 650;
  color: var(--rb-muted); text-align: right; white-space: nowrap;
}
.rb-punch-track {
  flex: 1 1 auto; height: 18px; background: #eef2f7;
  border-radius: 6px; overflow: hidden;
}
.rb-punch-fill {
  height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  transition: width 0.5s ease;
}
.rb-punch-cnt {
  width: 28px; flex: 0 0 auto; font-size: 11px; font-weight: 700;
  color: var(--rb-text); text-align: left;
}




@media (max-width: 575px) {
  .rb-weekly-inner { height: 160px; gap: 3px; }
  .rb-weekly-bars { height: 100px; }
  .rb-weekly-bar { width: 10px; }
  .rb-weekly-vals { font-size: 9px; }
  .rb-weekly-lbl { font-size: 9px; }
  .rb-punch-lbl { width: 40px; font-size: 10px; }
  .rb-punch-cnt { width: 22px; font-size: 10px; }
  .rb-punch-track { height: 14px; }
}

/* ==========================================================================
   kumardairy — legacy monster layout neutralization inside the rb shell
   Pages wrap content in .page-wrapper > .container-fluid; the modern shell
   (.rb-main) now owns spacing + sidebar offset, so reset the old margins.
   ========================================================================== */
.page-wrapper {
  margin-left: 0 !important;
  padding-top: 0 !important;
  background: transparent !important;
  display: block !important;
}
.page-wrapper > .container-fluid,
.page-wrapper > .container-lg,
.page-wrapper > .container-md,
.page-wrapper > .container-sm,
.page-wrapper > .container-xl {
  padding: 0;
  min-height: 0;
}

/* ==========================================================================
   Ocean — premium finish layer
   Appended last so these refinements consistently win the cascade:
   • calm colour-aware shadows    • refined hover / active states
   • consistent focus rings       • slim sidebar scrollbar
   ========================================================================== */

/* —— Focus rings: one calm ocean halo for every interactive control —— */
.form-control:focus,
.form-control:focus-visible {
  border-color: var(--rb-primary);
  box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.16);
  outline: 0;
}
.btn:focus-visible,
.rb-auth-btn:focus-visible,
.rb-menu-btn:focus-visible,
.rb-nav-link:focus-visible {
  outline: 2px solid rgba(3, 105, 161, 0.55);
  outline-offset: 2px;
}

/* —— Buttons: quiet resting glow, gentle hover lift, colour-matched depth —— */
.btn {
  transition: background 0.15s ease, border-color 0.15s ease,
              box-shadow 0.2s ease, transform 0.12s ease;
}
.btn-primary { box-shadow: 0 4px 12px -6px rgba(3, 105, 161, 0.4); }
.btn-primary:hover,
.btn-outline-primary:hover,
.btn-success:hover,
.btn-danger:hover { transform: translateY(-1px); }
.btn-primary:hover { box-shadow: 0 10px 20px -8px rgba(2, 84, 128, 0.55); }
.btn-primary:active,
.btn-success:active,
.btn-danger:active { transform: translateY(0); }
.btn-outline-primary:hover { box-shadow: 0 8px 16px -8px rgba(3, 105, 161, 0.45); }

/* —— Clickable tiles: tinted border on hover (content cards stay still) —— */
.rb-stat:hover,
.rb-quick:hover { border-color: rgba(3, 105, 161, 0.3); }

/* —— Sidebar: slim, unobtrusive scrollbar —— */
.rb-sidebar {
  scrollbar-width: thin;
  scrollbar-color: var(--rb-border-strong) transparent;
}
.rb-sidebar::-webkit-scrollbar { width: 6px; }
.rb-sidebar::-webkit-scrollbar-track { background: transparent; }.rb-sidebar::-webkit-scrollbar-thumb { background: var(--rb-border-strong); border-radius: 999px; }
.rb-sidebar::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ==========================================================================
   Dashboard stat-card popups (rb-stat-pop) — hover / click detail panel
   Shown on the admin Home.aspx counters for Present / Absent / Leave lists.
   ========================================================================== */
.rb-stat.rb-sp-card { cursor: pointer; }
.rb-stat-pop {
  position: fixed;
  z-index: 2100;
  width: 330px;
  max-width: calc(100vw - 24px);
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-radius: 14px;
  box-shadow: var(--rb-shadow-lg), 0 2px 6px -2px rgba(15, 23, 42, 0.1);
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transition: opacity 0.14s ease, transform 0.14s ease;
  pointer-events: none;
}
.rb-stat-pop.show { opacity: 1; transform: none; pointer-events: auto; }
.rb-stat-pop .rb-sp-arr {
  position: absolute;
  left: 50%;
  margin-left: -7px;
  width: 0;
  height: 0;
}
.rb-stat-pop:not(.rb-sp-up) .rb-sp-arr {
  top: -8px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid var(--rb-border);
}
.rb-stat-pop:not(.rb-sp-up) .rb-sp-arr::after {
  content: "";
  position: absolute;
  left: -6px;
  top: 1px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--rb-surface);
}
.rb-stat-pop.rb-sp-up .rb-sp-arr {
  bottom: -8px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid var(--rb-border);
}
.rb-stat-pop.rb-sp-up .rb-sp-arr::after {
  content: "";
  position: absolute;
  left: -6px;
  top: -8px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--rb-surface);
}
.rb-stat-pop .rb-sp-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--rb-border);
}
.rb-stat-pop .rb-sp-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex: 0 0 auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 10px -4px rgba(15, 23, 42, 0.3);
}
.rb-stat-pop .rb-sp-ico svg { width: 17px; height: 17px; }
.rb-stat-pop .rb-sp-tt { flex: 1 1 auto; min-width: 0; }
.rb-stat-pop .rb-sp-title {
  font-size: 13.5px;
  font-weight: 750;
  color: var(--rb-text);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.rb-stat-pop .rb-sp-subt {
  font-size: 11px;
  color: var(--rb-muted);
  margin-top: 1px;
}
.rb-stat-pop .rb-sp-count {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 750;
  border-radius: 999px;
  padding: 3px 10px;
  background: var(--rb-primary-soft);
  color: var(--rb-primary-dark);
  font-variant-numeric: tabular-nums;
}
.rb-stat-pop .rb-sp-close {
  border: 0;
  background: transparent;
  color: var(--rb-muted);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 3px 7px;
  border-radius: 7px;
  flex: 0 0 auto;
}
.rb-stat-pop .rb-sp-close:hover { background: var(--rb-surface-2); color: var(--rb-text); }
.rb-stat-pop .rb-sp-body {
  max-height: 300px;
  overflow-y: auto;
  padding: 6px;
  overscroll-behavior: contain;
}
.rb-stat-pop .rb-sp-load {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 10px;
  color: var(--rb-muted);
  font-size: 12.5px;
}
.rb-stat-pop .rb-sp-spin {
  width: 14px;
  height: 14px;
  border: 2px solid var(--rb-border-strong);
  border-top-color: var(--rb-primary);
  border-radius: 50%;
  animation: rbSpin 0.6s linear infinite;
  flex: 0 0 auto;
}
.rb-stat-pop .rb-sp-empty {
  padding: 20px 12px;
  text-align: center;
  color: var(--rb-muted);
  font-size: 12.5px;
}
.rb-stat-pop .rb-sp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 10px;
  min-width: 0;
}
.rb-stat-pop .rb-sp-row:hover { background: var(--rb-surface-2); }
.rb-stat-pop .rb-sp-av {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex: 0 0 auto;
  box-shadow: 0 2px 6px -2px rgba(15, 23, 42, 0.25);
}
.rb-stat-pop .rb-sp-txt {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.rb-stat-pop .rb-sp-nm {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--rb-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rb-stat-pop .rb-sp-sub {
  font-size: 11px;
  color: var(--rb-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rb-stat-pop .rb-sp-rt {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  max-width: 45%;
  justify-content: flex-end;
}
.rb-stat-pop .rb-sp-rt .rb-time { padding: 2px 7px; font-size: 11px; }
.rb-stat-pop .rb-sp-rt .rb-chip { padding: 2px 8px; font-size: 11px; }
.rb-stat-pop .rb-sp-body::-webkit-scrollbar { width: 6px; }
.rb-stat-pop .rb-sp-body::-webkit-scrollbar-thumb { background: var(--rb-border-strong); border-radius: 999px; }
/* ==========================================================================
   CRM Lead Generator — CRM-specific styles
   ========================================================================== */

/* ---------- CRM Stats Cards ---------- */
.crm-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.crm-stat-card {
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-radius-lg);
  box-shadow: var(--rb-shadow);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.crm-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--rb-shadow-md);
  border-color: var(--rb-border-strong);
}
.crm-stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), inset 0 -1px 0 rgba(15,23,42,0.12), 0 8px 16px -6px rgba(15,23,42,0.35);
}
.crm-stat-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 18%, rgba(255,255,255,0.38), transparent 55%);
  pointer-events: none;
}
.crm-stat-icon svg { width: 22px; height: 22px; color: #fff; position: relative; }
.crm-icon-all { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.crm-icon-new { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.crm-icon-contacted { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.crm-icon-progress { background: linear-gradient(135deg, #0ea5e9, #38bdf8); }
.crm-icon-converted { background: linear-gradient(135deg, #22c55e, #4ade80); }
.crm-icon-followup { background: linear-gradient(135deg, #ef4444, #f87171); }
.crm-stat-val {
  font-size: 24px;
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--rb-text);
}
.crm-stat-lbl {
  font-size: 12.5px;
  color: var(--rb-muted);
  font-weight: 550;
}

/* ---------- CRM Filter Bar ---------- */
.crm-filter-bar {
  margin-bottom: 14px;
  padding: 14px 16px;
  background: var(--rb-surface-2);
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-radius);
}

/* ---------- CRM Lead Table ---------- */
.crm-lead-table {
  font-size: 13px;
}
.crm-lead-table thead th {
  background: var(--rb-surface-2);
  color: #334155;
  font-weight: 650;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--rb-border);
  padding: 10px 10px;
  white-space: nowrap;
  vertical-align: middle;
}
.crm-lead-table td {
  padding: 9px 10px;
  border-top: 1px solid var(--rb-border);
  vertical-align: middle;
}
.crm-lead-table tbody tr { transition: background 0.1s ease; }
.crm-lead-table tbody tr:hover { background: var(--rb-primary-soft); }

/* ---------- CRM Stage Badges ---------- */
.crm-stage-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
}
.crm-stage-new { background: #eff6ff; color: #2563eb; }
.crm-stage-contacted { background: #fffbeb; color: #d97706; }
.crm-stage-progress { background: #ecfeff; color: #0891b2; }
.crm-stage-qualified { background: #f0fdf4; color: #16a34a; }
.crm-stage-proposal { background: #faf5ff; color: #9333ea; }
.crm-stage-converted { background: #ecfdf3; color: #16a34a; }
.crm-stage-lost { background: #fef2f2; color: #dc2626; }

/* ---------- CRM Priority Badges ---------- */
.crm-pri-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
}
.crm-pri-low { background: #f1f5f9; color: #64748b; }
.crm-pri-medium { background: #eff6ff; color: #3b82f6; }
.crm-pri-high { background: #fffbeb; color: #d97706; }
.crm-pri-urgent { background: #fef2f2; color: #dc2626; }

/* ---------- CRM Follow-up Chips ---------- */
.crm-fup-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
}
.crm-fup-overdue { background: #fef2f2; color: #dc2626; }
.crm-fup-today { background: #fffbeb; color: #d97706; }
.crm-fup-upcoming { background: #ecfdf3; color: #16a34a; }

/* ---------- CRM Source Chip ---------- */
.crm-src-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 550;
  background: #f1f5f9;
  color: #475569;
  white-space: nowrap;
}

/* ---------- CRM Tag Badges (form) ---------- */
.crm-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.crm-tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--rb-surface-2);
  border: 1.5px solid var(--rb-border);
  color: var(--rb-muted);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}
.crm-tag:hover {
  border-color: var(--rb-primary);
  color: var(--rb-primary-dark);
  background: var(--rb-primary-soft);
}
.crm-tag.active {
  background: var(--rb-primary);
  color: #fff;
  border-color: var(--rb-primary);
  box-shadow: 0 4px 10px -4px rgba(79, 70, 229, 0.55);
}

/* ---------- CRM Detail Modal Groups ---------- */
.crm-detail-group {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rb-border);
}
.crm-detail-group:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}
.crm-detail-label {
  font-size: 11.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rb-muted);
  margin-bottom: 3px;
}
.crm-detail-val {
  font-size: 14px;
  color: var(--rb-text);
}
.crm-detail-val a {
  color: var(--rb-primary);
  text-decoration: none;
}
.crm-detail-val a:hover {
  text-decoration: underline;
}

/* ---------- CRM Report Date Filter ---------- */
.crm-report-filter {
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-radius-lg);
  padding: 0;
  margin-bottom: 18px;
  overflow: hidden;
}
.crm-report-filter-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  flex-wrap: wrap;
}
.crm-report-filter-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 650;
  color: var(--rb-text);
  white-space: nowrap;
}
.crm-report-filter-fields {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.crm-report-filter-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.crm-report-filter-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--rb-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.crm-report-filter-field .form-control-sm {
  border-radius: var(--rb-radius);
  border-color: var(--rb-border);
  font-size: 13px;
  padding: 5px 10px;
  height: 32px;
  min-width: 140px;
}
.crm-report-filter-field .form-control-sm:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}
.crm-report-filter-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
}
.crm-preset-btn {
  font-size: 11.5px !important;
  padding: 4px 12px !important;
  border-radius: 999px !important;
  font-weight: 600 !important;
  transition: all 0.2s ease;
}
.crm-preset-btn.active {
  background: var(--rb-primary) !important;
  color: #fff !important;
  border-color: var(--rb-primary) !important;
}
.crm-report-filter-status {
  padding: 0 20px 12px;
}
@media (max-width: 767.98px) {
  .crm-report-filter-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
  }
  .crm-report-filter-presets {
    margin-left: 0;
  }
  .crm-report-filter-field .form-control-sm {
    min-width: 120px;
  }
}

/* ---------- CRM Funnel ---------- */
.crm-funnel { display: flex; flex-direction: column; gap: 10px; padding: 10px 0; }
.crm-funnel-row { display: flex; align-items: center; gap: 12px; }
.crm-funnel-label { min-width: 110px; font-size: 12.5px; font-weight: 600; color: var(--rb-text); text-align: right; white-space: nowrap; }
.crm-funnel-bar-wrap { flex: 1; background: var(--rb-surface-2); border-radius: 8px; height: 32px; overflow: hidden; }
.crm-funnel-bar { height: 100%; border-radius: 8px; display: flex; align-items: center; justify-content: flex-end; padding-right: 10px; min-width: 40px; transition: width 0.6s ease; }
.crm-funnel-bar-val { font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }

/* ---------- CRM Lead Photo & GPS ---------- */
.crm-photo-capture { border: 2px dashed var(--rb-border); border-radius: 10px; padding: 8px; background: var(--rb-surface); position: relative; }
.crm-photo-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 16px; cursor: pointer; color: var(--rb-muted); text-align: center; border-radius: 8px; transition: background 0.2s; }
.crm-photo-placeholder:hover { background: var(--rb-surface-2); color: var(--rb-text); }
.crm-photo-placeholder svg { margin-bottom: 6px; opacity: 0.5; }
.crm-photo-placeholder div { font-size: 12.5px; }
.crm-photo-preview { position: relative; text-align: center; }
.crm-photo-preview canvas { border-radius: 8px; max-width: 100%; height: auto; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.crm-lead-thumb { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid var(--rb-border); cursor: pointer; transition: transform 0.15s; }
.crm-lead-thumb:hover { transform: scale(1.15); border-color: var(--rb-primary); }
.crm-lead-no-photo { color: var(--rb-muted); font-size: 12px; }
.crm-detail-photo { max-width: 100%; border-radius: 10px; box-shadow: 0 2px 12px rgba(0,0,0,0.15); cursor: pointer; transition: transform 0.2s; }
.crm-detail-photo:hover { transform: scale(1.02); }
.crm-detail-location { padding: 12px 16px; background: var(--rb-surface); border-radius: 8px; border-left: 4px solid var(--rb-primary); margin-bottom: 20px; }
.crm-detail-location-label { font-size: 12px; font-weight: 600; color: var(--rb-muted); margin-bottom: 4px; }
.crm-detail-location-val { font-size: 13px; color: var(--rb-text); }
.crm-geo-status { margin-bottom: 6px; font-size: 12px; padding: 6px 10px; border-radius: 6px; background: var(--rb-surface); }
.crm-geo-loading { color: var(--rb-primary); }
.crm-geo-ok { color: var(--rb-success); }
.crm-geo-error { color: var(--rb-danger); }
.crm-geo-waiting { color: var(--rb-muted); }

/* ---------- CRM Responsive ---------- */
@media (max-width: 991.98px) {
  .crm-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 575.98px) {
  .crm-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .crm-stat-card { padding: 13px; }
  .crm-stat-val { font-size: 20px; }
  .crm-filter-bar { padding: 10px 12px; }
  .crm-lead-table { font-size: 12px; }
  .crm-lead-table thead th { font-size: 10.5px; padding: 8px 6px; }
  .crm-lead-table td { padding: 7px 6px; }
  .crm-funnel-label { min-width: 80px; font-size: 11px; }
  .crm-funnel-bar { height: 26px; }
}

/* ---------- CRM Print-Only Header ---------- */
.crm-print-header { display: none; }

/* ---------- CRM Print / PDF Styles ---------- */
@media print {
  /* Hide everything non-essential */
  .rb-topbar, .rb-sidebar, .rb-overlay, .rb-main,
  .rb-page-header, .crm-report-filter, .crm-report-filter-status,
  .btn, .rb-page-actions, .card-header,
  .rb-footer, .preloader, .rb-app > aside,
  #btnRefreshReports, #btnExportReport, #btnPrintReport, #btnExit { display: none !important; }

  /* Show print header */
  .crm-print-header {
    display: block !important;
    padding: 0 0 16px;
    margin-bottom: 18px;
    border-bottom: 2px solid #1e293b;
  }
  .crm-print-header-top {
    display: flex;
    align-items: center;
    gap: 16px;
  }
  .crm-print-logo {
    width: 48px;
    height: 48px;
    background: #3b82f6;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .crm-print-logo::after {
    content: 'CRM';
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
  }
  .crm-print-title h1 {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1.2;
  }
  .crm-print-sub {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
  }
  .crm-print-meta {
    margin-left: auto;
    text-align: right;
    font-size: 11px;
    color: #64748b;
  }
  .crm-print-meta-row { margin-bottom: 2px; }

  /* Reset body */
  body {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .rb-app { display: block !important; }
  .rb-main { display: block !important; width: 100% !important; margin: 0 !important; padding: 0 !important; }
  .form1 { display: block !important; }

  /* Force show content area */
  .rb-main > *, .rb-main > div { display: block !important; }

  /* KPI stats row */
  .crm-stats {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
    page-break-inside: avoid;
  }
  .crm-stat-card {
    border: 1px solid #e2e8f0 !important;
    background: #fff !important;
    padding: 10px 14px !important;
  }
  .crm-stat-icon { display: none !important; }
  .crm-stat-val { font-size: 20px !important; }
  .crm-stat-lbl { font-size: 11px !important; }

  /* Cards */
  .card.rb-dash-card {
    border: 1px solid #e2e8f0 !important;
    background: #fff !important;
    box-shadow: none !important;
    margin-bottom: 14px !important;
    page-break-inside: avoid;
  }
  .card-body { padding: 12px !important; }
  .card-title { font-size: 14px !important; color: #1e293b !important; }
  .rb-card-sub { display: none !important; }

  /* Charts - ensure they fit on page */
  .card-body div[style*="position:relative"] {
    height: 240px !important;
  }
  canvas { max-width: 100% !important; }

  /* Row layout for print - 2 columns per row */
  .row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
  }
  .col-lg-5, .col-lg-6, .col-lg-7, .col-md-12 {
    flex: 1 1 48% !important;
    max-width: 49% !important;
  }

  /* Funnel */
  .crm-funnel-bar { print-color-adjust: exact !important; -webkit-print-color-adjust: exact !important; }

  /* Table */
  .crm-lead-table {
    font-size: 10px !important;
    border-collapse: collapse !important;
  }
  .crm-lead-table th, .crm-lead-table td {
    padding: 5px 6px !important;
    border-bottom: 1px solid #e2e8f0 !important;
  }
  .crm-lead-table thead th {
    background: #f1f5f9 !important;
    font-size: 9.5px !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Chips with color */
  .crm-stage-chip, .crm-pri-chip, .crm-src-chip, .crm-fup-chip {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Page layout */
  @page {
    size: A4 landscape;
    margin: 12mm;
  }

  /* Prevent awkward breaks */
  h1, h2, h3, h4 { page-break-after: avoid !important; }
  img, table, canvas, .card { page-break-inside: avoid !important; }
}

/* ======================================================
   Master Panel Home Dashboard
   ====================================================== */
.mstr-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 28px 32px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  box-shadow: 0 8px 32px rgba(102,126,234,0.25);
  margin-bottom: 8px;
}
.mstr-banner-content { display: flex; align-items: center; gap: 16px; }
.mstr-banner-icon {
  width: 56px; height: 56px;
  background: rgba(255,255,255,0.2);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
}
.mstr-banner-icon svg { width: 30px; height: 30px; stroke: #fff; }
.mstr-banner-title { font-size: 22px; font-weight: 700; margin: 0; }
.mstr-banner-sub { font-size: 13px; opacity: 0.85; margin: 2px 0 0; }
.mstr-banner-stats {
  display: flex;
  align-items: center;
  gap: 24px;
  background: rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 16px 28px;
  backdrop-filter: blur(4px);
}
.mstr-stat { text-align: center; min-width: 70px; }
.mstr-stat-val { font-size: 26px; font-weight: 800; line-height: 1; }
.mstr-stat-lbl { font-size: 11px; opacity: 0.8; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.mstr-stat-divider { width: 1px; height: 36px; background: rgba(255,255,255,0.25); }

/* Master Grid */
.mstr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.mstr-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--rb-surface);
  border-radius: 14px;
  border: 1px solid var(--rb-border);
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.mstr-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border-color: transparent;
}
.mstr-card-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mstr-card-icon svg { width: 26px; height: 26px; }
.mstr-card-red .mstr-card-icon { background: #fef2f2; color: #dc2626; }
.mstr-card-red:hover { border-color: #fca5a5; }
.mstr-card-blue .mstr-card-icon { background: #eff6ff; color: #2563eb; }
.mstr-card-blue:hover { border-color: #93c5fd; }
.mstr-card-green .mstr-card-icon { background: #f0fdf4; color: #16a34a; }
.mstr-card-green:hover { border-color: #86efac; }
.mstr-card-purple .mstr-card-icon { background: #faf5ff; color: #9333ea; }
.mstr-card-purple:hover { border-color: #d8b4fe; }
.mstr-card-body { flex: 1; min-width: 0; }
.mstr-card-title { font-size: 15px; font-weight: 700; color: var(--rb-text); }
.mstr-card-desc { font-size: 12.5px; color: var(--rb-muted); margin-top: 2px; }
.mstr-card-count {
  position: absolute;
  top: 12px;
  right: 44px;
  background: var(--rb-surface-2);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--rb-text);
}
.mstr-card-arrow { color: var(--rb-muted); transition: transform 0.2s; }
.mstr-card:hover .mstr-card-arrow { transform: translateX(4px); color: var(--rb-primary); }

/* Quick Actions */
.mstr-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.mstr-action-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px; font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid var(--rb-border);
  background: var(--rb-surface);
  color: var(--rb-text);
}
.mstr-action-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.mstr-action-primary:hover { background: #eff6ff; border-color: #93c5fd; color: #2563eb; }
.mstr-action-teal:hover { background: #f0fdfa; border-color: #5eead4; color: #0d9488; }
.mstr-action-orange:hover { background: #fff7ed; border-color: #fdba74; color: #ea580c; }
.mstr-action-pink:hover { background: #fdf2f8; border-color: #f9a8d4; color: #db2777; }

@media (max-width: 767.98px) {
  .mstr-banner { flex-direction: column; text-align: center; padding: 20px; }
  .mstr-banner-content { flex-direction: column; }
  .mstr-banner-stats { flex-wrap: wrap; justify-content: center; gap: 16px; padding: 14px; }
  .mstr-stat-divider { display: none; }
  .mstr-grid { grid-template-columns: 1fr; }
  .mstr-actions { flex-direction: column; }
}

/* ======================================================
   CRM Staff Manager
   ====================================================== */
.crm-station-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rb-border); }
.crm-station-row:first-of-type { border-top: none; margin-top: 8px; padding-top: 0; }
.crm-station-lbl {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--rb-text);
  margin-bottom: 6px;
}
.crm-station-lbl svg { color: var(--rb-primary); flex-shrink: 0; }

/* Photo upload tile */
.crm-upload-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 20px; border: 2px dashed var(--rb-border);
  border-radius: 10px; cursor: pointer; text-align: center;
  background: var(--rb-surface-2); transition: all 0.2s;
}
.crm-upload-tile:hover { border-color: var(--rb-primary); background: var(--rb-surface); }
.crm-upload-tile span { font-size: 12px; color: var(--rb-muted); }
.crm-file-hidden { display: none; }

/* Staff avatar in table */
.crm-staff-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--rb-primary); color: #fff; font-size: 14px; font-weight: 700;
}

/* Form inputs */
.crm-input { border-color: var(--rb-border); transition: border-color 0.2s; }
.crm-input:focus { border-color: var(--rb-primary); box-shadow: 0 0 0 2px rgba(59,130,246,0.15); }
/* ===== Toolbar (search + buttons row) ===== */
.rb-toolbar {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  background: transparent !important;
}
.rb-toolbar .form-control { flex: 1 1 0; min-width: 0; }
.rb-toolbar-btns {
  display: flex; gap: 8px; flex-shrink: 0;
}
@media (max-width: 576px) {
  .rb-toolbar {
    flex-direction: column; align-items: stretch;
  }
  .rb-toolbar .form-control { width: 100%; }
  .rb-toolbar-btns {
    justify-content: stretch;
  }
  .rb-toolbar-btns .btn {
    flex: 1; padding: 10px 0; font-size: 14px; font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 6px;
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .crm-station-row { padding: 10px 0; }
  .crm-upload-tile { padding: 14px; }
  .crm-staff-avatar { width: 30px; height: 30px; font-size: 12px; }
}

/* CRM City dropdown with many options */
#drpLeadCity {
  max-height: 42px;
  overflow-y: auto;
}
#drpLeadCity option[data-type="district"] {
  font-weight: 700;
  color: var(--rb-primary);
  background: var(--rb-primary-soft);
  padding: 4px 8px;
}
#drpLeadCity option[data-type="tehsil"] {
  font-weight: 400;
  color: var(--rb-text);
  padding-left: 16px;
}

