/* ========================= ADMIN PANEL STYLES ========================= */
:root {
  --admin-bg: #f1f5f9;
  --admin-sidebar-bg: #111827;
  --admin-sidebar-width: 260px;
  --admin-card-bg: #fff;
  --admin-border: #e2e8f0;
  --admin-text: #1e293b;
  --admin-text-muted: #64748b;
  --admin-primary: #B87333;
  --admin-primary-hover: #A0522D;
  --admin-success: #22c55e;
  --admin-danger: #ef4444;
  --admin-warning: #f59e0b;
  --admin-info: #3b82f6;
  --admin-radius: 0.75rem;
  --admin-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --admin-shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}


/* ========================= CUSTOM SCROLLBARS ========================= */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(184,115,51,0.25), rgba(184,115,51,0.15));
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(184,115,51,0.55), rgba(184,115,51,0.35));
  box-shadow: 0 0 6px rgba(184,115,51,0.3);
}

/* Sidebar scrollbars — translucent on dark bg */
.admin-sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.admin-sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.admin-sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
}
.admin-sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.3);
}

/* Firefox scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.15) transparent;
}
.admin-sidebar-nav {
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

/* ========================= LOGIN PAGE ========================= */
.admin-login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #111827, #1f2937);
  padding: 1rem;
}
.admin-login-card {
  background: var(--admin-card-bg);
  border-radius: 1rem;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--admin-shadow-lg);
}
.admin-login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.admin-login-logo img {
  width: 60px;
  height: 60px;
  margin: 0 auto 1rem;
  object-fit: contain;
}
.admin-login-logo h1 {
  font-size: 1.5rem;
  color: var(--admin-text);
  margin-bottom: 0.25rem;
}
.admin-login-logo p {
  color: var(--admin-text-muted);
  font-size: 0.9rem;
}
.admin-form-group {
  margin-bottom: 1.25rem;
}
.admin-form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--admin-text);
  margin-bottom: 0.5rem;
}
.admin-form-group input,
.admin-form-group select,
.admin-form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--admin-border);
  border-radius: var(--admin-radius);
  font-size: 0.95rem;
  color: var(--admin-text);
  background: var(--admin-card-bg);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  font-family: inherit;
}
.admin-form-group input:focus,
.admin-form-group select:focus,
.admin-form-group textarea:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(184,115,51,0.15);
}
.admin-form-group textarea {
  min-height: 100px;
  resize: vertical;
}
.admin-login-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--admin-text-muted);
  margin-top: 1rem;
}
.admin-login-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--admin-border);
}
.admin-login-footer a {
  color: var(--admin-text-muted);
  font-size: 0.85rem;
  transition: color 0.2s;
}
.admin-login-footer a:hover {
  color: var(--admin-primary);
}

/* ========================= BUTTONS ========================= */
.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--admin-radius);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: inherit;
  width: 100%;
}
.admin-btn-primary {
  background: var(--admin-primary);
  color: #fff;
}
.admin-btn-primary:hover {
  background: var(--admin-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(184,115,51,0.3);
}
.admin-btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}
.admin-btn-secondary {
  background: var(--admin-bg);
  color: var(--admin-text);
  border: 2px solid var(--admin-border);
}
.admin-btn-secondary:hover {
  border-color: var(--admin-primary);
  color: var(--admin-primary);
}
.admin-btn-danger {
  background: var(--admin-danger);
  color: #fff;
}
.admin-btn-danger:hover {
  background: #dc2626;
}
.admin-btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  width: auto;
}

/* ========================= ALERTS ========================= */
.admin-alert {
  padding: 0.875rem 1.25rem;
  border-radius: var(--admin-radius);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  animation: slideDown 0.3s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.admin-alert-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.admin-alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.admin-alert-warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* ========================= LAYOUT ========================= */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ========================= SIDEBAR OVERLAY ========================= */
.admin-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s;
  backdrop-filter: blur(2px);
}
.admin-sidebar-overlay.visible {
  display: block;
  opacity: 1;
}

/* ========================= SIDEBAR ========================= */
.admin-sidebar {
  width: var(--admin-sidebar-width);
  background: var(--admin-sidebar-bg);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow-x: visible;
  transition: width 0.3s cubic-bezier(0.4,0,0.2,1), transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.admin-sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.admin-sidebar.collapsed .admin-sidebar-nav {
  overflow-y: auto;
  overflow-x: visible;
}
.admin-sidebar.collapsed {
  width: 72px;
}
/* Hide text labels, badges, and brand name when collapsed */
.admin-sidebar.collapsed .admin-sidebar-brand,
.admin-sidebar.collapsed .admin-nav-item span,
.admin-sidebar.collapsed .admin-nav-badge,
.admin-sidebar.collapsed .admin-sidebar-collapse span {
  opacity: 0;
  width: 0;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  margin: 0;
  padding: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, width 0.25s ease, margin 0.25s ease, padding 0.25s ease;
}
/* Center the sidebar header when collapsed */
.admin-sidebar.collapsed .admin-sidebar-header {
  padding: 1.5rem 0;
  justify-content: center;
  gap: 0;
}
.admin-sidebar.collapsed .admin-sidebar-header .admin-sidebar-logo {
  margin: 0;
}
/* Center nav items when collapsed */
.admin-sidebar.collapsed .admin-nav-item {
  padding: 0.75rem;
  justify-content: center;
  position: relative;
  gap: 0;
}
.admin-sidebar.collapsed .admin-nav-item svg {
  margin: 0;
  flex-shrink: 0;
}
/* Tooltip on hover when collapsed */
.admin-sidebar.collapsed .admin-nav-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: #1e293b;
  color: #fff;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 300;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.admin-sidebar.collapsed .admin-nav-item:hover::after {
  opacity: 1;
}
/* Slim divider when collapsed */
.admin-sidebar.collapsed .admin-nav-divider {
  margin: 0.5rem 0.75rem;
}

/* Sidebar collapse toggle button — aligned with nav items, at the bottom */
.admin-sidebar-collapse {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.25rem;
  color: rgba(255,255,255,0.45);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: auto;
  flex-shrink: 0;
}
.admin-sidebar-collapse:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}
.admin-sidebar-collapse svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}
.admin-sidebar.collapsed .admin-sidebar-collapse {
  padding: 0.75rem;
  justify-content: center;
  gap: 0;
}
.admin-sidebar.collapsed .admin-sidebar-collapse svg {
  transform: rotate(180deg);
}
.admin-sidebar-collapse span {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: opacity 0.15s ease, width 0.25s ease, margin 0.25s ease;
}
.admin-sidebar.collapsed .admin-sidebar-collapse span {
  opacity: 0;
  width: 0;
  min-width: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

/* Smooth main content transition */
.admin-main {
  flex: 1;
  margin-left: var(--admin-sidebar-width);
  background: var(--admin-bg);
  min-height: 100vh;
  transition: margin-left 0.3s cubic-bezier(0.4,0,0.2,1);
}
.admin-layout.sidebar-collapsed .admin-main {
  margin-left: 72px;
}
.admin-sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.admin-sidebar-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.admin-sidebar-brand {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.025em;
}
.admin-sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.25rem;
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
  position: relative;
}
.admin-nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.admin-nav-item:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}
.admin-nav-item.active {
  color: #fff;
  background: rgba(184,115,51,0.2);
}
.admin-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--admin-primary);
  border-radius: 0 3px 3px 0;
}
.admin-nav-badge {
  margin-left: auto;
  background: rgba(255,255,255,0.12);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}
.admin-nav-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 0.5rem 1.25rem;
}
.admin-nav-danger {
  color: rgba(239,68,68,0.8) !important;
}
.admin-nav-danger:hover {
  color: #ef4444 !important;
  background: rgba(239,68,68,0.1);
}


.admin-header {
  background: var(--admin-card-bg);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--admin-border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.admin-sidebar-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--admin-text);
}
.admin-sidebar-toggle svg {
  width: 24px;
  height: 24px;
}
.admin-page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--admin-text);
}
.admin-header-user {
  margin-left: auto;
}
.admin-user-email {
  font-size: 0.8rem;
  color: var(--admin-text-muted);
  background: var(--admin-bg);
  padding: 0.4rem 0.75rem;
  border-radius: 20px;
}
.admin-content {
  padding: 2rem;
}

/* ========================= STATS GRID ========================= */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.admin-stat-card {
  background: var(--admin-card-bg);
  border-radius: var(--admin-radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--admin-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.admin-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--admin-shadow-lg);
}
.admin-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.admin-stat-icon svg {
  width: 24px;
  height: 24px;
}
.admin-stat-info {
  display: flex;
  flex-direction: column;
}
.admin-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--admin-text);
  line-height: 1;
}
.admin-stat-label {
  font-size: 0.8rem;
  color: var(--admin-text-muted);
  margin-top: 0.25rem;
}

/* ========================= CARDS ========================= */
.admin-card {
  background: var(--admin-card-bg);
  border-radius: var(--admin-radius);
  padding: 1.5rem;
  box-shadow: var(--admin-shadow);
  margin-bottom: 1.5rem;
}
.admin-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--admin-text);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--admin-border);
}

/* ========================= QUICK ACTIONS ========================= */
.admin-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.admin-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1rem;
  border: 2px solid var(--admin-border);
  border-radius: var(--admin-radius);
  color: var(--admin-text);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.2s;
  text-align: center;
}
.admin-action-btn svg {
  width: 28px;
  height: 28px;
  color: var(--admin-primary);
}
.admin-action-btn:hover {
  border-color: var(--admin-primary);
  background: rgba(184,115,51,0.04);
  transform: translateY(-2px);
  box-shadow: var(--admin-shadow);
}

/* ========================= TABLES ========================= */
.admin-table-wrapper {
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th,
.admin-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--admin-border);
  font-size: 0.9rem;
}
.admin-table th {
  font-weight: 600;
  color: var(--admin-text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.admin-table tbody tr:hover {
  background: var(--admin-bg);
}
.admin-table tbody tr:last-child td {
  border-bottom: none;
}

/* ========================= BADGES ========================= */
.admin-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.admin-badge-success {
  background: #f0fdf4;
  color: #166534;
}
.admin-badge-danger {
  background: #fef2f2;
  color: #991b1b;
}
.admin-badge-warning {
  background: #fffbeb;
  color: #92400e;
}

/* ========================= LINKS ========================= */
.admin-link {
  color: var(--admin-primary);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.2s;
}
.admin-link:hover {
  color: var(--admin-primary-hover);
}

/* ========================= EMPTY STATE ========================= */
.admin-empty {
  text-align: center;
  padding: 2rem;
  color: var(--admin-text-muted);
}
.admin-empty a {
  color: var(--admin-primary);
  font-weight: 600;
}

/* ========================= FORM GRID ========================= */
.admin-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* ========================= IMAGE UPLOAD ========================= */
.admin-upload-zone {
  border: 2px dashed var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--admin-bg);
}
.admin-upload-zone:hover,
.admin-upload-zone.dragover {
  border-color: var(--admin-primary);
  background: rgba(184,115,51,0.04);
}
.admin-upload-zone svg {
  width: 40px;
  height: 40px;
  color: var(--admin-text-muted);
  margin-bottom: 0.75rem;
}
.admin-upload-zone p {
  color: var(--admin-text-muted);
  font-size: 0.9rem;
}
.admin-upload-zone .upload-hint {
  font-size: 0.8rem;
  margin-top: 0.5rem;
  color: #94a3b8;
}

/* ========================= IMAGE GRID ========================= */
.admin-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
.admin-image-item {
  background: var(--admin-card-bg);
  border-radius: var(--admin-radius);
  overflow: hidden;
  border: 2px solid var(--admin-border);
  transition: all 0.2s;
  position: relative;
}
.admin-image-item:hover {
  border-color: var(--admin-primary);
  transform: translateY(-2px);
  box-shadow: var(--admin-shadow);
}
.admin-image-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}
.admin-image-item-info {
  padding: 0.5rem;
}
.admin-image-item-name {
  font-size: 0.7rem;
  color: var(--admin-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-image-item-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.25rem;
}
.admin-image-item-actions button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.admin-image-item-actions button svg {
  width: 14px;
  height: 14px;
}
.admin-image-item-actions .btn-copy {
  background: rgba(0,0,0,0.5);
  color: #fff;
}
.admin-image-item-actions .btn-rename {
  background: rgba(59,130,246,0.8);
  color: #fff;
}
.admin-image-item-actions .btn-rename:hover {
  background: var(--admin-info);
}
.admin-image-item-actions .btn-copy {
  background: rgba(0,0,0,0.5);
  color: #fff;
}
.admin-image-item-actions .btn-copy:hover {
  background: var(--admin-primary);
}
.admin-image-item-actions .btn-delete {
  background: rgba(239,68,68,0.8);
  color: #fff;
}
.admin-image-item-actions .btn-delete:hover {
  background: var(--admin-danger);
}

/* ========================= PRODUCT FORM ========================= */
.admin-product-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--admin-border);
}
.admin-product-form-actions {
  display: flex;
  gap: 0.5rem;
}

/* ========================= SETTINGS GRID ========================= */
.admin-settings-section {
  margin-bottom: 2rem;
}
.admin-settings-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--admin-text);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--admin-border);
}

/* ========================= PASSWORD TOGGLE ========================= */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
  padding-right: 3rem;
}
.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--admin-text-muted);
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  z-index: 2;
}
.password-toggle:hover {
  color: var(--admin-primary);
}
.password-toggle svg {
  width: 20px;
  height: 20px;
}

/* ========================= ENHANCED ANIMATIONS ========================= */
.admin-stat-card {
  animation: fadeInUp 0.5s ease-out both;
}
.admin-stat-card:nth-child(1) { animation-delay: 0.05s; }
.admin-stat-card:nth-child(2) { animation-delay: 0.1s; }
.admin-stat-card:nth-child(3) { animation-delay: 0.15s; }
.admin-stat-card:nth-child(4) { animation-delay: 0.2s; }

.admin-card {
  animation: fadeInUp 0.5s ease-out 0.15s both;
}

.admin-action-btn {
  animation: fadeInUp 0.4s ease-out both;
}
.admin-action-btn:nth-child(1) { animation-delay: 0.1s; }
.admin-action-btn:nth-child(2) { animation-delay: 0.15s; }
.admin-action-btn:nth-child(3) { animation-delay: 0.2s; }
.admin-action-btn:nth-child(4) { animation-delay: 0.25s; }

.admin-table tbody tr {
  transition: background 0.2s, transform 0.2s;
}
.admin-table tbody tr:hover {
  transform: translateX(3px);
}

.admin-login-card {
  animation: cardAppear 0.5s ease-out;
}
@keyframes cardAppear {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-btn {
  position: relative;
  overflow: hidden;
}
.admin-btn::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}
.admin-btn:active::after {
  width: 300px;
  height: 300px;
}

/* Toast notification */
.admin-toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 0.875rem 1.5rem;
  border-radius: var(--admin-radius);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 10000;
  animation: toastIn 0.4s ease-out, toastOut 0.4s ease-in 2.5s forwards;
  box-shadow: var(--admin-shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(50px); }
}

/* Confirm Modal */
.admin-confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(3px);
}
.admin-confirm-overlay.visible {
  display: flex;
}
.admin-confirm-modal {
  background: var(--admin-card-bg);
  border-radius: 1rem;
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
  animation: modalIn 0.3s ease-out;
  text-align: center;
}
.admin-confirm-modal .confirm-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.5rem;
}
.admin-confirm-modal .confirm-icon.danger {
  background: rgba(239,68,68,0.1);
  color: var(--admin-danger);
}
.admin-confirm-modal .confirm-icon.warning {
  background: rgba(245,158,11,0.1);
  color: var(--admin-warning);
}
.admin-confirm-modal .confirm-icon.info {
  background: rgba(59,130,246,0.1);
  color: var(--admin-info);
}
.admin-confirm-modal h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--admin-text);
  margin-bottom: 0.5rem;
}
.admin-confirm-modal p {
  color: var(--admin-text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.admin-confirm-modal .confirm-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}
.admin-confirm-modal .confirm-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  text-align: left;
}
.admin-confirm-modal .confirm-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 2px solid var(--admin-border);
  border-radius: var(--admin-radius);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}
.admin-confirm-modal .confirm-option:hover {
  border-color: var(--admin-primary);
  background: rgba(184,115,51,0.04);
}
.admin-confirm-modal .confirm-option.selected {
  border-color: var(--admin-primary);
  background: rgba(184,115,51,0.08);
}
.admin-confirm-modal .confirm-option input[type=radio] {
  accent-color: var(--admin-primary);
  width: 18px;
  height: 18px;
}
.admin-confirm-modal .confirm-option-label {
  font-weight: 600;
  color: var(--admin-text);
}
.admin-confirm-modal .confirm-option-desc {
  font-size: 0.8rem;
  color: var(--admin-text-muted);
}
.admin-confirm-modal .confirm-preview {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--admin-border);
  margin: 0 auto 1rem;
}

/* ========================= SEARCH & PAGINATION ========================= */
.admin-search-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.admin-search-input {
  flex: 1;
  min-width: 200px;
  position: relative;
}
.admin-search-input input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  border: 2px solid var(--admin-border);
  border-radius: var(--admin-radius);
  font-size: 0.9rem;
  background: var(--admin-card-bg);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  font-family: inherit;
}
.admin-search-input input:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(184,115,51,0.12);
}
.admin-search-input svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--admin-text-muted);
  pointer-events: none;
}
.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.admin-pagination a,
.admin-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  color: var(--admin-text);
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
}
.admin-pagination a:hover {
  border-color: var(--admin-primary);
  color: var(--admin-primary);
  background: rgba(184,115,51,0.04);
}
.admin-pagination .active {
  background: var(--admin-primary);
  color: #fff;
  border-color: var(--admin-primary);
}
.admin-pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}
.admin-results-info {
  font-size: 0.85rem;
  color: var(--admin-text-muted);
  margin-bottom: 0.5rem;
}

/* ========================= LOADING SPINNER ========================= */
.admin-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: adminSpin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 0.35rem;
}
.admin-btn:disabled .admin-spinner {
  border-color: rgba(255,255,255,0.3);
  border-top-color: #fff;
}
@keyframes adminSpin {
  to { transform: rotate(360deg); }
}

/* ========================= UPLOAD PROGRESS ========================= */
.admin-upload-progress {
  margin-top: 0.75rem;
}
.admin-upload-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--admin-bg);
  border-radius: 3px;
  overflow: hidden;
}
.admin-upload-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--admin-primary), #d4956a);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.admin-upload-progress-text {
  font-size: 0.8rem;
  color: var(--admin-text-muted);
  margin-top: 0.35rem;
  text-align: center;
}

/* ========================= IMAGE PREVIEW ========================= */
.admin-upload-preview {
  margin-top: 1rem;
  text-align: center;
  display: none;
}
.admin-upload-preview.visible {
  display: block;
}
.admin-upload-preview img {
  max-width: 280px;
  max-height: 200px;
  border-radius: var(--admin-radius);
  border: 2px solid var(--admin-border);
  object-fit: cover;
  box-shadow: var(--admin-shadow);
  animation: fadeInUp 0.3s ease-out;
}
.admin-upload-preview .preview-name {
  font-size: 0.8rem;
  color: var(--admin-text-muted);
  margin-top: 0.5rem;
}
.admin-upload-preview .preview-remove {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.5rem;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  background: var(--admin-danger);
  color: #fff;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.admin-upload-preview .preview-remove:hover {
  background: #dc2626;
}

/* ========================= DRAG & DROP REORDERING ========================= */
.admin-table tbody tr[draggable] {
  cursor: default;
  transition: background 0.15s, transform 0.15s, opacity 0.15s;
}
.admin-table tbody tr[draggable]:hover {
  background: rgba(184,115,51,0.03);
}
.drag-handle {
  width: 36px;
  text-align: center;
  color: #cbd5e1;
  cursor: grab;
  user-select: none;
  transition: color 0.2s;
}
.drag-handle:hover {
  color: var(--admin-primary);
}
.drag-handle:active {
  cursor: grabbing;
}
.admin-table tbody tr.dragging {
  opacity: 0.4;
  background: rgba(184,115,51,0.08);
}
.admin-table tbody tr.dragging > td {
  border-top: 2px solid var(--admin-primary);
}
.admin-table tbody tr.drag-over > td:first-child {
  border-top: 3px solid var(--admin-primary);
  background: rgba(184,115,51,0.06);
}
.admin-table tbody tr.drag-over > td {
  background: rgba(184,115,51,0.04);
}
/* ========================= IMAGE SELECTOR MODAL ========================= */
.admin-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(3px);
}
.admin-modal-overlay.visible {
  display: flex;
}
.admin-modal {
  background: var(--admin-card-bg);
  border-radius: var(--radius-lg, 1rem);
  width: 100%;
  max-width: 800px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
  animation: modalIn 0.3s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--admin-border);
}
.admin-modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--admin-text);
}
.admin-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--admin-bg);
  color: var(--admin-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.admin-modal-close:hover {
  background: var(--admin-danger);
  color: #fff;
}
.admin-modal-close svg {
  width: 18px;
  height: 18px;
}
.admin-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}
.admin-modal-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
}
.admin-modal-image-item {
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--admin-border);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.admin-modal-image-item:hover {
  border-color: var(--admin-primary);
  transform: translateY(-2px);
  box-shadow: var(--admin-shadow);
}
.admin-modal-image-item.selected {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(184,115,51,0.25);
}
.admin-modal-image-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
}
.admin-modal-image-item .modal-img-name {
  padding: 0.4rem;
  font-size: 0.65rem;
  color: var(--admin-text-muted);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-modal-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--admin-text-muted);
}
.admin-modal-empty svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  opacity: 0.3;
}

/* ========================= SERVER FILE MANAGER ========================= */
.server-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.server-stat {
  background: var(--admin-bg);
  border-radius: var(--admin-radius);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 120px;
}
.server-stat-count {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--admin-primary);
  line-height: 1;
}
.server-stat-label {
  font-size: 0.8rem;
  color: var(--admin-text-muted);
  margin-top: 0.25rem;
  font-weight: 600;
}
.server-stat-path {
  font-size: 0.65rem;
  color: #94a3b8;
  margin-top: 0.15rem;
  font-family: monospace;
  word-break: break-all;
  text-align: center;
}
.server-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--admin-border);
  margin-bottom: 1.25rem;
}
.server-tab {
  padding: 0.6rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--admin-text-muted);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
}
.server-tab:hover {
  color: var(--admin-text);
}
.server-tab.active {
  color: var(--admin-primary);
  border-bottom-color: var(--admin-primary);
}
.server-tab-count {
  background: var(--admin-bg);
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
}
.server-tab.active .server-tab-count {
  background: rgba(184,115,51,0.12);
  color: var(--admin-primary);
}
.server-tab-content {
  display: none;
}
.server-tab-content.active {
  display: block;
  animation: fadeInUp 0.3s ease-out;
}
.server-files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}
.server-file-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem;
  border: 2px solid var(--admin-border);
  border-radius: var(--admin-radius);
  background: var(--admin-card-bg);
  transition: all 0.2s;
}
.server-file-item:hover {
  border-color: var(--admin-primary);
  box-shadow: var(--admin-shadow);
}
.server-file-item.orphan {
  border-color: #fde68a;
  background: #fffbeb;
}
.server-file-item.orphan:hover {
  border-color: var(--admin-warning);
}
.server-file-thumb {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
}
.server-file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.server-file-badge {
  position: absolute;
  bottom: 2px;
  left: 2px;
  font-size: 0.5rem;
  font-weight: 700;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  line-height: 1;
  white-space: nowrap;
}
.orphan-badge {
  background: #f59e0b;
  color: #fff;
}
.db-badge {
  background: #22c55e;
  color: #fff;
}
.server-file-info {
  flex: 1;
  min-width: 0;
}
.server-file-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--admin-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.server-file-meta {
  display: flex;
  gap: 0.3rem;
  font-size: 0.7rem;
  color: var(--admin-text-muted);
  margin-top: 0.15rem;
}
.server-file-ext {
  font-weight: 700;
  color: var(--admin-primary);
}
.server-file-path {
  font-size: 0.65rem;
  font-family: monospace;
  color: #94a3b8;
  margin-top: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.server-file-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}
.server-file-actions button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.server-file-actions button svg {
  width: 14px;
  height: 14px;
}
.server-file-actions .btn-copy {
  background: rgba(0,0,0,0.5);
  color: #fff;
}
.server-file-actions .btn-copy:hover {
  background: var(--admin-primary);
}
.server-file-actions .btn-view {
  background: rgba(59,130,246,0.8);
  color: #fff;
}
.server-file-actions .btn-view:hover {
  background: var(--admin-info);
}
.server-file-actions .btn-delete-server {
  background: rgba(239,68,68,0.8);
  color: #fff;
}
.server-file-actions .btn-delete-server:hover {
  background: var(--admin-danger);
}

/* ========================= MOBILE REORDER BUTTONS ========================= */
.mobile-reorder-btns {
  display: none;
}
.drag-dots {
  display: inline-block;
}
.reorder-up,
.reorder-down {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid var(--admin-border);
  background: var(--admin-card-bg);
  color: var(--admin-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
}
.reorder-up svg,
.reorder-down svg {
  width: 18px;
  height: 18px;
}
.reorder-up:hover,
.reorder-down:hover {
  border-color: var(--admin-primary);
  color: var(--admin-primary);
  background: rgba(184,115,51,0.06);
}
.reorder-up:active,
.reorder-down:active {
  transform: scale(0.9);
}

/* ========================= RESPONSIVE / MOBILE ========================= */

/* ── Tablet (≤ 768px) ── */
@media (max-width: 768px) {
  /* Sidebar → off-canvas drawer */
  .admin-sidebar {
    transform: translateX(-100%);
    overflow-x: hidden;
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-sidebar-collapse {
    display: none;
  }
  .admin-main {
    margin-left: 0 !important;
  }
  .admin-sidebar-toggle {
    display: block;
  }
  .admin-header {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  .admin-page-title {
    font-size: 1rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .admin-header-user {
    margin-left: auto;
  }
  .admin-user-email {
    font-size: 0.7rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .admin-content {
    padding: 1rem;
  }
  /* Stats → 2 cols */
  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .admin-stat-card {
    padding: 1rem;
  }
  .admin-stat-value {
    font-size: 1.4rem;
  }
  /* Quick actions → 2 cols */
  .admin-quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
  /* Forms → single column */
  .admin-form-row {
    grid-template-columns: 1fr;
  }
  /* Tables → card layout */
  .admin-table-wrapper {
    overflow-x: visible;
  }
  .admin-table,
  .admin-table thead,
  .admin-table tbody,
  .admin-table th,
  .admin-table td,
  .admin-table tr {
    display: block;
  }
  .admin-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
  }
  .admin-table tbody tr {
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    margin-bottom: 0.75rem;
    padding: 0;
    box-shadow: var(--admin-shadow);
    position: relative;
    overflow: hidden;
  }
  .admin-table tbody tr:hover {
    transform: none;
  }
  .admin-table td {
    padding: 0.5rem 1rem;
    text-align: right;
    border-bottom: 1px solid var(--admin-border);
    position: relative;
    padding-left: 45%;
    min-height: 2.5rem;
  }
  .admin-table td:last-child {
    border-bottom: none;
  }
  .admin-table td[data-label]:not([data-label=""])::before {
    content: attr(data-label);
    position: absolute;
    left: 1rem;
    width: 40%;
    font-weight: 600;
    color: var(--admin-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: left;
    white-space: nowrap;
  }
  /* Drag handle row on mobile */
  .admin-table td.drag-handle {
    width: 100%;
    padding: 0.35rem 0.75rem;
    text-align: left;
    border-bottom: 1px dashed var(--admin-border);
    background: var(--admin-bg);
  }
  /* Search bar */
  .admin-search-bar {
    flex-direction: column;
    gap: 0.5rem;
  }
  .admin-search-input {
    min-width: 0;
    width: 100%;
  }
  .admin-search-bar .admin-btn {
    width: 100%;
  }
  /* Product form header */
  .admin-product-form-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  /* Upload zone */
  .admin-upload-zone {
    padding: 1.5rem 1rem;
  }
  .admin-upload-zone svg {
    width: 32px;
    height: 32px;
  }
  /* Image gallery grid */
  .admin-images-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
  }
  .admin-image-item img {
    height: 100px;
  }
  /* Pagination */
  .admin-pagination a,
  .admin-pagination span {
    min-width: 30px;
    height: 30px;
    font-size: 0.75rem;
  }
  /* Settings sections */
  .admin-settings-section h3 {
    font-size: 0.95rem;
  }
  /* Password form row */
  .password-wrapper {
    flex-wrap: nowrap;
  }
  /* Modals → full width on mobile */
  .admin-modal {
    max-width: 100%;
    max-height: 90vh;
    margin: 0.5rem;
  }
  .admin-modal-images {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
  }
  .admin-confirm-modal {
    max-width: 100%;
    margin: 0.5rem;
    padding: 1.5rem;
  }
  /* Hide tooltip on mobile */
  .admin-sidebar.collapsed .admin-nav-item::after {
    display: none;
  }
  /* Buttons stacked */
  .admin-btn {
    padding: 0.6rem 1rem;
  }
  .admin-btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
  }
  /* Role hint on users page */
  #roleHint {
    font-size: 0.8rem;
  }
}

/* ── Phone (≤ 480px) ── */
@media (max-width: 480px) {
  .admin-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .admin-stat-card {
    padding: 0.75rem;
    gap: 0.5rem;
  }
  .admin-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }
  .admin-stat-icon svg {
    width: 18px;
    height: 18px;
  }
  .admin-stat-value {
    font-size: 1.15rem;
  }
  .admin-stat-label {
    font-size: 0.7rem;
  }
  .admin-quick-actions {
    grid-template-columns: 1fr;
  }
  .admin-images-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .admin-content {
    padding: 0.75rem;
  }
  .admin-card {
    padding: 1rem;
  }
  .admin-page-title {
    font-size: 0.9rem;
  }
  .admin-header {
    padding: 0.6rem 0.75rem;
  }
  /* Table cards smaller on phone */
  .admin-table td {
    padding: 0.4rem 0.75rem;
    padding-left: 42%;
    font-size: 0.82rem;
  }
  .admin-table td::before {
    font-size: 0.68rem;
  }
  /* Confirm modal */
  .admin-confirm-modal {
    padding: 1.25rem;
  }
  .admin-confirm-modal .confirm-actions {
    flex-direction: column;
  }
  .admin-confirm-modal .confirm-actions .admin-btn {
    width: 100%;
  }
  /* User permissions legend */
  .admin-permissions-grid {
    grid-template-columns: 1fr !important;
  }
  /* Modals */
  .admin-modal-header {
    padding: 1rem;
  }
  .admin-modal-body {
    padding: 1rem;
  }
  .admin-modal-images {
    grid-template-columns: repeat(2, 1fr);
  }
  /* Mobile reorder buttons */
  .mobile-reorder-btns {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.35rem;
  }
  .drag-dots {
    display: none;
  }
  .admin-table td.drag-handle {
    padding-top: 0.5rem;
  }

  /* Server file manager */
  .server-stats {
    flex-direction: column;
    gap: 0.5rem;
  }
  .server-stat {
    flex-direction: row;
    gap: 0.5rem;
    min-width: 0;
  }
  .server-stat-path {
    display: none;
  }
  .server-files-grid {
    grid-template-columns: 1fr;
  }
  .server-file-thumb {
    width: 44px;
    height: 44px;
  }
  .server-file-actions {
    flex-direction: column;
  }
  .server-tab {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }
  /* Form buttons */
  [style*="display:flex"][style*="gap:0.5rem"] {
    flex-wrap: wrap;
  }
}
