/* בסיס מודרני + RTL */
.auth-system-container { 
  direction: rtl; 
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #64748b;
  --success-color: #059669;
  --danger-color: #dc2626;
  --warning-color: #d97706;
  --background: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 0.75rem;
  --radius-lg: 1rem;
}

.auth-system-container .container {
  max-width: 520px; 
  margin: 60px auto; 
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 3rem 2.5rem;
  display: flex; 
  flex-direction: column; 
  align-items: center;
  border: 1px solid var(--border);
}

/* כותרות וטקסטים */
.auth-system-container h2 { 
  text-align: center; 
  color: var(--primary-color); 
  margin: 0 0 1.5rem; 
  font-weight: 800; 
  font-size: 1.875rem;
  letter-spacing: -0.025em;
}

.auth-system-container .form-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-system-container .form-subtitle,
.auth-system-container .welcome-subtitle {
  color: var(--text-secondary);
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* כפתורים */
.auth-system-container .btn { 
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.5rem; 
  border: none;
  border-radius: var(--radius); 
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  gap: 0.5rem;
}

.auth-system-container .btn-primary { 
  background: var(--primary-color); 
  color: white;
}

.auth-system-container .btn-primary:hover { 
  background: var(--primary-hover); 
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.auth-system-container .btn-secondary { 
  background: var(--surface); 
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.auth-system-container .btn-secondary:hover { 
  background: var(--primary-color); 
  color: white;
}

.auth-system-container .btn-users {
  background: var(--success-color);
  color: white;
}

.auth-system-container .btn-users:hover {
  background: #047857;
}

.auth-system-container .btn-home {
  background: var(--secondary-color);
  color: white;
}

.auth-system-container .btn-home:hover {
  background: #475569;
}

.auth-system-container .btn-back {
  background: var(--warning-color);
  color: white;
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
}

.auth-system-container .btn-back:hover {
  background: #b45309;
}

/* טפסים */
.auth-system-container form { 
  display: flex; 
  flex-direction: column; 
  gap: 1.5rem; 
  width: 100%; 
  max-width: 400px;
}

.auth-system-container .form-group { 
  position: relative; 
}

.auth-system-container input[type="text"], 
.auth-system-container input[type="email"], 
.auth-system-container input[type="password"] {
  width: 100%; 
  box-sizing: border-box; 
  padding: 1rem 1.25rem; 
  border: 2px solid var(--border); 
  border-radius: var(--radius); 
  font-size: 1rem; 
  background: var(--surface);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.auth-system-container input:focus { 
  border-color: var(--primary-color); 
  outline: none; 
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.auth-system-container input::placeholder {
  color: var(--text-secondary);
}

/* עין בתוך השדה */
.auth-system-container .password-group { 
  position: relative; 
  display: flex; 
  align-items: center; 
}

.auth-system-container .password-toggle {
  position: absolute; 
  right: 1rem; 
  top: 50%; 
  transform: translateY(-50%);
  cursor: pointer; 
  user-select: none; 
  z-index: 2;
  width: 2rem; 
  height: 2rem; 
  display: flex; 
  align-items: center; 
  justify-content: center;
  border-radius: 0.375rem; 
  background: rgba(255,255,255,0.9);
  transition: all 0.2s ease;
  font-size: 1.1rem;
}

.auth-system-container .password-toggle:hover { 
  background: var(--background);
  transform: translateY(-50%) scale(1.1);
}

.auth-system-container .password-group input { 
  padding-right: 3.5rem;
}

/* כפתורי שליחה */
.auth-system-container button[type="submit"] {
  padding: 1rem 1.5rem; 
  background: var(--primary-color); 
  color: white; 
  border: none; 
  border-radius: var(--radius); 
  font-size: 1rem; 
  font-weight: 600; 
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.auth-system-container button[type="submit"]:hover { 
  background: var(--primary-hover); 
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.auth-system-container button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* קישורים בטפסים */
.auth-system-container .form-links { 
  text-align: center; 
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.auth-system-container .form-links a { 
  color: var(--primary-color); 
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.auth-system-container .form-links a:hover { 
  color: var(--primary-hover);
  text-decoration: underline;
}

.auth-system-container .separator {
  color: var(--text-secondary);
  font-weight: 400;
}

/* עמוד פתיחה */
.auth-system-container .welcome-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.auth-system-container .welcome-actions { 
  display: flex; 
  flex-direction: column;
  gap: 1rem; 
  width: 100%;
  max-width: 300px;
}

/* אזור ברוכים הבאים למחוברים */
.auth-system-container #welcomeSection { 
  text-align: center; 
  width: 100%; 
  max-width: 600px;
}

.auth-system-container .welcome-content { 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  gap: 2rem;
}

.auth-system-container .welcome-message {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); 
  border: 2px solid var(--primary-color); 
  border-radius: var(--radius-lg); 
  padding: 2rem; 
  width: 100%;
  box-shadow: var(--shadow-md);
}

.auth-system-container .welcome-message h2 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.auth-system-container .welcome-sub { 
  margin: 0.5rem 0; 
  line-height: 1.6;
}

.auth-system-container .admin-status { 
  font-weight: 700; 
  color: var(--success-color); 
  margin-top: 1rem;
  font-size: 0.9rem;
}

.auth-system-container .welcome-actions { 
  display: flex; 
  gap: 1rem; 
  justify-content: center; 
  flex-wrap: wrap;
}

/* ניהול משתמשים */
.auth-system-container .users-management {
  width: 100%;
  max-width: 900px;
  margin-top: 2rem;
}

.auth-system-container .users-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.auth-system-container .users-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

/* מונים */
.users-stats { 
  display: flex; 
  gap: 1rem; 
  justify-content: center; 
  margin-bottom: 2rem; 
  flex-wrap: wrap; 
}

.stat-item { 
  background: linear-gradient(135deg, #f8fafc, #f1f5f9); 
  border: 2px solid var(--border); 
  border-radius: var(--radius); 
  padding: 1.25rem 1.5rem; 
  text-align: center; 
  min-width: 120px; 
  transition: all 0.2s ease;
  flex: 1;
  max-width: 150px;
}

.stat-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-item.admin { 
  border-color: var(--danger-color); 
  background: linear-gradient(135deg, #fef2f2, #fee2e2); 
}

.stat-item.regular { 
  border-color: var(--success-color); 
  background: linear-gradient(135deg, #f0fdf4, #dcfce7); 
}

.stat-item.total { 
  border-color: var(--primary-color); 
  background: linear-gradient(135deg, #eff6ff, #dbeafe); 
}

.stat-number { 
  font-size: 2rem; 
  font-weight: 800; 
  line-height: 1;
}

.stat-label { 
  font-size: 0.875rem; 
  color: var(--text-secondary); 
  margin-top: 0.25rem;
}

/* טבלת משתמשים */
.users-table-container { 
  background: var(--surface); 
  border-radius: var(--radius); 
  overflow: hidden; 
  box-shadow: var(--shadow-md); 
  border: 1px solid var(--border);
}

.users-loading {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.users-table { 
  width: 100%; 
  border-collapse: collapse; 
  font-size: 0.875rem; 
}

.users-table thead tr { 
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)); 
  color: white; 
}

.users-table th, 
.users-table td { 
  padding: 1rem 1.25rem; 
  text-align: right; 
  border-bottom: 1px solid var(--border); 
}

.users-table th {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.users-table tbody tr {
  transition: all 0.2s ease;
}

.users-table tbody tr:hover,
.users-table tbody tr.hover { 
  background: var(--background);
}

.users-table tbody tr.current-user {
  background: linear-gradient(135deg, #eff