:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #141414;
  --bg-card: #1a1a1a;
  --text-primary: #f5f5f5;
  --text-secondary: #a3a3a3;
  --accent: #f97316;
  --accent-rgb: 249, 115, 22;
  --accent-hover: #ea580c;
  --border: #262626;
  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --sidebar-width: 260px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: "Cairo", sans-serif;
  line-height: 1.65;
}

body.is-locked {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.login-overlay,
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(9px);
}

.login-overlay.is-visible,
.modal.is-open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.login-card,
.modal-card {
  border: 1px solid #303030;
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  box-shadow: var(--shadow);
  animation: modalSlide 0.25s ease;
}

.login-card {
  width: min(430px, 100%);
  padding: 38px;
  text-align: center;
}

.login-brand-mark {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 18px;
  background: rgba(var(--accent-rgb), 0.13);
  color: var(--accent);
  font-size: 1.8rem;
}

.eyebrow,
.section-header p,
.admin-topbar p {
  margin: 0;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
}

.login-card h1 {
  margin: 3px 0 4px;
  font-size: 2rem;
}

.login-card > p:not(.eyebrow) {
  margin: 0 0 24px;
  color: var(--text-secondary);
}

.back-store-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.back-store-link:hover {
  color: var(--accent);
}

.admin-shell {
  min-height: 100vh;
}

.admin-sidebar {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 70;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  border-inline-end: 0;
  border-inline-start: 1px solid var(--border);
  background: var(--bg-secondary);
}

.sidebar-brand {
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand > i {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}

.sidebar-brand strong {
  font-size: 1rem;
}

.sidebar-brand span {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
  padding: 22px 14px;
}

.nav-item,
.sidebar-footer button,
.sidebar-footer a {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 0;
  border-inline-start: 3px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  text-align: start;
  font-weight: 700;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.nav-item:hover,
.sidebar-footer button:hover,
.sidebar-footer a:hover {
  color: var(--text-primary);
  background: #1d1d1d;
}

.nav-item.is-active {
  border-inline-start-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.09);
  color: var(--accent);
}

.sidebar-footer {
  display: grid;
  gap: 7px;
  margin-top: auto;
  padding: 16px 14px 20px;
  border-top: 1px solid var(--border);
}

.sidebar-footer button:hover {
  color: var(--error);
}

.admin-main-wrapper {
  min-height: 100vh;
  margin-inline-start: var(--sidebar-width);
  margin-inline-end: 0;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 45;
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 16px 34px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(14px);
}

.admin-topbar h1 {
  margin: 1px 0 0;
  font-size: 1.55rem;
}

.current-date {
  margin-inline-start: auto;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.mobile-menu-button,
.icon-button,
.action-icon-button,
.password-toggle {
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: #1d1d1d;
  color: var(--text-primary);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.mobile-menu-button,
.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.mobile-menu-button {
  display: none;
}

.mobile-menu-button:hover,
.icon-button:hover,
.action-icon-button:hover,
.password-toggle:hover {
  border-color: #454545;
  background: #292929;
}

.admin-content {
  padding: 34px;
}

.admin-section {
  display: none;
}

.admin-section.is-active {
  display: block;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 25px;
}

.section-header h2 {
  margin: 3px 0 0;
  font-size: 2rem;
}

.primary-button,
.secondary-button,
.danger-button,
.text-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  transform: translateY(-1px);
  background: var(--accent-hover);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.secondary-button {
  border-color: var(--border);
  background: #202020;
  color: var(--text-primary);
}

.secondary-button:hover {
  border-color: #414141;
  background: #292929;
}

.danger-button {
  background: var(--error);
  color: #fff;
}

.danger-button:hover {
  background: #dc2626;
}

.text-button {
  min-height: auto;
  padding: 4px 0;
  background: transparent;
  color: var(--accent);
}

.full-width {
  width: 100%;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 23px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.stat-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 15px;
  background: rgba(var(--accent-rgb), 0.11);
  color: var(--accent);
  font-size: 1.25rem;
}

.stat-card strong,
.stat-card span {
  display: block;
}

.stat-card strong {
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  line-height: 1.2;
}

.stat-card span {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}

.panel-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th,
td {
  padding: 15px 17px;
  border-bottom: 1px solid var(--border);
  text-align: start;
  vertical-align: middle;
}

th {
  background: #111;
  color: #d8d8d8;
  font-size: 0.8rem;
  font-weight: 800;
}

tbody tr:nth-child(even):not(.expanded-order-row) {
  background: rgba(255, 255, 255, 0.012);
}

tbody tr:hover:not(.expanded-order-row) {
  background: rgba(var(--accent-rgb), 0.035);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.table-empty {
  padding: 40px 20px;
  color: var(--text-secondary);
  text-align: center;
}

.product-table-image {
  width: 55px;
  height: 55px;
  overflow: hidden;
  border-radius: 10px;
  background: #111;
}

.product-table-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-icon-button {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.action-icon-button.edit:hover {
  color: var(--accent);
}

.action-icon-button.delete:hover {
  color: var(--error);
}

.status-badge,
.status-select {
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.78rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
}

.status-new {
  background: rgba(59, 130, 246, 0.14);
  color: #60a5fa;
}

.status-processing {
  background: rgba(245, 158, 11, 0.14);
  color: var(--warning);
}

.status-shipped {
  background: rgba(34, 197, 94, 0.14);
  color: var(--success);
}

.status-cancelled {
  background: rgba(239, 68, 68, 0.14);
  color: var(--error);
}

.status-select {
  min-width: 128px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  outline: none;
  background: #121212;
  color: var(--text-primary);
}

.expand-products-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 800;
}

.expanded-order-row {
  background: #101010;
}

.expanded-order-row td {
  padding: 0;
}

.expanded-content {
  padding: 17px 22px 20px;
}

.expanded-content strong {
  display: block;
  margin-bottom: 10px;
}

.expanded-content ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.expanded-content li {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: #d0d0d0;
  font-size: 0.88rem;
}

.settings-form {
  max-width: 900px;
  padding: 26px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.settings-wide {
  grid-column: 1 / -1;
}

.settings-actions {
  display: flex;
  gap: 12px;
  margin-top: 25px;
  flex-wrap: wrap;
}

.form-group {
  min-width: 0;
  text-align: start;
}

.form-group label,
.images-fieldset legend {
  display: block;
  margin-bottom: 8px;
  color: #ececec;
  font-weight: 700;
}

.form-group input,
.form-group select,
.form-group textarea,
.image-url-input {
  width: 100%;
  min-height: 49px;
  padding: 10px 13px;
  border: 1px solid #363636;
  border-radius: 10px;
  outline: none;
  background: #111;
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group textarea {
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #666;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.image-url-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.13);
}

.form-group input.is-invalid,
.form-group textarea.is-invalid {
  border-color: var(--error);
}

.field-error {
  min-height: 20px;
  display: block;
  margin-top: 4px;
  color: var(--error);
  font-size: 0.78rem;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-inline-end: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  inset-inline-end: 8px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  transform: translateY(-50%);
}

.password-toggle:hover {
  transform: translateY(-50%);
}

.modal-card {
  width: min(760px, 100%);
  max-height: calc(100vh - 44px);
  overflow-y: auto;
}

.product-form-card {
  padding-bottom: 0;
}

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

.modal-header h2 {
  margin: 3px 0 0;
  font-size: 1.55rem;
}

#product-form {
  padding: 25px 26px 27px;
}

.images-fieldset {
  margin: 22px 0 0;
  padding: 0;
  border: 0;
}

.images-fieldset-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 15px;
  padding: 11px 13px;
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  border-radius: 11px;
  background: rgba(var(--accent-rgb), 0.07);
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.images-fieldset-note i {
  margin-top: 4px;
  color: var(--accent);
}

.image-field-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 15px;
  align-items: center;
  margin-bottom: 13px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.018);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.image-field-row:focus-within {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(var(--accent-rgb), 0.035);
}

.image-preview {
  position: relative;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #3a3a3a;
  border-radius: 13px;
  background: #101010;
  color: #5c5c5c;
  font-size: 1.35rem;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-slot-number {
  position: absolute;
  top: 6px;
  inset-inline-start: 6px;
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
}

.image-loading-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.62);
  color: var(--accent);
  font-size: 1.3rem;
}

.image-input-wrap label:not(.image-upload-button) {
  display: block;
  margin-bottom: 7px;
  font-size: 0.86rem;
  font-weight: 700;
}

.required-mark {
  color: var(--error);
}

.image-upload-controls {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.image-upload-button,
.image-remove-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 800;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.image-upload-button {
  border: 1px solid rgba(var(--accent-rgb), 0.42);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  cursor: pointer;
}

.image-upload-button:hover {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.17);
  transform: translateY(-1px);
}

.image-remove-button {
  border: 1px solid rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  cursor: pointer;
}

.image-remove-button:hover:not(:disabled) {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.14);
  transform: translateY(-1px);
}

.image-remove-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.image-file-name {
  display: block;
  margin-top: 7px;
  color: var(--text-secondary);
  font-size: 0.74rem;
  overflow-wrap: anywhere;
}

.image-slot-error,
.product-images-error {
  min-height: 0;
}

.product-images-error:not(:empty) {
  display: block;
  margin-top: 9px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.modal-actions {
  display: flex;
  gap: 11px;
  justify-content: flex-end;
  margin-top: 25px;
  flex-wrap: wrap;
}

.confirmation-card {
  width: min(470px, 100%);
  padding: 34px;
  text-align: center;
}

.confirmation-icon {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  margin: 0 auto 17px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.13);
  color: var(--error);
  font-size: 1.6rem;
}

.confirmation-card h2 {
  margin: 0;
  font-size: 1.5rem;
}

.confirmation-card p {
  margin: 9px 0 0;
  color: var(--text-secondary);
}

.confirmation-card .modal-actions {
  justify-content: center;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 65;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.toast-container {
  position: fixed;
  top: 24px;
  inset-inline-end: 24px;
  z-index: 200;
  width: min(360px, calc(100% - 48px));
  display: grid;
  gap: 10px;
}

.toast {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 25px;
  gap: 10px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-inline-start-width: 4px;
  border-radius: 11px;
  background: #191919;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  animation: toastIn 0.3s ease;
}

.toast.is-leaving {
  animation: toastOut 0.24s ease forwards;
}

.toast-success { border-inline-start-color: var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-error { border-inline-start-color: var(--error); }
.toast-error .toast-icon { color: var(--error); }
.toast-warning { border-inline-start-color: var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-close { border: 0; background: transparent; color: var(--text-secondary); }

.shake {
  animation: shake 0.35s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlide {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

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

@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

@media (max-width: 1050px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .admin-sidebar {
    width: min(300px, 86vw);
    transform: translateX(105%);
    transition: transform 0.28s ease;
  }

  .admin-sidebar.is-open {
    transform: translateX(0);
  }

  .admin-main-wrapper {
    margin-inline-start: 0;
    margin-inline-end: 0;
  }

  .mobile-menu-button {
    display: grid;
  }

  .admin-content {
    padding: 24px 18px;
  }

  .admin-topbar {
    padding-inline: 18px;
  }

  .current-date {
    display: none;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-wide {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .login-overlay,
  .modal {
    align-items: flex-end;
    padding: 0;
  }

  .login-card,
  .modal-card {
    width: 100%;
    max-height: 94vh;
    border-radius: 23px 23px 0 0;
  }

  .login-card {
    padding: 30px 22px;
  }

  .section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .section-header .primary-button {
    width: 100%;
  }

  .admin-topbar h1 {
    font-size: 1.25rem;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-form {
    padding: 20px;
  }

  .settings-actions > * {
    width: 100%;
  }

  .image-field-row {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 11px;
    padding: 10px;
  }

  .image-preview {
    width: 72px;
    height: 72px;
  }

  .image-upload-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .image-upload-button,
  .image-remove-button {
    width: 100%;
  }

  .modal-actions > * {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


.action-icon-button.view,
.action-icon-button.copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
}

.action-icon-button.view:hover,
.action-icon-button.copy:hover {
  border-color: rgba(var(--accent-rgb), 0.38);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
}

.order-delivery-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.order-delivery-details p {
  margin: 0;
  padding: 12px;
  border: 1px solid #2e2e2e;
  border-radius: 10px;
  background: #151515;
}

.order-delivery-details span,
.order-delivery-details strong {
  display: block;
}

.order-delivery-details span {
  margin-bottom: 3px;
  color: var(--text-secondary);
  font-size: 0.74rem;
}

.order-delivery-details strong {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .order-delivery-details {
    grid-template-columns: 1fr;
  }
}

/* عناصر إعدادات المظهر والتوصيل */
.setting-help {
  display: block;
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.settings-subheading {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.055);
}

.settings-subheading > div {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-primary);
}

.settings-subheading i {
  color: var(--accent);
}

.settings-subheading p {
  margin: 5px 0 0;
  color: var(--text-secondary);
  font-size: 0.77rem;
}

.price-input-wrap {
  position: relative;
}

.price-input-wrap input {
  padding-inline-end: 58px;
}

.price-input-wrap span {
  position: absolute;
  top: 50%;
  inset-inline-end: 13px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  transform: translateY(-50%);
  pointer-events: none;
}

/* الوضع النهاري للوحة التحكم */
html[data-theme="light"] {
  color-scheme: light;
  --bg-primary: #f4f6f8;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #171717;
  --text-secondary: #62666d;
  --border: #dfe3e8;
  --shadow: 0 18px 50px rgba(17, 24, 39, 0.1);
}

html[data-theme="light"] .login-overlay,
html[data-theme="light"] .modal {
  background: rgba(27, 33, 41, 0.52);
}

html[data-theme="light"] .admin-topbar {
  background: rgba(255, 255, 255, 0.92);
}

html[data-theme="light"] .nav-item:hover,
html[data-theme="light"] .sidebar-footer button:hover,
html[data-theme="light"] .sidebar-footer a:hover,
html[data-theme="light"] .mobile-menu-button,
html[data-theme="light"] .icon-button,
html[data-theme="light"] .action-icon-button,
html[data-theme="light"] .password-toggle,
html[data-theme="light"] .secondary-button {
  background: #f1f3f5;
  color: #31353a;
}

html[data-theme="light"] th,
html[data-theme="light"] .expanded-order-row,
html[data-theme="light"] .product-table-image,
html[data-theme="light"] .image-preview {
  background: #f3f5f7;
  color: #2c3035;
}

html[data-theme="light"] tbody tr:nth-child(even):not(.expanded-order-row) {
  background: #fafbfc;
}

html[data-theme="light"] tbody tr:hover:not(.expanded-order-row) {
  background: rgba(var(--accent-rgb), 0.055);
}

html[data-theme="light"] .form-group label,
html[data-theme="light"] .images-fieldset legend {
  color: #292d32;
}

html[data-theme="light"] .form-group input,
html[data-theme="light"] .form-group select,
html[data-theme="light"] .form-group textarea,
html[data-theme="light"] .image-url-input,
html[data-theme="light"] .status-select,
html[data-theme="light"] .order-delivery-details p {
  border-color: var(--border);
  background: #f8f9fb;
  color: var(--text-primary);
}

html[data-theme="light"] .form-group input:focus,
html[data-theme="light"] .form-group select:focus,
html[data-theme="light"] .form-group textarea:focus,
html[data-theme="light"] .image-url-input:focus {
  background: #ffffff;
}

html[data-theme="light"] .expanded-content li,
html[data-theme="light"] .order-delivery-details strong {
  color: #33383e;
}

html[data-theme="light"] .image-field-row {
  background: #fbfcfd;
}

html[data-theme="light"] .image-field-row:focus-within {
  background: rgba(var(--accent-rgb), 0.045);
}

html[data-theme="light"] .images-fieldset-note {
  background: rgba(var(--accent-rgb), 0.055);
}

html[data-theme="light"] .image-upload-button {
  background: rgba(var(--accent-rgb), 0.075);
}

html[data-theme="light"] .image-remove-button {
  background: rgba(239, 68, 68, 0.055);
}

html[data-theme="light"] .toast {
  background: #ffffff;
}

html[data-theme="light"] .sidebar-overlay {
  background: rgba(31, 36, 43, 0.42);
}

/* إعدادات المتجر الديناميكية */
.sidebar-brand-icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent);
}

.sidebar-brand-logo,
.login-brand-logo {
  display: block;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.09);
}

.sidebar-brand-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}

.login-brand-logo {
  width: 74px;
  height: 74px;
  margin: 0 auto 12px;
}

.appearance-panel,
.settings-panel {
  width: 100%;
  max-width: 1120px;
  margin-bottom: 20px;
  padding: 24px;
}

.appearance-panel {
  border-color: rgba(var(--accent-rgb), 0.4);
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.09), var(--bg-card) 50%);
}

.settings-form {
  width: 100%;
  max-width: 1120px;
  padding: 0;
  border: 0;
  background: transparent;
}

.settings-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 22px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--border);
}

.settings-card-heading h3,
.settings-card-heading p {
  margin: 0;
}

.settings-card-heading h3 {
  color: var(--text-primary);
  font-size: 1.05rem;
}

.settings-card-heading p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.settings-card-icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
}

.appearance-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(260px, 1.3fr) auto;
  align-items: end;
  gap: 18px;
}

.save-appearance-button {
  min-height: 49px;
  white-space: nowrap;
}

.color-field {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 9px;
}

.color-field input[type="color"] {
  min-height: 49px;
  padding: 5px;
  cursor: pointer;
}

.color-field input[type="text"] {
  direction: ltr;
  text-align: left;
}

.trust-settings-grid,
.delivery-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.delivery-settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.trust-settings-grid fieldset,
.delivery-settings-grid fieldset {
  min-width: 0;
  margin: 0;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.018);
}

.trust-settings-grid legend,
.delivery-settings-grid legend {
  padding: 0 8px;
  color: var(--accent);
  font-weight: 900;
}

.trust-settings-grid label,
.delivery-settings-grid label {
  display: block;
  margin: 10px 0 6px;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 700;
}

.trust-settings-grid input,
.delivery-settings-grid input {
  width: 100%;
  min-height: 47px;
  padding: 9px 12px;
  border: 1px solid #363636;
  border-radius: 10px;
  outline: none;
  background: #111;
  color: var(--text-primary);
}

.setting-preview {
  display: flex;
  min-height: 74px;
  margin-top: 10px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--text-secondary);
}

.setting-preview img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 10px;
}

.setting-preview i {
  width: 52px;
  text-align: center;
  color: var(--accent);
  font-size: 1.5rem;
}

.hero-image-preview {
  min-height: 180px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px dashed var(--border);
  border-radius: 13px;
  background-position: center;
  background-size: cover;
  color: var(--text-secondary);
}

.sticky-settings-save {
  position: sticky;
  bottom: 14px;
  z-index: 25;
  display: flex;
  justify-content: flex-start;
  max-width: 1120px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(20, 20, 20, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(15px);
}

html[data-theme="light"] .trust-settings-grid fieldset,
html[data-theme="light"] .delivery-settings-grid fieldset {
  background: #fafbfc;
}

html[data-theme="light"] .trust-settings-grid input,
html[data-theme="light"] .delivery-settings-grid input {
  border-color: var(--border);
  background: #f8f9fb;
  color: var(--text-primary);
}

html[data-theme="light"] .sticky-settings-save {
  background: rgba(255, 255, 255, 0.94);
}

@media (max-width: 900px) {
  .appearance-grid {
    grid-template-columns: 1fr 1fr;
  }

  .save-appearance-button {
    grid-column: 1 / -1;
  }

  .trust-settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .appearance-panel,
  .settings-panel {
    padding: 18px;
  }

  .appearance-grid,
  .delivery-settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-card-heading {
    align-items: center;
  }

  .sticky-settings-save {
    bottom: 8px;
  }

  .sticky-settings-save .primary-button {
    width: 100%;
  }
}

/* تلوين صفوف الطلبات حسب الحالة */
.order-row,
.order-detail-row {
  --order-row-rgb: 59, 130, 246;
  --order-row-color: #60a5fa;
}

.order-row > td,
.order-detail-row > td {
  background-color: rgba(var(--order-row-rgb), 0.075);
  transition: background-color 0.22s ease, box-shadow 0.22s ease;
}

.order-row > td:first-child {
  box-shadow: inset -4px 0 0 var(--order-row-color);
}

.order-row:hover > td {
  background-color: rgba(var(--order-row-rgb), 0.14);
}

.order-detail-row > td {
  background-color: rgba(var(--order-row-rgb), 0.055);
}

.order-detail-row .expanded-content {
  border-top: 1px solid rgba(var(--order-row-rgb), 0.22);
}

.order-row-new,
.order-detail-row.order-row-new {
  --order-row-rgb: 59, 130, 246;
  --order-row-color: #3b82f6;
}

.order-row-processing,
.order-detail-row.order-row-processing {
  --order-row-rgb: 245, 158, 11;
  --order-row-color: #f59e0b;
}

.order-row-shipped,
.order-detail-row.order-row-shipped {
  --order-row-rgb: 20, 184, 166;
  --order-row-color: #14b8a6;
}

.order-row-completed,
.order-detail-row.order-row-completed {
  --order-row-rgb: 34, 197, 94;
  --order-row-color: #22c55e;
}

.order-row-cancelled,
.order-detail-row.order-row-cancelled {
  --order-row-rgb: 239, 68, 68;
  --order-row-color: #ef4444;
}

.status-completed {
  background: rgba(34, 197, 94, 0.14);
  color: var(--success);
}

.status-select.status-new {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
}

.status-select.status-processing {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
}

.status-select.status-shipped {
  border-color: rgba(20, 184, 166, 0.45);
  background: rgba(20, 184, 166, 0.12);
  color: #2dd4bf;
}

.status-select.status-completed {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

.status-select.status-cancelled {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
  color: var(--error);
}

html[data-theme="light"] .order-row > td,
html[data-theme="light"] .order-detail-row > td {
  background-color: rgba(var(--order-row-rgb), 0.09);
}

html[data-theme="light"] .order-row:hover > td {
  background-color: rgba(var(--order-row-rgb), 0.16);
}

html[data-theme="light"] .status-select.status-new,
html[data-theme="light"] .status-select.status-processing,
html[data-theme="light"] .status-select.status-shipped,
html[data-theme="light"] .status-select.status-completed,
html[data-theme="light"] .status-select.status-cancelled {
  background-color: rgba(var(--order-row-rgb, 59, 130, 246), 0.1);
}

/* قسم أسعار التوصيل حسب الولاية */
.delivery-prices-intro,
.delivery-prices-panel {
  max-width: none;
}

.delivery-bulk-tools {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto;
  gap: 16px;
  align-items: end;
  margin-top: 22px;
}

.delivery-bulk-tools .form-group {
  margin: 0;
}

.delivery-bulk-tools .secondary-button {
  min-height: 49px;
  white-space: nowrap;
}

.delivery-bulk-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 15px 0 0;
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.delivery-bulk-note i {
  color: var(--accent);
}

.delivery-prices-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.delivery-search-field {
  position: relative;
  width: min(100%, 430px);
}

.delivery-search-field i {
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}

.delivery-search-field input {
  width: 100%;
  min-height: 48px;
  padding: 10px 43px 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  background: var(--bg-input, #111);
  color: var(--text-primary);
}

.delivery-search-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.13);
}

#delivery-prices-count {
  flex: 0 0 auto;
  padding: 8px 13px;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.09);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
}

.delivery-prices-table-wrapper {
  max-height: 640px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.delivery-prices-table {
  min-width: 720px;
}

.delivery-prices-table thead {
  position: sticky;
  top: 0;
  z-index: 3;
}

.delivery-prices-table th:nth-child(1) {
  width: 85px;
}

.delivery-prices-table th:nth-child(2) {
  min-width: 190px;
}

.delivery-prices-table tr {
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.delivery-prices-table tr.is-edited {
  background: rgba(var(--accent-rgb), 0.07);
  box-shadow: inset -3px 0 0 var(--accent);
}

.wilaya-number-badge {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 11px;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  font-weight: 900;
}

.wilaya-name {
  color: var(--text-primary);
  font-size: 0.95rem;
}

.delivery-price-field {
  display: flex;
  min-width: 170px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg-input, #111);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.delivery-price-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.delivery-price-field input {
  width: 100%;
  min-width: 0;
  min-height: 45px;
  padding: 8px 12px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-weight: 800;
  text-align: center;
}

.delivery-price-field input.is-invalid {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.delivery-price-field span {
  align-self: stretch;
  display: inline-flex;
  min-width: 52px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-right: 1px solid var(--border);
  background: rgba(var(--accent-rgb), 0.07);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.sticky-delivery-save {
  position: sticky;
  bottom: 14px;
  z-index: 25;
  display: flex;
  max-width: none;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(20, 20, 20, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(15px);
}

.sticky-delivery-save div {
  display: grid;
  gap: 2px;
}

.sticky-delivery-save strong {
  color: var(--text-primary);
}

.sticky-delivery-save span {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

html[data-theme="light"] .delivery-search-field input,
html[data-theme="light"] .delivery-price-field {
  background: #fff;
}

html[data-theme="light"] .sticky-delivery-save {
  background: rgba(255, 255, 255, 0.95);
}

@media (max-width: 900px) {
  .delivery-bulk-tools {
    grid-template-columns: 1fr 1fr;
  }

  .delivery-bulk-tools .secondary-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .delivery-bulk-tools {
    grid-template-columns: 1fr;
  }

  .delivery-bulk-tools .secondary-button {
    grid-column: auto;
  }

  .delivery-prices-toolbar,
  .sticky-delivery-save {
    align-items: stretch;
    flex-direction: column;
  }

  .delivery-search-field {
    width: 100%;
  }

  #delivery-prices-count {
    align-self: flex-start;
  }

  .sticky-delivery-save .primary-button {
    width: 100%;
  }
}


/* إدارة أرشفة وحذف الطلبات */
.orders-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 14px 16px;
}

.orders-toolbar p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.order-view-tabs {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.order-view-tab {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 13px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 800;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.order-view-tab span {
  min-width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
}

.order-view-tab.is-active {
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.28);
}

.order-view-tab.is-active span {
  background: var(--accent);
  color: #fff;
}

.order-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.order-action-button {
  min-height: 35px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-primary);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.order-action-button:hover {
  transform: translateY(-1px);
}

.order-action-button.archive:hover {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
}

.order-action-button.restore:hover {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

.order-action-button.delete:hover {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.12);
  color: var(--error);
}

.order-row.is-archived > td,
.order-detail-row.is-archived > td {
  filter: saturate(0.72);
}

.status-select:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.archive-confirm-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 18px;
  border: 1px solid rgba(245, 158, 11, 0.5);
  border-radius: 11px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  font-weight: 800;
}

.archive-confirm-button:hover {
  background: var(--warning);
  color: #111;
}

.order-action-icon.archive {
  color: var(--warning);
  background: rgba(245, 158, 11, 0.12);
}

.order-action-icon.restore {
  color: var(--success);
  background: rgba(34, 197, 94, 0.12);
}

.order-action-icon.delete {
  color: var(--error);
  background: rgba(239, 68, 68, 0.12);
}

html[data-theme="light"] .order-view-tabs,
html[data-theme="light"] .order-action-button {
  background: rgba(15, 23, 42, 0.025);
}

@media (max-width: 900px) {
  .orders-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .order-view-tabs {
    width: 100%;
  }

  .order-view-tab {
    flex: 1;
  }
}

@media (max-width: 560px) {
  .order-view-tab {
    padding-inline: 9px;
    font-size: 0.76rem;
  }

  .order-action-button span {
    display: none;
  }

  .order-action-button {
    width: 35px;
    padding: 6px;
  }
}

/* رفع هوية المتجر ومؤشر المزامنة */
.topbar-status-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-inline-start: auto;
}

.topbar-status-wrap .current-date {
  margin-inline-start: 0;
}

.sync-status {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.sync-status.is-online {
  border-color: rgba(34, 197, 94, 0.34);
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.sync-status.is-checking {
  border-color: rgba(var(--accent-rgb), 0.34);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
}

.sync-status.is-local {
  border-color: rgba(245, 158, 11, 0.34);
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.sync-status.is-error {
  border-color: rgba(239, 68, 68, 0.34);
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.settings-image-uploader {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.018);
}

.settings-image-uploader.compact {
  grid-template-columns: 150px minmax(0, 1fr);
}

.settings-image-uploader.hero {
  grid-template-columns: minmax(280px, 440px) minmax(0, 1fr);
}

.settings-image-uploader.hero .hero-image-preview {
  width: 100%;
  min-height: 230px;
  margin-top: 0;
  background-color: var(--bg-secondary);
  background-position: center;
  background-size: cover;
}

.brand-image-preview,
.favicon-image-preview {
  min-height: 112px;
  margin-top: 0;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  background: var(--bg-secondary);
}

.brand-image-preview img {
  width: min(180px, 100%);
  height: 82px;
  object-fit: contain;
}

.favicon-image-preview img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.settings-image-actions {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-image-actions small {
  flex-basis: 100%;
  color: var(--text-secondary);
  line-height: 1.7;
}

@media (max-width: 760px) {
  .topbar-status-wrap {
    margin-inline-start: auto;
  }

  .sync-status span {
    display: none;
  }

  .sync-status {
    width: 36px;
    min-height: 36px;
    justify-content: center;
    padding: 0;
  }

  .settings-image-uploader,
  .settings-image-uploader.compact,
  .settings-image-uploader.hero {
    grid-template-columns: 1fr;
  }

  .settings-image-actions,
  .settings-image-actions .image-upload-button,
  .settings-image-actions .image-remove-button {
    width: 100%;
  }
}
