/* ═══════════════════════════════════════════════════════════════
   Bhikusa Manager - Application Styles
   Dashboard layout with sidebar, header, footer
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Color Palette */
  --bg-primary: #0a0a0c;
  --bg-secondary: #121216;
  --bg-tertiary: #1a1a1f;
  --bg-card: rgba(26, 26, 31, 0.9);
  
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-muted: #636366;
  
  --accent-primary: #d4a44a;
  --accent-secondary: #b8892d;
  --accent-glow: rgba(212, 164, 74, 0.3);
  --accent-subtle: rgba(212, 164, 74, 0.1);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  
  --success: #34c759;
  --error: #ff453a;
  --info: #5ac8fa;
  
  /* Typography */
  --font-display: 'Crimson Pro', Georgia, serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Layout */
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --header-height: 64px;
  --footer-height: 50px;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════
   App Layout
   ═══════════════════════════════════════════════════════════════ */

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

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left var(--transition-base);
}

/* ═══════════════════════════════════════════════════════════════
   Sidebar
   ═══════════════════════════════════════════════════════════════ */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition-base), width var(--transition-base);
}

.sidebar-nav {
  flex: 1;
  padding: var(--header-height) 0 1rem;
  overflow-y: auto;
}

.nav-section {
  padding: 1rem 1.25rem;
}

.nav-section-title {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.nav-list {
  list-style: none;
}

.nav-item {
  margin-bottom: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: all var(--transition-fast);
}

.nav-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

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

.nav-link.active {
  background: var(--accent-subtle);
  color: var(--accent-primary);
}

.nav-link.active svg {
  stroke: var(--accent-primary);
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
}

.back-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.back-link svg {
  width: 18px;
  height: 18px;
}

.back-link:hover {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   Header
   ═══════════════════════════════════════════════════════════════ */

.app-header {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 90;
  transition: left var(--transition-base);
}

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

.sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 8px;
  transition: all var(--transition-fast);
}

.sidebar-toggle svg {
  width: 22px;
  height: 22px;
}

.sidebar-toggle:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

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

.logo-mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--bg-primary);
}

.logo-mark.small {
  width: 32px;
  height: 32px;
  font-size: 1rem;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

.header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.page-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.header-right {
  display: flex;
  align-items: center;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary);
  border-radius: 100px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: var(--accent-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bg-primary);
}

.user-name {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   Content Area
   ═══════════════════════════════════════════════════════════════ */

.app-content {
  flex: 1;
  padding: calc(var(--header-height) + 1.5rem) 1.5rem calc(var(--footer-height) + 1.5rem);
  overflow-y: auto;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════════════════════════ */

.app-footer {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--footer-height);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: left var(--transition-base);
}

.version {
  padding: 0.25rem 0.75rem;
  background: var(--bg-tertiary);
  border-radius: 100px;
}

/* ═══════════════════════════════════════════════════════════════
   Dashboard Page
   ═══════════════════════════════════════════════════════════════ */

.dashboard-page {
  animation: fadeIn 0.4s ease-out;
}

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

.welcome-card {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-tertiary));
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.welcome-icon {
  width: 64px;
  height: 64px;
  background: var(--accent-subtle);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.welcome-icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--accent-primary);
}

.welcome-card h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.welcome-card p {
  color: var(--text-muted);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition-fast);
}

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
}

.stat-icon.production {
  background: rgba(212, 164, 74, 0.15);
}
.stat-icon.production svg { stroke: var(--accent-primary); }

.stat-icon.reports {
  background: rgba(90, 200, 250, 0.15);
}
.stat-icon.reports svg { stroke: var(--info); }

.stat-icon.analytics {
  background: rgba(52, 199, 89, 0.15);
}
.stat-icon.analytics svg { stroke: var(--success); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

/* Production Stat Card - Enhanced */
.production-stat .stat-info {
  flex: 1;
}

.stat-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.stat-period-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  background: var(--accent-subtle);
  color: var(--accent-primary);
  border: 1px solid rgba(212, 164, 74, 0.3);
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-main-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.stat-change {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.stat-change.positive {
  color: var(--success);
  background: rgba(52, 199, 89, 0.15);
}

.stat-change.negative {
  color: var(--error);
  background: rgba(255, 69, 58, 0.15);
}

.stat-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Mini Chart Styles */
.analytics-card {
  min-width: 220px;
}

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

.mini-chart-container {
  width: 100%;
  height: 50px;
  margin: 0.5rem 0 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-chart-svg {
  width: 100%;
  height: 100%;
}

.chart-line {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line.current-line {
  stroke: var(--accent-primary);
}

.chart-line.prev-line {
  stroke: var(--text-muted);
  stroke-dasharray: 4 3;
  stroke-width: 1.5;
  opacity: 0.6;
}

.chart-fill.current-fill {
  fill: url(#chartGradient);
  fill: var(--accent-subtle);
  opacity: 0.3;
}

.mini-chart-legend {
  display: flex;
  gap: 0.75rem;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.legend-dot {
  width: 8px;
  height: 3px;
  border-radius: 2px;
}

.legend-dot.current {
  background: var(--accent-primary);
}

.legend-dot.prev {
  background: var(--text-muted);
  opacity: 0.6;
}

.mini-chart-loading {
  display: flex;
  gap: 4px;
  align-items: center;
}

.loading-dot {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: loadingPulse 1s ease-in-out infinite;
}

.loading-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes loadingPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

.mini-chart-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
}

.info-card h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.info-list {
  list-style: none;
}

.info-list li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.info-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent-primary);
}

.status-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.connected {
  background: var(--success);
  box-shadow: 0 0 8px rgba(52, 199, 89, 0.5);
}

.status-dot.disconnected {
  background: var(--error);
  box-shadow: 0 0 8px rgba(255, 69, 58, 0.5);
}

/* Placeholder Pages */
.placeholder-page {
  text-align: center;
  padding: 4rem 2rem;
}

.placeholder-page h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.placeholder-page p {
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   Sidebar Overlay (Mobile)
   ═══════════════════════════════════════════════════════════════ */

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 95;
  opacity: 0;
  transition: opacity var(--transition-base);
}

/* ═══════════════════════════════════════════════════════════════
   Responsive Design
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .header-center {
    display: none;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .sidebar-overlay.visible {
    display: block;
    opacity: 1;
  }
  
  .app-main {
    margin-left: 0;
  }
  
  .app-header {
    left: 0;
  }
  
  .app-footer {
    left: 0;
  }
  
  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .header-brand {
    display: none;
  }
  
  .user-name {
    display: none;
  }
}

@media (max-width: 480px) {
  .app-content {
    padding: calc(var(--header-height) + 1rem) 1rem calc(var(--footer-height) + 1rem);
  }
  
  .welcome-card {
    padding: 1.5rem;
  }
  
  .stats-row {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Production Page Styles
   ═══════════════════════════════════════════════════════════════ */

.production-page {
  animation: fadeIn 0.4s ease-out;
  position: relative;
}

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

.page-header-content {
  flex: 1;
}

.page-header h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

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

/* Analytics Page */
.analytics-content {
  margin-top: 1.5rem;
}

.placeholder-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 4rem 2rem;
  text-align: center;
}

.placeholder-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.1));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder-icon svg {
  width: 40px;
  height: 40px;
  stroke: var(--accent-primary);
}

.placeholder-card h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.placeholder-card p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 400px;
  margin: 0 auto;
}

/* Analytics Table Styles */
.paper-type-badge {
  display: inline-block;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(147, 51, 234, 0.15));
  color: var(--text-primary);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  margin: 0.15rem;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.breakdown-cell {
  max-width: 350px;
}

.summary-badge {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.2));
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

/* Chart Card */
.chart-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

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

.chart-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

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

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

/* Unit Toggle */
.unit-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.unit-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.unit-label.active {
  color: var(--accent-primary);
  font-weight: 600;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  transition: all 0.3s ease;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(147, 51, 234, 0.3));
  border-color: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
  background: var(--accent-primary);
}

.chart-container {
  padding: 1.5rem;
  height: 400px;
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
}

.chart-scroll-wrapper {
  height: 100%;
  min-width: 100%;
  position: relative;
}

/* Custom scrollbar for chart container */
.chart-container::-webkit-scrollbar {
  height: 8px;
}

.chart-container::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

.chart-container::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
}

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

@media (max-width: 768px) {
  .chart-container {
    height: 300px;
    padding: 1rem;
  }
  
  .chart-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .unit-toggle {
    align-self: flex-end;
  }
}

/* Filters Card */
.filters-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 150px;
}

.filter-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.filter-group label .required {
  color: var(--error);
}

.filter-select {
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-select:hover:not(:disabled) {
  border-color: var(--border-hover);
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-subtle);
}

.filter-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.filter-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.filter-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: var(--bg-primary);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

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

/* Results Summary */
.results-summary {
  display: flex;
  gap: 2rem;
  padding: 1rem 1.25rem;
  background: var(--accent-subtle);
  border: 1px solid rgba(212, 164, 74, 0.2);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.summary-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.summary-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-primary);
}

.summary-unit {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Table Card */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

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

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

.data-table th,
.data-table td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background: var(--bg-tertiary);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover:not(.empty-row) {
  background: rgba(255, 255, 255, 0.02);
}

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

.data-table .value-cell {
  font-weight: 500;
  color: var(--accent-primary);
}

/* Empty State */
.empty-row td {
  padding: 3rem;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 0.95rem;
  text-align: center;
}

/* Loading Overlay */
.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 12, 0.8);
  backdrop-filter: blur(4px);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

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

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

.loading-overlay p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Table Header with Add Button */
.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

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

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-1px);
}

/* Icon-only button */
.btn-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-icon svg {
  width: 22px;
  height: 22px;
  margin: 0;
}

.btn-icon.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), #2563eb);
  color: white;
}

.btn-icon.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-1px);
}

/* Table Toggle Section */
.table-toggle-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.table-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-toggle-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  width: 90%;
  max-width: 550px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

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

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

.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.modal-close svg {
  width: 20px;
  height: 20px;
}

.modal-form {
  padding: 1.5rem;
}

.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  flex: 1;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

/* Notification Styles */
.notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  z-index: 1100;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}

.notification.show {
  transform: translateY(0);
  opacity: 1;
}

.notification.success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.notification.error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

/* Responsive adjustments for Production Page */
@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .page-header .btn {
    align-self: flex-start;
  }
  
  .filters-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-group {
    min-width: 100%;
  }
  
  .filter-actions {
    margin-left: 0;
    margin-top: 0.5rem;
  }
  
  .results-summary {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .data-table th,
  .data-table td {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
  
  .table-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  .table-header h3 {
    text-align: center;
  }
  
  .form-row {
    flex-direction: column;
    gap: 1rem;
  }
  
  .modal {
    width: 95%;
    margin: 1rem;
  }
  
  .notification {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Settings Page Styles
   ═══════════════════════════════════════════════════════════════ */

.settings-page .filter-input {
  padding: 0.6rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-primary);
  min-width: 200px;
  transition: all 0.2s ease;
}

.settings-page .filter-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.settings-page .filter-input::placeholder {
  color: var(--text-muted);
}

/* Key cell styling */
.key-cell code {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-primary);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
}

/* Type badge */
.type-badge {
  display: inline-block;
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.15), rgba(79, 70, 229, 0.15));
  color: #a78bfa;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Status badge */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.enabled {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.status-badge.disabled {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* Value cell */
.value-cell {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Text muted */
.text-muted {
  color: var(--text-muted);
  font-style: italic;
}

/* Actions cell */
.actions-cell {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn svg {
  width: 16px;
  height: 16px;
}

.action-btn.edit-btn {
  color: var(--accent-primary);
}

.action-btn.edit-btn:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--accent-primary);
}

.action-btn.delete-btn {
  color: #f87171;
}

.action-btn.delete-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #f87171;
}

/* Modal small variant */
.modal.modal-small {
  max-width: 420px;
}

.modal-body {
  padding: 1.5rem;
  text-align: center;
}

.modal-body p {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.delete-key {
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  margin: 1rem 0;
}

.delete-warning {
  color: #f87171 !important;
  font-size: 0.9rem;
  margin-top: 1rem !important;
}

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

/* Danger button */
.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-1px);
}

/* Full width form group */
.form-group.full-width {
  width: 100%;
}

.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text-primary);
  font-family: inherit;
  resize: vertical;
  transition: all 0.2s ease;
}

.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-group textarea::placeholder {
  color: var(--text-muted);
}

/* Settings responsive */
@media (max-width: 1024px) {
  .settings-page .data-table th:nth-child(5),
  .settings-page .data-table td:nth-child(5),
  .settings-page .data-table th:nth-child(6),
  .settings-page .data-table td:nth-child(6) {
    display: none;
  }
}

@media (max-width: 768px) {
  .settings-page .data-table th:nth-child(3),
  .settings-page .data-table td:nth-child(3) {
    display: none;
  }
  
  .settings-page .filter-input {
    min-width: 100%;
  }
}

/* ═══════════════════════════════════════════════════════════════
   About Page
   ═══════════════════════════════════════════════════════════════ */

.about-page {
  padding-bottom: 2rem;
}

.about-hero {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.about-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 20%, var(--accent-subtle) 0%, transparent 50%),
              radial-gradient(circle at 70% 80%, var(--accent-subtle) 0%, transparent 50%);
  pointer-events: none;
}

.about-hero-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: var(--accent-subtle);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.about-hero-icon svg {
  width: 40px;
  height: 40px;
  stroke: var(--accent-primary);
}

.about-hero h1 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  position: relative;
}

.about-tagline {
  font-size: 1.1rem;
  color: var(--text-secondary);
  position: relative;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all var(--transition-fast);
}

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

.about-card-wide {
  grid-column: 1 / -1;
}

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

.about-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-subtle);
  flex-shrink: 0;
}

.about-card-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--accent-primary);
}

.about-card-icon.mission {
  background: rgba(59, 130, 246, 0.15);
}

.about-card-icon.mission svg {
  stroke: rgb(59, 130, 246);
}

.about-card-icon.vision {
  background: rgba(147, 51, 234, 0.15);
}

.about-card-icon.vision svg {
  stroke: rgb(147, 51, 234);
}

.about-card-icon.products {
  background: rgba(16, 185, 129, 0.15);
}

.about-card-icon.products svg {
  stroke: rgb(16, 185, 129);
}

.about-card-icon.values {
  background: rgba(245, 158, 11, 0.15);
}

.about-card-icon.values svg {
  stroke: rgb(245, 158, 11);
}

.about-card-icon.contact {
  background: rgba(239, 68, 68, 0.15);
}

.about-card-icon.contact svg {
  stroke: rgb(239, 68, 68);
}

.about-card-header h3 {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.about-card-content {
  color: var(--text-secondary);
  line-height: 1.7;
}

.about-card-content p {
  margin-bottom: 1rem;
}

.about-card-content p:last-child {
  margin-bottom: 0;
}

.product-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.product-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.product-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.product-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  flex-shrink: 0;
}

.product-badge.package {
  background: rgba(59, 130, 246, 0.15);
  color: rgb(59, 130, 246);
}

.product-badge.kraft {
  background: rgba(16, 185, 129, 0.15);
  color: rgb(16, 185, 129);
}

.product-badge.duplex {
  background: rgba(245, 158, 11, 0.15);
  color: rgb(245, 158, 11);
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.value-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--bg-tertiary);
  border-radius: 8px;
}

.value-icon {
  color: var(--success);
  font-weight: bold;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.contact-item svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-muted);
  flex-shrink: 0;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
}

.about-stat {
  text-align: center;
}

.about-stat .stat-number {
  display: block;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--accent-primary);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.about-stat .stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .about-hero {
    padding: 2rem 1.5rem;
  }
  
  .about-hero h1 {
    font-size: 1.75rem;
  }
  
  .about-grid {
    grid-template-columns: 1fr;
  }
  
  .about-card-wide {
    grid-column: auto;
  }
  
  .values-grid {
    grid-template-columns: 1fr;
  }
  
  .about-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .about-stat .stat-number {
    font-size: 2rem;
  }
}

