/* ============================================================
   WHY Admin Console — Enterprise SaaS Design System
   ============================================================ */

/* ---- Quick-action modal search dropdown styles ---- */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1060;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    max-height: 260px;
    overflow-y: auto;
}
.search-results-dropdown .search-result-item {
    padding: 8px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.1s;
}
.search-results-dropdown .search-result-item:last-child { border-bottom: none; }
.search-results-dropdown .search-result-item:hover { background: #f0f4ff; }
.search-results-dropdown .search-result-item .phone {
    font-weight: 600;
    font-family: monospace;
    font-size: 13px;
}
.search-results-dropdown .search-result-item .name {
    color: #6c757d;
    font-size: 12px;
    margin-left: 8px;
}
.search-results-dropdown .search-result-item .meta {
    display: block;
    color: #94a3b8;
    font-size: 11px;
    margin-top: 2px;
}
.search-results-dropdown .search-result-item .channel-pill {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    margin-right: 6px;
    vertical-align: middle;
}
.search-results-dropdown .search-result-item .channel-pill.wa { background: #dcfce7; color: #166534; }
.search-results-dropdown .search-result-item .channel-pill.app { background: #dbeafe; color: #1e40af; }
.search-results-dropdown .search-result-item.no-results { color: #6c757d; cursor: default; font-size: 13px; }
.search-results-dropdown .search-result-item.create-new { color: #4f46e5; font-weight: 600; font-size: 13px; }
.search-results-dropdown .search-result-item.create-new i { margin-right: 6px; }

:root {
  /* Semantic aliases — resolve to the primitive ramps in tokens.css.
     Keep these names stable; components reference intent, not raw hex. */
  --primary: var(--brand-600);
  --primary-hover: var(--brand-700);
  --primary-light: var(--brand-50);
  --primary-subtle: var(--brand-100);
  --bg-sidebar: var(--gray-900);
  --bg-sidebar-hover: var(--gray-800);
  --bg-main: var(--gray-100);
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-500);
  --text-muted: var(--gray-400);
  --border-color: var(--gray-200);
  --border-light: var(--gray-100);
  --success: var(--green-500);
  --success-light: var(--green-100);
  --success-dark: var(--green-800);
  --danger: var(--red-500);
  --danger-light: var(--red-100);
  --danger-dark: var(--red-800);
  --warning: var(--amber-500);
  --warning-light: var(--amber-100);
  --warning-dark: var(--amber-800);
  --info: var(--blue-500);
  --info-light: var(--blue-50);
  /* --font-family retained for backwards compatibility; aliases --font-sans */
  --font-family: var(--font-sans);
  --sidebar-width: 230px;
  --header-height: 52px;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-primary);
  margin: 0;
  overflow-x: hidden;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   ACCESSIBILITY — Global keyboard focus ring
   Uses :focus-visible so the ring shows for keyboard/AT users
   without appearing on mouse clicks.
   ============================================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
.btn:focus-visible,
.btn-enterprise:focus-visible,
.action-btn:focus-visible,
.nav-item:focus-visible,
.dropdown-item:focus-visible,
.kyc-item:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Form controls keep their existing tinted focus shadow AND gain the
   ring for keyboard users, without a doubled/offset outline. */
.form-control:focus-visible,
.form-select:focus-visible {
  outline: none;
  border-color: var(--focus-ring-color);
  box-shadow: var(--focus-ring-shadow);
}

/* Respect users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-sidebar-hover) var(--bg-sidebar);
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: var(--bg-sidebar);
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--bg-sidebar-hover);
  border-radius: 6px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--gray-700);
}

.sidebar-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--overlay-white-06);
}

.logo-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--brand-400) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  flex-shrink: 0;
}

.logo-text .brand {
  font-weight: 700;
  font-size: 14px;
  color: var(--gray-100);
  line-height: 1.2;
}

.logo-text .sub-brand {
  font-size: 9px;
  color: var(--gray-500);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  color: var(--gray-400);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.15s;
}

.nav-item:hover {
  background-color: var(--bg-sidebar-hover);
  color: var(--gray-200);
}

.nav-item.active {
  background-color: var(--primary);
  color: white;
}

.nav-item i {
  width: 16px;
  text-align: center;
  font-size: 13px;
  flex-shrink: 0;
}

.nav-sub {
  padding-left: 44px !important;
  font-size: 0.85rem;
}

.nav-sub i {
  font-size: 0.8rem !important;
  width: 16px !important;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,.15);
  margin: 4px 10px;
}

.sidebar-footer {
  padding: 10px;
  border-top: 1px solid var(--overlay-white-06);
}

.support-btn {
  background-color: var(--overlay-brand-12);
  color: var(--brand-300);
}

.support-btn:hover {
  background-color: var(--overlay-brand-20);
  color: var(--brand-200);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top Header */
.top-header {
  height: var(--header-height);
  background-color: white;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.breadcrumb-container {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.breadcrumb-container .current {
  color: var(--text-primary);
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-bar {
  position: relative;
}

.search-bar input {
  padding: 5px 10px 5px 30px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 12px;
  width: 200px;
  background-color: var(--bg-main);
  outline: none;
  transition: all 0.15s;
}

.search-bar input:focus {
  border-color: var(--primary);
  background-color: white;
  width: 240px;
}

.search-bar i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 12px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 1px solid var(--border-color);
  padding-left: 12px;
}

.notification {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-secondary);
  position: relative;
  padding: 4px;
}

.badge-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  background-color: var(--danger);
  border-radius: 50%;
  border: 1.5px solid white;
}

.live-call-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-secondary);
  position: relative;
  padding: 4px 6px;
  text-decoration: none;
  border-radius: 6px;
  transition: background-color .15s;
}
.live-call-indicator:hover {
  background-color: var(--surface-hover);
  color: var(--success);
}
.live-call-indicator.has-calls {
  color: var(--success);
  animation: live-pulse 2s ease-in-out infinite;
}
.live-call-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  color: #fff;
  background-color: var(--success);
  border-radius: 10px;
  border: 1.5px solid #fff;
}

@@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: var(--radius-md);
  transition: background-color 0.15s;
}

.user-profile:hover {
  background-color: var(--bg-main);
}

.user-info { text-align: right; }

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.user-role {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}

.dropdown-menu {
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
  padding: 4px;
  margin-top: 6px;
  font-size: 13px;
}

.dropdown-item {
  border-radius: var(--radius-md);
  padding: 6px 10px;
  font-weight: 500;
  color: var(--text-primary);
}

.dropdown-item:active { background-color: var(--primary); color: white; }

.dropdown-item.text-danger:hover {
  background-color: var(--danger-light);
  color: var(--danger-dark);
}

.header-actions button[type="submit"].dropdown-item {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
}

/* Page Body */
.page-body {
  padding: 16px;
  flex: 1;
}

.page-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 2px;
  letter-spacing: -0.3px;
}

.page-subtitle {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

/* ============================================================
   CARD SYSTEM
   ============================================================ */
.card-box {
  background: white;
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.card-box-sm {
  padding: 12px;
}

.card-box-compact {
  padding: 12px 16px;
}

.card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.card-header-clean {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.dashboard-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 16px;
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.stat-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.1;
}

.stat-change {
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 3px;
}

.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--danger); }
.stat-period { color: var(--text-muted); margin-left: 2px; font-weight: 400; }

/* ============================================================
   CHARTS
   ============================================================ */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.chart-value {
  font-size: 20px;
  font-weight: 700;
  margin-right: 6px;
}

/* ============================================================
   TABLES — Compact Enterprise Design
   ============================================================ */
.table-container {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.table-title {
  font-size: 13px;
  font-weight: 600;
}

.table-action {
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
}

.custom-table thead th {
  text-align: left;
  padding: 8px 12px;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  background-color: var(--gray-50);
  border-bottom: 1px solid var(--border-color);
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.custom-table tbody td {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.custom-table tbody tr:last-child td {
  border-bottom: none;
}

.custom-table tbody tr:hover {
  background-color: var(--gray-50);
}

.custom-table tbody tr {
  transition: background-color 0.1s;
}

/* Action buttons — ALWAYS visible, no hover reveal */
.action-buttons {
  display: flex;
  gap: 4px;
  white-space: nowrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: white;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 12px;
  text-decoration: none;
}

.action-btn:hover {
  background-color: var(--bg-main);
  border-color: var(--gray-300);
}

.action-btn-view { color: var(--info); }
.action-btn-edit { color: var(--primary); }
.action-btn-delete { color: var(--danger); }
.action-btn-send { color: var(--success); }
.action-btn-manage { color: var(--success); }
.action-btn-notification { color: var(--warning); }
.action-btn-approve { color: var(--success); }
.action-btn-reject { color: var(--danger); }

/* ============================================================
   STATUS BADGES
   ============================================================ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-badge-success { background-color: var(--success-light); color: var(--success-dark); }
.status-badge-warning { background-color: var(--warning-light); color: var(--warning-dark); }
.status-badge-danger { background-color: var(--danger-light); color: var(--danger-dark); }
.status-badge-info { background-color: var(--info-light); color: var(--blue-700); }
.status-badge-secondary { background-color: var(--gray-100); color: var(--text-secondary); }

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot-green { background-color: var(--success); }
.status-dot-gray { background-color: var(--gray-300); }
.status-dot-red { background-color: var(--danger); }
.status-dot-yellow { background-color: var(--warning); }

/* ============================================================
   AVATARS
   ============================================================ */
.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
  background-color: var(--primary-light);
  color: var(--primary);
}

.avatar-circle-sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.avatar-circle-lg {
  width: 40px;
  height: 40px;
  font-size: 15px;
}

.avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* ============================================================
   BUTTONS — Enterprise Style
   ============================================================ */
.btn-enterprise {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-outline-primary {
  background: white;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-primary:hover {
  /* Keep colored text on light fill — Bootstrap's default hover forces white text. */
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-secondary {
  background-color: white;
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active {
  /* Keep dark text on the light fill — Bootstrap's default hover/focus forces white. */
  background-color: var(--bg-main);
  border-color: var(--gray-300);
  color: var(--text-primary);
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}

.btn-danger:hover {
  background-color: var(--red-600);
}

.btn-outline-danger {
  background: white;
  color: var(--danger);
  border-color: var(--danger);
}

.btn-outline-danger:hover {
  /* Keep danger text on light fill — Bootstrap's default hover forces white text. */
  background-color: var(--danger-light);
  color: var(--danger);
  border-color: var(--danger);
}

.btn-outline-info {
  background: white;
  color: var(--info);
  border-color: var(--info);
}

.btn-outline-info:hover {
  background-color: var(--info-light);
  color: var(--info);
  border-color: var(--info);
}

.btn-outline-success {
  background: white;
  color: var(--success);
  border-color: var(--success);
}

.btn-outline-success:hover {
  background-color: var(--success-light);
  color: var(--success);
  border-color: var(--success);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 4px 8px;
}

.btn-ghost:hover {
  background-color: var(--bg-main);
  color: var(--text-primary);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11.5px;
}

.btn-lg {
  padding: 8px 20px;
  font-size: 14px;
}

/* ============================================================
   FORMS — Compact
   ============================================================ */
.form-control, .form-select {
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--overlay-brand-10);
  outline: none;
}

.form-control-sm {
  padding: 4px 8px;
  font-size: 12px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.form-text {
  font-size: 11px;
  color: var(--text-muted);
}

.input-group-text {
  font-size: 12px;
  padding: 6px 10px;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-bar .search-wrap {
  position: relative;
  flex: 1;
  min-width: 180px;
}

.filter-bar .search-wrap input {
  width: 100%;
  padding: 5px 10px 5px 30px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 12px;
  background-color: var(--bg-main);
  outline: none;
}

.filter-bar .search-wrap input:focus {
  border-color: var(--primary);
  background-color: white;
}

.filter-bar .search-wrap i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 12px;
}

.filter-bar select {
  font-size: 12px;
  padding: 5px 24px 5px 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-main);
  outline: none;
  min-width: 120px;
}

.filter-bar select:focus {
  border-color: var(--primary);
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-content {
  border-radius: var(--radius-xl);
  border: none;
  box-shadow: var(--shadow-xl);
}

.modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
}

/* ============================================================
   TABS
   ============================================================ */
.nav-tabs-clean {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 14px;
}

.nav-tabs-clean .nav-link {
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: -1px;
}

.nav-tabs-clean .nav-link:hover {
  color: var(--text-primary);
}

.nav-tabs-clean .nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.table-footer {
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  background: white;
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 12.5px;
  border: 1px solid transparent;
}

.alert-success {
  background-color: var(--success-light);
  color: var(--success-dark);
  border-color: var(--green-300);
}

.alert-danger {
  background-color: var(--danger-light);
  color: var(--danger-dark);
  border-color: var(--red-200);
}

.alert-warning {
  background-color: var(--warning-light);
  color: var(--warning-dark);
  border-color: var(--amber-200);
}

.alert-info {
  background-color: var(--info-light);
  color: var(--blue-800);
  border-color: var(--blue-200);
}

/* ============================================================
   BADGES / TAGS
   ============================================================ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background-color: var(--bg-main);
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}

.tag-primary {
  background-color: var(--primary-light);
  color: var(--primary);
}

.tag-success {
  background-color: var(--success-light);
  color: var(--success-dark);
}

.tag-warning {
  background-color: var(--warning-light);
  color: var(--warning-dark);
}

.tag-danger {
  background-color: var(--danger-light);
  color: var(--danger-dark);
}

.tag-info {
  background-color: var(--info-light);
  color: var(--blue-700);
}

/* ============================================================
   TABLE CELL — User Cell (Avatar + Name)
   ============================================================ */
.user-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-cell .user-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.3;
}

.user-cell .user-email {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.2;
}

.date-cell {
  white-space: nowrap;
}

.date-cell .date-main {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
}

.date-cell .date-sub {
  font-size: 10px;
  color: var(--text-muted);
}

/* ============================================================
   CONTENT CONTAINERS
   ============================================================ */
.content-section {
  margin-bottom: 16px;
}

.section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ============================================================
   KYC PAGE — Compact
   ============================================================ */
.kyc-container {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.kyc-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  transition: background-color 0.1s;
}

.kyc-item:last-child {
  border-bottom: none;
}

.kyc-item.active {
  background-color: var(--primary-light);
}

.kyc-item:hover {
  background-color: var(--gray-50);
}

.kyc-item.active:hover {
  background-color: var(--blue-100);
}

.doc-icon-box {
  width: 34px;
  height: 34px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.doc-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 12px;
  margin-bottom: 1px;
}

.doc-subtitle {
  color: var(--text-muted);
  font-size: 10px;
}

/* ============================================================
   SUMMARY CARDS (Referrals)
   ============================================================ */
.summary-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 12px;
}

.summary-card .summary-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.summary-card .summary-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 3px;
}

.summary-card .summary-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 20px;
  margin-left: 6px;
  border-left: 2px solid var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 14px;
}

.timeline-item:last-child { margin-bottom: 0; }

.timeline-badge {
  position: absolute;
  left: -25px;
  top: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--border-color);
  border: 3px solid white;
  box-shadow: 0 0 0 1.5px var(--border-color);
}

.timeline-badge-pending { background-color: var(--warning); box-shadow: 0 0 0 1.5px var(--amber-200); }
.timeline-badge-accepted { background-color: var(--info); box-shadow: 0 0 0 1.5px var(--blue-200); }
.timeline-badge-enroute { background-color: var(--brand-500); box-shadow: 0 0 0 1.5px var(--brand-200); }
.timeline-badge-active { background-color: var(--success); box-shadow: 0 0 0 1.5px var(--green-300); }
.timeline-badge-completed { background-color: var(--success); box-shadow: 0 0 0 1.5px var(--green-300); }
.timeline-badge-cancelled { background-color: var(--danger); box-shadow: 0 0 0 1.5px var(--red-200); }

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1px;
}

.timeline-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.timeline-time {
  font-size: 10px;
  color: var(--text-muted);
}

.timeline-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.timeline-actor {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ============================================================
   FOOTER STATUS BAR — Minimal
   ============================================================ */
.app-footer {
  display: none;
}

/* ============================================================
   TOASTR CUSTOMIZATION
   ============================================================ */
#toast-container>div {
  opacity: 1;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
  padding: 12px 12px 12px 44px;
  font-size: 13px;
}

#toast-container>.toast-success {
  background-color: var(--green-50) !important;
  color: var(--green-700) !important;
  border: 1px solid var(--green-200);
}

#toast-container>.toast-error {
  background-color: var(--red-50) !important;
  color: var(--red-800) !important;
  border: 1px solid var(--red-200);
}

#toast-container>.toast-warning {
  background-color: var(--amber-50) !important;
  color: var(--amber-800) !important;
  border: 1px solid var(--amber-200);
}

/* ============================================================
   GLOBAL SPINNER
   ============================================================ */
#global-spinner {
  background-color: var(--overlay-white-80);
  z-index: 9999;
}

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.min-width-0 { min-width: 0; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.fs-10 { font-size: 10px; }
.fs-11 { font-size: 11px; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

/* ============================================================
   BOOTSTRAP OVERRIDES
   ============================================================ */
.badge {
  font-weight: 600;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 99px;
}

.btn {
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  transition: all 0.15s;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11.5px;
}

.btn-xs {
  padding: 2px 6px;
  font-size: 10px;
}

.btn-light {
  background-color: white;
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-light:hover {
  background-color: var(--bg-main);
  border-color: var(--gray-300);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }
  .sidebar .logo-text,
  .sidebar .nav-item span,
  .sidebar .sub-brand,
  .sidebar .support-btn span {
    display: none;
  }
  .sidebar .nav-item {
    justify-content: center;
    padding: 10px;
  }
  .sidebar-header {
    justify-content: center;
  }
  .main-content {
    margin-left: 60px;
  }
  .charts-row {
    grid-template-columns: 1fr;
  }
  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .header-right .search-bar {
    display: none;
  }
}

.clickable-row:hover {
    background-color: #f0f4ff !important;
}

/* ============================================================
   Support Quick-Action FAB
   ============================================================ */
.support-fab-container {
    position: fixed;
    bottom: var(--space-8);
    right: var(--space-8);
    z-index: var(--z-fab);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.support-fab-btn {
    width: 58px;
    height: 58px;
    border-radius: var(--radius-full);
    border: none;
    background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-400) 100%);
    color: var(--white);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-xl);
    cursor: pointer;
    position: relative;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.support-fab-btn::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: var(--radius-full);
    border: 2px solid var(--overlay-brand-20);
    animation: supportFabPulse 2.4s ease-out infinite;
    pointer-events: none;
}

.support-fab-btn i {
    transition: transform var(--transition-base);
}

.support-fab-btn:hover,
.support-fab-container.open .support-fab-btn {
    transform: scale(1.06);
    box-shadow: var(--shadow-xl), 0 0 0 8px var(--overlay-brand-12);
}

.support-fab-container.open .support-fab-btn i {
    transform: rotate(20deg);
}

@keyframes supportFabPulse {
    0%   { opacity: .55; transform: scale(1); }
    80%  { opacity: 0;   transform: scale(1.35); }
    100% { opacity: 0;   transform: scale(1.35); }
}

.support-fab-menu {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 250px;
    background: var(--white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.96);
    transform-origin: bottom right;
    transition: opacity var(--transition-base), transform var(--transition-base), visibility var(--transition-base);
}

.support-fab-container:hover .support-fab-menu,
.support-fab-container:focus-within .support-fab-menu,
.support-fab-container.open .support-fab-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.support-fab-menu-label {
    font-size: var(--text-2xs);
    font-weight: var(--fw-semibold);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--gray-400);
    padding: var(--space-2) var(--space-3) var(--space-1);
}

.support-fab-menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--gray-800);
    transition: background var(--transition-fast);
}

.support-fab-menu-item + .support-fab-menu-item {
    margin-top: 2px;
}

.support-fab-menu-item:hover,
.support-fab-menu-item:focus {
    background: var(--brand-50);
}

.fab-menu-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: var(--white);
    flex-shrink: 0;
}

.fab-icon-booking  { background: linear-gradient(135deg, var(--blue-500), var(--blue-700)); }
.fab-icon-customer { background: linear-gradient(135deg, var(--green-500), var(--green-600)); }
.fab-icon-ticket   { background: linear-gradient(135deg, var(--amber-500), #d97706); }

.fab-menu-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.fab-menu-title {
    font-size: var(--text-md);
    font-weight: var(--fw-semibold);
    color: var(--gray-800);
}

.fab-menu-sub {
    font-size: var(--text-xs);
    color: var(--gray-500);
}

@media (max-width: 576px) {
    .support-fab-container { bottom: var(--space-6); right: var(--space-6); }
    .support-fab-menu { width: 220px; }
}
