:root{
  --bg: #0a0d11;
  --bg2: #0f1419;
  --bg3: #141b23;
  --card: #1a212b;
  --card-hover: #1f2631;
  --line: #2d3748;
  --line-hover: #4a5568;
  --txt: #f7fafc;
  --txt-muted: #a0aec0;
  --txt-dim: #718096;
  
  --primary: #667eea;
  --primary-light: #7c3aed;
  --secondary: #06b6d4;
  --accent: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  
  --success: #48bb78;
  --warning: #ed8936;
  --error: #f56565;
  --info: #4299e1;
  
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  color: var(--txt);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  opacity: 0.95;
  z-index: -1;
}

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: var(--accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  color: var(--txt-muted);
  margin-bottom: 2rem;
}

.login-form {
  text-align: left;
}

.login-form .form-group {
  margin-bottom: 1.5rem;
}

.login-btn {
  width: 100%;
  margin-top: 1rem;
}

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 33, 43, 0.9);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--line);
  transition: var(--transition);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--txt);
}

.logo-icon {
  font-size: 2rem;
  background: var(--accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.badge {
  background: var(--accent);
  color: var(--bg);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header-info {
  color: var(--txt-dim);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--txt-muted);
}

.logout-btn {
  background: var(--bg2);
  color: var(--txt-dim);
  border: 1px solid var(--line);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}

.logout-btn:hover {
  background: var(--bg3);
  border-color: var(--line-hover);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 1200px) {
  .container {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--bg2) 0%, var(--bg3) 100%);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--txt);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  background: var(--bg2);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--txt-dim);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg2);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--line);
  transition: var(--transition);
}

.toolbar-group:hover {
  border-color: var(--line-hover);
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--txt-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg2);
  color: var(--txt);
  border: 2px solid var(--line);
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-textarea {
  min-height: 150px;
  resize: vertical;
  white-space: pre-wrap;
  line-height: 1.8;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  outline: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--bg2);
  color: var(--txt);
  border: 1px solid var(--line);
}

.btn-secondary:hover {
  background: var(--bg3);
  border-color: var(--line-hover);
}

.btn-danger {
  background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
}

.task-list {
  display: grid;
  gap: 1rem;
}

.task-item {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  transition: var(--transition);
  position: relative;
}

.task-item:hover {
  background: var(--card-hover);
  border-color: var(--line-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

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

.task-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.task-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--txt);
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
}

.task-status {
  padding: 0.375rem 1rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-open {
  background: rgba(237, 137, 54, 0.15);
  color: var(--warning);
  border: 1px solid rgba(237, 137, 54, 0.3);
}

.status-doing {
  background: rgba(66, 153, 225, 0.15);
  color: var(--info);
  border: 1px solid rgba(66, 153, 225, 0.3);
}

.status-done {
  background: rgba(72, 187, 120, 0.15);
  color: var(--success);
  border: 1px solid rgba(72, 187, 120, 0.3);
}

.task-details {
  color: var(--txt-muted);
  margin-bottom: 1rem;
  line-height: 1.8;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.task-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--border-radius);
  border: 1px solid var(--line);
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--txt-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  color: var(--txt-muted);
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
}

.task-actions {
  display: flex;
  gap: 0.5rem;
}

.task-image {
  margin-top: 1rem;
  border-radius: var(--border-radius);
  overflow: hidden;
  border: 1px solid var(--line);
  max-width: 100%;
  position: relative;
}

.task-image img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  display: block;
  cursor: pointer;
  background: var(--bg);
}

.image-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.image-container img {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: cover;
  border-radius: var(--border-radius);
}

.image-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: var(--bg2);
  border-radius: var(--border-radius);
  color: var(--txt-dim);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

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

.modal-content {
  background: var(--card);
  border-radius: var(--border-radius-lg);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px);
  transition: var(--transition);
}

.modal.active .modal-content {
  transform: translateY(0);
}

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

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.modal-body {
  padding: 1.5rem;
}

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

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

.stat-card {
  background: var(--bg2);
  padding: 1rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--line);
  text-align: center;
  transition: var(--transition);
}

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

.stat-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--txt-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.animate-fade-in {
  animation: fadeInUp 0.3s ease-out;
}

.security-warning {
  background: rgba(237, 137, 54, 0.1);
  border: 1px solid rgba(237, 137, 54, 0.3);
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  color: var(--warning);
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--line-hover);
}

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--line);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s ease-in-out infinite;
}

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

.error-message {
  color: var(--error);
  font-size: 0.8rem;
  margin-top: 0.5rem;
  display: none;
}

.form-group.error .form-input,
.form-group.error .form-textarea,
.form-group.error .form-select {
  border-color: var(--error);
}

.form-group.error .error-message {
  display: block;
}

.hidden {
  display: none !important;
}