html, body {
  direction: rtl;
  font-family: 'Noto Sans Arabic', sans-serif;
  margin: 0;
  background: #f9fafb;
  color: #111827;
}

a { text-decoration: none; color: inherit; }

/* ---------- Admin sidebar ---------- */
.admin-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 220px;
  height: 100vh;
  background: #1a1a2e;
  color: #fff;
  padding: 20px 16px;
  box-sizing: border-box;
}

.admin-sidebar .sidebar-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 28px;
}

.admin-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-sidebar nav a {
  padding: 10px 12px;
  border-radius: 6px;
  color: #e5e7eb;
}

.admin-sidebar nav a:hover {
  background: #2a2a45;
  color: #fff;
}

.admin-main {
  margin-right: 220px;
  padding: 32px 28px;
}

/* ---------- Merchant navbar ---------- */
.merchant-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1a1a2e;
  color: #fff;
  padding: 14px 24px;
}

.merchant-navbar .merchant-name {
  font-weight: 700;
}

.merchant-navbar a {
  color: #e5e7eb;
}

.merchant-navbar a:hover { color: #fff; }

.merchant-main {
  padding: 28px 24px;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.badge-active { background: #d1fae5; color: #047857; }
.badge-trial { background: #fef3c7; color: #b45309; }
.badge-expired { background: #fee2e2; color: #b91c1c; }

/* ---------- Tables ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: right;
}

th {
  background: #f3f4f6;
  font-weight: 600;
  font-size: 14px;
}

td { font-size: 14px; }

/* ---------- Subscription card ---------- */
.subscription-card {
  background: #fff;
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 24px;
  font-weight: 600;
  border-left: 4px solid #9ca3af;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.status-active { border-left-color: #10b981; }
.status-trial { border-left-color: #f59e0b; }
.status-expired { border-left-color: #ef4444; }

/* ---------- Forms ---------- */
form input, form select {
  width: 100%;
  padding: 8px;
  margin-bottom: 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-sizing: border-box;
  font-family: inherit;
}

form label {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  color: #374151;
}

.product-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
}

.product-row input { margin-bottom: 0; }

/* ---------- Password field with visibility toggle ---------- */
.password-field {
  position: relative;
}

.password-field input {
  padding-left: 40px;
  padding-right: 12px;
  direction: ltr;
  text-align: left;
}

.password-toggle {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
}

.password-toggle:hover { color: #374151; }

.password-toggle svg { width: 20px; height: 20px; }

/* ---------- Reusable LTR field (phone numbers, IDs, tokens, etc.) ---------- */
.ltr-field {
  direction: ltr;
  text-align: left;
}

/* ---------- Buttons ---------- */
.btn-primary, .btn-success, .btn-danger {
  display: inline-block;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.btn-primary { background: #2563eb; }
.btn-primary:hover { background: #1d4ed8; }

.btn-success { background: #059669; }
.btn-success:hover { background: #047857; }

.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }

.success-msg {
  background: #d1fae5;
  color: #047857;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.error-msg {
  background: #fee2e2;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.hint-box {
  background: #fef3c7;
  color: #92400e;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .admin-sidebar {
    position: static;
    width: 100%;
    height: auto;
  }
  .admin-sidebar nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .admin-main {
    margin-right: 0;
    padding: 20px 16px;
  }
  table, thead, tbody, th, td, tr {
    display: block;
  }
  thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  tr {
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
  }
  td {
    border: none;
    padding-right: 45%;
    position: relative;
  }
}
