@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* CogFocus One Light Green & Clean Enterprise Tokens */
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-hover: #f0fdf4;
  --border-subtle: #e2e8f0;
  --border-soft: #edf2f7;
  --border-strong: #cbd5e1;
  
  --text-main: #0f172a;
  --text-body: #1e293b;
  --text-muted: #475569;
  --text-dim: #64748b;
  --text-light: #94a3b8;
  
  /* CogFocus One Light Green Accents */
  --accent-primary: #10b981;
  --accent-hover: #059669;
  --accent-subtle: #ecfdf5;
  --accent-border: #a7f3d0;
  --accent-dark: #047857;

  --brand-green: #10b981;
  --brand-green-hover: #059669;
  --brand-green-light: #ecfdf5;
  --brand-green-border: #a7f3d0;
  --brand-green-dark: #065f46;

  --indigo-primary: #10b981;
  --indigo-hover: #059669;
  --indigo-subtle: #ecfdf5;
  --indigo-border: #a7f3d0;
  
  --success-bg: #ecfdf5;
  --success-text: #047857;
  --success-border: #a7f3d0;
  
  --warning-bg: #fffbeb;
  --warning-text: #b45309;
  --warning-border: #fde68a;
  
  --danger-bg: #fff1f2;
  --danger-text: #be123c;
  --danger-border: #fecdd3;
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 8px -1px rgba(15, 23, 42, 0.07);
  --shadow-green: 0 4px 14px 0 rgba(16, 185, 129, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-body);
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

a { color: var(--accent-dark); text-decoration: none; transition: color 0.1s ease; }
a:hover { color: var(--accent-hover); }

/* Typography */
h1 { font-size: 1.05rem; font-weight: 700; color: #0f172a; letter-spacing: -0.015em; }
h2 { font-size: 0.92rem; font-weight: 600; color: #0f172a; letter-spacing: -0.012em; }
h3 { font-size: 0.84rem; font-weight: 600; color: #0f172a; }
h4 { font-size: 0.76rem; font-weight: 600; color: #0f172a; }

.app-container { display: flex; height: 100vh; width: 100vw; overflow: hidden; }

/* Clean Sleek CogFocus Sidebar (Icons + Full Labels Always Visible) */
.sidebar {
  width: 218px;
  min-width: 218px;
  background: #ffffff;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  user-select: none;
  position: relative;
  z-index: 20;
}

.brand-section {
  height: 52px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: #ffffff;
}

.brand-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-title {
  font-weight: 800;
  font-size: 0.88rem;
  color: #0f172a;
  letter-spacing: -0.015em;
}

.brand-subtitle {
  font-size: 0.64rem;
  color: #64748b;
  font-weight: 500;
}

.nav-links {
  list-style: none;
  padding: 10px 8px 14px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: #e2e8f0 transparent;
}

.nav-links::-webkit-scrollbar {
  width: 4px;
}
.nav-links::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Collapsible Nav Categories */
.nav-category {
  font-size: 0.64rem;
  text-transform: uppercase;
  color: #64748b;
  padding: 8px 8px 4px;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.12s ease;
  margin-top: 6px;
}

.nav-category:hover {
  background: #f0fdf4;
  color: #047857;
}

.category-toggle-icon {
  font-size: 0.58rem;
  color: #94a3b8;
  transition: transform 0.2s ease;
}

.nav-category.collapsed .category-toggle-icon {
  transform: rotate(-90deg);
}

.nav-category-group {
  overflow: hidden;
  transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
  max-height: 800px;
  opacity: 1;
}

.nav-category-group.collapsed {
  max-height: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.nav-item {
  margin-bottom: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  color: #475569;
  font-size: 0.74rem;
  font-weight: 500;
  transition: all 0.12s ease;
  height: 28px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-link:hover {
  background: #f8fafc;
  color: #0f172a;
}

.nav-link.active {
  background: #ecfdf5 !important;
  color: #047857 !important;
  font-weight: 600;
  border-left: 3px solid #10b981;
}

.nav-link.ai-active {
  background: #ecfdf5 !important;
  color: #047857 !important;
  font-weight: 600;
  border-left: 3px solid #10b981;
}

.nav-icon {
  width: 16px;
  text-align: center;
  font-size: 0.78rem;
  color: #64748b;
}

.nav-link.active .nav-icon,
.nav-link.ai-active .nav-icon {
  color: #10b981;
}

.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border-soft);
  background: #ffffff;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: #047857;
  flex-shrink: 0;
}

/* Main Container & Topbar */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--bg-base);
}

.topbar {
  height: 48px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  z-index: 10;
}

.breadcrumb-area {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: #64748b;
}

.breadcrumb-area span {
  font-weight: 600;
  color: #0f172a;
}

.breadcrumb-area i {
  font-size: 0.55rem;
  color: #cbd5e1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-content {
  flex: 1;
  padding: 16px 22px;
  overflow-y: auto;
}

/* INDUSTRY-GRADE BUTTON SYSTEM */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 6px !important;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  text-decoration: none !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
}

.btn:active {
  transform: translateY(0);
}

/* Primary CogFocus One Green */
.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  border-color: #059669 !important;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.28) !important;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  border-color: #047857 !important;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.4) !important;
}

/* Secondary Button */
.btn-secondary {
  background: #ffffff !important;
  color: #334155 !important;
  border-color: #cbd5e1 !important;
}

.btn-secondary:hover {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

/* Light Green Tint Button */
.btn-green-light {
  background: #ecfdf5 !important;
  color: #047857 !important;
  border-color: #a7f3d0 !important;
}

.btn-green-light:hover {
  background: #d1fae5 !important;
  color: #065f46 !important;
  border-color: #6ee7b7 !important;
}

/* Small Button */
.btn-sm {
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 11px !important;
  font-size: 0.74rem !important;
  border-radius: 5px !important;
}

/* Large Button */
.btn-lg {
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 20px !important;
  font-size: 0.88rem !important;
  border-radius: 8px !important;
}

/* Filter Tab Buttons */
.tab-btn {
  padding: 7px 14px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #64748b;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.12s ease;
  border-radius: 6px !important;
}

.tab-btn:hover {
  color: #0f172a;
  background: #f8fafc;
  border-color: #cbd5e1;
}

.tab-btn.active {
  color: #047857 !important;
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.15);
}

/* Data Tables */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 8px !important;
  background: #ffffff;
  box-shadow: var(--shadow-xs);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.76rem;
}

th {
  padding: 9px 14px;
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  font-size: 0.65rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-subtle);
  letter-spacing: 0.04em;
}

td {
  padding: 9px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #0f172a;
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #f0fdf4;
}

/* Status Pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px !important;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.status-connected {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.status-warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  border: 1px solid var(--warning-border);
}

.status-danger {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
}

.status-info {
  background: var(--accent-subtle);
  color: var(--accent-dark);
  border: 1px solid var(--accent-border);
}

/* Form Controls */
.form-group {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 4px;
}

.form-control {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px !important;
  color: #0f172a;
  font-family: inherit;
  font-size: 0.76rem;
  transition: all 0.12s ease;
}

.form-control:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Card System */
.card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 8px !important;
  padding: 16px;
  box-shadow: var(--shadow-xs);
}

/* Welcome Hero Card & Product Grid */
.welcome-hero-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 50%, #ecfdf5 100%);
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  padding: 22px 26px;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px -4px rgba(16, 185, 129, 0.12);
  position: relative;
  overflow: hidden;
}

.product-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 1100px) {
  .product-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .product-cards-grid {
    grid-template-columns: 1fr;
  }
}

.product-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.product-card:hover {
  border-color: #a7f3d0;
  box-shadow: 0 6px 16px -2px rgba(16, 185, 129, 0.15);
  transform: translateY(-2px);
}

.dash-card-3d:hover {
  transform: translateY(-3px) scale(1.006);
  box-shadow: 0 16px 36px -6px rgba(16, 185, 129, 0.22), 0 4px 12px rgba(0,0,0,0.05) !important;
}

/* ==========================================================================
   FORTUNE 500 ENTERPRISE COCKPIT DESIGN TOKENS (Databricks / Snowflake Grade)
   ========================================================================== */
.cockpit-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.cockpit-kpi-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px 0 rgba(15, 23, 42, 0.06);
}

.cockpit-kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 6px;
}

.cockpit-kpi-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.cockpit-kpi-sub {
  font-size: 0.74rem;
  color: #475569;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot-active {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #059669;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2);
}

.status-dot-warning {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #d97706;
}

.status-dot-neutral {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #94a3b8;
}

.badge-subtle {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  font-size: 0.70rem;
  font-weight: 600;
  border-radius: 4px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.badge-subtle-emerald {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  font-size: 0.70rem;
  font-weight: 600;
  border-radius: 4px;
  background: #f0fdf4;
  color: #047857;
  border: 1px solid #bbf7d0;
}

.badge-subtle-blue {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  font-size: 0.70rem;
  font-weight: 600;
  border-radius: 4px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.btn-cockpit-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #0f172a;
  color: #ffffff !important;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid #0f172a;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-cockpit-primary:hover {
  background: #1e293b;
  border-color: #1e293b;
}

.btn-cockpit-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #ffffff;
  color: #334155 !important;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-cockpit-secondary:hover {
  background: #f8fafc;
  color: #0f172a !important;
  border-color: #94a3b8;
}

.btn-cockpit-emerald {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #059669;
  color: #ffffff !important;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #059669;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-cockpit-emerald:hover {
  background: #047857;
  border-color: #047857;
}

.cockpit-table-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.cockpit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.cockpit-table th {
  background: #f8fafc;
  padding: 10px 16px;
  font-size: 0.70rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.cockpit-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}

.cockpit-table tr:hover td {
  background: #f8fafc;
}

.cockpit-tab-pill {
  padding: 6px 14px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cockpit-tab-pill:hover {
  color: #0f172a;
  border-color: #cbd5e1;
}
.cockpit-tab-pill.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}
