* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Tahoma, Arial, sans-serif;
  background: #f7f7fb;
  color: #111827;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

.topbar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  background: #111827;
  color: #fff;
  padding: 10px 12px;
  position: sticky; /* این خاصیت را اضافه کرده‌ایم */
  top: 0; /* منو در بالای صفحه ثابت می‌ماند */
  z-index: 10; /* اطمینان از اینکه منو بالاتر از دیگر محتوای صفحه باشد */
}


.topbar #navToggle {
  background: #374151;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}

.topnav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.topnav a {
  color: #fff;
  text-decoration: none;
  background: #1f2937;
  padding: 6px 10px;
  border-radius: 8px;
}

.topnav.open {
  display: flex;
}

.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
  padding: 12px;
  margin: 12px 0;
}

.hint {
  color: #6b7280;
}

.msg {
  padding: 10px;
  border-radius: 8px;
  background: #f3f4f6;
}

.msg.success {
  background: #ecfdf5;
  color: #065f46;
}

.msg.error {
  background: #fef2f2;
  color: #991b1b;
}

/* جدول */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table th,
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: middle;
}

.table thead th {
  background: #f3f4f6;
}

.table tbody tr:nth-child(odd) {
  background: #fafafa;
}

.table tbody tr:hover {
  background: #f3f4f6;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  background: #f3f4f6;
}

.drag-handle {
  cursor: move;
}

/* فرم‌ها */
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.form-grid .form-actions {
  grid-column: 1 / -1;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

button {
  padding: 8px 12px;
  border-radius: 8px;
  border: 0;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}

button.danger {
  background: #ef4444;
}

/* ریسپانسیو */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}
