* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Tahoma, 'Segoe UI', sans-serif;
  background: #f3f5f9;
  color: #1f2430;
  direction: rtl;
}
a { text-decoration: none; color: inherit; }

/* ---------- Login page ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: #fff;
  padding: 40px;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(20,20,40,.08);
  width: 100%;
  max-width: 360px;
}
.login-box h1 { font-size: 20px; margin-bottom: 24px; text-align: center; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px;
  background: #171b2e;
  color: #cfd3e6;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  flex-shrink: 0;
}
.sidebar .brand { padding: 0 20px 20px; font-weight: bold; font-size: 16px; color: #fff; border-bottom: 1px solid #2a2f47; margin-bottom: 10px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a { padding: 12px 20px; font-size: 14px; border-right: 3px solid transparent; }
.sidebar nav a:hover { background: #232842; }
.sidebar nav a.active { background: #232842; border-right-color: #5b7cfa; color: #fff; }
.sidebar-footer { padding: 16px 20px 0; border-top: 1px solid #2a2f47; margin-top: 10px; }
.sidebar-footer .admin-name { font-size: 13px; margin-bottom: 8px; color: #fff; }
.sidebar-footer .logout { font-size: 13px; color: #ff8686; }

.content { flex: 1; padding: 28px 32px; max-width: 100%; overflow-x: auto; }

/* ---------- Common components ---------- */
.page-title { font-size: 20px; margin: 0 0 20px; }
.card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 2px 10px rgba(20,20,40,.05); margin-bottom: 20px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr 1fr; } }

.stat-box { background: #fff; border-radius: 12px; padding: 18px 20px; box-shadow: 0 2px 10px rgba(20,20,40,.05); }
.stat-box .num { font-size: 26px; font-weight: bold; }
.stat-box .label { font-size: 13px; color: #6b7290; margin-top: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table th, table td { padding: 10px 12px; text-align: right; border-bottom: 1px solid #eef0f5; }
table th { color: #6b7290; font-weight: 600; background: #f8f9fc; }
table tr:hover td { background: #fafbff; }

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  background: #5b7cfa;
  color: #fff !important;
  border: none;
  cursor: pointer;
  font-size: 13.5px;
}
.btn:hover { background: #4a68e0; }
.btn.btn-danger { background: #e14b4b; }
.btn.btn-danger:hover { background: #c73b3b; }
.btn.btn-outline { background: transparent; border: 1px solid #d7dae5; color: #333 !important; }
.btn.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn.btn-success { background: #23b26d; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; }
.badge-green { background: #e5f8ee; color: #17a866; }
.badge-red { background: #fdecec; color: #d5433f; }
.badge-gray { background: #eef0f5; color: #666; }
.badge-yellow { background: #fff6df; color: #a67c00; }

form.inline-form { display: inline; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13.5px; color: #444; }
.form-group input[type=text],
.form-group input[type=password],
.form-group input[type=number],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d7dae5;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
.form-group textarea { min-height: 90px; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; }
.alert-success { background: #e5f8ee; color: #17a866; }
.alert-error { background: #fdecec; color: #d5433f; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.muted { color: #8a8fa8; font-size: 12.5px; }
.tag-list { display: flex; gap: 6px; flex-wrap: wrap; }
