.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-color);
  color: var(--text-color);
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--header-bg, #f5f5f5);
  border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.app-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.refresh-btn {
  padding: 0.5rem 1rem;
  background: var(--primary-color, #2196f3);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.2s;
}

.refresh-btn:hover {
  background: var(--primary-hover, #1976d2);
}

/* Main Content */
.app-main {
  flex: 1;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

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

.stat-card {
  background: var(--card-bg, white);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-color, #2196f3);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary, #666);
}

/* Create Task Section */
.create-task-section {
  background: var(--card-bg, white);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.create-task-section h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.create-task-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.task-input {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 4px;
  font-size: 1rem;
  background: var(--input-bg, white);
  color: var(--text-color);
}

.project-select {
  padding: 0.75rem;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 4px;
  font-size: 1rem;
  background: var(--input-bg, white);
  color: var(--text-color);
  min-width: 150px;
}

.create-btn {
  padding: 0.75rem 1.5rem;
  background: var(--success-color, #4caf50);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

.create-btn:hover {
  background: var(--success-hover, #45a049);
}

/* Tasks Section */
.tasks-section {
  background: var(--card-bg, white);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.tasks-section h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.task-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--task-bg, #f9f9f9);
  border-radius: 4px;
  transition: background 0.2s;
}

.task-item:hover {
  background: var(--task-hover, #f0f0f0);
}

.task-item.completed {
  opacity: 0.6;
}

.task-item.completed .task-title {
  text-decoration: line-through;
}

.task-title {
  flex: 1;
  font-size: 0.95rem;
}

.task-project {
  font-size: 0.8rem;
  color: var(--text-secondary, #666);
  background: var(--tag-bg, #e3f2fd);
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
}

/* Settings Section */
.settings-section {
  background: var(--card-bg, white);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.settings-section h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.setting-item select {
  padding: 0.5rem;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 4px;
  background: var(--input-bg, white);
  color: var(--text-color);
}

.setting-item input[type='checkbox'] {
  width: 1.2rem;
  height: 1.2rem;
}

/* Footer */
.app-footer {
  padding: 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary, #666);
  background: var(--footer-bg, #f5f5f5);
  border-top: 1px solid var(--border-color, #e0e0e0);
}

/* Loading State */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 50vh;
  font-size: 1.25rem;
  color: var(--text-secondary, #666);
}

/* Dark Theme */
[data-theme='dark'] {
  --bg-color: #1a1a1a;
  --text-color: #e0e0e0;
  --text-secondary: #999;
  --header-bg: #2a2a2a;
  --footer-bg: #2a2a2a;
  --card-bg: #2a2a2a;
  --border-color: #3a3a3a;
  --input-bg: #333;
  --task-bg: #333;
  --task-hover: #3a3a3a;
  --tag-bg: #1e3a5f;
  --primary-color: #64b5f6;
  --primary-hover: #42a5f5;
  --success-color: #66bb6a;
  --success-hover: #4caf50;
}

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

  .app-main {
    padding: 1rem;
  }

  .create-task-form {
    flex-direction: column;
  }

  .task-input,
  .project-select,
  .create-btn {
    width: 100%;
  }
}
