:root {
  /* Color Palette - Retaining original scheme */
  --background: #000000;
  --surface: #111111;
  --surface-alt: #222222;
  --text: #9E9E9F;
  --text-bright: #cccccc;
  
  /* Accents */
  --primary: #B8EF67;      /* Lime/Green - Headings, Primary Actions */
  --secondary: #06B6D4;    /* Cyan/Blue - Links, Secondary Actions */
  --border: #333333;
  
  /* Status Colors */
  --status-submitted: #555555;
  --status-in-process: #ff9800;
  --status-pending: #ff9800;    /* Changed to orange as per user request */
  --status-completed: #4caf50;
  --status-rejected: #f44336;

  /* Pico CSS Overrides */
  --pico-background-color: var(--background);
  --pico-color: var(--text);
  --pico-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  
  --pico-primary: var(--primary);
  --pico-primary-background: var(--primary);
  --pico-primary-border: var(--primary);
  --pico-primary-inverse: #000000;
  
  --pico-secondary: var(--secondary);
  --pico-secondary-background: var(--surface);
  --pico-secondary-border: var(--secondary);
  --pico-secondary-inverse: var(--secondary);

  --pico-border-color: var(--border);
  --pico-card-background-color: var(--surface);
  --pico-card-border-color: var(--border);
  
  --pico-form-element-background-color: var(--background);
  --pico-form-element-border-color: var(--border);
  --pico-form-element-color: var(--text);
  --pico-form-element-placeholder-color: #555;
  --pico-form-element-active-border-color: var(--secondary);
  --pico-form-element-focus-color: var(--secondary);
}

/* Base Overrides */
body {
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Space Grotesk", sans-serif;
  color: var(--primary);
  --pico-color: var(--primary);
}

a {
  color: var(--secondary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout Utilities */
.dashboard-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 30px;
  width: 100%;
  padding: 20px;
}

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

/* Components */
.sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--pico-border-radius);
  padding: 20px;
  height: calc(100vh - 140px); /* Adjust for header/padding */
  position: sticky;
  top: 20px;
}

.sidebar nav a {
  display: block;
  padding: 12px;
  color: var(--text);
  border-radius: 4px;
  margin-bottom: 8px;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background: var(--secondary);
  color: #000;
  text-decoration: none;
}

.main-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--pico-border-radius);
  padding: 30px;
  overflow-x: hidden; /* Prevent horizontal scroll */
  width: 100%;
}

.status-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
}

.status-badge.status-submitted { background: var(--status-submitted); }
.status-badge.status-in_process { background: var(--status-in-process); color: #000; }
.status-badge.status-pending_review { background: var(--status-pending); }
.status-badge.status-completed { background: var(--status-completed); color: #000; }
.status-badge.status-rejected { background: var(--status-rejected); }

/* Helpers */
.text-cyan { color: var(--secondary); }
.text-orange { color: var(--status-in-process); }
.text-green { color: var(--status-completed); }
.text-red { color: var(--status-rejected); }

.bg-dark { background: #000 !important; }
.bg-surface { background: var(--surface) !important; }
.bg-surface-alt { background: var(--surface-alt) !important; }

.border-primary { border-color: var(--primary) !important; }
.border-secondary { border-color: var(--secondary) !important; }
.border-warning { border-color: var(--status-in-process) !important; }
.border-danger { border-color: var(--status-rejected) !important; }

/* Custom Button Overrides for specific cases */
.btn-small {
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  width: auto;
  display: inline-block;
}

/* Modal styling overrides to match Pico but keep dark theme */
dialog article {
  background-color: var(--surface);
  border: 1px solid var(--border);
}

/* Spinner CSS */
.spinner {
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 2px solid #fff;
  width: 1em;
  height: 1em;
  -webkit-animation: spin 1s linear infinite;
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.5em;
}

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

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