/* Bottom toolbar styling */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

#app {
  flex: 1;
  display: grid !important;
  grid-template-columns: var(--sidebar-width, 288px) 6px 1fr !important;
}

.main {
  display: flex !important;
  flex-direction: column !important;
}

#content {
  flex: 1;
  overflow-y: auto;
}

.bottom-toolbar {
  grid-area: toolbar;
  display: flex;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid #e5e7eb;
  background: #f8fafc;
  min-height: 60px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  z-index: 100;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.toolbar-btn {
  padding: 10px 14px;
  border: none;
  border-radius: 4px;
  font-size: 12.6px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s ease;
  flex: 1;
  min-width: 108px;
  max-width: 180px;
  justify-content: center;
  white-space: nowrap;
}

.calendar-btn {
  background: #6b7280;
  color: white;
}

.calendar-btn:hover {
  background: #069d84;
  transform: translateY(-1px);
}

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

/* Calendar view styling */
.calendar-view {
  display: none;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  height: 100%;
  overflow: auto;
}

.calendar-view.active {
  display: flex;
  flex-direction: column;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.calendar-header > div:first-child {
  flex: 0 0 auto;
}

.calendar-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.calendar-nav button {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  background: white;
  border-radius: 4px;
  cursor: pointer;
}

.calendar-nav button:hover {
  background: #f3f4f6;
}

.calendar-quick-nav {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.calendar-quick-nav button {
  padding: 6px 12px;
  border: 1px solid #3b82f6;
  background: white;
  color: #3b82f6;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.calendar-quick-nav button:hover {
  background: #3b82f6;
  color: white;
}

/* Task edit button styling */
.task-edit-btn { 
  padding: 4px 8px; 
  font-size: 11px; 
  background: #f3f4f6; 
  border: 1px solid #d1d5db; 
  border-radius: 4px; 
  cursor: pointer; 
  margin-left: auto; 
}
.task-edit-btn:hover { 
  background: #e5e7eb; 
}

/* Edit task modal styling */
.edit-task-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.edit-task-content {
  background: white;
  padding: 24px;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.edit-task-content h3 {
  margin: 0 0 20px;
  font-size: 18px;
}

.edit-task-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.edit-task-form label {
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}

.edit-task-form input,
.edit-task-form textarea {
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 14px;
}

.edit-task-form textarea {
  resize: vertical;
  font-family: inherit;
}

.edit-task-buttons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.secondary-btn {
  background: #f3f4f6;
  color: #374151;
  padding: 10px 16px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
}

.secondary-btn:hover {
  background: #e5e7eb;
}

/* Comment editing styles */
.edit-comment-form {
  background: #f8fafc;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  margin-top: 12px;
}

.edit-comment-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.edit-attachments-container {
  margin: 12px 0;
}

.attachments-label {
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  font-size: 14px;
}

.edit-attachments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.edit-attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.attachment-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.attachment-thumbnail {
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid #e5e7eb;
}

.attachment-filename {
  font-size: 14px;
  color: #374151;
}

.delete-attachment-btn {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.delete-attachment-btn:hover {
  background: #fecaca;
  border-color: #f87171;
}

/* Kanban button styling */
.kanban-btn {
  background: #10b981;
  color: white;
}

.kanban-btn:hover {
  background: #059669;
  transform: translateY(-1px);
}

/* Kanban view styling */
.kanban-view {
  display: none;
  padding: 10px 20px 20px 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  height: calc(100vh - 140px);
  overflow: hidden;
}

.kanban-view.active {
  display: flex;
  flex-direction: column;
}

.kanban-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e5e7eb;
}

.kanban-header h2 {
  margin: 0;
  color: #1f2937;
}

.search-container {
  position: relative;
}

.search-input {
  padding: 8px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 20px;
  font-size: 14px;
  width: 300px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.kanban-column {
  background: #f8fafc;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.kanban-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e2e8f0;
}

.kanban-column-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #475569;
}

.task-count {
  background: #64748b;
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.kanban-tasks {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding-right: 4px;
  padding-bottom: 40px;
}

.kanban-task {
  background: white;
  padding: 10px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  cursor: grab;
  transition: all 0.2s ease;
  border-left: 4px solid #e5e7eb;
  position: relative;
}

.kanban-task::after {
  content: '👁️';
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.kanban-task:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.kanban-task:hover::after {
  opacity: 1;
}

.kanban-task:hover .kanban-task-title {
  color: #3b82f6;
}

.kanban-task.dragging {
  cursor: grabbing;
  opacity: 0.8;
  transform: rotate(5deg);
}

.kanban-task-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: #1f2937;
  font-size: 13px;
}

.kanban-task-project {
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 4px;
  font-weight: 500;
}

.kanban-task-dates {
  font-size: 10px;
  color: #9ca3af;
  display: flex;
  gap: 3px;
}

.kanban-task-description {
  font-size: 11px;
  color: #6b7280;
  margin-top: 4px;
  line-height: 1.3;
  max-height: 30px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kanban-column[data-status="todo"] .kanban-task {
  border-left-color: #ef4444;
}

.kanban-column[data-status="doing"] .kanban-task {
  border-left-color: #f59e0b;
}

.kanban-column[data-status="done"] .kanban-task {
  border-left-color: #10b981;
}

.kanban-tasks.drag-over {
  background: #dbeafe;
  border: 2px dashed #3b82f6;
}

/* Dashboard button styling */
.dashboard-btn {
  background: #8b5cf6;
  color: white;
}

.dashboard-btn:hover {
  background: #7c3aed;
  transform: translateY(-1px);
}

/* Dashboard view styling */
.dashboard-view {
  display: none;
  padding: 20px;
  background: #f8fafc;
  height: 100%;
  overflow-y: auto;
}

.dashboard-view.active {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dashboard-header h2 {
  margin: 0;
  color: #1f2937;
  font-size: 28px;
}

.dashboard-filter {
  padding: 8px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  cursor: pointer;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

/* Stats Cards */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 15px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.stat-icon {
  font-size: 32px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
}

.stat-content h3 {
  margin: 0;
  font-size: 32px;
  font-weight: bold;
  color: #1f2937;
}

.stat-content p {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

/* Charts Section */
.charts-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.chart-container {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.chart-container h3 {
  margin: 0 0 20px 0;
  color: #1f2937;
  font-size: 18px;
}

/* Timeline Section */
.timeline-section {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.timeline-section h3 {
  margin: 0 0 20px 0;
  color: #1f2937;
  font-size: 18px;
}

.project-timeline {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.timeline-item {
  display: flex;
  align-items: center;
  padding: 15px;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 4px solid #e5e7eb;
}

.timeline-project {
  font-weight: 600;
  margin-right: 15px;
  min-width: 150px;
}

.timeline-bar {
  flex: 1;
  height: 20px;
  background: #e5e7eb;
  border-radius: 10px;
  position: relative;
  margin: 0 15px;
}

.timeline-progress {
  height: 100%;
  border-radius: 10px;
  transition: width 0.3s ease;
}

.timeline-dates {
  font-size: 12px;
  color: #6b7280;
  min-width: 120px;
  text-align: right;
}

/* Deadlines Section */
.deadlines-section {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.deadlines-section h3 {
  margin: 0 0 20px 0;
  color: #1f2937;
  font-size: 18px;
}

.deadlines-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deadline-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 4px solid #ef4444;
}

.deadline-item.warning {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.deadline-item.info {
  border-left-color: #3b82f6;
  background: #eff6ff;
}

.deadline-task {
  font-weight: 600;
  color: #1f2937;
}

.deadline-project {
  font-size: 12px;
  color: #6b7280;
}

.deadline-date {
  font-size: 14px;
  font-weight: 600;
}

.deadline-item.overdue .deadline-date {
  color: #ef4444;
}

.deadline-item.warning .deadline-date {
  color: #f59e0b;
}

.deadline-item.info .deadline-date {
  color: #3b82f6;
}

/* Activity Section */
.activity-section {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.activity-section h3 {
  margin: 0 0 20px 0;
  color: #1f2937;
  font-size: 18px;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
}

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #3b82f6;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.activity-content {
  flex: 1;
}

.activity-description {
  font-weight: 500;
  color: #1f2937;
  margin-bottom: 4px;
}

.activity-time {
  font-size: 12px;
  color: #6b7280;
}

/* Dashboard error styling */
.dashboard-error {
  text-align: center;
  padding: 40px 20px;
  color: #6b7280;
}

.dashboard-error h2 {
  color: #1f2937;
  margin-bottom: 16px;
}

.retry-btn {
  padding: 8px 16px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 16px;
}

.retry-btn:hover {
  background: #2563eb;
}

/* Notification System Styles */
/* Shared styles for all icon buttons */
.icon-button {
  position: fixed;
  top: 20px;
  right: 430px;
  z-index: 1000;
  cursor: pointer;
  background: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  user-select: none;
  opacity: 0.7;
}

.icon-button:hover {
  width: 40px;
  height: 40px;
  opacity: 1;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.icon-button .bell-icon,
.icon-button .icon {
  font-size: 14px;
  transition: font-size 0.3s ease;
  pointer-events: none;
}

.icon-button:hover .bell-icon,
.icon-button:hover .icon {
  font-size: 20px;
}

.notification-bell {
  transform: translateX(-240px);
}

.notification-bell:hover {
  transform: translateX(-240px);
}

.bell-icon {
  font-size: 20px;
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  min-width: 20px;
}

.notification-badge.hidden {
  display: none;
}

.notification-center {
  position: fixed;
  top: 70px;
  left: calc(var(--sidebar-width, 280px) + 20px);
  width: 350px;
  max-height: 500px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  z-index: 999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  transition: left 0.3s;
}

.notification-center.active {
  display: flex;
}

.notification-header {
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}

.notification-header h3 {
  margin: 0;
  color: #1f2937;
  font-size: 18px;
}

.notification-controls {
  display: flex;
  gap: 10px;
}

.notification-btn {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.2s;
}

.notification-btn:hover {
  background: #f3f4f6;
}

.notification-list {
  flex: 1;
  overflow-y: auto;
  max-height: 400px;
}

.notification-item {
  padding: 15px 20px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: background 0.2s;
  cursor: pointer;
}

.notification-item:hover {
  background: #f8fafc;
}

.notification-item.unread {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
}

.notification-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.notification-icon.deadline {
  background: #fef2f2;
  color: #ef4444;
}

.notification-icon.comment {
  background: #f0f9ff;
  color: #3b82f6;
}

.notification-icon.task {
  background: #f0fdf4;
  color: #10b981;
}

.notification-content {
  flex: 1;
}

.notification-title {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
  font-size: 14px;
}

.notification-description {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 6px;
}

.notification-time {
  color: #9ca3af;
  font-size: 11px;
}

.notification-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.notification-action-btn {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.2s;
}

.notification-action-btn:hover {
  background: #f3f4f6;
}

.notification-action-btn.primary {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

.notification-action-btn.primary:hover {
  background: #2563eb;
}

.no-notifications {
  padding: 40px 20px;
  text-align: center;
  color: #6b7280;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 90px;
  right: 20px;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 12px 16px;
  max-width: 300px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease-out;
  border-left: 4px solid #3b82f6;
}

.toast.success {
  border-left-color: #10b981;
}

.toast.warning {
  border-left-color: #f59e0b;
}

.toast.error {
  border-left-color: #ef4444;
}

.toast-icon {
  font-size: 16px;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 12px;
  color: #6b7280;
}

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  font-size: 16px;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Time Tracker Button */
.time-tracker-btn {
  transform: translateX(-200px);
  pointer-events: auto;
}

.time-icon {
  font-size: 20px;
}

/* User Management Styles */
.user-management-btn {
  transform: translateX(-160px);
}

/* Activity Log Button */
.activity-log-btn {
  transform: translateX(-200px);
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.activity-log-btn:hover {
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* Role Management Button */
.role-management-btn {
  transform: translateX(-120px);
}

.user-icon {
  font-size: 14px;
  transition: font-size 0.3s ease;
  pointer-events: none;
}

.icon-button:hover .user-icon {
  font-size: 20px;
}

/* Language Selector Button */
.language-btn {
  transform: translateX(-80px);
}

.language-flag {
  width: 18px;
  height: 18px;
  display: block;
  transition: all 0.3s ease;
  pointer-events: none;
}

.language-flag svg {
  width: 100%;
  height: 100%;
  display: block;
}

.icon-button:hover .language-flag {
  width: 24px;
  height: 24px;
}

/* Language Dropdown Menu */
.language-dropdown {
  position: fixed;
  top: 60px;
  right: 430px;
  z-index: 1001;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  padding: 8px 0;
  min-width: 160px;
}

.language-option {
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: white;
  text-align: left;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.15s;
  display: block;
}

.language-option:hover {
  background: #f3f4f6;
}

.language-option:active {
  background: #e5e7eb;
}

/* SuperAdmin button - round button (fifth in top icon row) */
.super-admin-btn {
  transform: translateX(-40px);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.super-admin-btn:hover {
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Hidden utility class for icon buttons */
.hidden {
  display: none !important;
}

/* Trash button */
.trash-btn {
  transform: translateX(0);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
}

/* When trash has items - show red background */
.trash-btn.has-items {
  background: linear-gradient(135deg, #ff7a7a 0%, #ff4d4d 100%);
}

.trash-btn .user-icon {
  font-size: 14px;
  line-height: 1;
  transition: font-size 0.3s ease;
}

.trash-btn:hover .user-icon {
  font-size: 20px;
}

.user-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
}

.user-modal.active {
  display: flex;
}

.user-modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.user-modal-header {
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}

.user-modal-header h2 {
  margin: 0;
  color: #1f2937;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6b7280;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.modal-close:hover {
  background: #f3f4f6;
}

.user-modal-tabs {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
  background: white;
}

.user-tab {
  flex: 1;
  padding: 15px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #6b7280;
  transition: color 0.2s, background 0.2s;
}

.user-tab:hover {
  background: #f8fafc;
}

.user-tab.active {
  color: #3b82f6;
  border-bottom: 2px solid #3b82f6;
  background: white;
}

.user-tab-content {
  display: none;
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

.user-tab-content.active {
  display: block;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h3 {
  margin: 0;
  color: #1f2937;
}

.assignments-list {
  overflow-y: auto;
  max-height: calc(100vh - 250px);
  padding-right: 8px;
}

.assignments-section {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.invite-btn {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.invite-btn:hover {
  background: #2563eb;
}

.team-members-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.team-member-item {
  display: flex;
  align-items: center;
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #3b82f6;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-right: 12px;
}

.member-info {
  flex: 1;
}

.member-name {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
}

.member-email {
  color: #6b7280;
  font-size: 14px;
}

.member-role {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-right: 12px;
}

.member-role.admin {
  background: #fef2f2;
  color: #dc2626;
}

.member-role.project_manager {
  background: #fef3c7;
  color: #d97706;
}

.member-role.member {
  background: #f0f9ff;
  color: #2563eb;
}

.member-actions {
  display: flex;
  gap: 8px;
}

.member-action-btn {
  background: none;
  border: 1px solid #d1d5db;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.2s;
}

.member-action-btn:hover {
  background: #f3f4f6;
}

.invite-form {
  background: #f8fafc;
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
}

.invite-form h4 {
  margin: 0 0 16px 0;
  color: #1f2937;
}

.invite-form form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.invite-form input,
.invite-form select {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

.form-actions {
  display: flex;
  gap: 12px;
}

.form-actions button {
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.form-actions button[type="submit"] {
  background: #3b82f6;
  color: white;
  border: none;
}

.form-actions button[type="submit"]:hover {
  background: #2563eb;
}

.form-actions button[type="button"] {
  background: none;
  border: 1px solid #d1d5db;
  color: #6b7280;
}

.form-actions button[type="button"]:hover {
  background: #f3f4f6;
}

/* Account Section */
.account-section {
  padding: 20px;
}

.account-section h3 {
  margin: 0 0 24px 0;
  color: #1f2937;
  font-size: 18px;
}

.account-form {
  max-width: 600px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: #374151;
  font-weight: 500;
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input:disabled {
  background: #f3f4f6;
  color: #6b7280;
  cursor: not-allowed;
}

.form-group small {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 12px;
}

.btn-primary {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #2563eb;
}

.btn-secondary {
  background: white;
  color: #374151;
  border: 1px solid #d1d5db;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #f3f4f6;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

#changePasswordSection {
  padding: 20px;
  background: #f8fafc;
  border-radius: 8px;
  margin-top: 2rem;
}

#changePasswordSection h3 {
  margin: 0 0 20px 0;
  color: #1f2937;
  font-size: 18px;
}

.role-definitions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.role-card {
  background: #f8fafc;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.role-card h4 {
  margin: 0 0 12px 0;
  color: #1f2937;
  font-size: 16px;
}

.role-card ul {
  margin: 0;
  padding-left: 20px;
  color: #6b7280;
}

.role-card li {
  margin-bottom: 6px;
  font-size: 14px;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
  /* Notification Bell - Smaller on mobile */
  .notification-bell {
    width: 40px;
    height: 40px;
    top: 15px;
    right: 15px;
  }
  
  .bell-icon {
    font-size: 16px;
  }
  
  .notification-badge {
    width: 16px;
    height: 16px;
    font-size: 10px;
    top: -3px;
    right: -3px;
  }
  
  /* Time Tracker Button */
  .time-tracker-btn {
    width: 40px;
    height: 40px;
    top: 15px;
    right: 115px;
  }
  
  .time-icon {
    font-size: 16px;
  }
  
  /* User Management Button */
  .user-management-btn {
    width: 40px;
    height: 40px;
    top: 15px;
    right: 65px;
  }
  
  .user-icon {
    font-size: 16px;
  }
  
  /* Bottom Toolbar - More responsive on tablets */
  .bottom-toolbar {
    padding: 8px;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }
  
  .toolbar-btn {
    padding: 10px 8px;
    font-size: 12px;
    min-height: 44px; /* Apple recommended minimum touch target */
    min-width: 80px;
    max-width: 90px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }
  
  .toolbar-btn span:last-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Dashboard - Mobile optimized */
  .dashboard-view {
    padding: 15px;
  }
  
  .dashboard-header {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }
  
  .dashboard-header h2 {
    font-size: 24px;
  }
  
  .stats-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  
  .stat-card {
    padding: 15px;
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
  
  .stat-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
  }
  
  .stat-content h3 {
    font-size: 24px;
  }
  
  .charts-section {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .chart-container {
    padding: 15px;
  }
  
  #projectStatusChart,
  #taskStatusChart {
    width: 250px !important;
    height: 250px !important;
  }
  
  /* Kanban - Mobile optimized */
  .kanban-view {
    padding: 15px;
  }
  
  .kanban-header {
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
  }
  
  .search-input {
    width: 100%;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .kanban-board {
    grid-template-columns: 1fr;
    gap: 15px;
    height: auto;
  }
  
  .kanban-column {
    min-height: 200px;
    max-height: 400px;
  }
  
  .kanban-task {
    padding: 12px;
    margin-bottom: 8px;
  }
  
  .kanban-task-title {
    font-size: 16px;
    margin-bottom: 8px;
  }
  
  /* Calendar - Mobile optimized */
  .calendar-view {
    padding: 15px;
  }
  
  .calendar-nav {
    padding: 15px;
  }
  
  .calendar-nav button {
    padding: 8px 12px;
    min-height: 44px;
  }
  
  .calendar-grid {
    font-size: 14px;
  }
  
  .calendar-day {
    min-height: 60px;
    padding: 4px;
  }
  
  .day-number {
    font-size: 12px;
  }
  
  .calendar-event {
    font-size: 10px;
    padding: 2px 4px;
    margin: 1px 0;
  }
  
  /* Modals - Mobile optimized */
  .user-modal-content {
    width: 95%;
    max-height: 95vh;
  }
  
  .user-modal-header {
    padding: 15px;
  }
  
  .user-tab-content {
    padding: 15px;
  }
  
  .user-modal-tabs {
    overflow-x: auto;
  }
  
  .user-tab {
    min-width: 100px;
    white-space: nowrap;
  }
  
  .team-member-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
  }
  
  .member-info {
    width: 100%;
  }
  
  .member-actions {
    width: 100%;
    justify-content: flex-end;
  }
  
  .member-action-btn {
    min-height: 44px;
    padding: 8px 16px;
  }
  
  /* Notification Center - Mobile optimized */
  .notification-center {
    width: 95%;
    max-width: none;
    top: 70px;
    right: 2.5%;
    left: 2.5%;
  }
  
  .notification-item {
    padding: 12px 15px;
  }
  
  .notification-actions {
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
  }
  
  .notification-action-btn {
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
  }
  
  /* Toast - Mobile optimized */
  .toast-container {
    top: 70px;
    right: 15px;
    left: 15px;
  }
  
  .toast {
    max-width: none;
    width: 100%;
  }
  
  /* Form elements - Better touch targets */
  input[type="text"],
  input[type="email"],
  select,
  textarea {
    min-height: 44px;
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 12px;
  }
  
  button {
    min-height: 44px;
    padding: 8px 16px;
  }
  
  /* Project tiles - Touch optimized */
  .project-tile {
    min-height: 60px;
    padding: 15px;
    margin-bottom: 10px;
  }
  
  .project-tile-name {
    font-size: 16px;
  }
  
  /* Context menus - Touch friendly */
  .project-context-menu {
    min-width: 200px;
  }
  
  .context-menu-item {
    padding: 12px 16px;
    font-size: 16px;
    min-height: 44px;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .stats-cards {
    grid-template-columns: 1fr;
  }
  
  .bottom-toolbar {
    padding: 8px 4px !important;
    gap: 4px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important; /* Förhindra radbrytning */
    justify-content: space-between !important; /* Fördela jämnt */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    min-height: 70px !important;
    position: fixed !important; /* Förankrad längst ner */
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    z-index: 1000 !important;
    background: #f8fafc !important;
    border-top: 1px solid #e5e7eb !important;
  }
  
  /* Dölj scrollbar i webkit browsers */
  .bottom-toolbar::-webkit-scrollbar {
    display: none;
  }
  
  .toolbar-btn {
    font-size: 9px !important;
    padding: 6px 2px !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: 1 !important; /* Alla tar lika mycket plats */
    flex-direction: column !important;
    gap: 3px !important;
    flex-shrink: 0 !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  .toolbar-btn span:first-child {
    font-size: 20px !important;
    line-height: 1 !important;
  }
  
  .toolbar-btn span:last-child {
    font-size: 9px !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: 100% !important;
    text-align: center !important;
    line-height: 1.1 !important;
    word-break: break-word !important;
  }
  
  .dashboard-header h2 {
    font-size: 20px;
  }
  
  .kanban-column-header h3 {
    font-size: 14px;
  }
  
  .notification-bell,
  .time-tracker-btn,
  .user-management-btn,
  .role-management-btn {
    width: 36px;
    height: 36px;
  }
  
  .bell-icon,
  .time-icon,
  .user-icon {
    font-size: 14px;
  }
  
  .time-tracker-btn {
    right: 100px;
  }
  
  .user-management-btn {
    right: 55px;
  }
  
  .role-management-btn {
    right: 100px; /* Stack with time tracker on mobile */
    top: 60px; /* Move down to avoid overlap */
  }
}

/* Touch gestures for Kanban */
@media (hover: none) and (pointer: coarse) {
  .kanban-task {
    cursor: default;
  }
  
  .kanban-task:active {
    transform: scale(0.98);
    opacity: 0.9;
  }
  
  /* Disable hover effects on touch devices */
  .kanban-task:hover {
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }
  
  .stat-card:hover {
    transform: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }
  
  .notification-bell:hover,
  .time-tracker-btn:hover,
  .user-management-btn:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }
}

/* Reports button styling */
.reports-btn {
  background: #8b5cf6;
  color: white;
}

.reports-btn:hover {
  background: #7c3aed;
  transform: translateY(-1px);
}

/* Reports view styling */
.reports-view {
  display: none;
  padding: 20px;
  background: #f8fafc;
  height: 100%;
  overflow: hidden;
}

.reports-view.active {
  display: flex;
  flex-direction: column;
}

.reports-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.reports-header h2 {
  margin: 0;
  color: #1f2937;
  font-size: 28px;
}

.reports-controls {
  display: flex;
  gap: 15px;
  align-items: center;
}

.report-filter {
  padding: 8px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  cursor: pointer;
}

.export-btn {
  background: #10b981;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.export-btn:hover {
  background: #059669;
}

.reports-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.report-section {
  display: none;
  padding: 20px;
}

.report-section.active {
  display: block;
}

.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

.report-chart-container {
  background: #f8fafc;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
}

.report-chart-container h3 {
  margin: 0 0 20px 0;
  color: #1f2937;
  font-size: 18px;
}

.report-stats {
  background: #f8fafc;
  padding: 20px;
  border-radius: 12px;
}

.report-stats h3 {
  margin: 0 0 20px 0;
  color: #1f2937;
  font-size: 18px;
}

.report-stat-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.report-stat-card {
  background: white;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-value {
  font-size: 28px;
  font-weight: bold;
  color: #3b82f6;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.report-table-container {
  background: #f8fafc;
  padding: 20px;
  border-radius: 12px;
}

.report-table-container h3 {
  margin: 0 0 20px 0;
  color: #1f2937;
  font-size: 18px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.report-table th {
  background: #f3f4f6;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: #374151;
  font-size: 14px;
  border-bottom: 1px solid #e5e7eb;
}

.report-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
  color: #1f2937;
}

.report-table tr:hover {
  background: #f8fafc;
}

.progress-bar {
  width: 100%;
  height: 20px;
  background: #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #10b981;
  transition: width 0.3s ease;
}

.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge.active {
  background: #dbeafe;
  color: #1e40af;
}

.status-badge.completed,
.status-badge.slutfört {
  background: #d1fae5;
  color: #065f46;
}

.status-badge.planning,
.status-badge.pågående {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.inte-påbörjat {
  background: #fee2e2;
  color: #991b1b;
}

.project-name-cell {
  font-weight: 500;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}

.progress-bar {
  position: relative;
}

.no-data {
  text-align: center;
  padding: 40px;
  color: #6b7280;
}

/* Time Analysis Styles */
.time-metrics {
  background: #f8fafc;
  padding: 20px;
  border-radius: 12px;
}

.time-metrics h3 {
  margin: 0 0 20px 0;
  color: #1f2937;
  font-size: 18px;
}

.time-breakdown {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.time-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.time-label {
  color: #6b7280;
  font-size: 14px;
}

.time-value {
  color: #1f2937;
  font-weight: 600;
  font-size: 16px;
}

/* Productivity Charts */
.productivity-charts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
}

/* Team Performance */
.team-stats {
  background: #f8fafc;
  padding: 20px;
  border-radius: 12px;
}

.team-stats h3 {
  margin: 0 0 20px 0;
  color: #1f2937;
  font-size: 18px;
}

.member-performance-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.member-performance-item {
  display: flex;
  align-items: center;
  padding: 16px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.member-perf-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #3b82f6;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-right: 15px;
}

.member-perf-info {
  flex: 1;
}

.member-perf-name {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
}

.member-perf-stats {
  font-size: 14px;
  color: #6b7280;
}

.member-perf-score {
  display: flex;
  align-items: center;
  gap: 10px;
}

.perf-score-bar {
  width: 100px;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.perf-score-fill {
  height: 100%;
  background: #10b981;
  transition: width 0.3s ease;
}

.perf-score-text {
  font-weight: 600;
  color: #1f2937;
}

/* Mobile responsiveness for reports */
@media (max-width: 768px) {
  .reports-header {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }
  
  .reports-controls {
    width: 100%;
    justify-content: space-between;
  }
  
  .report-filter {
    flex: 1;
    margin-right: 10px;
  }
  
  .report-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .report-stat-cards {
    grid-template-columns: 1fr;
  }
  
  .productivity-charts {
    grid-template-columns: 1fr;
  }
  
  .report-table {
    font-size: 12px;
  }
  
  .report-table th,
  .report-table td {
    padding: 8px;
  }
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.calendar-day-header {
  background: #374151;
  color: white;
  padding: 12px 8px;
  text-align: center;
  font-weight: 600;
  font-size: 12px;
}

.calendar-day {
  background: white;
  min-height: 100px;
  padding: 8px;
  position: relative;
}

.calendar-day-number {
  font-weight: 600;
  font-size: 14px;
  color: #374151;
  margin-bottom: 4px;
}

.calendar-day.other-month {
  background: #f9fafb;
  color: #9ca3af;
}

.calendar-day.today {
  background: #dbeafe;
}

.calendar-event {
  /* Bakgrundsfärg sätts dynamiskt baserat på projektfärg */
  padding: 2px 4px;
  margin: 1px 0;
  border-radius: 2px;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.calendar-event.stacked {
  margin-top: 1px;
}

/* Additional calendar styling for JS-generated elements */
.calendar-header-row {
  display: contents;
}

.calendar-week-row {
  display: contents;
}

.calendar-day-cell {
  background: white;
  min-height: 100px;
  padding: 8px;
  position: relative;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.calendar-day-cell:hover {
  background: #f3f4f6;
}

.calendar-day-cell.empty {
  background: #f9fafb;
  cursor: default;
}

.calendar-day-cell.today {
  background: #dbeafe;
  border-color: #3b82f6;
  color: #1e40af;
}

/* Status badges för rapporter */
.status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.planning {
  background: #f3f4f6;
  color: #6b7280;
}

.status-badge.active {
  background: #dbeafe;
  color: #2563eb;
}

.status-badge.completed {
  background: #d1fae5;
  color: #065f46;
}

/* Progress bars för rapporter */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}

.progress-fill {
  height: 100%;
  transition: width 0.3s ease;
  border-radius: 4px;
}

/* Förbättringar för rapporttabeller */
.reports-view table tbody tr:hover {
  background: #f9fafb;
}

.reports-view table td:first-child {
  font-weight: 600;
}

/* Tasks View Styles */
.tasks-view {
  display: none;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  height: 100%;
  overflow: hidden;
}

.tasks-view.active {
  display: flex;
  flex-direction: column;
}

.tasks-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
  padding: 10px 20px;
  border-bottom: 2px solid #e5e7eb;
}

.tasks-header h2 {
  margin: 0;
  color: #1f2937;
  font-size: 28px;
}

.tasks-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.tasks-controls select {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  font-size: 14px;
  min-width: 150px;
}

.tasks-controls select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.tasks-content {
  margin-top: 10px;
  padding: 0 20px 20px 20px;
}

.tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.task-card {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 10px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  position: relative;
  /* Background will be set dynamically to match project color */
}

.task-card.colored {
  color: white;
  border: 3px solid rgba(255, 255, 255, 0.2);
}

.task-card.colored .task-title {
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.task-card.colored .task-description {
  color: rgba(255, 255, 255, 0.9);
}

.task-card.colored .task-project,
.task-card.colored .task-dates,
.task-card.colored .task-assignee {
  color: rgba(255, 255, 255, 0.8);
}

.task-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  border-color: #3b82f6;
}

/* Collapsed state - minimerad vy */
.task-card.collapsed {
  padding: 8px 10px;
  min-height: auto;
}

.task-card.collapsed:hover {
  transform: translateY(-1px);
}

/* Toggle button styling */
.toggle-task-btn {
  transition: transform 0.3s ease, background 0.2s ease;
}

.toggle-task-btn:hover {
  background: rgba(255,255,255,0.3) !important;
  transform: scale(1.1);
}

.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}

.task-title {
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
  flex: 1;
  margin-right: 8px;
  line-height: 1.3;
}

.task-status {
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.task-status.todo {
  background: #fef3c7;
  color: #92400e;
}

.task-status.doing {
  background: #dbeafe;
  color: #1e40af;
}

.task-status.done {
  background: #d1fae5;
  color: #065f46;
}

/* Status badges in colored task cards */
.task-card.colored .task-status {
  background: rgba(255, 255, 255, 0.9);
  color: #374151;
  font-weight: 700;
}

.task-description {
  color: #6b7280;
  margin: 3px 0;
  line-height: 1.35;
  font-size: 13px;
}

.task-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 4px 0;
  font-size: 12px;
}

.task-project {
  color: #374151;
  font-weight: 500;
}

.task-dates {
  color: #6b7280;
}

.task-assignee {
  color: #6b7280;
  font-style: italic;
}

.task-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #f3f4f6;
}

.task-card.colored .task-actions {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.task-action-btn {
  padding: 5px 10px;
  border: none;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
}

.assign-task-btn {
  background: #3b82f6;
  color: white;
}

.assign-task-btn:hover {
  background: #2563eb;
}

.view-task-btn {
  background: #f3f4f6;
  color: #374151;
}

.view-task-btn:hover {
  background: #e5e7eb;
}

/* Button styles for colored task cards */
.task-card.colored .assign-task-btn {
  background: rgba(255, 255, 255, 0.9);
  color: #374151;
  font-weight: 600;
}

.task-card.colored .assign-task-btn:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-1px);
}

.task-card.colored .view-task-btn {
  background: rgba(255, 255, 255, 0.7);
  color: #374151;
  font-weight: 600;
}

.task-card.colored .view-task-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.tasks-btn {
  background: #8b5cf6;
  color: white;
}

.tasks-btn:hover {
  background: #7c3aed;
  transform: translateY(-1px);
}

/* ====================================
   EKONOMI (FINANCE) VIEW STYLING
   ==================================== */

.finance-view {
  padding: 24px;
  background: #f9fafb;
  height: 100%;
  overflow-y: auto;
}

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

.finance-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e5e7eb;
}

.finance-header h2 {
  margin: 0;
  font-size: 28px;
  color: #111827;
}

.finance-actions {
  display: flex;
  gap: 12px;
}

.finance-actions button {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.finance-actions .btn-primary {
  background: #059669;
  color: white;
}

.finance-actions .btn-primary:hover {
  background: #047857;
  transform: translateY(-1px);
}

.finance-actions .btn-secondary {
  background: #6b7280;
  color: white;
}

.finance-actions .btn-secondary:hover {
  background: #4b5563;
  transform: translateY(-1px);
}

/* Sammanfattningskort */
.finance-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.summary-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

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

.summary-card h3 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-card .amount {
  font-size: 32px;
  font-weight: 700;
  margin: 0;
}

.amount.positive {
  color: #059669;
}

.amount.negative {
  color: #dc2626;
}

.income-card {
  border-left: 4px solid #059669;
}

.expense-card {
  border-left: 4px solid #dc2626;
}

.balance-card {
  border-left: 4px solid #3b82f6;
}

/* Huvudinnehåll */
.finance-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

/* Transaktioner */
.transactions-section,
.budget-section {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.transactions-section h3,
.budget-section h3 {
  margin: 0 0 20px 0;
  font-size: 20px;
  color: #111827;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 12px;
}

.transactions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 600px;
  overflow-y: auto;
}

.transaction-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-radius: 8px;
  background: #f9fafb;
  border-left: 4px solid #e5e7eb;
  transition: all 0.2s ease;
}

.transaction-item:hover {
  background: #f3f4f6;
  transform: translateX(2px);
}

.transaction-item.income {
  border-left-color: #059669;
}

.transaction-item.expense {
  border-left-color: #dc2626;
}

.transaction-info {
  flex: 1;
}

.transaction-category {
  font-weight: 600;
  color: #111827;
  font-size: 14px;
  margin-bottom: 4px;
}

.transaction-description {
  color: #6b7280;
  font-size: 13px;
  margin-bottom: 4px;
}

.transaction-date {
  color: #9ca3af;
  font-size: 12px;
}

.transaction-amount {
  font-size: 18px;
  font-weight: 700;
  margin: 0 12px;
  min-width: 120px;
  text-align: right;
}

.transaction-amount.income {
  color: #059669;
}

.transaction-amount.expense {
  color: #dc2626;
}

.btn-icon-small {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.2s ease;
  font-size: 16px;
}

.btn-icon-small:hover {
  background: #e5e7eb;
}

/* Budget */
.budget-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.budget-item {
  padding: 16px;
  border-radius: 8px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.budget-item.over-budget {
  background: #fef2f2;
  border-color: #fecaca;
}

.budget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.budget-category {
  font-weight: 600;
  color: #111827;
  font-size: 14px;
}

.budget-amount {
  color: #6b7280;
  font-size: 14px;
}

.budget-progress {
  margin-top: 8px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: #059669;
  transition: width 0.3s ease;
}

.progress-fill.over {
  background: #dc2626;
}

.budget-status {
  font-size: 12px;
  color: #6b7280;
  text-align: right;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.finance-modal {
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e5e7eb;
}

.modal-header h3 {
  margin: 0;
  font-size: 22px;
  color: #111827;
}

.close-modal {
  background: none;
  border: none;
  font-size: 28px;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.close-modal:hover {
  background: #f3f4f6;
  color: #111827;
}

.finance-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.finance-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.finance-form label {
  font-weight: 600;
  color: #374151;
  font-size: 14px;
}

.finance-form input,
.finance-form select {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.finance-form input:focus,
.finance-form select:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.modal-actions button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.no-data {
  padding: 40px 20px;
  text-align: center;
  color: #6b7280;
  font-style: italic;
}

/* Responsive design */
@media (max-width: 1024px) {
  .finance-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .finance-summary {
    grid-template-columns: 1fr;
  }
  
  .finance-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .finance-actions {
    width: 100%;
  }
  
  .finance-actions button {
    flex: 1;
  }
}
