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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f7fa;
  color: #1a1a1a;
  min-height: 100vh;
}

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

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

.login-card h1 {
  font-size: 24px;
  margin-bottom: 4px;
  color: #2d3748;
}

.subtitle {
  color: #718096;
  margin-bottom: 24px;
  font-size: 14px;
}

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
  background: white;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input:disabled {
  background: #f7fafc;
  color: #a0aec0;
}

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

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-outline {
  background: white;
  border: 1px solid #e2e8f0;
  color: #4a5568;
}

.btn-outline:hover { background: #f7fafc; border-color: #cbd5e0; }

.btn-danger {
  background: #fed7d7;
  color: #c53030;
}

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

.btn-full { width: 100%; }

.btn-sm { padding: 6px 12px; font-size: 12px; }

.error-text {
  color: #e53e3e;
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
}

.topbar {
  background: white;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-left h2 {
  font-size: 18px;
  color: #2d3748;
}

.badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.dashboard-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

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

.stat-card {
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.stat-number {
  font-size: 32px;
  font-weight: 700;
  color: #667eea;
}

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

.section {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

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

.section-header h3 {
  font-size: 18px;
  color: #2d3748;
}

.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.site-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.site-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

.site-card-header {
  background: #f7fafc;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
}

.site-card-header h4 {
  font-size: 15px;
  color: #2d3748;
}

.site-id {
  background: #edf2f7;
  color: #4a5568;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-family: monospace;
}

.site-card-body {
  padding: 16px;
}

.site-card-body p {
  font-size: 13px;
  color: #4a5568;
  margin-bottom: 6px;
}

.site-card-actions {
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.empty-state {
  text-align: center;
  color: #a0aec0;
  padding: 40px;
  font-size: 14px;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-sm { max-width: 480px; }

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

.modal-header h3 {
  font-size: 18px;
  color: #2d3748;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #a0aec0;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.modal-close:hover { background: #f7fafc; color: #4a5568; }

.modal-content form { padding: 24px; }

.modal-desc {
  padding: 0 24px;
  font-size: 14px;
  color: #718096;
  margin-top: 16px;
}

.code-block {
  margin: 16px 24px 24px;
  background: #1a202c;
  color: #68d391;
  padding: 16px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  overflow-x: auto;
}

.code-block code {
  flex: 1;
  word-break: break-all;
}

.code-block .btn { flex-shrink: 0; }

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
  .sites-grid { grid-template-columns: 1fr; }
  .dashboard-content { padding: 16px; }
}

.form-section-divider {
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
  margin-top: 8px;
  margin-bottom: 16px;
}

.form-section-divider h4 {
  font-size: 15px;
  color: #2d3748;
  margin-bottom: 4px;
}

.section-desc {
  font-size: 13px;
  color: #718096;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.color-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-input-wrap input[type="color"] {
  width: 40px;
  height: 36px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 2px;
  cursor: pointer;
}

.color-text-input {
  width: 90px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-family: monospace;
}

.field-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  overflow: hidden;
}

.field-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
}

.field-select {
  width: auto;
  min-width: 60px;
  max-width: 90px;
  padding: 10px 4px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  background: white;
  flex-shrink: 0;
}

.field-req {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #718096;
  white-space: nowrap;
  cursor: pointer;
}

.field-remove-btn {
  flex-shrink: 0;
}

.empty-fields-msg {
  font-size: 13px;
  color: #a0aec0;
  padding: 8px 0;
}

.field-options {
  margin: -4px 0 8px 0;
}

.field-options textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  resize: vertical;
}
