:root{--ovu-sb-bg: #0f172a;--ovu-sb-bg-secondary: #1e293b;--ovu-sb-text: #f8fafc;--ovu-sb-text-muted: #94a3b8;--ovu-sb-border: #334155;--ovu-sb-accent: #6366f1;--ovu-sb-hover: rgba(255, 255, 255, .05);--ovu-sb-active: rgba(99, 102, 241, .15);--ovu-sb-width-expanded: 280px;--ovu-sb-width-collapsed: 72px;--ovu-sb-item-height: 48px;--ovu-sb-transition: .3s cubic-bezier(.4, 0, .2, 1);--ovu-sb-z-base: 100;--ovu-sb-z-tooltip: 200}.ovu-sidebar{font-family:system-ui,-apple-system,sans-serif;background-color:var(--ovu-sb-bg);color:var(--ovu-sb-text);height:100vh;width:var(--ovu-sb-width-expanded);display:flex;flex-direction:column;border-inline-end:1px solid var(--ovu-sb-border);transition:width var(--ovu-sb-transition);position:relative;box-sizing:border-box;isolation:isolate;direction:ltr}.ovu-sidebar *,.ovu-sidebar *:before,.ovu-sidebar *:after{box-sizing:border-box}.ovu-sidebar button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:none;cursor:pointer;font-family:inherit;padding:0;margin:0;line-height:inherit;color:inherit;display:inline-flex;align-items:center;justify-content:center}.ovu-sidebar[dir=rtl]{direction:rtl;border-inline-end:none;border-inline-start:1px solid var(--ovu-sb-border)}.ovu-sidebar.collapsed{width:var(--ovu-sb-width-collapsed)}.ovu-sb-flex-center{display:flex;align-items:center;justify-content:center}.ovu-sb-scroll-area{flex:1;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:var(--ovu-sb-border) transparent}.ovu-sb-item-wrapper{display:flex;flex-direction:column;width:100%}.ovu-sb-item{display:flex;align-items:center;gap:12px;padding:0 16px;height:56px;cursor:pointer;position:relative;color:var(--ovu-sb-text-muted);transition:all .2s;border-radius:8px;margin:4px 8px}.ovu-sb-item:hover{background:var(--ovu-sb-hover);color:var(--ovu-sb-text)}.ovu-sb-item.active{background:var(--ovu-sb-active);color:var(--ovu-sb-text);border-inline-start:3px solid var(--ovu-sb-accent)}.ovu-sb-status{width:8px;height:8px;border-radius:50%;background:#cbd5e1;flex-shrink:0}.ovu-sb-status.active{background:#10b981;box-shadow:0 0 8px #10b98166}.ovu-sb-status.beta{background:#f59e0b}.ovu-sb-status.dev{background:#6366f1}.ovu-sb-icon{width:24px;height:24px;display:flex;align-items:center;justify-content:center;font-size:18px;flex-shrink:0}.ovu-sb-info{display:flex;flex-direction:column;overflow:hidden;white-space:nowrap;flex-grow:1;min-width:0}.ovu-sb-name{font-weight:500;font-size:14px;text-overflow:ellipsis;overflow:hidden}.ovu-sb-code{font-size:11px;opacity:.6}.ovu-sb-expand-btn{margin-inline-start:auto;width:28px;height:28px;background:#ffffff1a;border:1px solid rgba(255,255,255,.2);border-radius:6px;color:var(--ovu-sb-text);transition:all .2s ease;z-index:2}.ovu-sb-expand-btn:hover{background:#fff3;border-color:var(--ovu-sb-text)}.ovu-sb-arrow-icon{width:14px;height:14px;transition:transform .3s cubic-bezier(.4,0,.2,1)}.ovu-sb-expand-btn .ovu-sb-arrow-icon{transform:rotate(0)}[dir=rtl] .ovu-sb-expand-btn{margin-right:auto;margin-left:0}.ovu-sb-sub-menu{background:#0003;margin:0 16px 8px;border-radius:8px;overflow:hidden;animation:slideDown .2s ease-out}.ovu-sb-sub-item{padding:10px 16px;display:flex;align-items:center;gap:12px;font-size:13px;color:var(--ovu-sb-text-muted);cursor:pointer;border-inline-start:2px solid transparent}.ovu-sb-sub-item:hover{color:var(--ovu-sb-text);background:#ffffff08}.ovu-sb-sub-item.active{color:var(--ovu-sb-accent);border-color:var(--ovu-sb-accent);background:#6366f10d}@keyframes slideDown{0%{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}
/**
 * Dashboard Page Styles
 */

.dashboard-page {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Header */
.dashboard-header {
  margin-bottom: 2rem;
}

.dashboard-header h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2.5rem;
  color: var(--text-color);
}

.dashboard-subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1.125rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-color);
}

.stat-card.primary::before { background: #3b82f6; }
.stat-card.secondary::before { background: #8b5cf6; }
.stat-card.success::before { background: #10b981; }
.stat-card.info::before { background: #06b6d4; }

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.stat-icon {
  font-size: 2.5rem;
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-color);
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-action {
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  color: var(--primary-color);
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.stat-action:hover {
  background: var(--primary-color);
  color: white;
}

/* Charts Row */
.charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.chart-card h3 {
  margin: 0 0 1.5rem 0;
  font-size: 1.25rem;
  color: var(--text-color);
}

.chart-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chart-bar-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chart-bar-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.chart-bar-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

.chart-bar {
  height: 32px;
  background: var(--primary-color);
  border-radius: 6px;
  transition: width 0.5s ease;
  min-width: 40px;
}

.chart-bar.status-active { background: #10b981; }
.chart-bar.status-development { background: #3b82f6; }
.chart-bar.status-deprecated { background: #f59e0b; }
.chart-bar.status-archived { background: #6b7280; }

.chart-bar-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-color);
  min-width: 30px;
}

/* Quick Actions */
.quick-actions {
  margin-bottom: 2rem;
}

.quick-actions h2 {
  margin: 0 0 1.5rem 0;
  font-size: 1.5rem;
  color: var(--text-color);
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.action-card {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.3s;
  text-align: left;
}

.action-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.action-icon {
  font-size: 2.5rem;
}

.action-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-color);
}

.action-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Recent Apps */
.recent-apps {
  margin-bottom: 2rem;
}

.recent-apps h2 {
  margin: 0 0 1.5rem 0;
  font-size: 1.5rem;
  color: var(--text-color);
}

.recent-apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.recent-app-card {
  background: var(--card-bg);
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.3s;
}

.recent-app-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.recent-app-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.recent-app-info {
  flex: 1;
  min-width: 0;
}

.recent-app-name {
  font-weight: 600;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-app-code {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
  margin-top: 0.25rem;
}

.recent-app-stats {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Loading & Error */
.loading-container,
.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 1rem;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-primary {
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
  .dashboard-page {
    padding: 1rem;
  }

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

  .charts-row {
    grid-template-columns: 1fr;
  }

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

  .recent-apps-grid {
    grid-template-columns: 1fr;
  }
}

/* RTL Support */
[dir="rtl"] .stat-card {
  text-align: right;
}

[dir="rtl"] .action-card {
  text-align: right;
}

[dir="rtl"] .recent-app-card {
  flex-direction: row-reverse;
}

[dir="rtl"] .chart-bar-container {
  flex-direction: row-reverse;
}

/**
 * AppCard Styles
 */

.app-card {
  background: var(--card-bg);
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  border-color: var(--primary-color);
}

.app-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.app-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.app-card-title {
  flex: 1;
  min-width: 0;
}

.app-card-title h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-card-code {
  display: inline-block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
  background: var(--bg-secondary);
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  margin-top: 0.25rem;
}

.app-card-status {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.app-card-body {
  margin-bottom: 1rem;
}

.app-card-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0 0 0.75rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-card-category {
  margin-bottom: 0.5rem;
}

.category-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--primary-color);
  color: white;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
}

.app-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: 4px;
  font-size: 0.75rem;
}

.tag-badge.more {
  background: var(--primary-color);
  color: white;
}

.app-card-footer {
  display: flex;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.app-card-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.app-card-stat .stat-icon {
  font-size: 1.25rem;
}

.app-card-stat .stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  flex: 1;
}

.app-card-stat .stat-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color);
}

.app-card-version {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

/* RTL Support */
[dir="rtl"] .app-card-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .app-card-footer {
  flex-direction: row-reverse;
}

[dir="rtl"] .app-card-stat {
  flex-direction: row-reverse;
}

[dir="rtl"] .app-card-version {
  right: auto;
  left: 1rem;
}

/* Dark Mode */
[data-theme="dark"] .app-card {
  background: var(--card-bg);
  border-color: #374151;
}

[data-theme="dark"] .app-card:hover {
  border-color: var(--primary-color);
}

[data-theme="dark"] .app-card-code {
  background: #1f2937;
}

[data-theme="dark"] .tag-badge {
  background: #1f2937;
  color: #9ca3af;
}

[data-theme="dark"] .app-card-version {
  background: #1f2937;
}

/**
 * AppsList Page Styles
 */

.apps-list-page {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.apps-list-header {
  margin-bottom: 2rem;
}

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

.header-top h1 {
  margin: 0;
  font-size: 2rem;
  color: var(--text-color);
}

.search-and-filters {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-form {
  display: flex;
  gap: 1rem;
  flex: 1;
}

.search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--input-bg);
  color: var(--text-color);
  transition: border-color 0.3s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.btn-search {
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-search:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

.filters {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-select {
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.875rem;
  background: var(--input-bg);
  color: var(--text-color);
  cursor: pointer;
  transition: border-color 0.3s;
}

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

.btn-clear {
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-clear:hover {
  background: #ef4444;
  color: white;
}

.apps-list-stats {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.apps-list-stats strong {
  color: var(--primary-color);
  font-size: 1.125rem;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 1rem;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error-message {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #fee;
  border: 2px solid #fcc;
  border-radius: 8px;
  color: #c00;
  margin-bottom: 1.5rem;
}

.error-message button {
  margin-left: auto;
  padding: 0.5rem 1rem;
  background: #c00;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
  gap: 1rem;
}

.empty-icon {
  font-size: 4rem;
  opacity: 0.5;
}

.empty-state h3 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text-color);
}

.empty-state p {
  margin: 0;
  color: var(--text-secondary);
}

.btn-primary {
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
  .apps-list-page {
    padding: 1rem;
  }

  .header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .search-and-filters {
    flex-direction: column;
  }

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

/* RTL Support */
[dir="rtl"] .header-top {
  flex-direction: row-reverse;
}

[dir="rtl"] .search-form {
  flex-direction: row-reverse;
}

[dir="rtl"] .filters {
  flex-direction: row-reverse;
}

[dir="rtl"] .error-message {
  flex-direction: row-reverse;
}

[dir="rtl"] .error-message button {
  margin-left: 0;
  margin-right: auto;
}

/**
 * AppDetail Page Styles
 */

.app-detail-page {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
.app-detail-header {
  margin-bottom: 2rem;
}

.btn-back {
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  color: var(--text-color);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: all 0.3s;
}

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

.app-header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  padding: 2rem;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.app-header-left {
  display: flex;
  gap: 1.5rem;
  flex: 1;
}

.app-icon-large {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  flex-shrink: 0;
}

.app-title-section h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
  color: var(--text-color);
}

.app-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.app-code,
.app-type,
.app-status,
.app-version {
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
}

.app-code {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
}

.app-type {
  background: var(--primary-color);
  color: white;
}

.app-status {
  color: white;
}

.app-version {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.app-header-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-secondary {
  padding: 0.75rem 1.25rem;
  background: var(--bg-secondary);
  color: var(--text-color);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

/* Quick Links */
.quick-links {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: 12px;
}

.quick-links h3 {
  margin: 0 0 1rem 0;
  color: var(--text-color);
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.link-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s;
}

.link-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.link-icon {
  font-size: 1.5rem;
}

.link-label {
  font-weight: 600;
  color: var(--text-color);
}

.link-url {
  font-size: 0.875rem;
  color: var(--text-secondary);
  word-break: break-all;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border-color);
}

.tab {
  padding: 1rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.tab:hover {
  color: var(--primary-color);
}

.tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

/* Tab Content */
.tab-content {
  min-height: 400px;
}

.info-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: 12px;
}

.info-section h2 {
  margin: 0 0 1rem 0;
  font-size: 1.5rem;
  color: var(--text-color);
}

.info-section p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

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

.info-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.info-value {
  font-size: 1rem;
  color: var(--text-color);
}

/* Tech Stack */
.tech-stack-grid {
  display: grid;
  gap: 1rem;
}

.tech-category h4 {
  margin: 0 0 0.5rem 0;
  color: var(--text-color);
  font-size: 1rem;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-tag {
  padding: 0.5rem 1rem;
  background: var(--primary-color);
  color: white;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Deployments */
.deployments-list {
  display: grid;
  gap: 1rem;
}

.deployment-card {
  padding: 1rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
}

.deployment-header {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.deployment-env,
.deployment-component {
  padding: 0.25rem 0.75rem;
  background: var(--primary-color);
  color: white;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.deployment-active {
  padding: 0.25rem 0.75rem;
  background: #10b981;
  color: white;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.deployment-url {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.875rem;
}

.deployment-url:hover {
  text-decoration: underline;
}

/* Routes */
.routes-list {
  display: grid;
  gap: 1rem;
}

.route-card {
  padding: 1rem;
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 8px;
}

.route-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.route-method {
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
}

.method-get { background: #10b981; }
.method-post { background: #3b82f6; }
.method-put { background: #f59e0b; }
.method-delete { background: #ef4444; }
.method-patch { background: #8b5cf6; }

.route-path {
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  color: var(--text-color);
  flex: 1;
}

.route-auth {
  padding: 0.25rem 0.5rem;
  background: #fef3c7;
  color: #92400e;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.route-summary {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Dependencies */
.dependencies-tab {
  display: grid;
  gap: 2rem;
}

.dependencies-section h2 {
  margin: 0 0 1rem 0;
  font-size: 1.5rem;
  color: var(--text-color);
}

.dependencies-list {
  display: grid;
  gap: 1rem;
}

.dependency-card {
  padding: 1rem;
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 8px;
}

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

.dependency-name {
  font-weight: 600;
  color: var(--text-color);
}

.dependency-criticality {
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
}

.dependency-type {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Documentation */
.docs-tab {
  display: grid;
  gap: 2rem;
}

.doc-section h2 {
  margin: 0 0 1rem 0;
  font-size: 1.5rem;
  color: var(--text-color);
}

.doc-content {
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: 8px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Empty States */
.empty-message {
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
}

/* Loading & Error */
.loading-container,
.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 1rem;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
  .app-detail-page {
    padding: 1rem;
  }

  .app-header-content {
    flex-direction: column;
  }

  .app-header-left {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .app-header-actions {
    width: 100%;
    flex-direction: column;
  }

  .tabs {
    overflow-x: auto;
  }

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

/* RTL Support */
[dir="rtl"] .app-header-content {
  flex-direction: row-reverse;
}

[dir="rtl"] .app-header-left {
  flex-direction: row-reverse;
}

[dir="rtl"] .route-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .dependency-header {
  flex-direction: row-reverse;
}

/**
 * SystemMap Page Styles - Redesigned
 * Clean, hierarchical, RTL-first design
 */

/* ============================================
   Base Layout
   ============================================ */

.system-map-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height, 70px));
  background: var(--bg-main);
  overflow: hidden;
}

.system-map-page.rtl {
  direction: rtl;
}

.system-map-page.ltr {
  direction: ltr;
}

/* ============================================
   Header
   ============================================ */

.map-header {
  flex-shrink: 0;
  padding: 1.5rem 2rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}

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

.header-title h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-subtitle {
  margin: 0.5rem 0 0 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--bg-hover);
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--app-primary);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border-color);
}

.header-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Search Box */
.search-box {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.search-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: var(--text-secondary);
  pointer-events: none;
}

.rtl .search-icon {
  right: 1rem;
}

.ltr .search-icon {
  left: 1rem;
}

.search-input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.rtl .search-input {
  padding-right: 2.75rem;
  padding-left: 2.5rem;
}

.ltr .search-input {
  padding-left: 2.75rem;
  padding-right: 2.5rem;
}

.search-input:focus {
  outline: none;
  border-color: var(--app-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-input::placeholder {
  color: var(--text-secondary);
}

.search-clear {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 0.875rem;
  line-height: 1;
  transition: color 0.2s;
}

.rtl .search-clear {
  left: 0.75rem;
}

.ltr .search-clear {
  right: 0.75rem;
}

.search-clear:hover {
  color: var(--color-error);
}

/* View Toggle */
.view-toggle {
  display: flex;
  background: var(--bg-hover);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}

.view-btn {
  padding: 0.5rem 0.75rem;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.view-btn:hover {
  background: var(--bg-card);
}

.view-btn.active {
  background: var(--app-primary);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* ============================================
   Main Content
   ============================================ */

.map-content {
  flex: 1;
  display: flex;
  overflow: hidden;
  gap: 0;
}

/* Apps Panel */
.apps-panel {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  background: var(--bg-main);
}

/* ============================================
   Tree View
   ============================================ */

.tree-view {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tree-group {
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.tree-group-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border-color);
}

.group-icon {
  font-size: 1.5rem;
}

.group-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
}

.group-count {
  background: var(--app-primary);
  color: white;
  padding: 0.25rem 0.625rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.rtl .group-count {
  margin-right: auto;
}

.ltr .group-count {
  margin-left: auto;
}

.tree-group-items {
  padding: 0.5rem;
}

.tree-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  margin: 0.25rem 0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.tree-item:hover {
  background: var(--bg-hover);
}

.tree-item.selected {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--app-primary);
}

.tree-item-main {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.tree-item-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.tree-item-info {
  flex: 1;
  min-width: 0;
}

.tree-item-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-item-code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.125rem;
}

.tree-item-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.rtl .tree-item-stats {
  padding-right: 3.5rem;
}

.ltr .tree-item-stats {
  padding-left: 3.5rem;
}

.mini-stat {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Status Badge */
.status-badge {
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.version-badge {
  background: var(--bg-hover);
  color: var(--text-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
}

/* ============================================
   Grid View
   ============================================ */

.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.grid-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.grid-card:hover {
  border-color: var(--app-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.grid-card.selected {
  border-color: var(--app-primary);
  background: rgba(59, 130, 246, 0.05);
}

.grid-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.grid-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.grid-card-title {
  margin: 0 0 0.25rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.grid-card-code {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
}

.grid-card-desc {
  margin: 0 0 1rem 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.grid-card-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

/* ============================================
   List View
   ============================================ */

.list-view {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

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

.list-table th,
.list-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.rtl .list-table th,
.rtl .list-table td {
  text-align: right;
}

.ltr .list-table th,
.ltr .list-table td {
  text-align: left;
}

.list-table th {
  background: var(--bg-hover);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.list-table tbody tr {
  cursor: pointer;
  transition: background 0.2s ease;
}

.list-table tbody tr:hover {
  background: var(--bg-hover);
}

.list-table tbody tr.selected {
  background: rgba(59, 130, 246, 0.1);
}

.list-cell-icon {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.list-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.list-cell-icon code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
}

/* ============================================
   Details Panel
   ============================================ */

.details-panel {
  width: 0;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  overflow: hidden;
  transition: width 0.3s ease;
  flex-shrink: 0;
}

.rtl .details-panel {
  border-left: none;
  border-right: 1px solid var(--border-color);
}

.details-panel.open {
  width: 420px;
  overflow-y: auto;
}

.details-content {
  padding: 1.5rem;
  position: relative;
}

.details-close {
  position: absolute;
  top: 1rem;
  background: var(--bg-hover);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.rtl .details-close {
  left: 1rem;
}

.ltr .details-close {
  right: 1rem;
}

.details-close:hover {
  background: var(--color-error);
  color: white;
}

.details-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  gap: 1rem;
  color: var(--text-secondary);
}

.details-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
}

.placeholder-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.details-placeholder h3 {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
}

.details-placeholder p {
  margin: 0;
  font-size: 0.95rem;
}

/* Details Header */
.details-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.rtl .details-header {
  margin-top: 2rem;
}

.details-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}

.details-title-section {
  flex: 1;
  min-width: 0;
}

.details-title-section h2 {
  margin: 0 0 0.25rem 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.details-code {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
}

.details-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* Details Sections */
.details-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.details-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.details-section h3 {
  margin: 0 0 1rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-count {
  background: var(--bg-hover);
  color: var(--text-secondary);
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 500;
}

.details-description {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Quick Links */
.quick-links-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  background: var(--bg-hover);
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.quick-link:hover {
  background: var(--app-primary);
  color: white;
}

.quick-link-icon {
  font-size: 1rem;
}

/* API Routes */
.api-routes-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.api-route {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-hover);
  border-radius: 6px;
  font-size: 0.85rem;
}

.route-method {
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  color: white;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  min-width: 50px;
  text-align: center;
}

.route-path {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
  font-size: 0.8rem;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-auth {
  font-size: 0.8rem;
}

.show-more-btn {
  width: 100%;
  padding: 0.625rem;
  background: transparent;
  border: 1px dashed var(--border-color);
  border-radius: 6px;
  color: var(--app-primary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.show-more-btn:hover {
  background: var(--bg-hover);
  border-style: solid;
}

/* Dependencies Mini */
.dependencies-mini {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.deps-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.deps-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.deps-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.dep-tag {
  background: var(--bg-hover);
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-primary);
}

.no-deps {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Tech Stack Mini */
.tech-stack-mini {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tech-group {
  display: flex;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.tech-label {
  color: var(--text-secondary);
  min-width: 70px;
}

.tech-value {
  color: var(--text-primary);
}

/* Details Actions */
.details-actions {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-top: 1.5rem;
}

.details-actions .btn-primary,
.details-actions .btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  text-align: center;
}

.details-actions .btn-primary {
  background: var(--app-primary);
  color: white;
  border: none;
}

.details-actions .btn-primary:hover {
  background: var(--app-primary-hover);
  transform: translateY(-1px);
}

.details-actions .btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.details-actions .btn-secondary:hover {
  border-color: var(--app-primary);
  color: var(--app-primary);
}

/* ============================================
   AI Banner
   ============================================ */

.ai-banner {
  flex-shrink: 0;
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  padding: 0.75rem 2rem;
}

.ai-banner-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 1200px;
  margin: 0 auto;
}

.ai-banner-icon {
  font-size: 1.25rem;
}

.ai-banner-text {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
}

.ai-banner-endpoint {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.625rem;
  border-radius: 4px;
  color: white;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

.ai-banner-link {
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}

.rtl .ai-banner-link {
  margin-right: auto;
}

.ltr .ai-banner-link {
  margin-left: auto;
}

.ai-banner-link:hover {
  opacity: 0.8;
}

/* ============================================
   Loading & Error States
   ============================================ */

.loading-container,
.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 1rem;
  color: var(--text-secondary);
}

.error-icon {
  font-size: 3rem;
}

.error-container h2 {
  margin: 0;
  color: var(--text-primary);
}

.error-container p {
  margin: 0;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-color);
  border-top-color: var(--app-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner.small {
  width: 24px;
  height: 24px;
  border-width: 2px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-primary {
  padding: 0.75rem 1.5rem;
  background: var(--app-primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1024px) {
  .details-panel.open {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 100%;
    max-width: 420px;
    z-index: 100;
    box-shadow: var(--shadow-lg);
  }

  .rtl .details-panel.open {
    left: 0;
    right: auto;
  }

  .ltr .details-panel.open {
    right: 0;
    left: auto;
  }

  .header-main {
    flex-direction: column;
    gap: 1rem;
  }

  .header-stats {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .map-header {
    padding: 1rem;
  }

  .header-controls {
    flex-direction: column;
    width: 100%;
  }

  .search-box {
    max-width: none;
    width: 100%;
  }

  .view-toggle {
    width: 100%;
    justify-content: center;
  }

  .apps-panel {
    padding: 1rem;
  }

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

  .details-panel.open {
    max-width: 100%;
  }

  .quick-links-list {
    grid-template-columns: 1fr;
  }

  .ai-banner {
    padding: 0.75rem 1rem;
  }

  .ai-banner-content {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }

  .ai-banner-link {
    width: 100%;
    margin-top: 0.5rem;
  }
}

@media (max-width: 480px) {
  .header-title h1 {
    font-size: 1.25rem;
  }

  .stat-value {
    font-size: 1.25rem;
  }

  .tree-item-main {
    flex-wrap: wrap;
  }

  .tree-item-stats {
    width: 100%;
    padding: 0;
    margin-top: 0.5rem;
  }

  .list-table {
    font-size: 0.85rem;
  }

  .list-table th,
  .list-table td {
    padding: 0.75rem 0.5rem;
  }
}

.dev-guidelines {
  padding: 2rem;
  min-height: 100vh;
  background: var(--background-color);
}

.dev-guidelines.dark {
  --background-color: #1a1a2e;
  --card-background: #16213e;
  --text-primary: #eee;
  --text-secondary: #aaa;
  --border-color: #0f3460;
  --hover-bg: #1e3a5f;
  --primary-blue: #2563eb;
}

.dev-guidelines.light {
  --background-color: #f5f7fa;
  --card-background: #ffffff;
  --text-primary: #2c3e50;
  --text-secondary: #7f8c8d;
  --border-color: #e1e8ed;
  --hover-bg: #f0f3f6;
  --primary-blue: #2563eb;
}

.guidelines-header {
  text-align: center;
  margin-bottom: 2rem;
}

.guidelines-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 700;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.category-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.category-filter button {
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: var(--card-background);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.category-filter button:hover {
  background: var(--hover-bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2);
  border-color: var(--primary-blue);
}

.category-filter button.active {
  background: var(--primary-blue);
  color: white;
  font-weight: 600;
  border-color: var(--primary-blue);
}

.guidelines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

@media (max-width: 768px) {
  .guidelines-grid {
    grid-template-columns: 1fr;
  }
}

.guideline-card {
  background: var(--card-background);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.guideline-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.15);
  border-color: var(--primary-blue);
}

.guideline-card.expanded {
  grid-column: span 2;
}

@media (max-width: 1024px) {
  .guideline-card.expanded {
    grid-column: span 1;
  }
}

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

.header-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.category-icon {
  font-size: 1.5rem;
}

.card-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-primary);
  font-weight: 600;
}

.importance-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  color: white;
  font-size: 0.875rem;
  font-weight: bold;
  white-space: nowrap;
}

.card-content {
  color: var(--text-primary);
}

.guideline-text {
  white-space: pre-wrap;
  font-family: inherit;
  line-height: 1.6;
  margin: 0;
  padding: 1rem;
  background: var(--background-color);
  border-radius: 8px;
  border-left: 4px solid var(--primary-blue);
  color: var(--text-primary);
}

.examples-section {
  margin-top: 1.5rem;
}

.examples-section h4 {
  margin-bottom: 0.75rem;
  color: var(--primary-blue);
  font-size: 1rem;
  font-weight: 600;
}

.code-block {
  background: var(--background-color);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
}

.code-block code {
  display: block;
  margin: 0.25rem 0;
  white-space: pre;
  color: var(--text-primary);
}

.expand-hint {
  text-align: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  color: var(--primary-blue);
  font-size: 0.875rem;
  font-weight: 500;
}

.guidelines-footer {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 2rem 0;
  background: var(--card-background);
  border-radius: 12px;
  border: 2px solid var(--border-color);
  margin-top: 2rem;
}

.guidelines-footer p {
  margin: 0.5rem 0;
  color: var(--text-primary);
}

.api-ui-endpoints {
  padding: 2rem;
  min-height: 100vh;
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* Header */
.api-header {
  margin-bottom: 2rem;
  text-align: center;
}

.api-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.api-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

/* Content Layout */
.api-content {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 2rem;
  max-width: 1600px;
  margin: 0 auto;
}

/* Pages Tree */
.pages-tree {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  height: fit-content;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

.tree-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.page-item {
  margin-bottom: 0.5rem;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
}

.page-header:hover {
  background: var(--hover-bg);
  border-color: #2563eb;
}

.page-header.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

.page-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.page-name {
  flex: 1;
  font-weight: 500;
}

.page-route {
  font-size: 0.875rem;
  opacity: 0.7;
  font-family: 'Courier New', monospace;
}

.expand-icon {
  font-size: 0.875rem;
  transition: transform 0.2s ease;
}

.expand-icon.expanded {
  transform: rotate(90deg);
}

/* Endpoints Mini (in tree) */
.endpoints-mini {
  padding: 0.5rem 0 0 2rem;
  margin-top: 0.5rem;
}

.endpoint-mini {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  border-radius: 4px;
  background: var(--bg-primary);
}

.method-badge {
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  color: white;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  flex-shrink: 0;
}

.method-badge.large {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

/* Endpoints Details */
.endpoints-details {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  min-height: 500px;
}

.details-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
}

.details-header h2 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.route-badge {
  padding: 0.5rem 1rem;
  background: #2563eb;
  color: white;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  font-weight: 500;
}

.no-selection {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: var(--text-secondary);
}

.no-selection-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.no-selection p {
  font-size: 1.125rem;
}

/* Endpoints List */
.endpoints-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.endpoint-card {
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  transition: all 0.2s ease;
}

.endpoint-card:hover {
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.endpoint-path {
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-secondary);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  flex: 1;
}

.usage-badge {
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.usage-badge.used {
  background: #d4edda;
  color: #155724;
}

.usage-badge.unused {
  background: #f8d7da;
  color: #721c24;
}

.endpoint-description {
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* Dark Theme */
.api-ui-endpoints.dark {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --border-color: #0f3460;
  --text-primary: #eee;
  --text-secondary: #aaa;
  --hover-bg: #1e3a5f;
}

.api-ui-endpoints.dark .usage-badge.used {
  background: #2d5016;
  color: #9ae66e;
}

.api-ui-endpoints.dark .usage-badge.unused {
  background: #5c1a1a;
  color: #ff6b6b;
}

/* Light Theme */
.api-ui-endpoints.light {
  --bg-primary: #f5f7fa;
  --bg-secondary: #ffffff;
  --border-color: #e1e8ed;
  --text-primary: #2c3e50;
  --text-secondary: #7f8c8d;
  --hover-bg: #f0f3f6;
}

/* RTL Support */
.api-ui-endpoints[dir="rtl"] .page-header {
  flex-direction: row-reverse;
}

.api-ui-endpoints[dir="rtl"] .endpoint-header {
  flex-direction: row-reverse;
}

.api-ui-endpoints[dir="rtl"] .endpoints-mini {
  padding: 0.5rem 2rem 0 0;
}

/* Responsive */
@media (max-width: 1024px) {
  .api-content {
    grid-template-columns: 1fr;
  }

  .pages-tree {
    max-height: 400px;
  }
}

@media (max-width: 768px) {
  .api-ui-endpoints {
    padding: 1rem;
  }

  .api-title {
    font-size: 2rem;
  }

  .endpoints-details {
    padding: 1.5rem;
  }

  .endpoint-header {
    flex-wrap: wrap;
  }

  .endpoint-path {
    width: 100%;
  }
}

/* Custom Scrollbar */
.pages-tree::-webkit-scrollbar {
  width: 8px;
}

.pages-tree::-webkit-scrollbar-track {
  background: var(--bg-primary);
  border-radius: 4px;
}

.pages-tree::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.pages-tree::-webkit-scrollbar-thumb:hover {
  background: #2563eb;
}

.api-logs {
  padding: 2rem;
  min-height: 100vh;
  background: var(--background-color);
}

.api-logs.dark {
  --background-color: #1a1a2e;
  --card-background: #16213e;
  --text-primary: #eee;
  --text-secondary: #aaa;
  --border-color: #0f3460;
  --hover-bg: #1e3a5f;
  --primary-blue: #2563eb;
}

.api-logs.light {
  --background-color: #f5f7fa;
  --card-background: #ffffff;
  --text-primary: #2c3e50;
  --text-secondary: #7f8c8d;
  --border-color: #e1e8ed;
  --hover-bg: #f0f3f6;
  --primary-blue: #2563eb;
}

.logs-header {
  text-align: center;
  margin-bottom: 2rem;
}

.logs-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 700;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.coming-soon-notice {
  background: var(--card-background);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.notice-icon {
  font-size: 4rem;
  flex-shrink: 0;
}

.notice-content h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.notice-content p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.notice-content ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.notice-content ul li {
  color: var(--text-primary);
  padding: 0.5rem 0;
  padding-right: 1.5rem;
  position: relative;
}

.notice-content ul li::before {
  content: '✓';
  position: absolute;
  right: 0;
  color: var(--primary-blue);
  font-weight: bold;
}

.api-logs[dir="rtl"] .notice-content ul li {
  padding-right: 0;
  padding-left: 1.5rem;
}

.api-logs[dir="rtl"] .notice-content ul li::before {
  right: auto;
  left: 0;
}

.logs-table-placeholder {
  background: var(--card-background);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

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

.logs-table thead {
  background: var(--primary-blue);
  color: white;
}

.logs-table th {
  padding: 1rem;
  text-align: right;
  font-weight: 600;
  font-size: 0.95rem;
}

.api-logs[dir="ltr"] .logs-table th {
  text-align: left;
}

.logs-table tbody {
  background: var(--card-background);
}

.placeholder-row {
  height: 300px;
}

.placeholder-content {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.5rem;
  padding: 3rem;
}

@media (max-width: 768px) {
  .api-logs {
    padding: 1rem;
  }

  .coming-soon-notice {
    flex-direction: column;
    text-align: center;
  }

  .notice-icon {
    font-size: 3rem;
  }

  .logs-table {
    font-size: 0.875rem;
  }

  .logs-table th {
    padding: 0.75rem 0.5rem;
  }
}

 .data-table {
  background: var(--card-background, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.data-table.dark {
  --card-background: #16213e;
  --border-color: #1d2948;
  --text-color: #eef2ff;
  --muted-color: #94a3b8;
  --control-bg: rgba(59, 130, 246, 0.1);
}

.data-table.light {
  --card-background: #ffffff;
  --border-color: #e2e8f0;
  --text-color: #1f2933;
  --muted-color: #6b7280;
  --control-bg: #eef2ff;
}

.data-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.search-wrapper {
  flex: 1;
  min-width: 200px;
  display: flex;
  gap: 0.5rem;
}

.search-input {
  flex: 1;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--text-color);
}

.clear-btn,
.export-btn {
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--control-bg);
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-color);
}

.clear-btn:hover,
.export-btn:hover {
  opacity: 0.9;
}

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

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

.data-table th,
.data-table td {
  padding: 0.85rem 1rem;
  text-align: start;
  color: var(--text-color);
}

.data-table th {
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.data-table td {
  border-bottom: 1px solid rgba(226, 232, 240, 0.3);
  font-size: 0.95rem;
}

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

.data-table tr.clickable {
  cursor: pointer;
}

.data-table tr.clickable:hover td {
  background: var(--control-bg);
}

.data-table-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted-color);
}

.data-table-state.error {
  color: #f87171;
}

.data-table-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--muted-color);
}

.pagination-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.pagination-controls button {
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: transparent;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  color: var(--text-color);
}

.pagination-controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.data-table [data-align='center'] {
  text-align: center;
}

.data-table [data-align='end'] {
  text-align: end;
}

@media (max-width: 768px) {
  .data-table {
    padding: 1rem;
  }

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

  .search-wrapper {
    width: 100%;
  }
}

.database-viewer {
  padding: 2rem;
  min-height: 100vh;
  background: var(--background-color);
}

.database-viewer.dark {
  --background-color: #1a1a2e;
  --card-background: #16213e;
  --text-primary: #eee;
  --text-secondary: #aaa;
  --border-color: #0f3460;
  --hover-bg: #1e3a5f;
  --active-bg: #2563eb;
  --table-header-bg: #0f3460;
  --table-row-hover: #1e3a5f;
  --null-color: #666;
  --true-color: #4caf50;
  --false-color: #f44336;
}

.database-viewer.light {
  --background-color: #f5f7fa;
  --card-background: #ffffff;
  --text-primary: #2c3e50;
  --text-secondary: #7f8c8d;
  --border-color: #e1e8ed;
  --hover-bg: #f0f3f6;
  --active-bg: #2563eb;
  --table-header-bg: #f8f9fa;
  --table-row-hover: #f5f7fa;
  --null-color: #999;
  --true-color: #27ae60;
  --false-color: #e74c3c;
}

/* Header */
.viewer-header {
  text-align: center;
  margin-bottom: 2rem;
}

.viewer-title {
  font-size: 2.5rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.viewer-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

/* Main Container */
.viewer-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  max-width: 1800px;
  margin: 0 auto;
}

/* Sidebar */
.tables-sidebar {
  background: var(--card-background);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  height: fit-content;
  max-height: calc(100vh - 250px);
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-title {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.375rem;
  line-height: 1.3;
  flex-shrink: 0;
}

.tables-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.7rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  flex-shrink: 0;
}

.meta-count strong {
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
}

.tables-search {
  position: relative;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.tables-search input {
  width: 100%;
  padding-block: 0.375rem;
  padding-inline-start: 0.75rem;
  padding-inline-end: 2rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.8rem;
  background: var(--background-color);
  color: var(--text-primary);
  transition: border-color 0.2s ease;
  line-height: 1.4;
}

.tables-search input:focus {
  outline: none;
  border-color: var(--active-bg);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}

.clear-table-search {
  position: absolute;
  inset-inline-end: 0.375rem;
  inset-block-start: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0.125rem;
  line-height: 1;
  z-index: 10;
}

.clear-table-search:hover {
  color: var(--text-primary);
}

.no-tables {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem 0;
  font-size: 0.95rem;
}

.tables-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-right: 0.5rem;
  margin-right: -0.5rem;
}

.tables-list::-webkit-scrollbar {
  width: 6px;
}

.tables-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.tables-list::-webkit-scrollbar-track {
  background: transparent;
}

.table-item {
  background: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.5rem 0.625rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.table-item:hover {
  background: var(--hover-bg);
  transform: translateX(-2px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

[dir="ltr"] .table-item:hover {
  transform: translateX(2px);
}

.table-item.active {
  background: var(--active-bg);
  border-color: var(--active-bg);
  color: white;
}

.table-item-name {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  margin-bottom: 0.125rem;
  font-size: 0.8rem;
  line-height: 1.2;
}

.table-icon {
  font-size: 0.875rem;
}

.table-item-info {
  display: flex;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.table-item.active .table-item-info {
  color: rgba(255, 255, 255, 0.9);
}

.table-stat {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Table Content */
.table-content {
  background: var(--card-background);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  min-height: 600px;
  min-width: 0; /* Allow grid item to shrink and enable scrolling */
  overflow-x: auto; /* Enable horizontal scrolling for the entire content area */
}

.no-selection {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  color: var(--text-secondary);
}

.no-selection-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.no-selection p {
  font-size: 1.2rem;
}

/* Toolbar */
.content-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
  flex-wrap: wrap;
  gap: 1rem;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.selected-table-name {
  font-size: 1.5rem;
  color: var(--text-primary);
  font-weight: 600;
  margin: 0;
}

.table-info-badge {
  background: var(--active-bg);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

.toolbar-right {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  padding: 0.5rem 2.5rem 0.5rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--background-color);
  color: var(--text-primary);
  min-width: 250px;
  transition: all 0.3s ease;
}

[dir="rtl"] .search-input {
  padding: 0.5rem 1rem 0.5rem 2.5rem;
}

.search-input:focus {
  outline: none;
  border-color: var(--active-bg);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.clear-search-btn {
  position: absolute;
  left: 0.5rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem;
  transition: color 0.3s ease;
}

[dir="rtl"] .clear-search-btn {
  left: auto;
  right: 0.5rem;
}

.clear-search-btn:hover {
  color: var(--text-primary);
}

.toolbar-btn {
  background: var(--background-color);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-primary);
}

.toolbar-btn:hover {
  background: var(--hover-bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Data Table */
.table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 60vh;
  margin-bottom: 1.5rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  width: 100%;
  display: block; /* Ensure wrapper is block-level for scrolling */
}

.table-wrapper::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 999px;
}

.table-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.data-table {
  width: max-content;
  border-collapse: collapse;
  font-size: 0.9rem;
  table-layout: auto;
  display: table; /* Ensure table displays as table */
}

.data-table thead {
  background: var(--table-header-bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table th {
  padding: 1rem;
  text-align: right;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  min-width: 100px;
}

[dir="ltr"] .data-table th {
  text-align: left;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  text-align: right;
  min-width: 100px;
}

[dir="ltr"] .data-table td {
  text-align: left;
}

.data-table tbody tr {
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.data-table tbody tr:hover {
  background: var(--table-row-hover);
}

.null-value {
  color: var(--null-color);
  font-style: italic;
  font-size: 0.85rem;
}

.bool-value {
  font-weight: bold;
  font-size: 1.2rem;
}

.bool-value.true {
  color: var(--true-color);
}

.bool-value.false {
  color: var(--false-color);
}

.cell-text {
  display: inline-block;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 2px solid var(--border-color);
  flex-wrap: wrap;
  gap: 1rem;
}

.pagination-info {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.pagination-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.pagination-btn {
  background: var(--active-bg);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.pagination-btn:hover:not(:disabled) {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.pagination-btn:disabled {
  background: var(--border-color);
  cursor: not-allowed;
  opacity: 0.5;
}

.page-indicator {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.95rem;
}

.row-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.row-modal {
  background: var(--card-background);
  border: 2px solid var(--border-color);
  border-radius: 16px;
  width: min(700px, 90%);
  max-height: 80vh;
  overflow: auto;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.row-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.row-modal-header h3 {
  margin: 0;
  color: var(--text-primary);
}

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

.row-modal-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.row-modal-row {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.row-modal-row:last-child {
  border-bottom: none;
}

.row-modal-key {
  flex: 0 0 35%;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}

.row-modal-value {
  flex: 1;
  color: var(--text-primary);
  word-break: break-word;
  white-space: pre-wrap;
}

.row-modal-value code {
  background: var(--background-color);
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
}


  background: var(--active-bg);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.pagination-btn:hover:not(:disabled) {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.pagination-btn:disabled {
  background: var(--border-color);
  cursor: not-allowed;
  opacity: 0.5;
}

.page-indicator {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.95rem;
}

/* Loading & Error States */
.loading-container,
.error-container,
.no-data-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--active-bg);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.error-icon,
.no-data-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.loading-message,
.error-message {
  padding: 1rem;
  border-radius: 8px;
  background: var(--background-color);
  color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .viewer-container {
    grid-template-columns: 1fr;
  }

  .tables-sidebar {
    position: static;
    max-height: 400px;
  }

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

  .toolbar-left,
  .toolbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .search-input {
    min-width: auto;
    flex: 1;
  }
}

@media (max-width: 768px) {
  .database-viewer {
    padding: 1rem;
  }

  .viewer-title {
    font-size: 2rem;
  }

  .data-table {
    font-size: 0.8rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.5rem;
  }

  .pagination {
    flex-direction: column;
    gap: 1rem;
  }

  .pagination-controls {
    width: 100%;
    justify-content: center;
  }
}

/* ==============================================
   MAIN STYLES - OVU App Template
   Imports all style files
   ============================================== */

/* Base styles (resets, scrollbar, global elements) */

/* ==============================================
   BASE STYLES - OVU App Template
   Global resets, scrollbar, and base elements
   ============================================== */

/* HTML/Body Setup - NO SCROLL on body */

html, body {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

#root {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

/* Reset */

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

/* Custom Scrollbar (for containers) */

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 6px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Firefox scrollbar */

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) var(--bg-main);
}

/* Typography */

body {
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
}

/* Links */

a {
  color: var(--app-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--app-primary-hover);
}

/* Buttons base */

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.2s ease;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Inputs base */

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  outline: none;
  transition: all 0.2s ease;
}

/* Focus styles */

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--app-primary);
  outline-offset: 2px;
}

/* Loading spinner */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-size: 18px;
  color: var(--text-secondary);
}

/* Transitions */

.fade-enter {
  opacity: 0;
}

.fade-enter-active {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.fade-exit {
  opacity: 1;
}

.fade-exit-active {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Theme variables (colors, spacing, etc.) */

/* ==============================================
   THEME VARIABLES - OVU App Template
   CSS Variables for light/dark themes
   ============================================== */

/* Base Variables (never change) */

:root {
  --spacing-unit: 8px;
  --border-radius: 8px;
  --border-radius-sm: 4px;
  --border-radius-lg: 12px;
  --transition-speed: 0.3s;

  /* Layout */
  --sidebar-width: 280px;
  --sidebar-collapsed: 80px;
  --header-height: 70px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.12);
}

/* Light Theme */

:root[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e5e7eb;
  --header-bg: #f8fafc;

  /* Shadows for light theme */
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.12);
}

/* Dark Theme */

:root[data-theme="dark"] {
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --bg-hover: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --border-color: #334155;
  --header-bg: #0f172a;

  /* Shadows for dark theme */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* App-Specific Colors (customizable per app) */

:root {
  /* Default: Blue (like ULM) */
  --app-primary: #3b82f6;
  --app-primary-hover: #2563eb;
  --app-primary-light: #60a5fa;
  --app-primary-dark: #1e40af;

  /* For AAM: use purple
   * --app-primary: #8b5cf6;
   * --app-primary-hover: #7c3aed;
   * --app-primary-light: #a78bfa;
   * --app-primary-dark: #6d28d9;
   */

  /* Status Colors */
  --color-success: #10b981;
  --color-success-light: #34d399;
  --color-warning: #f59e0b;
  --color-warning-light: #fbbf24;
  --color-error: #ef4444;
  --color-error-light: #f87171;
  --color-info: #3b82f6;
  --color-info-light: #60a5fa;
}

/* Body background */

body {
  background: var(--bg-main);
  color: var(--text-primary);
  transition: background var(--transition-speed) ease, color var(--transition-speed) ease;
}

/* App-specific styles */

/* ==============================================
   APP-SPECIFIC STYLES - OVU App Template
   Customize these styles for your app
   ============================================== */

/* Login Page */

.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
}

.login-header {
  width: 100%;
  background: var(--header-bg);
  padding: 12px 32px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
}

.login-header-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.login-header-controls {
  display: flex;
  gap: 10px;
}

.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.login-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  padding: 48px 40px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
  border: 1px solid var(--border-color);
}

.logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}

.logo-icon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--app-primary) 0%, var(--app-primary-hover) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  box-shadow: var(--shadow-md);
}

.login-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 32px;
}

.error-message {
  background: var(--color-error-light);
  color: white;
  padding: 12px 16px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
  font-size: 14px;
  text-align: center;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.form-group label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-group input {
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-main);
  color: var(--text-primary);
  font-size: 15px;
}

.form-group input:focus {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.password-input-wrapper {
  position: relative;
}

.password-input-wrapper input {
  padding-right: 48px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 20px;
  padding: 4px;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.toggle-password:hover {
  opacity: 1;
}

.login-btn {
  padding: 14px 24px;
  background: var(--app-primary);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-top: 8px;
}

.login-btn:hover:not(:disabled) {
  background: var(--app-primary-hover);
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Control Buttons (Theme/Language) */

.control-btn {
  padding: 8px 16px;
  border-radius: var(--border-radius);
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 48px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* App Layout (after login) */

.app-layout {
  min-height: 100vh;
  display: flex;
  background: var(--bg-main);
}

.main-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-header {
  width: 100%;
  height: var(--header-height);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

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

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

.user-info {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 0 12px;
}

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

.logout-btn:hover {
  background: var(--color-error-light);
}

/* Main Container */

.main-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  background: var(--bg-main);
}

/* Page Placeholder (for empty routes) */

.page-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  font-size: 24px;
  color: var(--text-secondary);
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 2px dashed var(--border-color);
}

/* Dashboard Example */

.dashboard {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.dashboard-section {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  border: 1px solid var(--border-color);
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

/* App Layout with Sidebar - FIXED SIDEBAR WIDTH */
.app-layout {
  display: flex;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  background: var(--bg-main);
}

/* Main Layout - NO MARGIN (Sidebar occupies flex space) */
.main-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  margin: 0;
  transition: margin 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* App Header - FIXED HEIGHT */
.app-header {
  width: 100%;
  height: 70px;
  min-height: 70px;
  max-height: 70px;
  flex-shrink: 0;
  background: var(--header-bg);
  padding: 0 32px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.3s ease;
}

.header-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  transition: color 0.3s ease;
}

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

/* User Info */
.user-info {
  padding: 8px 16px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 8px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

/* Control Buttons - FIXED SIZE */
.control-btn {
  min-width: 38px;
  width: auto;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

:root[data-theme="dark"] .control-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.control-btn:hover {
  transform: translateY(-2px);
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

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

/* Logout Button */
.logout-btn {
  background: rgba(239, 68, 68, 0.1) !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  color: #ef4444 !important;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: #ef4444 !important;
}

/* Main Container - SCROLLABLE AREA WITH CUSTOM SCROLLBAR */
.main-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  height: calc(100vh - 70px);
  max-height: calc(100vh - 70px);
}

/* Custom Scrollbar - צמוד לתוכן */
.main-container::-webkit-scrollbar {
  width: 12px;
}

.main-container::-webkit-scrollbar-track {
  background: var(--bg-main);
  border-inline-start: 1px solid var(--border-color);
}

.main-container::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 6px;
  border: 3px solid var(--bg-main);
  transition: background 0.2s ease;
}

.main-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Firefox Scrollbar */
.main-container {
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) var(--bg-main);
}

/* Smooth Scrolling */
.main-container {
  scroll-behavior: smooth;
}

/* Responsive */
@media (max-width: 768px) {
  .main-layout {
    margin-inline-start: 0 !important;
  }

  [dir="rtl"] .main-layout {
    margin-right: 0 !important;
  }

  [dir="ltr"] .main-layout {
    margin-left: 0 !important;
  }

  .app-header {
    padding: 0 20px;
  }

  .header-title {
    font-size: 16px;
  }

  .user-info {
    display: none;
  }

  .header-controls {
    gap: 8px;
  }

  .control-btn {
    min-width: 32px;
    padding: 0 8px;
    font-size: 13px;
  }

  .main-container::-webkit-scrollbar {
    width: 8px;
  }
}

