/* copied minimal styles from client app.css */
:root {
  --primary: #14b8a6;
  /* teal/greenish-blue (replaced red) */
  --bg: #f1f5f9;
  /* page background */
  --muted: #6b7280;
  --card-bg: #ffffff;
  --footer-height: 50px;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  background: var(--bg);
  color: #0f172a;
  padding-bottom: 0;
}

/* adminLite styles */
.adminlite-sidebar {
  width: 260px;
  transition: width 0.18s ease, background 0.18s ease;
  overflow: hidden;
}

.adminlite-sidebar .brand-icon {
  width: 36px;
  height: 36px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.adminlite-sidebar.collapsed {
  width: 72px;
}

.adminlite-sidebar .brand-text {
  transition: opacity 0.12s ease;
}

.adminlite-sidebar.collapsed .brand-text {
  opacity: 0;
  width: 0;
  height: 0;
  overflow: hidden;
  display: inline-block;
}

/* nav items */
.adminlite-sidebar .nav-link {
  color: #0f172a;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 6px;
  white-space: nowrap;
}

.adminlite-sidebar .nav-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.adminlite-sidebar .nav-text {
  transition: opacity 0.12s ease, visibility 0.12s;
}

.adminlite-sidebar.collapsed .nav-text {
  opacity: 0;
  visibility: hidden;
  width: 0;
  margin: 0;
  padding: 0;
  display: inline-block;
}

.adminlite-sidebar .nav-link:hover .nav-icon {
  background: rgba(0, 0, 0, 0.04);
}

.adminlite-sidebar .nav-link.active,
.adminlite-sidebar .nav-link.active .nav-icon {
  background: rgba(20, 184, 166, 0.08);
  color: var(--primary);
}

.adminlite-sidebar.collapsed .nav-link {
  justify-content: center;
}

.adminlite-sidebar.collapsed .nav-icon {
  margin: 0;
}

.adminlite-main {
  min-height: 100vh;
}

.adminlite-header {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

/* adjust main padding to keep stable layout when sidebar collapses */
.adminlite-layout {
  align-items: stretch;
}

.adminlite-main {
  transition: margin-left 0.18s ease;
}

/* compact breadcrumb */
.breadcrumb {
  background: transparent;
  padding: 0;
  margin-bottom: 0;
}

/* admin-dashboard specific tweaks */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--card-bg);
  border-right: 1px solid rgba(15, 23, 42, 0.06);
  height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar .sidebar-top {
  border-bottom: 1px solid rgba(15, 23, 42, 0.03);
}

.sidebar .logo {
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar .logo img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.sidebar .nav-link {
  color: #0f172a;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 6px;
}

.sidebar .nav-link .nav-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.sidebar .nav-link.active {
  background: rgba(20, 184, 166, 0.08);
  color: var(--primary);
}

.sidebar .nav-link.active .nav-icon {
  background: rgba(20, 184, 166, 0.12);
  color: var(--primary);
}

.sidebar .mt-auto {
  border-top: 1px solid rgba(15, 23, 42, 0.03);
}

/* Collapsed sidebar */
.sidebar.collapsed {
  width: 72px;
  min-width: 72px;
}

.sidebar.collapsed .nav-text {
  display: none !important;
}

.sidebar.collapsed .sidebar-top .fw-bold {
  display: none;
}

/* Topbar */
.topbar {
  height: 72px;
  display: flex;
  align-items: center;
}

.search-box .form-control {
  border-radius: 20px;
  width: 420px;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: none;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.06);
}

.summary-card {
  border-radius: 12px;
}

.chart-card {
  border-radius: 12px;
}

/* Chart placeholder */
.chart-placeholder {
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.02), rgba(2, 6, 23, 0.01));
  border-radius: 8px;
}

/* Footer */
footer {
  background: transparent;
}

/* Fixed site footer */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  max-height: var(--footer-height);
  height: var(--footer-height);
  z-index: 1030;
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 -1px 6px rgba(2, 6, 23, 0.04);
  overflow: hidden;
}

/* Ensure admin-dashboard-layout fills viewport and doesn't scroll; only .content should scroll */
.admin-dashboard-layout {
  height: 100vh;
  /* full viewport height */
  overflow: hidden;
  /* prevent overall scrolling */
}

/* main column should fill available height and be column flex container */
.admin-main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  flex: 1 1 auto;
}

/* content becomes the only scrollable area */
.content {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
}

/* sidebar should stretch full height */
.sidebar {
  height: 100vh;
  position: sticky;
  top: 0;
}

/* footer is in-flow bottom item; cap at 50px */
.site-footer {
  height: var(--footer-height);
  max-height: var(--footer-height);
}

/* remove body padding-bottom when footer is in-flow */
body {
  padding-bottom: 0;
}

/* Make nav icons and text align nicely */
.nav-icon {
  font-size: 14px;
}

/* small responsive tweak */
@media (max-width: 768px) {
  .adminlite-sidebar {
    position: absolute;
    z-index: 1050;
    transform: translateX(-100%);
  }

  .adminlite-sidebar.show {
    transform: translateX(0);
  }

  /* Mobile toggle button spacing */
  .mobile-toggle-btn {
    margin-left: 30px !important;
  }

  /* Sidebar mobile behavior - hidden by default */
  .sidebar {
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    height: 100vh;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
  }

  /* Show sidebar when NOT collapsed (toggle shows menu) */
  .sidebar:not(.collapsed) {
    transform: translateX(0);
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
  }

  /* Make sure toggle button is always visible on mobile */
  .d-md-none {
    display: inline-flex !important;
  }

  /* Adjust main content to not be pushed */
  .admin-main {
    margin-left: 0 !important;
    width: 100%;
  }

  /* Hide wallet badge on very small screens */
  .wallet-badge {
    display: none !important;
  }
}

@media (max-width: 576px) {

  /* Stack user info vertically on very small screens */
  .topbar {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  .topbar .avatar {
    width: 32px !important;
    height: 32px !important;
  }

  /* Hide search box on very small screens */
  .search-box {
    display: none !important;
  }
}

@media (max-width: 992px) {
  .search-box .form-control {
    width: 240px;
  }
}

/* collapsed tooltip for sidebar icons */
.sidebar.collapsed .nav-link {
  position: relative;
  text-align: center;
}

.sidebar.collapsed .nav-link::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(2, 6, 23, 0.9);
  color: #fff;
  padding: 6px 8px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.sidebar.collapsed .nav-link:hover::after {
  opacity: 1;
}

/* AuthLayout global fallback (non-scoped) - ensures styles apply even if scoped css isn't loaded */
.auth-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f0fdfa, #ccfbf1);
  padding: 40px;
}

.auth-card {
  width: 900px;
  max-width: 95%;
  background: white;
  border-radius: 6px;
  display: flex;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.08);
}

.auth-left {
  width: 50%;
  min-width: 360px;
}

/* Avoid forcing color globally; allow utilities (.text-white) to control text color.
   If a specific element must be white by default, target it directly (e.g. .auth-right .brand-text) */
.auth-right {
  width: 50%;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
}

.auth-right .brand-text {
  color: #fff;
}

.auth-right-inner {
  padding: 40px;
  margin-top: 30%;
  justify-content: center;
  color: #ffffff !important;
}

.brand-icon {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  background: linear-gradient(135deg, #14b8a6, #0f766e);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
}

.brand-text {
  display: block;
  margin-top: 10px;
  font-weight: 700;
  font-size: 18px;
}

.auth-form {
  padding-top: 20px;
}

.btn-gradient {
  background: linear-gradient(90deg, #14b8a6, #0f766e);
  border: none;
  color: white;
}

@media (max-width: 768px) {
  .auth-right {
    display: none;
  }

  .auth-left {
    width: 100%;
  }
}

/* App site overrides */
:root {
  --zenith-primary: #14b8a6;
  /* override app primary - teal */
  --zenith-light: #F5F7FB;
  /* Override Bootstrap primary variables to use the teal */
  --bs-primary: #14b8a6;
  --bs-primary-rgb: 20, 184, 166;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  background: var(--zenith-light);
}

/* Override Bootstrap outline primary to use teal tone */
.btn-outline-primary {
  border-color: var(--bs-primary) !important;
  color: var(--bs-primary) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: var(--bs-primary) !important;
  color: #fff !important;
  border-color: var(--bs-primary) !important;
}

/* Replace bootstrap's blue hover color with the teal for common elements */
a:hover,
.nav-link:hover,
.page-link:hover,
.page-link:focus,
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.btn-check:focus+.btn-primary,
.btn-check:checked+.btn-primary {
  color: #ffffff !important;
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
  box-shadow: 0 0 0 .25rem rgba(20, 184, 166, .5) !important;
}

/* Links that previously used the blue hover color should use the teal */
.link-primary:hover,
.navbar-toggler:focus,
.btn-link:hover {
  color: var(--bs-primary) !important;
}

/* Ensure focus outlines match new color */
.btn-primary:focus,
.btn-outline-primary:focus,
a:focus,
.page-link:focus {
  box-shadow: 0 0 0 .25rem rgba(20, 184, 166, .25) !important;
}

/* Keep existing site styles below (if any) */

/* ============================================ */
/* GLOBAL BADGE FIXES - Ensure badges work everywhere */
/* ============================================ */

/* Base badge styling - restore Bootstrap defaults */
.badge {
  display: inline-block !important;
  padding: 0.35em 0.65em !important;
  font-size: 0.75em !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  text-align: center !important;
  white-space: nowrap !important;
  vertical-align: baseline !important;
  border-radius: 0.25rem !important;
}

/* Badge color variants - Force correct colors */
.badge.bg-primary {
  background-color: #0d6efd !important;
  color: #fff !important;
}

.badge.bg-secondary {
  background-color: #6c757d !important;
  color: #fff !important;
}

.badge.bg-success {
  background-color: #198754 !important;
  color: #fff !important;
}

.badge.bg-danger {
  background-color: #dc3545 !important;
  color: #fff !important;
}

.badge.bg-warning {
  background-color: #ffc107 !important;
  color: #000 !important;
}

.badge.bg-info {
  background-color: #0dcaf0 !important;
  color: #000 !important;
}

/* Prevent table row hover from affecting badges */
table tr:hover .badge.bg-primary,
table tr:hover .badge.bg-secondary,
table tr:hover .badge.bg-success,
table tr:hover .badge.bg-danger,
table tr:hover .badge.bg-warning,
table tr:hover .badge.bg-info {
  background-color: inherit !important;
  color: inherit !important;
}

/* Re-apply badge colors after hover override */
table tr:hover .badge.bg-primary {
  background-color: #0d6efd !important;
  color: #fff !important;
}

table tr:hover .badge.bg-secondary {
  background-color: #6c757d !important;
  color: #fff !important;
}

table tr:hover .badge.bg-success {
  background-color: #198754 !important;
  color: #fff !important;
}

table tr:hover .badge.bg-danger {
  background-color: #dc3545 !important;
  color: #fff !important;
}

table tr:hover .badge.bg-warning {
  background-color: #ffc107 !important;
  color: #000 !important;
}

table tr:hover .badge.bg-info {
  background-color: #0dcaf0 !important;
  color: #000 !important;
}

/* Badge spacing */
.badge+.badge {
  margin-left: 0.25rem;
}

/* Responsive badge sizing */
@media (max-width: 768px) {
  .badge {
    font-size: 0.7em !important;
    padding: 0.3em 0.55em !important;
  }
}

/* ============================================ */
/* DATATABLE SORT BUTTONS - Global Styles */
/* ============================================ */

/* Make table fill container width */
.table-fit {
  table-layout: auto;
  width: 100% !important;
  /* Fill 100% of container */
}

.table-fit th,
.table-fit td {
  white-space: nowrap;
  vertical-align: middle;
}

/* Keep action column compact */
.table-fit .col-action {
  white-space: nowrap;
  width: 1%;
}

/* Make th sort buttons fill the header cell */
.table-fit th {
  padding: 0 !important;
}

.table-fit th .sort-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 2.5rem !important;
  padding: 0.5rem 0.75rem !important;
  text-align: left !important;
  border: none !important;
  background: transparent !important;
  color: inherit !important;
  cursor: pointer !important;
  line-height: 1.5 !important;
  font-weight: inherit !important;
  transition: background-color 0.15s ease-in-out !important;
}

/* Hover effect */
.table-fit th .sort-btn:hover {
  background-color: rgba(0, 0, 0, 0.05) !important;
}

/* Active/pressed state */
.table-fit th .sort-btn:active {
  background-color: rgba(0, 0, 0, 0.1) !important;
}

/* Sort icon aligned to the right */
.table-fit th .sort-icon {
  margin-left: 0.5rem !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
}

/* Focus outline for accessibility */
.table-fit th .sort-btn:focus {
  outline: 2px solid rgba(13, 110, 253, 0.5) !important;
  outline-offset: -2px !important;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
}

.table-fit th .sort-btn:focus:not(:focus-visible) {
  outline: none !important;
  box-shadow: none !important;
}

.table-fit th .sort-btn:focus-visible {
  outline: 2px solid rgba(13, 110, 253, 0.5) !important;
  outline-offset: -2px !important;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
}

/* Responsive */
@media (max-width: 768px) {

  .table-fit th,
  .table-fit td {
    white-space: normal;
  }

  .table-fit th .sort-btn {
    white-space: normal !important;
    flex-wrap: wrap !important;
  }
}














/* View Switcher & Compact Grid (Added for Settings UI) */
.view-switcher-container {
  display: inline-flex;
  gap: 4px;
  background: #F4F6FA;
  /* Light blue-gray background */
  padding: 4px;
  border-radius: 10px;
  /* Slightly more rounded */
  border: 1px solid #EFF2F7;
  margin-right: 1rem;
  width: fit-content;
}

.view-btn {
  border: none;
  background: transparent;
  padding: 8px 16px;
  /* Larger padding for clearer click area */
  border-radius: 8px;
  /* Matching inner radius */
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: #64748B;
  /* Slate 500 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.view-btn:hover:not(.active) {
  color: #334155;
  background-color: rgba(255, 255, 255, 0.5);
}

.view-btn.active {
  background-color: #ffffff;
  color: var(--bs-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.03);
  /* Softer shadow */
  font-weight: 600;
}