:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --success: #16a34a;
  --danger: #dc2626;
  --bg: #f4f6f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
}
* { box-sizing: border-box; }
body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  direction: rtl;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  flex-wrap: wrap;
  gap: 10px;
}
.brand { font-weight: bold; font-size: 1.1em; }
.topbar nav a { margin-left: 16px; font-weight: 500; }
.userbox { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.9em; }

.container { max-width: 1100px; margin: 24px auto; padding: 0 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

h1 { font-size: 1.5em; margin-top: 0; }
h2 { font-size: 1.2em; }

table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { padding: 10px 8px; text-align: right; border-bottom: 1px solid var(--border); }
th { background: #f8fafc; font-weight: 600; }
tr:hover { background: #fafbfc; }

.btn {
  display: inline-block;
  background: var(--primary);
  color: white;
  border: none;
  padding: 9px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95em;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn.secondary { background: #64748b; }
.btn.danger { background: var(--danger); }
.link-btn { background: none; border: none; color: var(--primary); cursor: pointer; padding: 0; font-size: 0.9em; }
.link-btn:hover { text-decoration: underline; }

input[type=text], input[type=password], input[type=tel], input[type=number], select, textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95em;
  margin-bottom: 12px;
  font-family: inherit;
}
label { font-weight: 500; display: block; margin-bottom: 4px; font-size: 0.9em; color: var(--muted); }

.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 0.8em; font-weight: 600; }
.badge.taken { background: #dcfce7; color: var(--success); }
.badge.not-taken { background: #fee2e2; color: var(--danger); }
.badge.role-admin { background: #ede9fe; color: #6d28d9; }
.badge.role-staff { background: #e0f2fe; color: #0369a1; }

.progress-bar { background: #e2e8f0; border-radius: 6px; height: 10px; overflow: hidden; }
.progress-fill { background: var(--success); height: 100%; }

.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 90vh; }
.login-card { max-width: 380px; width: 100%; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.alert.error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert.success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tab-btn { padding: 10px 16px; background: none; border: none; cursor: pointer; font-size: 0.95em; border-bottom: 2px solid transparent; }
.tab-btn.active { border-bottom-color: var(--primary); color: var(--primary); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.footer { text-align: center; color: var(--muted); font-size: 0.8em; padding: 30px 0; }

.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input[type=checkbox] { width: 18px; height: 18px; margin: 0; }

.muted { color: var(--muted); font-size: 0.9em; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }

code.token { background: #f1f5f9; padding: 3px 6px; border-radius: 4px; font-size: 0.85em; word-break: break-all; }
