/**
 * Verktygsväskan Projects System CSS
 * Styling för projekthantering
 */

/* Projects View Container */
.projects-view {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  z-index: 9999;
  overflow-y: auto;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.projects-view.active {
  display: block;
  opacity: 1;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.projects-view-content {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.projects-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.projects-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  text-align: center;
}

.projects-back-btn,
.projects-add-btn,
.projects-menu-btn {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.projects-back-btn:hover,
.projects-add-btn:hover,
.projects-menu-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.projects-back-btn:active,
.projects-add-btn:active,
.projects-menu-btn:active {
  transform: scale(0.95);
}

/* Body */
.projects-body {
  flex: 1;
  padding: 1.5rem 1rem;
  background: #f8fafc;
}

/* Tips Banner - Gul informationsbanner högst upp i projektlistan */
.projects-tip-banner {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #fbbf24;
  border-radius: 12px;
  padding: 16px 20px;
  margin: 0 1rem 1.5rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.2);
  animation: slideInDown 0.4s ease-out;
}

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

.projects-tip-banner i {
  color: #f59e0b;
  font-size: 20px;
  margin-top: 2px;
  flex-shrink: 0;
}

.projects-tip-content {
  color: #78350f;
  font-size: 14px;
  line-height: 1.6;
  flex: 1;
}

.projects-quick-basket-bar {
  padding: 0 1rem 0.75rem;
}

.btn-quick-basket {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  border: 1px solid #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-quick-basket:hover {
  background: #dbeafe;
}

.projects-tip-content strong {
  color: #92400e;
  font-weight: 700;
}

/* Empty State Hint */
.empty-state-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 1.5rem;
}

.empty-state-hint i {
  color: #f59e0b;
  font-size: 1rem;
}

/* Project Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* Project Card */
.project-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.project-card:hover {
  border-color: #667eea;
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(102, 126, 234, 0.2);
}

.project-card:active {
  transform: translateY(-2px);
}

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

.project-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
}

.project-meta {
  text-align: right;
}

.project-date {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
}

.project-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.project-description {
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.project-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #667eea;
  font-weight: 600;
  font-size: 0.9rem;
}

.project-stat-basket {
  color: #6366f1;
}

.project-category {
  background: #eff6ff;
  color: #2563eb;
  padding: 0.375rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #64748b;
}

.empty-state i {
  font-size: 4rem;
  color: #cbd5e1;
  margin-bottom: 1.5rem;
}

.empty-state h3 {
  font-size: 1.5rem;
  color: #475569;
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 1rem;
  margin-bottom: 2rem;
}

.empty-state-small {
  text-align: center;
  padding: 2rem 1rem;
  color: #94a3b8;
  background: #f8fafc;
  border-radius: 12px;
  border: 2px dashed #e2e8f0;
}

.empty-state-small i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #cbd5e1;
}

.empty-state-small p {
  margin: 0.5rem 0;
}

.empty-state-small .hint {
  font-size: 0.85rem;
  color: #cbd5e1;
}

/* Form Styling */
.project-form-container {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.project-form-card {
  background: white;
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
}

/* Progress Indicator */
.form-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid #f1f5f9;
}

.form-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.3s;
}

.form-progress-step.active .step-circle {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.form-progress-step span {
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  text-align: center;
}

.form-progress-step.active span {
  color: #667eea;
}

.form-progress-line {
  width: 60px;
  height: 2px;
  background: #e2e8f0;
  margin: 0 0.5rem;
  margin-bottom: 1.5rem;
}

/* Form Group */
.form-group {
  margin-bottom: 2rem;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
  color: #1e293b;
  font-size: 1rem;
}

.form-label i {
  color: #667eea;
  font-size: 1.1rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s;
  font-family: 'Inter', sans-serif;
  background: #fafafa;
}

.form-input:hover,
.form-textarea:hover {
  border-color: #cbd5e1;
  background: white;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  background: white;
}

.form-input.error,
.form-textarea.error {
  border-color: #ef4444;
  background: #fef2f2;
}

.form-input.error:focus,
.form-textarea.error:focus {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.form-hint {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #64748b;
}

.form-hint i {
  margin-right: 0.25rem;
}

.char-counter {
  font-weight: 600;
  color: #94a3b8;
}

.form-error {
  display: none;
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  background: #fef2f2;
  border-left: 3px solid #ef4444;
  border-radius: 8px;
  color: #dc2626;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.category-card {
  position: relative;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.25rem 1rem;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.category-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.category-card:hover {
  border-color: #667eea;
  background: #f1f5f9;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}

.category-card input[type="radio"]:checked ~ * {
  /* This selector won't work, so we use .selected class */
}

.category-card.selected,
.category-card input[type="radio"]:checked + .category-icon {
  border-color: #667eea;
  background: linear-gradient(135deg, #667eea10, #764ba220);
}

.category-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea15, #764ba225);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #667eea;
  font-size: 1.75rem;
  transition: all 0.3s;
}

.category-card.selected .category-icon {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.category-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
}

.category-card.selected .category-name {
  color: #667eea;
}

.category-check {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s;
}

.category-card.selected .category-check {
  opacity: 1;
  background: #667eea;
  color: white;
}

.category-check i {
  font-size: 0.75rem;
}

/* Create Button */
.btn-create-project {
  width: 100%;
  padding: 1.25rem 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-create-project:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
}

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

.btn-create-project:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-icon {
  display: inline-flex;
  font-size: 1.25rem;
}

.btn-loading {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

/* Tips Sidebar */
.project-tips-card {
  background: linear-gradient(135deg, #667eea10, #764ba210);
  border: 2px solid #667eea30;
  border-radius: 20px;
  padding: 2rem;
  width: 320px;
  height: fit-content;
  position: sticky;
  top: 1.5rem;
}

.project-tips-card h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 1.5rem;
}

.project-tips-card h3 i {
  font-size: 1.5rem;
}

.tips-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tips-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  line-height: 1.5;
  color: #475569;
  font-size: 0.95rem;
}

.tips-list li i {
  color: #10b981;
  font-size: 1.1rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 1024px) {
  .project-form-container {
    grid-template-columns: 1fr;
  }
  
  .project-tips-card {
    width: 100%;
    position: static;
  }
}

@media (max-width: 768px) {
  .project-form-card {
    padding: 1.5rem;
  }
  
  .form-progress {
    margin-bottom: 2rem;
  }
  
  .step-circle {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
  }
  
  .form-progress-line {
    width: 40px;
  }
  
  .form-progress-step span {
    font-size: 0.65rem;
  }
  
  .category-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
  }
  
  .category-icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
  
  .category-name {
    font-size: 0.75rem;
  }
  
  .btn-create-project {
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }
}

/* Calculations List */
.project-calculations-section {
  margin-top: 1.5rem;
}

.project-calculations-section h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calculations-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Calculation Card */
.calculation-card {
  background: white;
  border-radius: 12px;
  padding: 1.25rem;
  border: 2px solid #e2e8f0;
  transition: all 0.2s;
}

.calculation-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.basket-group-card .basket-group-total {
  font-size: 0.95rem;
  font-weight: 700;
  color: #059669;
  white-space: nowrap;
}

.basket-group-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 600;
}

.project-special-calculations-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px dashed #e2e8f0;
}

.project-special-calculations-section .section-hint {
  font-size: 0.875rem;
  color: #64748b;
  margin: -0.25rem 0 1rem;
}

.basket-group-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.btn-secondary-small {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-secondary-small:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #1e293b;
}

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

.calculation-type-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.calculation-info {
  flex: 1;
}

.calculation-info h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.calculation-type {
  font-size: 0.85rem;
  color: #64748b;
}

.calculation-date {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 500;
}

.calculation-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.preview-item {
  background: #f1f5f9;
  color: #475569;
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.calculation-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.btn-icon {
  width: 36px;
  height: 36px;
  background: #f1f5f9;
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.btn-icon:active {
  transform: scale(0.9);
}

/* Project Actions */
.project-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.btn-primary-large,
.btn-secondary-large {
  width: 100%;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.btn-primary-large {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
}

.btn-primary-large:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.35);
}

.btn-primary-large:active {
  transform: translateY(-1px);
}

.btn-secondary-large {
  background: #f1f5f9;
  color: #475569;
  border: 2px solid #e2e8f0;
}

.btn-secondary-large:hover {
  background: #e2e8f0;
  color: #1e293b;
  border-color: #cbd5e1;
}

.btn-secondary-large:active {
  transform: scale(0.98);
}

/* Project Description Card */
.project-description-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 2px solid #e2e8f0;
}

.project-description-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.project-description-card p {
  color: #64748b;
  line-height: 1.6;
}

/* Success Toast */
.project-success-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  z-index: 10000;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-success-toast.show {
  opacity: 1;
  transform: translateX(0);
}

.project-success-toast i {
  font-size: 1.3rem;
}

/* Error Toast (samma stil som success men röd) */
.project-error-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.4);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  z-index: 10000;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.project-error-toast.show {
  opacity: 1;
  transform: translateX(0);
}

.project-error-toast i {
  font-size: 1.3rem;
}

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

  .projects-header h2 {
    font-size: 1.1rem;
  }

  .projects-body {
    padding: 1rem;
  }

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

  .project-form-card {
    padding: 1.5rem;
  }

  .btn-primary-large,
  .btn-secondary-large {
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
  }

  .project-success-toast,
  .project-error-toast {
    right: 10px;
    left: 10px;
    top: 10px;
  }
}

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

  .projects-header h2 {
    font-size: 1rem;
  }

  .projects-back-btn,
  .projects-add-btn,
  .projects-menu-btn {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .project-card {
    padding: 1.25rem;
  }

  .project-icon {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }

  .project-title {
    font-size: 1.1rem;
  }

  .project-form-card {
    padding: 1.25rem;
  }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  .projects-view {
    background: #0f172a;
  }

  .projects-body {
    background: #1e293b;
  }

  .project-card,
  .calculation-card,
  .project-form-card,
  .project-description-card {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
  }

  .project-title,
  .calculation-info h4,
  .project-description-card h3,
  .project-calculations-section h3 {
    color: #f1f5f9;
  }

  .project-description,
  .calculation-type,
  .project-date,
  .calculation-date,
  .project-description-card p {
    color: #94a3b8;
  }

  .project-category,
  .preview-item {
    background: #475569;
    color: #cbd5e1;
  }

  .form-input,
  .form-select,
  .form-textarea {
    background: #475569;
    border-color: #64748b;
    color: #f1f5f9;
  }

  .form-input:focus,
  .form-select:focus,
  .form-textarea:focus {
    background: #64748b;
    border-color: #667eea;
  }

  .btn-icon {
    background: #475569;
    color: #94a3b8;
  }

  .btn-icon:hover {
    background: #64748b;
    color: #f1f5f9;
  }

  .btn-secondary-large {
    background: #475569;
    color: #cbd5e1;
    border-color: #64748b;
  }

  .btn-secondary-large:hover {
    background: #64748b;
    color: #f1f5f9;
    border-color: #94a3b8;
  }

  .empty-state {
    color: #94a3b8;
  }

  .empty-state h3 {
    color: #cbd5e1;
  }

  .empty-state i,
  .empty-state-small i {
    color: #475569;
  }
}

/* ========================================
   DETALJERAD KALKYLVY
   ======================================== */

.calculation-detail-view {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.calc-image-preview {
  margin-bottom: 2rem;
  background: #f8fafc;
  padding: 1rem;
  border-radius: 12px;
}

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

.calc-info-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.calc-info-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.calc-info-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calc-info-card h3 i {
  color: #667eea;
}

.calc-info-card p {
  margin: 0.5rem 0;
  font-size: 0.9375rem;
  color: #4b5563;
  line-height: 1.6;
}

.calc-info-card p strong {
  color: #111827;
  font-weight: 600;
}

.calc-info-card.bbr-ok {
  border-color: #10b981;
  background: linear-gradient(to bottom right, #ffffff, #f0fdf4);
}

.calc-info-card.bbr-warning {
  border-color: #f59e0b;
  background: linear-gradient(to bottom right, #ffffff, #fffbeb);
}

/* Materiallista tabell */
.calc-materials-section {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.calc-materials-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 1.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calc-materials-section h3 i {
  color: #f97316;
}

.materials-table-container {
  overflow-x: auto;
  margin: 0 -1.5rem;
  padding: 0 1.5rem;
}

.materials-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: white;
}

.materials-table thead {
  background: #f9fafb;
  border-top: 2px solid #e5e7eb;
  border-bottom: 2px solid #e5e7eb;
}

.materials-table th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #374151;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.materials-table td {
  padding: 1rem;
  border-bottom: 1px solid #f3f4f6;
  color: #111827;
  vertical-align: top;
}

.materials-table tbody tr:hover {
  background: #fafafa;
}

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

.materials-table code {
  background: #f3f4f6;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: 'Courier New', monospace;
  color: #667eea;
  font-weight: 600;
}

.materials-table small {
  color: #6b7280;
  font-size: 0.8125rem;
}

/* Monteringsanvisningar */
.calc-assembly-section {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.calc-assembly-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calc-assembly-section h3 i {
  color: #3b82f6;
}

.calc-assembly-section h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin: 1.5rem 0 0.75rem 0;
}

.calc-assembly-section > p {
  color: #4b5563;
  margin-bottom: 1.5rem;
}

.assembly-steps ol {
  counter-reset: step-counter;
  list-style: none;
  padding: 0;
  margin: 0;
}

.assembly-steps li {
  counter-increment: step-counter;
  position: relative;
  padding-left: 3rem;
  margin-bottom: 1rem;
  color: #374151;
  line-height: 1.6;
}

.assembly-steps li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

.assembly-tools ul,
.assembly-safety ul {
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

.assembly-tools li,
.assembly-safety li {
  color: #4b5563;
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.assembly-safety {
  background: #fef3c7;
  border: 2px solid #fbbf24;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1.5rem;
}

.assembly-safety h4 {
  color: #92400e;
  margin-top: 0;
}

.assembly-safety li {
  color: #78350f;
}

/* Teknisk ritning */
.calc-drawing-section {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.calc-drawing-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 1.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calc-drawing-section h3 i {
  color: #6366f1;
}

/* Actions */
.calc-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 768px) {
  .calc-info-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .materials-table {
    font-size: 0.75rem;
  }
  
  .materials-table th,
  .materials-table td {
    padding: 0.5rem;
  }
  
  .assembly-steps li {
    padding-left: 2.5rem;
    font-size: 0.875rem;
  }
  
  .assembly-steps li::before {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.75rem;
  }
  
  .calc-actions {
    flex-direction: column;
  }
  
  .calc-actions button {
    width: 100%;
  }
}

/* === Projektmapp översiktstabell === */
.projects-list-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: #64748b;
}

.projects-sort-select {
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 0.875rem;
}

.projects-overview-table-wrap {
  display: block;
  background: #fff;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.projects-overview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.projects-overview-table thead {
  background: linear-gradient(135deg, #2d3748, #1f2937);
  color: #fff;
}

.projects-overview-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.projects-overview-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}

.projects-overview-row {
  cursor: pointer;
  transition: background 0.15s;
}

.projects-overview-row:hover {
  background: #f8fafc;
}

.projects-overview-row .col-name strong {
  display: block;
  color: #1e293b;
  font-size: 0.95rem;
}

.projects-overview-row .row-desc {
  display: block;
  color: #64748b;
  font-size: 0.8125rem;
  margin-top: 0.15rem;
}

.projects-overview-row .row-preview {
  display: block;
  color: #94a3b8;
  font-size: 0.75rem;
  margin-top: 0.25rem;
  font-style: italic;
}

.projects-overview-row .col-sum {
  font-weight: 600;
  color: #059669;
  white-space: nowrap;
}

.projects-overview-row .col-date {
  color: #64748b;
  white-space: nowrap;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  font-size: 0.8125rem;
}

.stat-badge--basket {
  background: #dbeafe;
  color: #1d4ed8;
}

.row-menu-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
}

.row-menu-btn:hover {
  background: #e2e8f0;
}

.project-preview {
  font-size: 0.8125rem;
  color: #94a3b8;
  margin: 0.25rem 0 0.75rem;
  font-style: italic;
}

.project-stat-sum {
  color: #059669;
}

.project-basket-section {
  margin-bottom: 1.5rem;
}

.section-header-row {
  margin-bottom: 0.25rem;
}

.projects-grid--mobile {
  display: none;
}

@media (max-width: 768px) {
  .projects-overview-table-wrap {
    display: none;
  }

  .projects-grid--mobile {
    display: grid;
  }
}
