/* Admin Layout with Sidebar */

.admin-layout {
  min-height: 100vh;
}

.admin-sidebar {
  position: fixed;
  left: 0;
  top: 60px; /* Height of main nav */
  width: 260px;
  height: calc(100vh - 60px);
  background: var(--bg-primary, #ffffff);
  border-right: 1px solid var(--border-color, #e5e7eb);
  overflow-y: auto;
  z-index: 100;
}

.admin-main {
  margin-left: 260px;
  margin-top: 60px;
  min-height: calc(100vh - 60px);
  background: var(--bg-secondary, #f9fafb);
}

.admin-content {
  padding: 0;
  width: 100%;
  max-width: 100%;
}

/* Sidebar Header */
.admin-sidebar-header {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.admin-sidebar-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary, #111827);
}

/* Sidebar Navigation */
.admin-sidebar-nav {
  padding: 1rem 0;
}

.admin-sidebar-section {
  margin-bottom: 1.5rem;
}

.admin-sidebar-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #6b7280);
}

.admin-sidebar-section-title i {
  font-size: 0.875rem;
}

.admin-sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  color: var(--text-secondary, #374151);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  position: relative;
}

.admin-sidebar-nav-item i {
  font-size: 1rem;
  flex-shrink: 0;
}

.admin-sidebar-nav-item:hover {
  background: var(--bg-secondary, #f9fafb);
  color: var(--primary-color, #3b82f6);
}

.admin-sidebar-nav-item.active {
  background: var(--primary-bg, #eff6ff);
  color: var(--primary-color, #3b82f6);
  font-weight: 600;
}

.admin-sidebar-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary-color, #3b82f6);
}

/* Scrollbar Styling */
.admin-sidebar::-webkit-scrollbar {
  width: 6px;
}

.admin-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.admin-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-color, #e5e7eb);
  border-radius: 3px;
}

.admin-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted, #6b7280);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .admin-sidebar {
    width: 220px;
  }

  .admin-main {
    margin-left: 220px;
  }

  .admin-sidebar-nav-item {
    padding: 0.625rem 0.75rem 0.625rem 2rem;
    font-size: 0.8125rem;
  }
}

@media (max-width: 768px) {
  .admin-sidebar {
    position: fixed;
    left: -260px;
    width: 260px;
    transition: left 0.3s ease;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  }

  .admin-sidebar.open {
    left: 0;
  }

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

  .admin-sidebar-toggle {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--primary-color, #3b82f6);
    color: white;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 101;
    font-size: 1.25rem;
  }

  .admin-sidebar-toggle:hover {
    background: var(--primary-hover, #2563eb);
  }
}

/* Remove existing page containers' max-width to allow full width */
.admin-layout .generation-config-detail,
.admin-layout .workflow-detail,
.admin-layout .workflows-container,
.admin-layout .inquiries-container {
  max-width: none;
  padding: 2rem 3rem;
  margin: 0;
}

/* Admin page title styling */
.admin-layout .page-title {
  margin-top: 0;
}

/* Ensure proper spacing for admin pages without custom containers */
.admin-content > :not(.generation-config-detail):not(.workflow-detail):not(.workflows-container):not(.inquiries-container) {
  padding: 2rem 3rem;
}

/* Ensure admin tables are responsive */
@media (max-width: 768px) {
  .admin-layout table {
    display: block;
    overflow-x: auto;
  }
}
