/* Reset e Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #333;
  min-height: 100vh;
  line-height: 1.6;
}

/* Screens */
.screen {
  display: none;
}

.screen.active {
  display: block;
}

/* Login Screen */
#login-screen.active {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-container {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.login-container h1 {
  font-size: 32px;
  margin-bottom: 10px;
  color: #667eea;
}

.subtitle {
  color: #666;
  margin-bottom: 30px;
  font-size: 14px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
}

.error-message {
  background: #fee;
  color: #c33;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: #667eea;
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background: #5568d3;
  transform: translateY(-2px);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-success {
  background: #28a745;
  color: white;
}

.btn-success:hover {
  background: #218838;
}

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

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

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

/* Main Screen */
#main-screen {
  min-height: 100vh;
  background: #f5f7fa;
}

.header {
  background: white;
  padding: 20px 40px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.header h1 {
  font-size: 24px;
  color: #667eea;
}

.nav-tabs {
  display: flex;
  gap: 10px;
}

.nav-tab {
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: #666;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
}

.nav-tab.active {
  color: #667eea;
  border-bottom-color: #667eea;
}

.nav-tab:hover {
  color: #667eea;
}

/* Main Content */
.main-content {
  padding: 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.tab-content {
  display: none;
}

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

.tab-content h2 {
  margin-bottom: 20px;
  color: #333;
}

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

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

.stat-value {
  font-size: 36px;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

/* Table */
.table-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
}

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

.data-table thead {
  background: #f8f9fa;
}

.data-table th,
.data-table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.data-table th {
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.data-table td {
  font-size: 14px;
  color: #666;
}

.data-table tbody tr:hover {
  background: #f8f9fa;
}

.data-table .loading {
  text-align: center;
  padding: 40px;
  color: #999;
}

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

.status-em_dia { background: #d4edda; color: #155724; }
.status-pode_postar_hoje { background: #fff3cd; color: #856404; }
.status-atrasado { background: #f8d7da; color: #721c24; }
.status-valida { background: #d4edda; color: #155724; }
.status-invalida { background: #f8d7da; color: #721c24; }
.status-pendente_revisao { background: #fff3cd; color: #856404; }
.status-ativo { background: #d4edda; color: #155724; }
.status-inativo { background: #e2e3e5; color: #383d41; }

/* Fila de Revisão */
.revisao-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 24px;
  margin-bottom: 20px;
}

.revisao-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.revisao-header h3 {
  color: #333;
  font-size: 18px;
}

.prioridade-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.prioridade-1 { background: #d1ecf1; color: #0c5460; }
.prioridade-2 { background: #fff3cd; color: #856404; }
.prioridade-3 { background: #f8d7da; color: #721c24; }

.revisao-body {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  margin-bottom: 20px;
}

.revisao-image {
  width: 100%;
  border-radius: 8px;
  cursor: pointer;
}

.revisao-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-row {
  display: flex;
  gap: 8px;
}

.detail-row strong {
  color: #333;
  min-width: 140px;
}

.detail-row span {
  color: #666;
}

.revisao-actions {
  display: flex;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid #e0e0e0;
}

.revisao-actions input {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
}

.revisao-actions input:focus {
  outline: none;
  border-color: #667eea;
}

/* Config */
.config-grid {
  display: grid;
  gap: 20px;
}

.config-item {
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.config-item label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.config-item .description {
  font-size: 12px;
  color: #999;
  margin-bottom: 12px;
}

.config-item input,
.config-item select,
.config-item textarea {
  width: 100%;
  padding: 10px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

.config-item input:focus,
.config-item select:focus,
.config-item textarea:focus {
  outline: none;
  border-color: #667eea;
}

/* Loading state */
.loading {
  color: #999;
  font-style: italic;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-state h3 {
  font-size: 24px;
  margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  .main-content {
    padding: 20px;
  }

  .header {
    padding: 20px;
  }

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

  .revisao-body {
    grid-template-columns: 1fr;
  }

  .revisao-actions {
    flex-direction: column;
  }

  .nav-tabs {
    width: 100%;
    overflow-x: auto;
  }
}
