* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.header {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.header h1 {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #1d1d1f;
}

.status-bar {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.status-item {
  background: #007AFF;
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
}

.status-item.warning { background: #FF9500; }
.status-item.success { background: #34C759; }
.status-item.error { background: #FF3B30; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

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

.stat-number {
  font-size: 28px;
  font-weight: 600;
  color: #007AFF;
}

.stat-label {
  font-size: 14px;
  color: #8e8e93;
  margin-top: 4px;
}

.controls {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #1d1d1f;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d1d6;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: #007AFF;
  box-shadow: 0 0 0 3px rgba(0,122,255,0.1);
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: #007AFF;
  color: white;
}

.btn-primary:hover {
  background: #0056CC;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #f2f2f7;
  color: #1d1d1f;
}

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

.btn-danger {
  background: #FF3B30;
  color: white;
}

.btn-danger:hover {
  background: #D70015;
}

.btn-success {
  background: #34C759;
  color: white;
}

.btn-success:hover {
  background: #248A3D;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.search-box {
  position: relative;
}

.search-box input {
  padding-left: 40px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #8e8e93;
}

.bulk-actions {
  display: none;
  background: #007AFF;
  color: white;
  padding: 16px 24px;
  border-radius: 12px;
  margin-bottom: 20px;
  align-items: center;
  justify-content: space-between;
}

.bulk-actions.show {
  display: flex;
}

.bulk-info {
  font-weight: 500;
}

.bulk-buttons {
  display: flex;
  gap: 12px;
}

.tasks-container {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tasks-header {
  padding: 20px 24px;
  border-bottom: 1px solid #f2f2f7;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tasks-header h2 {
  font-size: 20px;
  font-weight: 600;
}

.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 16px 21px;
  border-bottom: 1px solid #f2f2f7;
}

th {
  background: #f2f2f7;
  font-weight: 600;
  color: #1d1d1f;
  position: sticky;
  top: 0;
  z-index: 10;
}

.checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.status {
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.status.pending { background: #FF9500; color: white; }
.status.in_progress { background: #007AFF; color: white; }
.status.done { background: #34C759; color: white; }
.status.error { background: #FF3B30; color: white; }

.task-url {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-url a {
  color: #007AFF;
  text-decoration: none;
}

.task-url a:hover {
  text-decoration: underline;
}

.progress-indicator {
  width: 100%;
  height: 4px;
  background: #f2f2f7;
  border-radius: 2px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-bar {
  height: 100%;
  background: #007AFF;
  border-radius: 2px;
  transition: width 0.3s;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #8e8e93;
}

.empty-state h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: #1d1d1f;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

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

.modal-header h3 {
  font-size: 20px;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #8e8e93;
}

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-weight: 500;
}

.alert.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 20px;
  border-top: 1px solid #f2f2f7;
}

.pagination button {
  padding: 8px 12px;
  border: 1px solid #d1d1d6;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.pagination button:hover {
  background: #f2f2f7;
}

.pagination button.active {
  background: #007AFF;
  color: white;
  border-color: #007AFF;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Уведомления */
.notifications-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  max-width: 400px;
}

.notification {
  background: #fff;
  border-left: 4px solid #007bff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-bottom: 10px;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: slideInRight 0.3s ease-out;
}

.notification-success {
  border-left-color: #28a745;
}

.notification-warning {
  border-left-color: #ffc107;
}

.notification-error {
  border-left-color: #dc3545;
}

.notification-info {
  border-left-color: #17a2b8;
}

.notification button {
  background: none;
  border: none;
  font-size: 18px;
  color: #999;
  cursor: pointer;
  padding: 0;
  margin-left: 10px;
}

.notification button:hover {
  color: #666;
}

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

@media (max-width: 768px) {
  .container { padding: 12px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .filters { grid-template-columns: 1fr; }
  .bulk-actions { flex-direction: column; gap: 12px; }
  .bulk-buttons { flex-wrap: wrap; }
  
  th, td { padding: 12px 16px; }
  .task-url { max-width: 200px; }

  .notifications-container {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

/* Статус авторизации */
.auth-status {
  border: 1px solid #ddd;
  background-color: #f8f9fa;
  transition: all 0.3s ease;
}

.auth-status.authorized {
  background-color: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

.auth-status.unauthorized {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

.auth-status.checking {
  background-color: #fff3cd;
  border-color: #ffeaa7;
  color: #856404;
}

/* Система уведомлений */
.notifications-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  max-width: 400px;
  pointer-events: none;
}

.notification {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-bottom: 12px;
  border-left: 4px solid #007bff;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  pointer-events: auto;
}

.notification-show {
  opacity: 1;
  transform: translateX(0);
}

.notification-hide {
  opacity: 0;
  transform: translateX(100%);
}

.notification-content {
  display: flex;
  align-items: center;
  padding: 16px;
  gap: 12px;
}

.notification-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.notification-message {
  flex: 1;
  font-size: 14px;
  color: #333;
  line-height: 1.4;
}

.notification-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.2s;
}

.notification-close:hover {
  color: #666;
}

.notification-success {
  border-left-color: #28a745;
}

.notification-warning {
  border-left-color: #ffc107;
}

.notification-error {
  border-left-color: #dc3545;
}

.notification-info {
  border-left-color: #17a2b8;
}

/* Статусы в заголовке */
.status-item.success {
  color: #0f4619;
  font-weight: 500;
}

.status-item.warning {
  color: #6c5307;
  font-weight: 500;
}

.status-item.error {
  color: #5e1018;
  font-weight: 500;
}

.status-item.info {
  color: #0b4f5a;
  font-weight: 500;
}

.status-item.checking {
  color: #43484c;
  font-style: italic;
} 