/* ZoiKYC - Unified Modern Aesthetic & Design System */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --font-main: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Unified Auth & Dashboard Color Palette */
  --tiancai-purple-dark: #2e0854;
  --tiancai-purple: #4c1d95;
  --tiancai-purple-medium: #6b21a8;
  --tiancai-purple-light: #7e22ce;
  --tiancai-purple-gradient: linear-gradient(135deg, #3b0764 0%, #581c87 50%, #7e22ce 100%);
  --tiancai-hero-gradient: linear-gradient(135deg, #2e0854 0%, #4c1d95 60%, #6b21a8 100%);
  
  --tiancai-blue: #2563eb;
  --tiancai-blue-hover: #1d4ed8;
  --tiancai-blue-glow: rgba(37, 99, 235, 0.25);

  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-input: #f8fafc;
  
  --border-input: #e2e8f0;
  --border-focus: #2563eb;

  --text-dark: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --sidebar-width: 270px;
  --header-height: 70px;

  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-pill: 30px;

  --shadow-card: 0 10px 30px rgba(15, 23, 42, 0.04);
  --shadow-purple: 0 12px 30px rgba(76, 29, 149, 0.25);
  --shadow-blue: 0 8px 25px rgba(37, 99, 235, 0.35);

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px; /* Decreased font size by 2px across the entire application (from standard 16px to 14px) */
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-size: 14px;
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* ==========================================================================
   AUTHENTICATION SPLIT-SCREEN CONTAINER
   ========================================================================== */
.auth-split-page {
  display: flex;
  min-height: 100vh;
  width: 100%;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, #f8fafc 0%, #cbd5e1 100%);
  padding: 30px 16px;
}

/* Floating Master Outer Card */
.auth-master-card {
  display: flex;
  width: 100%;
  max-width: 1080px;
  min-height: 640px;
  background: #ffffff;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

/* Left Purple Graphic Panel */
.auth-split-left {
  flex: 0 0 44%;
  width: 44%;
  background: var(--tiancai-purple-gradient);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px;
  color: #ffffff;
  overflow: hidden;
}

.auth-split-left::before {
  content: '';
  position: absolute;
  top: -100px;
  left: -100px;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

/* Left Brand Header */
.auth-left-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  z-index: 10;
}

.brand-icon-square {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* Center Illustration Container */
.auth-illustration-container {
  margin: auto 0;
  text-align: center;
  position: relative;
  z-index: 5;
}

.illustration-svg-box {
  width: 100%;
  max-width: 280px;
  margin: 0 auto 20px;
}

.auth-left-caption {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.35;
  opacity: 0.95;
}

.auth-left-subcaption {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-top: 6px;
  font-weight: 500;
}

/* Right White Form Panel */
.auth-split-right {
  flex: 0 0 56%;
  width: 56%;
  background: #ffffff;
  padding: 44px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
}

/* Reference Header Style */
.auth-ref-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.auth-ref-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.auth-title-bar {
  width: 32px;
  height: 4px;
  background: var(--tiancai-blue);
  border-radius: 4px;
}

.lang-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--tiancai-blue);
  transition: var(--transition);
}

.lang-toggle-pill:hover {
  background: #e2e8f0;
}

/* Inputs Matching Reference Image */
.ref-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.ref-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ref-form-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-dark);
}

.ref-form-control {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  color: var(--text-dark);
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
}

.ref-form-control::placeholder {
  color: var(--text-light);
  font-weight: 400;
}

.ref-form-control:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--tiancai-blue-glow);
}

/* Inline Radio Options */
.radio-options-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 16px 0 24px;
}

.radio-option-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.radio-option-item input[type="radio"],
.radio-option-item input[type="checkbox"] {
  accent-color: var(--tiancai-blue);
  width: 17px;
  height: 17px;
}

/* Pill Primary CTA Button */
.btn-tiancai-pill {
  width: 100%;
  min-height: 46px;
  padding: 12px 24px;
  background: var(--tiancai-blue);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-blue);
  transition: var(--transition);
}

.btn-tiancai-pill:hover {
  background: var(--tiancai-blue-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.45);
}

.btn-tiancai-pill:active {
  transform: translateY(0);
}

/* Purple Pill Button Variant */
.btn-purple-pill {
  width: 100%;
  min-height: 46px;
  padding: 12px 24px;
  background: var(--tiancai-purple-gradient);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-purple);
  transition: var(--transition);
}

.btn-purple-pill:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(76, 29, 149, 0.35);
}

/* ==========================================================================
   APP DASHBOARD STYLING (PURPLE & BLUE UNIFIED PALETTE)
   ========================================================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
  background-color: var(--bg-body);
}

/* Mobile Sidebar Backdrop Overlay */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 105;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Desktop & Mobile Responsive Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: #ffffff;
  border-right: 1px solid var(--border-input);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 110;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-input);
}

.brand-logo {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--tiancai-purple-dark);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: var(--transition);
}

.sidebar-close-btn:hover {
  background: #f1f5f9;
  color: var(--text-dark);
}

.sidebar-nav {
  flex: 1;
  padding: 20px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  -webkit-overflow-scrolling: touch;
}

.nav-group-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--tiancai-purple-light);
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.nav-item a:hover {
  background: #f5f3ff;
  color: var(--tiancai-purple);
  transform: translateX(3px);
}

.nav-item.active a {
  background: var(--tiancai-purple-gradient);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(88, 28, 135, 0.3);
}

.nav-item.active a i {
  color: #ffffff;
}

.nav-item.disabled a {
  opacity: 0.45;
  cursor: not-allowed;
}

.nav-item.disabled a:hover {
  transform: none;
  background: transparent;
}

.disabled-badge {
  margin-left: auto;
  font-size: 0.65rem;
  background: #f1f5f9;
  color: var(--text-light);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
}

/* Sidebar Footer Card */
.sidebar-footer-card {
  margin: 14px;
  padding: 12px 14px;
  background: #faf5ff;
  border: 1px solid #f3e8ff;
  border-radius: var(--radius-md);
}

.sidebar-org-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--tiancai-purple-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-org-status {
  font-size: 0.72rem;
  margin-top: 4px;
}

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

.top-navbar {
  height: var(--header-height);
  padding: 0 28px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-input);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.top-navbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-navbar-left h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-dark);
}

.mobile-toggle-btn {
  display: none;
  background: #f1f5f9;
  border: 1px solid var(--border-input);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: var(--text-dark);
  cursor: pointer;
  transition: var(--transition);
}

.mobile-toggle-btn:hover {
  background: #e2e8f0;
  color: var(--tiancai-blue);
}

.top-navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.wallet-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid var(--border-input);
  padding: 7px 16px;
  border-radius: 30px;
  font-size: 0.85rem;
  transition: var(--transition);
}

.wallet-pill:hover {
  border-color: var(--tiancai-blue);
  background: #ffffff;
}

.wallet-pill-amount {
  font-weight: 800;
  color: #059669;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--tiancai-purple-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(88, 28, 135, 0.2);
}

.page-container {
  padding: 24px 32px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Dashboard Hero Banner with Purple Theme */
.dashboard-hero-banner {
  background: var(--tiancai-purple-gradient);
  border-radius: var(--radius-xl);
  padding: 32px;
  color: #ffffff;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-purple);
}

.dashboard-hero-banner::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.card {
  background: #ffffff;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

/* Specific Admin Desktop Grid Utilities */
.admin-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.admin-doc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.admin-split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 28px;
}

.doc-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

@media (max-width: 1280px) {
  .admin-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-doc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .admin-metric-grid {
    grid-template-columns: 1fr;
  }
  .admin-doc-grid {
    grid-template-columns: 1fr;
  }
  .admin-split-grid {
    grid-template-columns: 1fr;
  }
  .doc-cards-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.metric-card {
  background: #ffffff;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.02);
  transition: var(--transition);
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: #c084fc;
  box-shadow: 0 8px 25px rgba(88, 28, 135, 0.08);
}

.metric-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.metric-value {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-dark);
}

.metric-badge {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 700;
}

.badge-active {
  background: rgba(5, 150, 105, 0.1);
  color: #059669;
}

.badge-credit {
  background: rgba(5, 150, 105, 0.1);
  color: #059669;
}

.badge-debit {
  background: rgba(225, 29, 72, 0.1);
  color: #dc2626;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
  min-width: 580px;
}

.custom-table th {
  padding: 14px 16px;
  background: #faf5ff;
  color: var(--tiancai-purple);
  font-weight: 700;
  border-bottom: 1px solid var(--border-input);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
}

.custom-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-input);
  color: var(--text-dark);
}

.custom-table tbody tr:hover td {
  background: #fdf4ff;
}

.alert-container {
  margin-bottom: 20px;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.alert-success {
  background: #d1fae5;
  border: 1px solid #059669;
  color: #065f46;
}

.alert-danger {
  background: #ffe4e6;
  border: 1px solid #dc2626;
  color: #9f1239;
}

.alert-warning {
  background: #fef3c7;
  border: 1px solid #d97706;
  color: #92400e;
}

.alert-info {
  background: #e0e7ff;
  border: 1px solid var(--tiancai-blue);
  color: #3730a3;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.btn-preset {
  background: #ffffff;
  border: 1px solid var(--border-input);
  color: var(--text-dark);
  padding: 12px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-preset:hover, .btn-preset.selected {
  border-color: var(--tiancai-purple);
  background: var(--tiancai-purple-gradient);
  color: #ffffff;
}

.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ==========================================================================
   COMPREHENSIVE RESPONSIVE BREAKPOINTS (TABLET & MOBILE)
   ========================================================================== */

/* Medium Devices (Tablets & Small Laptops <= 992px) */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
  }

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

  .sidebar-close-btn {
    display: flex;
  }

  .mobile-toggle-btn {
    display: flex;
  }

  .main-wrapper {
    margin-left: 0;
    width: 100%;
  }

  .auth-master-card {
    flex-direction: column;
    min-height: auto;
  }

  .auth-split-left {
    width: 100%;
    flex: 0 0 auto;
    padding: 32px 24px;
    min-height: 220px;
  }

  .auth-illustration-container {
    margin: 16px 0;
  }

  .illustration-svg-box {
    max-width: 200px;
    margin-bottom: 12px;
  }

  .auth-split-right {
    width: 100%;
    flex: 0 0 auto;
    padding: 30px 24px;
  }
}

/* Global Mobile & Overflow Protection */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-input);
  background: #ffffff;
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(126, 34, 206, 0.25);
  border-radius: 4px;
}

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

.custom-table th, .custom-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-input);
  font-size: 0.86rem;
  white-space: nowrap;
}

.custom-table th {
  background: #f8fafc;
  color: var(--text-dark);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-companies-table {
  min-width: 880px;
}

.admin-txn-table {
  min-width: 780px;
}

.break-word, .code-ref, .api-key-text {
  word-break: break-all;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   SUPER ADMIN PORTAL RESPONSIVE COMPONENT CLASSES
   ========================================================================== */

/* 1. Admin Companies Directory Header & Filter Pills */
.admin-hero-btn-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* 1. Admin Companies Directory Header & Controls */
.saas-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.saas-page-title-group h3 {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.3px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.saas-count-badge {
  background: rgba(139, 0, 184, 0.08);
  color: #7e22ce;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  border: 1px solid rgba(139, 0, 184, 0.18);
}

.saas-page-subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Unified Controls Bar (Search + Segmented Tabs) */
.saas-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid #e2e8f0;
}

.saas-search-form {
  flex: 1 1 320px;
  max-width: 400px;
  margin: 0;
}

.saas-search-box {
  position: relative;
  width: 100%;
}

.saas-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.95rem;
  pointer-events: none;
}

.saas-search-field {
  width: 100%;
  height: 40px;
  padding: 0 36px 0 38px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: var(--text-dark);
  font-size: 0.86rem;
  font-family: inherit;
  font-weight: 500;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.saas-search-field:focus {
  border-color: #8b5cf6;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
  outline: none;
}

.saas-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.95rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.saas-search-clear:hover {
  color: #64748b;
}

/* Segmented Filter Tabs */
.saas-filter-tabs {
  display: inline-flex;
  background: #e2e8f0;
  padding: 4px;
  border-radius: 10px;
  gap: 4px;
  flex-wrap: wrap;
}

.saas-tab-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.saas-tab-link:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.6);
}

.saas-tab-link.active {
  background: #ffffff;
  color: #0f172a;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

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

.status-dot.dot-emerald {
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.status-dot.dot-amber {
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.status-dot.dot-rose {
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.tab-badge {
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 9999px;
  font-weight: 700;
}

.saas-tab-link.active .tab-badge {
  background: #ede9fe;
  color: #7c3aed;
}

/* Modern SaaS Table */
.saas-table-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  margin-bottom: 20px;
}

.saas-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

.saas-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 13px 18px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  white-space: nowrap;
}

.saas-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  font-size: 0.87rem;
}

.saas-table tbody tr {
  transition: background-color 0.15s ease;
}

.saas-table tbody tr:hover {
  background-color: #faf5ff;
}

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

/* Company Cell */
.company-name-link {
  font-size: 0.94rem;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
  transition: color 0.2s;
  display: inline-block;
}

.company-name-link:hover {
  color: #7e22ce;
}

.company-sub-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.74rem;
  color: #64748b;
}

.chip-client-id {
  font-family: 'SFMono-Regular', Consolas, Menlo, monospace;
  background: #ede9fe;
  color: #6d28d9;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* Signatory & Contact Cells */
.signatory-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #1e293b;
}

.signatory-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ede9fe;
  color: #7e22ce;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

.contact-email {
  color: #334155;
  font-weight: 500;
  font-size: 0.85rem;
}

.contact-phone {
  color: #94a3b8;
  font-size: 0.76rem;
  margin-top: 2px;
}

/* Wallet Balance Cell */
.balance-val {
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.balance-val.healthy {
  color: #059669;
}

.balance-val.low {
  color: #d97706;
}

.balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 700;
  margin-top: 3px;
  white-space: nowrap;
}

.balance-pill-healthy {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.balance-pill-low {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* Commercial Pricing Cell */
.pricing-cell-tag {
  display: inline-block;
}

.pricing-rate-val {
  font-weight: 800;
  color: #7e22ce;
  font-size: 0.88rem;
}

.pricing-unit-val {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 500;
}

.pricing-min-val {
  font-size: 0.75rem;
  color: #475569;
  font-weight: 600;
  margin-top: 2px;
}

/* Status Badges */
.saas-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap !important;
}

.saas-status-badge.badge-active {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.saas-status-badge.badge-pending {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.saas-status-badge.badge-suspended {
  background: #fff1f2;
  color: #9f1239;
  border: 1px solid #fecdd3;
}

/* Actions Group */
.table-action-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-table-manage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1.5px solid #e9d5ff;
  color: #7e22ce;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-table-manage:hover {
  background: var(--tiancai-purple-gradient);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(126, 34, 206, 0.25);
  transform: translateY(-1px);
}

.btn-table-bell {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #b45309;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
}

.btn-table-bell:hover {
  background: #fde68a;
  color: #78350f;
  transform: scale(1.08);
}

/* Legacy Support */
.admin-companies-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.admin-filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-search-form {
  margin-bottom: 20px;
  width: 100%;
}

.admin-search-wrap {
  display: flex;
  gap: 10px;
  max-width: 480px;
  width: 100%;
}

/* 2. Company 360° Profile Detail Header */
.company-detail-header-card {
  background: linear-gradient(135deg, #ffffff 0%, #faf5ff 100%);
  border-color: #e9d5ff;
  margin-bottom: 24px;
}

.company-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
}

.company-header-meta {
  flex: 1 1 340px;
  min-width: 0;
  word-break: break-word;
}

.company-badge-row {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--tiancai-purple-light);
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.company-client-id-badge {
  background: var(--tiancai-purple-gradient);
  color: #ffffff;
  font-size: 0.75rem;
  padding: 2px 8px;
}

.company-header-name {
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  font-weight: 800;
  color: var(--tiancai-purple-dark);
  margin-bottom: 8px;
  line-height: 1.25;
  word-break: break-word;
}

.company-header-contact {
  color: var(--text-muted);
  font-size: 0.88rem;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 6px;
  line-height: 1.4;
}

.company-header-address {
  color: var(--text-light);
  font-size: 0.82rem;
  margin-top: 4px;
  line-height: 1.4;
  word-break: break-word;
}

.company-header-status-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  flex: 0 0 auto;
}

.company-status-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* 3. Compliance Document Verification Cards */
.admin-doc-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-doc-card-item {
  background: #f8fafc;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.admin-doc-file-info {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--tiancai-purple-dark);
}

.admin-doc-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.admin-doc-actions > * {
  flex: 1 1 auto;
  text-align: center;
}

/* 4. Pricing & Limits Card */
.pricing-limits-card {
  margin-bottom: 24px;
  border: 1.5px solid #e9d5ff;
  background: linear-gradient(to bottom, #faf5ff 0%, #ffffff 80px);
}

.pricing-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.pricing-live-badges {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.pricing-pill-item {
  background: #ffffff;
  border: 1px solid #e9d5ff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
}

.pricing-preset-pills-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.btn-preset-kyc, .btn-preset-rech {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-preset-kyc:hover, .btn-preset-rech:hover {
  background: #f5f3ff;
  border-color: #a855f7;
  color: #7e22ce;
}

.currency-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
}

.wallet-adj-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

/* Medium Devices (Tablets & Small Laptops <= 1024px) */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
  }

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

  .sidebar-close-btn {
    display: flex;
  }

  .mobile-toggle-btn {
    display: flex;
  }

  .main-wrapper {
    margin-left: 0;
    width: 100%;
  }

  .page-container {
    padding: 20px 16px;
  }

  .admin-split-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .auth-master-card {
    flex-direction: column;
    min-height: auto;
  }

  .auth-split-left {
    width: 100%;
    flex: 0 0 auto;
    padding: 28px 24px;
    min-height: 200px;
  }

  .auth-illustration-container {
    margin: 14px 0;
  }

  .illustration-svg-box {
    max-width: 180px;
    margin-bottom: 10px;
  }

  .auth-split-right {
    width: 100%;
    flex: 0 0 auto;
    padding: 30px 24px;
  }
}

/* Small Devices (Mobiles <= 768px) */
@media (max-width: 768px) {
  .auth-split-page {
    padding: 12px 10px;
  }

  .auth-master-card {
    border-radius: var(--radius-lg);
  }

  .auth-split-left {
    padding: 22px 16px;
    min-height: 160px;
  }

  .auth-split-right {
    padding: 24px 16px;
  }

  .auth-ref-title {
    font-size: 1.35rem;
  }

  .ref-form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .preset-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .top-navbar {
    padding: 0 12px;
    height: 58px;
    gap: 8px;
  }

  .top-navbar-left {
    gap: 8px;
    min-width: 0;
  }

  .top-navbar-left h2 {
    font-size: 0.98rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .top-navbar-right {
    gap: 8px;
    flex-shrink: 0;
  }

  .wallet-pill-label {
    display: none;
  }

  .user-info-text {
    display: none;
  }

  .page-container {
    padding: 14px 10px;
  }

  .dashboard-hero-banner {
    padding: 20px 14px;
  }

  .dashboard-hero-banner h1 {
    font-size: 1.35rem !important;
  }

  .card {
    padding: 16px 12px;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .admin-metric-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .admin-doc-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .metric-card {
    padding: 16px;
  }

  .metric-value {
    font-size: 1.5rem;
  }

  /* Admin Hero Buttons */
  .admin-hero-btn-group {
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }

  .admin-hero-btn-group > * {
    width: 100% !important;
    justify-content: center;
  }

  /* Admin Companies Directory */
  .saas-controls-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    gap: 10px;
  }

  .saas-search-form {
    max-width: 100%;
    width: 100%;
  }

  .saas-filter-tabs {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 3px;
  }

  .saas-tab-link {
    padding: 5px 10px;
    font-size: 0.76rem;
  }

  .admin-companies-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .admin-filter-pills {
    width: 100%;
  }

  .admin-search-wrap {
    max-width: 100%;
  }

  /* Admin Company Detail Header */
  .company-header-flex {
    flex-direction: column;
    gap: 14px;
  }

  .company-header-meta {
    width: 100%;
  }

  .company-header-status-box {
    width: 100%;
    align-items: stretch;
  }

  .company-status-form {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .company-status-form select,
  .company-status-form button {
    width: 100% !important;
  }

  /* Admin Document Header & Action */
  .admin-doc-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .admin-approve-all-form {
    width: 100%;
  }

  .admin-approve-all-form button {
    width: 100% !important;
  }

  /* Pricing Card */
  .pricing-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .pricing-live-badges {
    width: 100%;
  }

  .pricing-pill-item {
    flex: 1 1 auto;
    text-align: center;
  }

  .pricing-save-btn {
    width: 100% !important;
  }

  /* Admin Header Buttons & Filter Stacks */
  .admin-action-bar, .filter-bar-wrap {
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .admin-action-bar > *, .filter-bar-wrap > * {
    width: 100% !important;
  }
}

/* Extra Small Devices (Phones <= 480px) */
@media (max-width: 480px) {
  .page-container {
    padding: 10px 6px;
  }

  .card {
    padding: 14px 10px;
    border-radius: 12px;
  }

  .auth-left-caption {
    font-size: 1rem;
  }

  .auth-left-subcaption {
    font-size: 0.75rem;
  }

  .btn-tiancai-pill, .btn-purple-pill {
    padding: 12px 16px;
    font-size: 0.9rem;
  }

  .wallet-pill {
    padding: 4px 8px;
    font-size: 0.75rem;
    gap: 4px;
  }

  .avatar-circle {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .ref-form-control {
    font-size: 0.92rem;
    padding: 9px 12px;
  }

  .preset-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .btn-preset {
    padding: 10px 8px;
    font-size: 0.88rem;
  }

  .admin-filter-pills .lang-toggle-pill {
    padding: 5px 8px;
    font-size: 0.75rem;
  }

  .company-header-name {
    font-size: 1.25rem;
  }

  .btn-preset-kyc, .btn-preset-rech {
    flex: 1 1 28%;
    text-align: center;
    padding: 4px 6px;
    font-size: 0.72rem;
  }

  .top-navbar-left h2 {
    font-size: 0.92rem;
  }

  .auth-split-right {
    padding: 20px 14px;
  }

  .auth-split-left {
    padding: 18px 12px;
    min-height: 140px;
  }

  .illustration-svg-box {
    max-width: 130px;
  }

  .auth-ref-header {
    margin-bottom: 18px;
  }

  .auth-ref-title {
    font-size: 1.2rem;
  }
}

/* Extra-Extra Small Devices (<= 360px) */
@media (max-width: 360px) {
  .auth-split-page {
    padding: 8px 6px;
  }

  .auth-split-right {
    padding: 16px 10px;
  }

  .auth-ref-title {
    font-size: 1.12rem;
  }

  .ref-form-control {
    padding: 8px 10px;
    font-size: 0.85rem;
  }
}



