/* =====================================================
   RideGo Admin — Modern SaaS Theme
   Purple accent · Light / Dark · Inter font
   ===================================================== */

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

/* ── 1. CSS Variables ── */
:root {
  --rg-accent:        #7c3aed;
  --rg-accent-hover:  #6d28d9;
  --rg-accent-light:  #ede9fe;
  --rg-accent-rgb:    124, 58, 237;

  --theme-deafult:    #7c3aed;

  --rg-bg-body:       #f0f2f8;
  --rg-bg-sidebar:    #1e1b4b;
  --rg-bg-sidebar-h:  rgba(255,255,255,0.1);
  --rg-bg-header:     #ffffff;
  --rg-bg-card:       #ffffff;

  --rg-text-primary:  #1e1e2d;
  --rg-text-muted:    #6b7280;
  --rg-text-sidebar:  rgba(255,255,255,0.7);
  --rg-text-side-act: #ffffff;

  --rg-border:        #e5e7eb;
  --rg-border-side:   rgba(255,255,255,0.08);

  --rg-shadow-sm:     0 1px 3px rgba(0,0,0,0.06);
  --rg-shadow-md:     0 4px 20px rgba(0,0,0,0.09);
  --rg-shadow-card:   0 2px 10px rgba(0,0,0,0.06);

  --rg-radius:        14px;
  --rg-radius-sm:     8px;
  --rg-radius-lg:     20px;
  --rg-radius-pill:   9999px;
}

body.dark-only {
  --rg-accent:        #a78bfa;
  --rg-accent-hover:  #8b5cf6;
  --rg-accent-light:  rgba(167,139,250,0.12);
  --rg-accent-rgb:    167, 139, 250;

  --theme-deafult:    #a78bfa;

  --rg-bg-body:       #0e0e1c;
  --rg-bg-sidebar:    #12122a;
  --rg-bg-sidebar-h:  rgba(255,255,255,0.08);
  --rg-bg-header:     #1a1a32;
  --rg-bg-card:       #1e1e38;

  --rg-text-primary:  #e2e8f0;
  --rg-text-muted:    #94a3b8;
  --rg-text-sidebar:  rgba(255,255,255,0.6);
  --rg-text-side-act: #ffffff;

  --rg-border:        #2a2a48;
  --rg-border-side:   rgba(255,255,255,0.06);

  --rg-shadow-sm:     0 1px 4px rgba(0,0,0,0.35);
  --rg-shadow-md:     0 4px 24px rgba(0,0,0,0.5);
  --rg-shadow-card:   0 2px 12px rgba(0,0,0,0.4);
}

/* ── 2. Base ── */
/* Apply Inter only to text elements — NOT ::before/::after (icon fonts use those) */
body, h1, h2, h3, h4, h5, h6, p, div, span, a, button,
input, select, textarea, label, td, th, li, small, strong, em {
  font-family: 'Inter', 'Montserrat', sans-serif;
}

body {
  background-color: var(--rg-bg-body) !important;
  color: var(--rg-text-primary) !important;
}

h1,h2,h3,h4,h5,h6 {
  color: var(--rg-text-primary) !important;
  font-weight: 600 !important;
}

p, span:not([class*="badge"]), td, th, li, label, a:not(.btn) {
  color: var(--rg-text-primary);
}

a:not(.btn):not(.sidebar-link):not(.lan-4):not(.link):not(.nav-link) {
  color: var(--rg-accent) !important;
}

/* ── 3. Header / Topbar ── */
.page-wrapper .page-header,
.page-wrapper .page-header .header-wrapper {
  background: var(--rg-bg-header) !important;
  border-bottom: 1px solid var(--rg-border) !important;
  box-shadow: var(--rg-shadow-sm) !important;
}

.page-header .header-wrapper .nav-right ul li svg {
  stroke: var(--rg-text-muted) !important;
}

/* Dark mode icon */
#dark_mode {
  width: 36px;
  height: 36px;
  border-radius: var(--rg-radius-sm) !important;
  background: var(--rg-accent-light) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
#dark_mode i { color: var(--rg-accent) !important; font-size: 15px; }
#dark_mode:hover { background: rgba(var(--rg-accent-rgb),0.2) !important; }

/* Profile dropdown */
.profile-nav .profile-dropdown,
.onhover-show-div {
  background: var(--rg-bg-card) !important;
  border: 1px solid var(--rg-border) !important;
  border-radius: var(--rg-radius) !important;
  box-shadow: var(--rg-shadow-md) !important;
  padding: 6px !important;
}
.profile-dropdown li a {
  border-radius: var(--rg-radius-sm) !important;
  padding: 8px 14px !important;
  font-size: 13px !important;
  color: var(--rg-text-primary) !important;
  display: flex;
  align-items: center;
  gap: 8px;
}
.profile-dropdown li a:hover {
  background: var(--rg-accent-light) !important;
  color: var(--rg-accent) !important;
}
.profile-dropdown li a i, .profile-dropdown li a svg { stroke: var(--rg-accent) !important; }

/* ── 4. Sidebar ── */
.page-body-wrapper .sidebar-wrapper {
  background: var(--rg-bg-sidebar) !important;
  border-right: none !important;
  box-shadow: 2px 0 20px rgba(0,0,0,0.15) !important;
}

/* Logo wrapper — fixed height so toggle button stays inside */
.sidebar-wrapper .logo-wrapper,
.sidebar-wrapper .logo-icon-wrapper {
  background: var(--rg-bg-sidebar) !important;
  border-bottom: 1px solid var(--rg-border-side) !important;
}

.rg-logo-wrapper {
  display: flex !important;
  align-items: center !important;
  padding: 0 16px !important;
  height: 70px !important;
  position: relative !important;
  margin-top: 0 !important;
}

.rg-brand-link {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  text-decoration: none !important;
  flex: 1 !important;
  min-width: 0 !important;
}

.rg-brand-logo {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  flex-shrink: 0 !important;
  border: 2px solid rgba(255,255,255,0.2) !important;
}

.rg-brand-name {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  letter-spacing: 0.01em !important;
}

/* Hide the old floating icon-box buttons — we use rg-collapse-btn instead */
.sidebar-wrapper .icon-box-sidebar,
.sidebar-wrapper .logo-icon-wrapper,
.sidebar-wrapper > div > .logo-icon-wrapper {
  display: none !important;
}

/* ── Sidebar collapse button ── */
.rg-collapse-btn {
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,0.75);
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
  padding: 0;
}
.rg-collapse-btn:hover {
  background: rgba(255,255,255,0.18);
  color: #fff;
}
.rg-collapse-btn svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  transition: transform 0.25s;
}

/* Flip arrow when sidebar is collapsed */
.sidebar-wrapper.close_icon .rg-collapse-btn svg {
  transform: rotate(180deg);
}

/* In collapsed state: hide brand name, centre the logo */
.sidebar-wrapper.close_icon .rg-brand-name {
  display: none !important;
}
.sidebar-wrapper.close_icon .rg-logo-wrapper {
  justify-content: center !important;
  padding: 0 10px !important;
}
.sidebar-wrapper.close_icon .rg-brand-link {
  flex: 0 !important;
}
.sidebar-wrapper.close_icon .rg-collapse-btn {
  margin-left: 0 !important;
}


/* Sidebar nav items */
.sidebar-links li.sidebar-list > a.sidebar-link {
  color: var(--rg-text-sidebar) !important;
  border-radius: var(--rg-radius-sm) !important;
  margin: 2px 10px !important;
  padding: 10px 14px !important;
  transition: all 0.18s ease !important;
  position: relative !important;
}

.sidebar-links li.sidebar-list > a.sidebar-link:hover,
.sidebar-links li.sidebar-list > a.sidebar-link.active {
  background: var(--rg-bg-sidebar-h) !important;
  color: var(--rg-text-side-act) !important;
}

.sidebar-links li.sidebar-list > a.sidebar-link.active::after {
  content: '';
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 22px;
  background: var(--rg-accent);
  border-radius: 4px 0 0 4px;
}

/* Sidebar SVG icons */
.sidebar-links li.sidebar-list > a.sidebar-link svg path {
  fill: rgba(255,255,255,0.55) !important;
}
.sidebar-links li.sidebar-list > a.sidebar-link:hover svg path,
.sidebar-links li.sidebar-list > a.sidebar-link.active svg path {
  fill: #ffffff !important;
}

/* Sidebar link text */
.sidebar-links li.sidebar-list > a.sidebar-link span {
  color: inherit !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
}

/* Submenu */
.sidebar-submenu { background: transparent !important; }
.sidebar-submenu li a {
  color: var(--rg-text-sidebar) !important;
  font-size: 13px !important;
  padding: 7px 14px 7px 50px !important;
  border-radius: var(--rg-radius-sm) !important;
  margin: 1px 10px !important;
  transition: all 0.15s ease !important;
}
.sidebar-submenu li a:hover,
.sidebar-submenu li a.active {
  color: var(--rg-text-side-act) !important;
  background: var(--rg-bg-sidebar-h) !important;
}
.sidebar-submenu li a::before { display: none !important; }

/* ── 5. Page body ── */
.page-wrapper .page-body-wrapper {
  background: var(--rg-bg-body) !important;
}
.page-wrapper .page-body-wrapper .page-body {
  background: var(--rg-bg-body) !important;
  min-height: calc(100vh - 80px);
}

/* Page title */
.page-title {
  background: transparent !important;
  padding: 20px 0 10px !important;
}
.page-title h3 {
  font-size: 20px !important;
  font-weight: 700 !important;
}
.breadcrumb-item, .breadcrumb-item a {
  color: var(--rg-text-muted) !important;
  font-size: 13px !important;
}
.breadcrumb-item.active { color: var(--rg-accent) !important; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--rg-text-muted) !important; }

/* ── 6. Cards ── */
.card {
  background: var(--rg-bg-card) !important;
  border: 1px solid var(--rg-border) !important;
  border-radius: var(--rg-radius) !important;
  box-shadow: var(--rg-shadow-card) !important;
  transition: box-shadow 0.2s, transform 0.2s !important;
}
.card:hover {
  box-shadow: var(--rg-shadow-md) !important;
}
.card .card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--rg-border) !important;
  padding: 18px 22px !important;
  border-radius: var(--rg-radius) var(--rg-radius) 0 0 !important;
}
.card .card-header h4,
.card .card-header h5 {
  font-size: 15px !important;
  font-weight: 600 !important;
}
.card .card-body { padding: 20px 22px !important; }
.card .card-footer {
  background: transparent !important;
  border-top: 1px solid var(--rg-border) !important;
  padding: 14px 22px !important;
  border-radius: 0 0 var(--rg-radius) var(--rg-radius) !important;
}

/* ── 7. Buttons ── */
.btn-primary, .btn-square.btn-primary, .btn-block.btn-primary {
  background: var(--rg-accent) !important;
  border-color: var(--rg-accent) !important;
  border-radius: var(--rg-radius-sm) !important;
  font-weight: 500 !important;
  font-size: 13.5px !important;
  letter-spacing: 0.01em !important;
  box-shadow: 0 2px 8px rgba(var(--rg-accent-rgb),0.28) !important;
  transition: all 0.18s ease !important;
}
.btn-primary:hover, .btn-square.btn-primary:hover {
  background: var(--rg-accent-hover) !important;
  border-color: var(--rg-accent-hover) !important;
  box-shadow: 0 4px 14px rgba(var(--rg-accent-rgb),0.38) !important;
  transform: translateY(-1px) !important;
}
.btn-secondary, .btn-light, .btn-outline-primary {
  border-radius: var(--rg-radius-sm) !important;
  font-weight: 500 !important;
  font-size: 13.5px !important;
  transition: all 0.18s ease !important;
}
.btn-outline-primary {
  color: var(--rg-accent) !important;
  border-color: var(--rg-accent) !important;
}
.btn-outline-primary:hover {
  background: var(--rg-accent) !important;
  color: #fff !important;
}

/* ── 8. Tables ── */
.table { color: var(--rg-text-primary) !important; }
.table thead th {
  background: var(--rg-bg-body) !important;
  color: var(--rg-text-muted) !important;
  font-weight: 600 !important;
  font-size: 11.5px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  border-bottom: 2px solid var(--rg-border) !important;
  padding: 12px 16px !important;
  white-space: nowrap !important;
}
.table td {
  border-color: var(--rg-border) !important;
  padding: 11px 16px !important;
  vertical-align: middle !important;
  font-size: 13px !important;
  color: var(--rg-text-primary) !important;
}
.table tbody tr { transition: background 0.12s !important; }
.table tbody tr:hover td { background: var(--rg-accent-light) !important; }

/* DataTables */
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_info {
  color: var(--rg-text-muted) !important;
  font-size: 13px !important;
}
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  background: var(--rg-bg-card) !important;
  border: 1px solid var(--rg-border) !important;
  border-radius: var(--rg-radius-sm) !important;
  padding: 6px 10px !important;
  color: var(--rg-text-primary) !important;
  font-size: 13px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: var(--rg-radius-sm) !important;
  font-size: 13px !important;
  border: 1px solid transparent !important;
  margin: 0 2px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--rg-accent) !important;
  border-color: var(--rg-accent) !important;
  color: #fff !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:not(.current):hover {
  background: var(--rg-accent-light) !important;
  color: var(--rg-accent) !important;
  border-color: transparent !important;
}

/* ── 9. Form controls ── */
.form-control, .form-select, select.form-control {
  background: var(--rg-bg-card) !important;
  border: 1.5px solid var(--rg-border) !important;
  border-radius: var(--rg-radius-sm) !important;
  color: var(--rg-text-primary) !important;
  font-size: 13.5px !important;
  padding: 9px 14px !important;
  transition: border-color 0.18s, box-shadow 0.18s !important;
}
.form-control:focus, .form-select:focus {
  border-color: var(--rg-accent) !important;
  box-shadow: 0 0 0 3px rgba(var(--rg-accent-rgb),0.12) !important;
  outline: none !important;
}
.form-control::placeholder { color: var(--rg-text-muted) !important; opacity: 0.75 !important; }
.col-form-label, label.col-form-label, label {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--rg-text-primary) !important;
  margin-bottom: 5px !important;
}
.form-group { margin-bottom: 18px !important; }

/* Checkbox */
.checkbox label::before {
  border: 1.5px solid var(--rg-border) !important;
  border-radius: 4px !important;
}

/* ── 10. Badges ── */
.badge, span.badge {
  font-weight: 500 !important;
  font-size: 11.5px !important;
  border-radius: var(--rg-radius-pill) !important;
  padding: 4px 10px !important;
  letter-spacing: 0.01em !important;
}
.badge-primary, .badge.badge-primary, .bg-primary.badge {
  background: rgba(var(--rg-accent-rgb),0.14) !important;
  color: var(--rg-accent) !important;
}
.badge-success, .badge.badge-success, .bg-success.badge {
  background: rgba(16,185,129,0.12) !important;
  color: #059669 !important;
}
.badge-danger, .badge.badge-danger, .bg-danger.badge {
  background: rgba(239,68,68,0.12) !important;
  color: #dc2626 !important;
}
.badge-warning, .badge.badge-warning, .bg-warning.badge {
  background: rgba(245,158,11,0.12) !important;
  color: #b45309 !important;
}
.badge-info, .badge.badge-info, .bg-info.badge {
  background: rgba(59,130,246,0.12) !important;
  color: #2563eb !important;
}
.badge-secondary, .badge.badge-secondary {
  background: rgba(107,114,128,0.12) !important;
  color: #4b5563 !important;
}

/* ── 11. Action icons ── */
ul.action { display: flex; gap: 8px; align-items: center; list-style: none; padding: 0; margin: 0; flex-wrap: nowrap; }
ul.action li a {
  border-radius: var(--rg-radius-sm) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s !important;
  white-space: nowrap;
}
/* Icon-only action buttons (edit, delete) get fixed square size */
ul.action li.edit a,
ul.action li.delete a {
  width: 32px; height: 32px;
  font-size: 15px;
}
ul.action li.edit a {
  background: rgba(var(--rg-accent-rgb),0.1) !important;
  color: var(--rg-accent) !important;
}
ul.action li.edit a:hover { background: var(--rg-accent) !important; color: #fff !important; }
ul.action li.delete a {
  background: rgba(239,68,68,0.1) !important;
  color: #dc2626 !important;
}
ul.action li.delete a:hover { background: #dc2626 !important; color: #fff !important; }
/* Text buttons (Detail) inside action — let them breathe */
ul.action li:not(.edit):not(.delete) a.btn {
  height: 32px;
  padding: 4px 12px !important;
  font-size: 13px;
  gap: 5px;
}
ul.action li:not(.edit):not(.delete) a.btn i {
  font-size: 14px;
}

/* ── 12. Login page ── */
.login-card {
  background: var(--rg-bg-body) !important;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-main {
  background: var(--rg-bg-card) !important;
  border-radius: var(--rg-radius-lg) !important;
  box-shadow: var(--rg-shadow-md) !important;
  border: 1px solid var(--rg-border) !important;
  padding: 40px 44px !important;
}
.login-main h4 {
  font-size: 24px !important;
  font-weight: 800 !important;
  margin-bottom: 6px !important;
}
.login-main p { color: var(--rg-text-muted) !important; font-size: 14px !important; }
.login-main .link { color: var(--rg-accent) !important; font-size: 13px !important; }
.login-main .btn-primary { padding: 11px 20px !important; font-size: 14px !important; }

/* Show-hide toggle */
.show-hide span.show::before { color: var(--rg-text-muted) !important; }

/* ── 13. Select2 ── */
.select2-container--default .select2-selection--single {
  background: var(--rg-bg-card) !important;
  border: 1.5px solid var(--rg-border) !important;
  border-radius: var(--rg-radius-sm) !important;
  height: 42px !important;
  line-height: 40px !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--rg-text-primary) !important;
  line-height: 40px !important;
  padding-left: 12px !important;
}
.select2-dropdown {
  background: var(--rg-bg-card) !important;
  border: 1px solid var(--rg-border) !important;
  border-radius: var(--rg-radius-sm) !important;
  box-shadow: var(--rg-shadow-md) !important;
}
.select2-container--default .select2-results__option--highlighted {
  background: var(--rg-accent) !important;
}

/* ── 14. Dark mode — targeted overrides ── */
body.dark-only .page-wrapper .page-body-wrapper {
  background: var(--rg-bg-body) !important;
}
body.dark-only .page-body {
  background: var(--rg-bg-body) !important;
}
body.dark-only .card {
  background: var(--rg-bg-card) !important;
  border-color: var(--rg-border) !important;
}
body.dark-only .card .card-header,
body.dark-only .card .card-footer {
  border-color: var(--rg-border) !important;
}
body.dark-only .table thead th {
  background: rgba(255,255,255,0.04) !important;
  border-color: var(--rg-border) !important;
  color: var(--rg-text-muted) !important;
}
body.dark-only .table td {
  border-color: var(--rg-border) !important;
  color: var(--rg-text-primary) !important;
}
body.dark-only .table tbody tr:hover td {
  background: rgba(var(--rg-accent-rgb),0.06) !important;
}
body.dark-only .form-control,
body.dark-only .form-select,
body.dark-only select.form-control {
  background: rgba(255,255,255,0.05) !important;
  border-color: var(--rg-border) !important;
  color: var(--rg-text-primary) !important;
}
body.dark-only .dataTables_wrapper .dataTables_length select,
body.dark-only .dataTables_wrapper .dataTables_filter input {
  background: rgba(255,255,255,0.05) !important;
  border-color: var(--rg-border) !important;
  color: var(--rg-text-primary) !important;
}
body.dark-only .onhover-show-div,
body.dark-only .profile-dropdown {
  background: var(--rg-bg-card) !important;
  border-color: var(--rg-border) !important;
}
body.dark-only .select2-container--default .select2-selection--single {
  background: rgba(255,255,255,0.05) !important;
  border-color: var(--rg-border) !important;
}
body.dark-only .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--rg-text-primary) !important;
}
body.dark-only .select2-dropdown { background: var(--rg-bg-card) !important; border-color: var(--rg-border) !important; }
body.dark-only .breadcrumb-item,
body.dark-only .breadcrumb-item a { color: var(--rg-text-muted) !important; }
body.dark-only .breadcrumb-item.active { color: var(--rg-accent) !important; }
body.dark-only .badge-secondary { color: var(--rg-text-muted) !important; }

/* Dark login */
body.dark-only .login-card { background: var(--rg-bg-body) !important; }
body.dark-only .login-main { background: var(--rg-bg-card) !important; border-color: var(--rg-border) !important; }

/* ── 15. Loader ── */
.loader-wrapper .dot { background: var(--rg-accent) !important; }

/* ── 16. Tap-top ── */
.tap-top {
  background: var(--rg-accent) !important;
  border-radius: var(--rg-radius-sm) !important;
}

/* ── 17. Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rg-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--rg-text-muted); }

/* ── 18. Toastr ── */
#toast-container > div {
  border-radius: var(--rg-radius-sm) !important;
  box-shadow: var(--rg-shadow-md) !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  padding: 14px 18px !important;
  opacity: 1 !important;
  background-image: none !important;
  background-repeat: no-repeat !important;
}
#toast-container > .toast-success { background-color: #059669 !important; background-image: none !important; }
#toast-container > .toast-error   { background-color: #dc2626 !important; background-image: none !important; }
#toast-container > .toast-warning { background-color: #d97706 !important; background-image: none !important; }
#toast-container > .toast-info    { background-color: var(--rg-accent) !important; background-image: none !important; }

/* ── 19. Input group ── */
.input-group-text {
  background: var(--rg-bg-body) !important;
  border: 1.5px solid var(--rg-border) !important;
  color: var(--rg-text-muted) !important;
  border-radius: var(--rg-radius-sm) !important;
}

/* ── 20. Modal ── */
.modal-content {
  background: var(--rg-bg-card) !important;
  border: 1px solid var(--rg-border) !important;
  border-radius: var(--rg-radius) !important;
  box-shadow: var(--rg-shadow-md) !important;
}
.modal-header {
  border-bottom: 1px solid var(--rg-border) !important;
  padding: 18px 22px !important;
}
.modal-footer {
  border-top: 1px solid var(--rg-border) !important;
  padding: 14px 22px !important;
}
.modal-title { font-weight: 600 !important; font-size: 16px !important; color: var(--rg-text-primary) !important; }
.modal-body { padding: 20px 22px !important; }

/* ── 21. Alert ── */
.alert {
  border-radius: var(--rg-radius-sm) !important;
  font-size: 13.5px !important;
  border-width: 0 !important;
  border-left: 4px solid !important;
  padding: 12px 16px !important;
}
.alert-success { background: rgba(16,185,129,0.08) !important; border-color: #059669 !important; color: #065f46 !important; }
.alert-danger  { background: rgba(239,68,68,0.08) !important;  border-color: #dc2626 !important; color: #991b1b !important; }
.alert-warning { background: rgba(245,158,11,0.08) !important; border-color: #d97706 !important; color: #92400e !important; }
.alert-info    { background: rgba(var(--rg-accent-rgb),0.08) !important; border-color: var(--rg-accent) !important; color: var(--rg-accent) !important; }

/* ── 22. Smooth transitions ── */
.page-wrapper, .sidebar-wrapper, .page-header, .card, .form-control, .btn { transition: background 0.2s, border-color 0.2s, color 0.2s !important; }

/* ═══════════════════════════════════════════════════
   23. RESPONSIVE
═══════════════════════════════════════════════════ */

/* ── Tablet + Mobile (≤ 991px): sidebar becomes a fixed overlay ── */
@media (max-width: 991px) {
  /* Sidebar is a full-height overlay; toggle shows/hides it */
  .page-body-wrapper .sidebar-wrapper {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    z-index: 9999 !important;
    transition: transform 0.28s cubic-bezier(.4,0,.2,1) !important;
    transform: translateX(0);
  }
  /* close_icon = sidebar hidden off-screen on mobile */
  .page-body-wrapper .sidebar-wrapper.close_icon {
    transform: translateX(-280px) !important;
    box-shadow: none !important;
  }

  /* Page header & body take full width — no sidebar offset */
  .page-wrapper.compact-wrapper .page-header,
  .page-wrapper.compact-wrapper .page-header.close_icon {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .page-wrapper.compact-wrapper .page-body-wrapper .page-body {
    margin-left: 0 !important;
  }

  /* Overlay backdrop when sidebar is open */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9998;
  }
  .sidebar-overlay.active { display: block; }

  /* Hide our desktop-only collapse button */
  .rg-collapse-btn { display: none !important; }

  /* Restore full logo when sidebar is open on mobile */
  .sidebar-wrapper.close_icon .rg-brand-name { display: block !important; }
  .sidebar-wrapper.close_icon .rg-logo-wrapper {
    justify-content: flex-start !important;
    padding: 0 16px !important;
  }
  .sidebar-wrapper.close_icon .rg-brand-link { flex: 1 !important; }

  /* Show hamburger in header on mobile */
  .page-header .header-logo-wrapper .toggle-sidebar { display: flex !important; }

  /* DataTables controls stack on tablet */
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter { float: none; text-align: left; }
}

/* ── Mobile (≤ 767px) ── */
@media (max-width: 767px) {
  /* Logo area */
  .rg-logo-wrapper { height: 60px !important; padding: 0 12px !important; }
  .rg-brand-logo   { width: 34px !important; height: 34px !important; }
  .rg-brand-name   { font-size: 13px !important; }

  /* Page title */
  .page-title { padding: 12px 0 6px !important; }
  .page-title h3 { font-size: 17px !important; }

  /* Cards */
  .card .card-header { padding: 12px 14px !important; }
  .card .card-body   { padding: 12px 14px !important; }
  .card .card-footer { padding: 10px 14px !important; }

  /* Dashboard stat cards — fix the col-md-12 cards to 50% on phablet */
  .col-md-12.box-col-4 { flex: 0 0 50%; max-width: 50%; }

  /* Tables: always horizontally scrollable */
  .table-responsive { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  .table { min-width: 600px; }
  .table thead th { padding: 10px 12px !important; font-size: 11px !important; }
  .table td       { padding: 9px 12px !important; font-size: 12px !important; }

  /* Action buttons — keep inline, allow table scroll to handle overflow */
  ul.action { flex-wrap: nowrap; gap: 6px; }

  /* Login */
  .login-main { padding: 24px 18px !important; border-radius: 16px !important; }
  .login-main h4 { font-size: 20px !important; }

  /* Modals */
  .modal-header { padding: 14px 16px !important; }
  .modal-body   { padding: 14px 16px !important; }
  .modal-footer { padding: 10px 16px !important; }

  /* Forms */
  .form-group { margin-bottom: 14px !important; }
  .form-control, .form-select { padding: 8px 12px !important; font-size: 13px !important; }
}

/* ── Small mobile (≤ 575px) ── */
@media (max-width: 575px) {
  .rg-brand-name { display: none !important; }
  .rg-logo-wrapper { padding: 0 8px !important; height: 56px !important; }
  .rg-brand-logo { width: 36px !important; height: 36px !important; }

  /* All dashboard cols go full-width on small phones */
  .col-md-12.box-col-4,
  .col-md-6.box-col-4 { flex: 0 0 100%; max-width: 100%; }

  /* Profile/header icons shrink */
  .nav-menus { gap: 4px !important; }

  /* Page title */
  .page-title h3 { font-size: 15px !important; }
}
