/* ============================================
   سایادبیرگران - استایل پنل مدیریت
   ============================================ */

:root {
  --gold-50: #FFFAF0;
  --gold-100: #FBF2D5;
  --gold-300: #E8C860;
  --gold-400: #D4AF37;
  --gold-500: #C5A028;
  --gold-600: #B08D1A;
  --gold-700: #8F7113;

  --navy-700: #0F2444;
  --navy-800: #0A1A35;
  --navy-900: #050E1F;

  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;

  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;

  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --topbar-height: 64px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
html { font-size: 16px; }

body.admin-body {
  margin: 0;
  padding: 0;
  font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 10px;
  border: 2px solid var(--gray-100);
}
::-webkit-scrollbar-thumb:hover { background: var(--gold-400); }

.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: var(--sidebar-width);
  background: var(--navy-900);
  color: white;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-sidebar.collapsed { width: var(--sidebar-collapsed); }

.admin-main {
  flex: 1;
  margin-right: var(--sidebar-width);
  min-height: 100vh;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.admin-main.sidebar-collapsed { margin-right: var(--sidebar-collapsed); }

.sidebar-brand {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-height: var(--topbar-height);
}

.sidebar-brand-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy-900);
  flex-shrink: 0;
}

.sidebar-brand-text {
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  opacity: 1;
  transition: var(--transition);
}

.admin-sidebar.collapsed .sidebar-brand-text { opacity: 0; width: 0; }
.sidebar-brand-text .gold { color: var(--gold-400); }

.sidebar-nav {
  flex: 1;
  padding: 16px 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); }

.nav-section { margin-bottom: 20px; }

.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  padding: 8px 16px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  opacity: 1;
  transition: var(--transition);
}

.admin-sidebar.collapsed .nav-section-title {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
  position: relative;
  white-space: nowrap;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: white; }

.nav-item.active {
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.05));
  color: var(--gold-400);
  border-right: 3px solid var(--gold-400);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--gold-400);
  border-radius: 3px;
}

.nav-item svg, .nav-item i { width: 20px; height: 20px; flex-shrink: 0; }

.nav-item-label { flex: 1; opacity: 1; transition: var(--transition); }
.admin-sidebar.collapsed .nav-item-label { opacity: 0; width: 0; }

.nav-item-badge {
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  line-height: 1.4;
}

.admin-sidebar.collapsed .nav-item-badge { display: none; }

.nav-submenu {
  margin-right: 32px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding-right: 8px;
  display: none;
}

.nav-submenu.open { display: block; }
.nav-submenu .nav-item { padding: 8px 14px; font-size: 13px; }

.sidebar-footer { padding: 12px 8px; border-top: 1px solid rgba(255, 255, 255, 0.08); }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.8);
}

.sidebar-user:hover { background: rgba(255, 255, 255, 0.06); }

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy-900);
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; overflow: hidden; transition: var(--transition); }
.admin-sidebar.collapsed .sidebar-user-info { display: none; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: white; }
.sidebar-user-role { font-size: 11px; color: var(--gray-500); }

.admin-topbar {
  height: var(--topbar-height);
  background: white;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-right, .topbar-left { display: flex; align-items: center; gap: 12px; }

.topbar-toggle {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gray-600);
  transition: var(--transition);
}

.topbar-toggle:hover { background: var(--gray-100); color: var(--gold-500); }

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--gray-500);
}

.topbar-breadcrumb a { color: var(--gray-600); text-decoration: none; transition: var(--transition); }
.topbar-breadcrumb a:hover { color: var(--gold-600); }
.topbar-breadcrumb .separator { color: var(--gray-300); }
.topbar-breadcrumb .current { color: var(--navy-900); font-weight: 600; }

.topbar-action {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gray-600);
  transition: var(--transition);
  position: relative;
  text-decoration: none;
}

.topbar-action:hover { background: var(--gray-100); color: var(--gold-500); }

.topbar-action.has-badge::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid white;
}

.topbar-action-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid white;
}

.topbar-search { position: relative; width: 240px; }

.topbar-search input {
  width: 100%;
  height: 40px;
  background: var(--gray-100);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 0 40px 0 14px;
  font-family: inherit;
  font-size: 14px;
  transition: var(--transition);
  color: var(--gray-800);
}

.topbar-search input:focus {
  outline: none;
  background: white;
  border-color: var(--gold-400);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.topbar-search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
  width: 18px;
  height: 18px;
}

.admin-content { padding: 24px; flex: 1; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title { font-size: 24px; font-weight: 700; color: var(--navy-900); margin: 0 0 4px; }
.page-subtitle { font-size: 14px; color: var(--gray-500); margin: 0; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  overflow: hidden;
}

.card-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy-900);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title svg, .card-title i { color: var(--gold-500); width: 20px; height: 20px; }
.card-body { padding: 20px; }
.card-body.p-0 { padding: 0; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: var(--gold-400);
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card.blue::before { background: var(--info); }
.stat-card.green::before { background: var(--success); }
.stat-card.purple::before { background: #8B5CF6; }
.stat-card.orange::before { background: var(--warning); }
.stat-card.red::before { background: var(--danger); }

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-100);
  color: var(--gold-700);
}

.stat-card.blue .stat-icon { background: #DBEAFE; color: #1E40AF; }
.stat-card.green .stat-icon { background: #D1FAE5; color: #065F46; }
.stat-card.purple .stat-icon { background: #EDE9FE; color: #5B21B6; }
.stat-card.orange .stat-icon { background: #FEF3C7; color: #92400E; }
.stat-card.red .stat-icon { background: #FEE2E2; color: #991B1B; }

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--navy-900);
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat-label { font-size: 13px; color: var(--gray-500); font-weight: 500; }

.stat-change {
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg, .btn i { width: 18px; height: 18px; }

.btn-primary {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  color: var(--navy-900);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
  transform: translateY(-1px);
}

.btn-secondary { background: var(--navy-900); color: white; }
.btn-secondary:hover { background: var(--navy-800); }

.btn-outline {
  background: transparent;
  border-color: var(--gray-300);
  color: var(--gray-700);
}

.btn-outline:hover {
  border-color: var(--gold-400);
  color: var(--gold-600);
  background: var(--gold-50);
}

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }

.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); color: var(--gold-600); }

.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-sm svg, .btn-sm i { width: 14px; height: 14px; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 15px; }

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn-icon.btn-sm { width: 30px; height: 30px; }
.btn-block { width: 100%; }

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-label .required { color: var(--danger); margin-right: 4px; }
.form-label .hint { color: var(--gray-400); font-weight: 400; font-size: 12px; margin-right: 6px; }

.form-control,
.form-select,
.form-textarea {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--gray-800);
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.form-textarea {
  height: auto;
  min-height: 120px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.7;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: left 12px center;
  background-size: 16px;
  padding-left: 36px;
}

.form-control:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--gold-400);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.form-control:disabled,
.form-select:disabled { background: var(--gray-100); cursor: not-allowed; }
.form-control::placeholder, .form-textarea::placeholder { color: var(--gray-400); }

.form-control.is-invalid,
.form-select.is-invalid,
.form-textarea.is-invalid { border-color: var(--danger); }

.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.form-help { font-size: 12px; color: var(--gray-500); margin-top: 4px; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.input-group { position: relative; }
.input-group .form-control { padding-right: 42px; }

.input-group-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
  width: 18px;
  height: 18px;
}

.input-group-suffix {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.switch-track {
  width: 44px;
  height: 24px;
  background: var(--gray-300);
  border-radius: 12px;
  position: relative;
  transition: var(--transition);
  flex-shrink: 0;
}

.switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.switch input:checked + .switch-track { background: var(--gold-400); }
.switch input:checked + .switch-track::after { right: 22px; }
.switch-label { font-size: 14px; color: var(--gray-700); font-weight: 500; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--gray-700);
  user-select: none;
}

.check input { width: 18px; height: 18px; accent-color: var(--gold-500); cursor: pointer; }

.image-picker {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--gray-50);
  position: relative;
  overflow: hidden;
}

.image-picker:hover { border-color: var(--gold-400); background: var(--gold-50); }
.image-picker-icon { width: 48px; height: 48px; margin: 0 auto 10px; color: var(--gold-500); }
.image-picker-text { font-size: 14px; color: var(--gray-600); font-weight: 500; }
.image-picker-hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; }
.image-picker-preview { display: none; position: relative; width: 100%; }
.image-picker.has-image .image-picker-preview { display: block; }
.image-picker.has-image .image-picker-empty { display: none; }

.image-picker-preview img {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius-md);
  display: block;
  margin: 0 auto;
}

.image-picker-remove {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.image-picker-remove:hover { background: var(--danger); }

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  background: white;
}

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table thead { background: var(--gray-50); border-bottom: 1px solid var(--gray-200); }

.table th {
  padding: 12px 16px;
  text-align: right;
  font-weight: 600;
  font-size: 13px;
  color: var(--gray-600);
  white-space: nowrap;
}

.table td {
  padding: 14px 16px;
  text-align: right;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--gold-50); }

.table-actions { display: flex; gap: 6px; justify-content: flex-end; }
.table-title { font-weight: 600; color: var(--navy-900); display: block; margin-bottom: 2px; }
.table-subtitle { font-size: 12px; color: var(--gray-500); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  line-height: 1.4;
}

.badge-primary { background: var(--gold-100); color: var(--gold-700); }
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-info { background: #DBEAFE; color: #1E40AF; }
.badge-gray { background: var(--gray-100); color: var(--gray-700); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 20px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  text-decoration: none;
  transition: var(--transition);
  border: 1px solid var(--gray-200);
  background: white;
}

.pagination a:hover { background: var(--gold-50); border-color: var(--gold-400); color: var(--gold-700); }

.pagination .active {
  background: var(--gold-500);
  border-color: var(--gold-500);
  color: var(--navy-900);
  font-weight: 700;
}

.pagination .disabled { opacity: 0.5; cursor: not-allowed; }
.pagination .dots { border: none; background: transparent; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 14, 31, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.2s;
}

.modal-overlay.open { display: flex; opacity: 1; }

.modal {
  background: white;
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95);
  transition: transform 0.2s;
}

.modal-overlay.open .modal { transform: scale(1); }
.modal-lg { max-width: 900px; }
.modal-xl { max-width: 1200px; }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title { font-size: 18px; font-weight: 700; color: var(--navy-900); margin: 0; }

.modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover { background: var(--gray-100); color: var(--danger); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--gray-50);
}

.toast-container {
  position: fixed;
  top: 80px;
  left: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 300px;
  max-width: 400px;
  background: white;
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-xl);
  border-right: 4px solid var(--info);
  pointer-events: auto;
  animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }

.toast-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #DBEAFE;
  color: var(--info);
}

.toast.success .toast-icon { background: #D1FAE5; color: var(--success); }
.toast.error .toast-icon { background: #FEE2E2; color: var(--danger); }
.toast.warning .toast-icon { background: #FEF3C7; color: var(--warning); }

.toast-content { flex: 1; }
.toast-title { font-weight: 700; color: var(--navy-900); font-size: 14px; margin-bottom: 2px; }
.toast-message { font-size: 13px; color: var(--gray-600); }

.toast-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.toast-close:hover { background: var(--gray-100); color: var(--gray-700); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.closing { animation: toastOut 0.2s forwards; }

@keyframes toastOut {
  to { opacity: 0; transform: translateX(-20px); }
}

.alert {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.alert svg, .alert i { flex-shrink: 0; margin-top: 1px; }
.alert-info { background: #EFF6FF; color: #1E40AF; border-color: #BFDBFE; }
.alert-success { background: #ECFDF5; color: #065F46; border-color: #A7F3D0; }
.alert-warning { background: #FFFBEB; color: #92400E; border-color: #FDE68A; }
.alert-danger { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }

.empty-state { padding: 60px 20px; text-align: center; color: var(--gray-500); }

.empty-state svg, .empty-state i {
  width: 64px;
  height: 64px;
  color: var(--gray-300);
  margin: 0 auto 16px;
  display: block;
}

.empty-state-title { font-size: 16px; font-weight: 700; color: var(--gray-700); margin-bottom: 6px; }
.empty-state-text { font-size: 14px; color: var(--gray-500); margin-bottom: 20px; }

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--gray-100);
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-500);
  background: transparent;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.tab:hover { color: var(--gold-600); }
.tab.active { color: var(--gold-600); border-bottom-color: var(--gold-500); }

.editor-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.editor-layout.preview-off { grid-template-columns: 1fr; }
.editor-pane { min-width: 0; }

.preview-pane {
  position: sticky;
  top: 88px;
  height: calc(100vh - 120px);
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
}

.preview-header {
  padding: 10px 14px;
  background: var(--navy-900);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.preview-device-btns { display: flex; gap: 4px; }

.preview-device-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: var(--transition);
}

.preview-device-btn:hover,
.preview-device-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--gold-400);
}

.preview-frame-wrap {
  flex: 1;
  overflow: hidden;
  background: var(--gray-100);
  display: flex;
  justify-content: center;
}

.preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
}

.preview-frame-wrap.mobile .preview-iframe { width: 375px; }
.preview-frame-wrap.tablet .preview-iframe { width: 768px; }

.menu-builder { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.menu-items-list { list-style: none; margin: 0; padding: 0; }

.menu-item {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: grab;
  transition: var(--transition);
}

.menu-item:hover { border-color: var(--gold-400); box-shadow: var(--shadow-md); }
.menu-item.dragging { opacity: 0.5; cursor: grabbing; }
.menu-item-handle { color: var(--gray-400); cursor: grab; flex-shrink: 0; }
.menu-item-info { flex: 1; }
.menu-item-label { font-weight: 600; font-size: 14px; color: var(--navy-900); margin-bottom: 2px; }

.menu-item-url {
  font-size: 12px;
  color: var(--gray-500);
  direction: ltr;
  text-align: left;
  font-family: monospace;
}

.menu-item-actions { display: flex; gap: 4px; }
.menu-item-sub { list-style: none; padding-right: 30px; margin-top: 8px; }

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.media-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  transition: var(--transition);
  aspect-ratio: 1;
  background: var(--gray-100);
}

.media-item:hover { border-color: var(--gold-400); transform: scale(1.02); }

.media-item.selected {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25);
}

.media-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

.media-item-overlay {
  position: absolute;
  inset: auto 0 0 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  padding: 20px 8px 8px;
  color: white;
  font-size: 11px;
  opacity: 0;
  transition: var(--transition);
}

.media-item:hover .media-item-overlay { opacity: 1; }

.media-item-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: var(--gold-500);
  color: white;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
}

.media-item.selected .media-item-check { display: flex; }

.upload-dropzone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  background: var(--gray-50);
  transition: var(--transition);
  cursor: pointer;
  margin-bottom: 20px;
}

.upload-dropzone:hover,
.upload-dropzone.dragover { border-color: var(--gold-400); background: var(--gold-50); }

.widget-list { display: flex; flex-direction: column; gap: 12px; }

.widget-item {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
}

.widget-item:hover { border-color: var(--gold-400); }

.widget-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--gold-100);
  color: var(--gold-700);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.widget-info { flex: 1; }
.widget-name { font-weight: 600; color: var(--navy-900); font-size: 14px; margin-bottom: 2px; }
.widget-desc { font-size: 12px; color: var(--gray-500); }

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.15), transparent 70%);
  border-radius: 50%;
}

.login-page::after {
  content: '';
  position: absolute;
  bottom: -150px;
  left: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.08), transparent 70%);
  border-radius: 50%;
}

.login-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
}

.login-brand { text-align: center; margin-bottom: 30px; }

.login-brand-logo {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  color: var(--navy-900);
  box-shadow: 0 10px 25px rgba(212, 175, 55, 0.4);
}

.login-brand-title { font-size: 22px; font-weight: 700; color: var(--navy-900); margin: 0 0 4px; }
.login-brand-sub { font-size: 13px; color: var(--gray-500); margin: 0; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.p-0 { padding: 0; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-muted { color: var(--gray-500); }
.text-navy { color: var(--navy-900); }
.text-gold { color: var(--gold-600); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.hidden { display: none !important; }
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.shadow { box-shadow: var(--shadow-md); }

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--gold-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

.spinner-sm { width: 16px; height: 16px; border-width: 2px; }

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(2px);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
}

.loading-overlay.active { display: flex; }

.sortable-ghost { opacity: 0.4; background: var(--gold-100) !important; }
.sortable-chosen { box-shadow: var(--shadow-xl); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 14, 31, 0.5);
  z-index: 45;
  opacity: 0;
  transition: opacity 0.25s;
}

.sidebar-overlay.active { display: block; opacity: 1; }

@media (max-width: 1024px) {
  .editor-layout { grid-template-columns: 1fr; }
  .preview-pane { display: none; }
  .menu-builder { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-right: 0; }
  .admin-content { padding: 16px; }
  .page-header { flex-direction: column; align-items: stretch; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .stat-grid { grid-template-columns: 1fr; }
  .topbar-search { display: none; }
  .toast-container { left: 10px; right: 10px; }
  .toast { min-width: auto; }
  .modal { max-height: 95vh; }
  .modal-body { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .table th, .table td { padding: 10px; font-size: 13px; }
  .pagination a, .pagination span { min-width: 32px; height: 32px; font-size: 13px; }
}