:root {
  --primary: #263A8A;
  --primary-light: #3a52b3;
  --success: #22c55e;
  --error: #ef4444;
  --bg: #f3f4f6;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Cairo', 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.navbar {
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
}

.nav-brand { font-weight: 700; font-size: 1.1rem; }

.nav-links a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  margin-left: 20px;
  padding: 6px 10px;
  border-radius: 6px;
}

.nav-links a:hover,
.nav-links a.active {
  color: white;
  background: rgba(255,255,255,0.15);
}

.main-content {
  max-width: 960px;
  margin: 30px auto;
  padding: 0 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.card h1, .card h2, .card h3 { margin-top: 0; color: var(--primary); }

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

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(38,58,138,0.1);
}

.password-wrapper {
  display: flex;
  gap: 8px;
}

.password-wrapper input { flex: 1; }

.toggle-password {
  padding: 10px 14px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.btn-primary,
.btn-secondary,
.btn-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-primary:hover { background: var(--primary-light); }

.btn-secondary {
  background: white;
  color: var(--primary);
  border-color: var(--primary);
}

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

.btn-small { padding: 6px 10px; font-size: 0.9rem; margin-left: 8px; }

.required { color: var(--error); }

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  margin-top: 16px;
  font-size: 0.95rem;
}

.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.preview-frame-wrapper {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

#preview-frame {
  width: 100%;
  height: 520px;
  border: none;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 0.95rem;
}

.table th,
.table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.table th { color: var(--muted); font-weight: 600; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-error { background: #fee2e2; color: #991b1b; }

.empty { color: var(--muted); margin: 10px 0; }

.columns-info {
  background: #f8f9fa;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.results { margin-top: 20px; }

.stats {
  display: flex;
  gap: 16px;
  margin: 16px 0;
}

.stat {
  flex: 1;
  background: #f8f9fa;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.stat.success { background: #f0fdf4; }
.stat.error { background: #fef2f2; }

.stat-value { font-size: 1.8rem; font-weight: 700; }

.stat-label { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }

.error-text { color: var(--error); font-size: 0.9rem; }
