/* ============ ALBAWANI Admin Panel ============ */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Tahoma', system-ui, sans-serif;
  background: #f3f4f6;
  color: #1f2937;
  direction: rtl;
}
a { color: inherit; text-decoration: none; }

/* ===== Sidebar ===== */
.sidebar {
  position: fixed;
  inset-inline-start: 0;
  top: 0; bottom: 0;
  width: 250px;
  background: #111827;
  color: #f3f4f6;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.sidebar .brand {
  padding: 20px;
  border-bottom: 1px solid #1f2937;
  background: #fff;
  text-align: center;
}
.sidebar .brand img { max-height: 50px; max-width: 100%; }
.sidebar nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.sidebar nav a {
  display: block;
  padding: 12px 20px;
  color: #d1d5db;
  border-inline-start: 3px solid transparent;
  transition: all .2s;
}
.sidebar nav a:hover { background: #1f2937; color: #fff; }
.sidebar nav a.active {
  background: #dc2626;
  color: #fff;
  border-inline-start-color: #fbbf24;
}
.sidebar .bottom { padding: 12px; border-top: 1px solid #1f2937; }
.sidebar .bottom a {
  display: block;
  padding: 10px 12px;
  color: #d1d5db;
  border-radius: 6px;
  margin-bottom: 4px;
}
.sidebar .bottom a:hover { background: #1f2937; }
.sidebar .bottom .logout { color: #fca5a5; }

/* ===== Main ===== */
.content { margin-inline-start: 250px; min-height: 100vh; }
.topbar {
  background: #fff;
  padding: 16px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.topbar h1 { margin: 0; font-size: 22px; color: #111827; }
.topbar .user { color: #6b7280; font-size: 14px; }
.page { padding: 30px; }

.flash { background: #d1fae5; color: #065f46; padding: 12px 18px; border-radius: 8px; margin-bottom: 20px; border: 1px solid #6ee7b7; }
.err   { background: #fee2e2; color: #991b1b; padding: 12px 18px; border-radius: 8px; margin-bottom: 16px; border: 1px solid #fca5a5; }

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 8px 16px;
  background: #e5e7eb;
  color: #1f2937;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  transition: all .2s;
}
.btn:hover { background: #d1d5db; }
.btn-primary { background: #dc2626; color: #fff; }
.btn-primary:hover { background: #b91c1c; }
.btn-danger { background: #fee2e2; color: #991b1b; }
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 5px 10px; font-size: 13px; }

.toolbar { margin-bottom: 18px; display: flex; gap: 10px; }

/* ===== Stats ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card {
  background: #fff; padding: 20px; border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  text-align: center; transition: transform .2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card .num { font-size: 36px; font-weight: bold; color: #dc2626; }
.stat-card.highlight { border-top: 3px solid #dc2626; }
.badge { background: #dc2626; color: #fff; padding: 2px 8px; border-radius: 10px; font-size: 11px; margin-inline-start: 4px; }

.welcome-card { background: #fff; padding: 24px; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.welcome-card h2 { margin-top: 0; }

/* ===== Tables ===== */
.data-table {
  width: 100%; border-collapse: collapse; background: #fff;
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.data-table th, .data-table td {
  padding: 12px 14px; text-align: start;
  border-bottom: 1px solid #f3f4f6;
}
.data-table th { background: #f9fafb; font-weight: 700; font-size: 13px; color: #4b5563; }
.data-table tr:hover { background: #fafafa; }
.data-table tr.unread { background: #fef9c3; font-weight: bold; }
.actions { white-space: nowrap; display: flex; gap: 6px; align-items: center; }

/* ===== Forms ===== */
.form-card {
  background: #fff; padding: 28px; border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08); max-width: 760px;
}
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; color: #374151; font-size: 14px; }
.field input[type=text], .field input[type=number], .field input[type=password], .field textarea, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid #d1d5db;
  border-radius: 6px; font-family: inherit; font-size: 14px; background: #fff;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,.1); }
.field input[type=file] { padding: 6px 0; }
.field small.hint { display: block; color: #6b7280; font-size: 12px; margin-top: 4px; }
.field .cb { font-weight: normal; }
.field .cb input { width: auto; margin-left: 6px; }
.field .cur-img { margin-bottom: 8px; }
.form-actions { padding-top: 10px; border-top: 1px solid #f3f4f6; margin-top: 20px; }

/* ===== Login ===== */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: linear-gradient(135deg,#111827,#dc2626);
}
.login-card {
  background: #fff; padding: 40px; border-radius: 14px;
  width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-card .login-logo { display: block; margin: 0 auto 16px; max-height: 60px; }
.login-card h1 { text-align: center; margin: 0 0 24px; color: #111827; }
.login-card label { display: block; font-weight: 700; margin: 14px 0 6px; font-size: 14px; }
.login-card input { width: 100%; padding: 12px; border: 1px solid #d1d5db; border-radius: 6px; font-family: inherit; font-size: 14px; }
.login-card input:focus { outline: none; border-color: #dc2626; }
.login-card button {
  width: 100%; margin-top: 20px; padding: 12px;
  background: #dc2626; color: #fff; border: none;
  border-radius: 6px; font-size: 16px; font-weight: 700; cursor: pointer;
}
.login-card button:hover { background: #b91c1c; }
.login-card .hint { text-align: center; color: #6b7280; font-size: 12px; margin-top: 16px; }
.login-card code { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: 12px; }

/* ===== Message view ===== */
.msg-card { background: #fff; padding: 28px; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-top: 16px; }
.msg-card h2 { margin-top: 0; color: #dc2626; }
.msg-body { background: #f9fafb; padding: 16px; border-radius: 6px; line-height: 1.8; }

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .sidebar { width: 100%; height: auto; position: static; }
  .content { margin-inline-start: 0; }
  .data-table { font-size: 13px; }
  .data-table th, .data-table td { padding: 8px; }
}
