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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

/* Login Page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.login-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  padding: 40px;
}

.login-card .logo {
  text-align: center;
  margin-bottom: 20px;
}

.login-card .logo img {
  height: 50px;
  width: auto;
}

.login-card h1 {
  font-size: 24px;
  margin-bottom: 10px;
  text-align: center;
}

.login-card > p {
  text-align: center;
  color: #666;
  margin-bottom: 30px;
}

/* Top Header Bar */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #2c3e50;
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-user {
  font-size: 13px;
  opacity: 0.85;
}

.header-logout {
  color: white;
  text-decoration: none;
  font-size: 13px;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 4px;
  transition: background 0.2s;
}

.header-logout:hover {
  background: rgba(255,255,255,0.1);
}

/* Dashboard Content */
.dashboard-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px;
}

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

.stat-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.tech-table-link {
  color: #3498db;
  text-decoration: none;
  font-weight: inherit;
}

.tech-table-link:hover {
  text-decoration: underline;
}

.stat-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-card.positive {
  border-left: 4px solid #4caf50;
}

.stat-card.neutral {
  border-left: 4px solid #ff9800;
}

.stat-card.negative {
  border-left: 4px solid #f44336;
}

.stat-label {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #2c3e50;
}

.stat-subtitle {
  font-size: 13px;
  color: #999;
  margin-top: 4px;
}

/* Sections */
.section {
  background: white;
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 30px;
}

.section h2 {
  font-size: 24px;
  margin-bottom: 20px;
  color: #2c3e50;
}

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

.section-header h2 {
  margin-bottom: 0;
}

/* Tables */
.table-container {
  overflow-x: auto;
}

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

thead {
  background-color: #f8f9fa;
}

th {
  text-align: left;
  padding: 12px;
  font-weight: 600;
  color: #2c3e50;
  border-bottom: 2px solid #dee2e6;
}

td {
  padding: 12px;
  border-bottom: 1px solid #dee2e6;
}

tr:hover {
  background-color: #f8f9fa;
}

.loading, .no-data {
  text-align: center;
  color: #666;
  padding: 40px !important;
}

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

.rating-badge.positive {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.rating-badge.neutral {
  background-color: #fff3e0;
  color: #e65100;
}

.rating-badge.negative {
  background-color: #ffebee;
  color: #c62828;
}

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

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

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3498db;
}

/* Buttons */
.btn-primary {
  padding: 10px 20px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background-color: #2980b9;
}

.btn-secondary {
  padding: 10px 20px;
  background-color: #95a5a6;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
  margin-right: 5px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn-small:hover {
  background-color: #2980b9;
}

.btn-danger {
  background-color: #e74c3c;
}

.btn-danger:hover {
  background-color: #c0392b;
}

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

.modal-content {
  background-color: white;
  border-radius: 8px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  position: relative;
}

.close {
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 28px;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
}

.close:hover {
  color: #000;
}

.modal-content h2 {
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Messages */
.error-message {
  background-color: #ffebee;
  color: #c62828;
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 20px;
  border-left: 4px solid #f44336;
}

.success-message {
  background-color: #e8f5e9;
  color: #2e7d32;
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 20px;
  border-left: 4px solid #4caf50;
}

/* Info Box */
.info-box {
  background-color: #e3f2fd;
  border-left: 4px solid #2196f3;
  padding: 20px;
  border-radius: 4px;
}

.info-box h3 {
  margin-bottom: 10px;
  color: #1565c0;
}

.info-box p {
  margin-bottom: 10px;
  color: #333;
}

.webhook-url {
  display: block;
  background-color: #263238;
  color: #aed581;
  padding: 12px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  word-break: break-all;
  margin: 10px 0;
}

/* Test Form */
.test-form {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.test-form input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.test-form button {
  flex-shrink: 0;
}

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

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

  .header-user {
    display: none;
  }
}
