/* FlowNexa Admin & RAG Dashboard Modern Design System */

:root {
  --bg-dark: #060911;
  --bg-surface: rgba(13, 18, 30, 0.95);
  --bg-card: rgba(18, 26, 43, 0.65);
  --bg-card-hover: rgba(23, 34, 56, 0.85);
  --border-color: rgba(255, 255, 255, 0.07);
  --border-highlight: rgba(255, 255, 255, 0.14);

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --primary: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.35);
  --purple: #8b5cf6;
  --purple-glow: rgba(139, 92, 246, 0.35);
  --cyan: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.35);
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.35);
  --amber: #f59e0b;
  --rose: #f43f5e;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background Radial Mesh Gradient */
.bg-grid-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(6, 182, 212, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 80%, rgba(59, 130, 246, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* App Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* Sidebar Backdrop for Mobile Drawer */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 99;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
  display: block;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  margin-bottom: 2rem;
  padding: 0 0.5rem;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-mobile-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-mobile-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--cyan);
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Main Content - Full Page 100% Width */
.main-content {
  margin-left: 260px;
  width: calc(100% - 260px);
  flex: 1;
  padding: 2rem 3rem;
  max-width: none !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Tenant Context Selector Dropdown */
.tenant-selector-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(18, 26, 43, 0.85);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.85rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.tenant-selector-icon {
  font-size: 1rem;
}

.tenant-select-dropdown {
  background: transparent;
  border: none;
  color: var(--cyan);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  padding-right: 0.5rem;
}

.tenant-select-dropdown option {
  background: #0f172a;
  color: var(--text-main);
  font-weight: 500;
}

/* Table Toolbars */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  max-width: 380px;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: var(--text-dim);
}

.search-control {
  padding-left: 2.2rem !important;
}

.filter-pills {
  display: flex;
  gap: 0.35rem;
  background: rgba(13, 20, 36, 0.9);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.filter-pill {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.filter-pill:hover {
  color: var(--text-main);
}

.filter-pill.active {
  background: var(--primary);
  color: white;
}

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

.logo-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(249, 115, 22, 0.25);
}

.logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(249, 115, 22, 0.4));
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: block;
  background: linear-gradient(135deg, #F97316, #FBBF24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub-header {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
}

.brand-dashboard-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(249, 115, 22, 0.12);
  color: #F97316;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

/* User Profile Card & Logout (Bottom of Sidebar) */
.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.user-profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(18, 26, 43, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
}

.user-avatar-wrap {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.user-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.25);
  color: var(--rose);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: rgba(244, 63, 94, 0.25);
  color: #fff;
}

/* Login Page Overlay */
.login-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(6, 9, 17, 0.96);
  backdrop-filter: blur(24px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(249, 115, 22, 0.15);
  text-align: center;
}

.login-logo {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 16px rgba(249, 115, 22, 0.5));
}

.login-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  background: linear-gradient(135deg, #F97316, #FBBF24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.35rem;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.login-form {
  text-align: left;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 420px;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-highlight);
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-success {
  border-left: 4px solid var(--emerald);
}

.toast-error {
  border-left: 4px solid var(--rose);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: #f87171;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.25);
}

.action-buttons-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 0.4rem 0.75rem 0.2rem 0.75rem;
}

.breadcrumb-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 0.2rem;
}

.breadcrumb-item {
  color: var(--text-muted);
}

.breadcrumb-sep {
  opacity: 0.5;
}

.breadcrumb-current {
  color: var(--cyan);
  font-weight: 600;
}

.last-updated-badge {
  font-size: 0.75rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(139, 92, 246, 0.16));
  border-color: rgba(59, 130, 246, 0.35);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
  position: relative;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 25%; bottom: 25%;
  width: 3px;
  background: var(--cyan);
  border-radius: 4px;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

/* DB Status Footer Card */
.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
}

.db-status-card {
  background: rgba(13, 20, 36, 0.9);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

.db-status-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.35rem;
}

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

.status-indicator.online {
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
}

.status-indicator.offline {
  background: var(--rose);
  box-shadow: 0 0 10px var(--rose);
}

.status-title {
  font-size: 0.82rem;
  font-weight: 600;
}

.db-details {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Main Content */
.main-content {
  margin-left: 260px;
  flex: 1;
  padding: 2rem 2.5rem;
  max-width: 1440px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-title-area h1 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Buttons */
.btn {
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--border-highlight);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
}

/* Metric Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.metric-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-highlight);
  background: var(--bg-card-hover);
}

.metric-card.glow-cyan::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--primary));
}

.metric-card.glow-purple::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--purple), var(--rose));
}

.metric-card.glow-blue::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
}

.metric-card.glow-amber::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--amber), var(--emerald));
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.metric-title {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-cyan { background: rgba(6, 182, 212, 0.12); color: var(--cyan); }
.icon-purple { background: rgba(139, 92, 246, 0.12); color: var(--purple); }
.icon-blue { background: rgba(59, 130, 246, 0.12); color: var(--primary); }
.icon-amber { background: rgba(245, 158, 11, 0.12); color: var(--amber); }

.metric-value {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.metric-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Cards & Tables */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.glow-border-cyan {
  border-color: rgba(6, 182, 212, 0.3);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.05);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.card-header h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.grid-crm {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.5rem;
}

@media (max-width: 1280px) {
  .grid-2col, .grid-crm {
    grid-template-columns: 1fr;
  }
}

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.88rem;
  vertical-align: middle;
}

.data-table select.form-control {
  min-width: 155px;
  width: auto;
  padding: 0.35rem 0.65rem !important;
  font-size: 0.8rem !important;
  font-weight: 600;
  background-color: rgba(15, 23, 42, 0.95) !important;
  color: var(--text-main) !important;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.data-table select.form-control option {
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
  padding: 6px 10px;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger { background: rgba(244, 63, 94, 0.15); color: #f87171; border: 1px solid rgba(244, 63, 94, 0.3); }
.badge-info { background: rgba(6, 182, 212, 0.15); color: #38bdf8; border: 1px solid rgba(6, 182, 212, 0.3); }

/* Tab Panes */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Form controls */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(13, 20, 36, 0.9);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

.input-with-button {
  display: flex;
  gap: 0.75rem;
}

/* Chat timeline */
.messages-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.message-bubble {
  max-width: 85%;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  line-height: 1.5;
  font-size: 0.88rem;
}

.message-bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: white;
  border-bottom-right-radius: 2px;
}

.message-bubble.assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-bottom-left-radius: 2px;
}

.citation-box {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: rgba(6, 182, 212, 0.1);
  border-left: 3px solid var(--cyan);
  border-radius: 4px;
  font-size: 0.8rem;
  color: #7dd3fc;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  color: var(--text-dim);
}

/* DB Info Grid */
.db-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.info-val {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--cyan);
  font-weight: 600;
}

.sql-version-banner {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  width: 90%;
  max-width: 650px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

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

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.json-code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #38bdf8;
  background: #060911;
  padding: 1rem;
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  word-break: break-all;
}

/* Colors & Helpers */
.text-cyan { color: var(--cyan); }
.text-purple { color: var(--purple); }
.text-blue { color: var(--primary); }
.text-amber { color: var(--amber); }
.text-rose { color: var(--rose); }
.text-emerald { color: var(--emerald); }

.mt-6 { margin-top: 1.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* Custom File Upload Component */
.file-upload-dropzone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.7);
  border: 1.5px dashed rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  transition: all 0.2s ease;
  gap: 12px;
  cursor: pointer;
  margin-top: 6px;
}

.file-upload-dropzone:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.file-info-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-select-file {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #ffffff !important;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-select-file:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.45);
}

/* Responsive Media Queries for Full-Page Fluid UI */
@media (max-width: 1400px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 992px) {
  .btn-mobile-toggle {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 500;
    transform: translateX(-100%);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
  }

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

  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 1.25rem 1.25rem;
  }

  .top-bar {
    gap: 1rem;
  }

  .grid-2col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .top-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .top-bar-left {
    width: 100%;
  }

  .top-bar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .tenant-selector-wrap {
    flex: 1;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

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

  .filter-pills {
    overflow-x: auto;
    width: 100%;
  }

  .modal {
    width: 95%;
    max-height: 90vh;
  }
}
