:root {
  --gold: #d4af37;
  --gold-soft: rgba(212, 175, 55, 0.16);
  --gold-border: rgba(212, 175, 55, 0.35);
  --bg: #080808;
  --bg-elevated: #111111;
  --bg-surface: #171717;
  --text: #f5f5f4;
  --text-muted: #a3a3a3;
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.14);
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.14);
  --warning: #f59e0b;
  --radius-lg: 20px;
  --radius-md: 12px;
  --font-fa: "Vazirmatn", "IRANSans", Tahoma, system-ui, -apple-system, sans-serif;
}

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

html, body {
  direction: rtl;
  text-align: right;
  font-family: var(--font-fa);
  background: radial-gradient(circle at top, #1b150b 0%, var(--bg) 65%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.65);
}

.auth-card {
  width: 100%;
  max-width: 430px;
}

.brand-badge {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 1.4px;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid var(--gold-border);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

h1 {
  font-size: 1.4rem;
  color: var(--gold);
  margin-bottom: 6px;
}

h2 {
  font-size: 1.12rem;
  color: var(--gold);
  margin-bottom: 12px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 22px;
}

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

label {
  display: block;
  font-size: 0.86rem;
  color: var(--text);
  margin-bottom: 6px;
  font-weight: 600;
}

input, select, textarea {
  width: 100%;
  background: var(--bg-surface);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-family: var(--font-fa);
  font-size: 0.92rem;
  transition: border-color 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-md);
  padding: 11px 20px;
  font-family: var(--font-fa);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-gold {
  background: var(--gold);
  color: #090909;
  width: 100%;
}

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-border);
}

.alert {
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.88rem;
  margin-bottom: 16px;
  display: none;
}

.alert.visible {
  display: block;
}

.alert-error {
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  color: #fecaca;
}

.alert-success {
  background: var(--success-bg);
  border: 1px solid var(--success);
  color: #bbf7d0;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.meta-list {
  list-style: none;
  display: grid;
  gap: 10px;
  font-size: 0.9rem;
}

.meta-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-surface);
  border-radius: 10px;
}

.perm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.perm-tag {
  font-size: 0.76rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 3px 10px;
  border-radius: 8px;
  direction: ltr;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: right;
}

th {
  color: var(--gold);
  font-weight: 700;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 20px;
  font-size: 0.88rem;
}
