/* Fraction ERP Support - Dark Theme with Glassmorphism */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-gradient-start: #0f172a;
  --bg-gradient-end: #1e293b;
  --sidebar-bg: rgba(15, 23, 42, 0.95);
  --card-bg: rgba(255, 255, 255, 0.1);
  --card-border: rgba(255, 255, 255, 0.2);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.8);
  --text-muted: rgba(255, 255, 255, 0.7);
  --accent-blue: #93c5fd;
  --accent-cyan: #67e8f9;
  --accent-gradient: linear-gradient(to right, #93c5fd, #67e8f9);
  --hover-bg: rgba(255, 255, 255, 0.1);
  --active-bg: rgba(6, 182, 212, 0.1);
  --active-border: #06b6d4;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
}

.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--sidebar-bg);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--card-border);
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--card-border);
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.logo-img {
  height: 36px;
  width: auto;
  margin: 0;
}

.nav-controls {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--card-border);
}

.expand-btn, .collapse-btn {
  flex: 1;
  padding: 0.5rem;
  font-size: 0.75rem;
  background: var(--hover-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.expand-btn:hover, .collapse-btn:hover {
  background: var(--card-bg);
  color: var(--text-primary);
}

.nav-list {
  padding: 0.25rem 0;
}

.nav-section {
  margin-bottom: 0.125rem;
}

.nav-section-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.nav-section-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.nav-section-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.nav-section-icon svg,
.nav-section-icon i {
  width: 18px;
  height: 18px;
}

.nav-section-title {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
}

.chevron {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
  color: var(--text-muted);
}

.nav-section.expanded .chevron {
  transform: rotate(90deg);
}

.nav-items {
  list-style: none;
  display: none;
  padding-left: 0;
  margin: 0;
}

.nav-items li {
  margin-bottom: 0;
}

.nav-section.expanded .nav-items {
  display: block;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem 0.35rem 2rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.75rem;
  transition: all 0.2s;
  border-left: 2px solid transparent;
}

.nav-link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-link-icon svg,
.nav-link-icon i {
  width: 14px;
  height: 14px;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--hover-bg);
}

.nav-link.active {
  color: var(--accent-cyan);
  background: var(--active-bg);
  border-left-color: var(--active-border);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 2rem;
  min-height: 100vh;
}

.content-wrapper {
  max-width: 56rem;
  margin: 0 auto;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 1rem;
  padding: 2rem;
  border: 1px solid var(--card-border);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Typography */
h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--card-border);
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.5rem 0 0.75rem;
}

h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 1rem 0 0.5rem;
}

p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.9375rem;
  line-height: 1.7;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-cyan);
  text-decoration: underline;
}

/* Video Embeds */
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 1.5rem 0;
  border-radius: 0.75rem;
  border: 1px solid var(--card-border);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Lists */
ul, ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
  color: var(--text-muted);
}

li {
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
}

li::marker {
  color: var(--accent-cyan);
}

/* Code */
code {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.8125rem;
  font-family: 'Monaco', 'Menlo', monospace;
  color: var(--accent-cyan);
}

pre {
  background: rgba(0, 0, 0, 0.4);
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1rem 0;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.875rem;
}

th, td {
  padding: 0.75rem;
  border: 1px solid var(--card-border);
  text-align: left;
}

th {
  background: rgba(0, 0, 0, 0.2);
  font-weight: 600;
  color: var(--text-primary);
}

td {
  color: var(--text-muted);
}

/* Blockquotes */
blockquote {
  border-left: 3px solid var(--accent-cyan);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 1rem 0;
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  padding: 0.75rem;
  color: var(--text-primary);
  cursor: pointer;
}

.mobile-menu-btn .icon {
  width: 24px;
  height: 24px;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }
  
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
    padding: 4rem 1rem 2rem;
  }
  
  .content-wrapper {
    padding: 1.5rem;
  }
  
  h1 {
    font-size: 1.5rem;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}
