/* ==========================================================================
   Rawty Pola — design tokens
   Palette is taken from the logo: a deep forest green on near-white paper,
   with a soft mint used only for selected states.
   ========================================================================== */

:root {
  --green-900: #123a25;
  --green-700: #1f5c3b;
  --green-600: #2f6b4f;
  --green-500: #3d8060;
  --mint-100: #e8f1ec;
  --mint-200: #d4e6da;

  --bg: #f2f4f3;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --border: #e4e9e6;
  --border-strong: #d3dbd7;
  --text: #17211c;
  --text-muted: #6a7a72;
  --text-faint: #9aa8a1;

  --danger: #b4322c;
  --danger-soft: #fbeceb;
  --warn: #9a6a12;
  --warn-soft: #fbf3e2;
  --info: #2b5c8a;
  --info-soft: #eaf1f8;
  --ok: #256b45;
  --ok-soft: #e6f2eb;

  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 9px;

  --shadow-sm: 0 1px 2px rgba(19, 40, 30, 0.05);
  --shadow: 0 6px 24px rgba(19, 40, 30, 0.07);
  --shadow-lg: 0 24px 60px rgba(19, 40, 30, 0.18);

  --sidebar-w: 264px;
  --gap: 14px;

  /* Per-user text scaling. Every size below is in rem, so changing this one
     number resizes all text without disturbing the layout's spacing. */
  --font-scale: 1;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic",
    "Noto Kufi Arabic", Tahoma, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

html[data-theme="dark"] {
  --bg: #0d1310;
  --surface: #151d18;
  --surface-2: #1a231e;
  --border: #26312b;
  --border-strong: #33413a;
  --text: #e7efe9;
  --text-muted: #99aaa1;
  --text-faint: #6f8078;

  --mint-100: #1e3129;
  --mint-200: #274038;
  --green-600: #4c9370;
  --green-700: #3d8060;

  --danger-soft: #33201f;
  --warn-soft: #322a1a;
  --info-soft: #1c2a37;
  --ok-soft: #1b2f24;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
}

/* ============================================================ base reset */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  font-size: calc(16px * var(--font-scale));
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9375rem; /* 15px at 100% */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

h1 {
  font-size: 1.65rem;
}
h2 {
  font-size: 1.15rem;
}
h3 {
  font-size: 1rem;
}

p {
  margin: 0;
}

a {
  color: var(--green-600);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--green-600);
  outline-offset: 2px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ================================================================= boot */

.boot {
  display: grid;
  place-items: center;
  height: 100vh;
}

.boot__mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--green-700);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.06em;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

/* =============================================================== layout */

.app-root {
  min-height: 100vh;
}

.shell {
  display: flex;
  gap: var(--gap);
  padding: var(--gap);
  min-height: 100vh;
  align-items: stretch;
}

/* ------------------------------------------------------------- sidebar */

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--gap);
  height: calc(100vh - var(--gap) * 2);
  transition: width 0.18s ease, flex-basis 0.18s ease;
}

.shell.is-collapsed .sidebar {
  --sidebar-w: 78px;
}

.sidebar__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px;
  border-bottom: 1px solid var(--border);
}

.avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
  background: var(--green-700);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.95rem;
}

/* Profile picture in the sidebar corner. */
.avatar--img {
  object-fit: cover;
  background: var(--surface-2);
}

/* Upload/remove block in the user edit form. */
.avatar-edit {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar-edit__pic {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--green-700);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.25rem;
}

.avatar-edit__pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-edit__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar__id {
  min-width: 0;
  flex: 1;
}

.sidebar__name {
  font-weight: 650;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__role {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: inline-grid;
  place-items: center;
  line-height: 0;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar__foot {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-group {
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 16px 12px 6px;
  font-weight: 650;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  color: var(--text-muted);
  font-weight: 550;
  font-size: 0.93rem;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: start;
  font-family: inherit;
  white-space: nowrap;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.nav-item.is-active {
  background: var(--mint-100);
  color: var(--green-700);
}

html[data-theme="dark"] .nav-item.is-active {
  color: #a7d6bd;
}

.nav-item svg {
  flex: 0 0 19px;
  width: 19px;
  height: 19px;
}

.nav-item__badge {
  margin-inline-start: auto;
  background: var(--green-700);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}

.shell.is-collapsed .nav-item__label,
.shell.is-collapsed .sidebar__id,
.shell.is-collapsed .nav-group {
  display: none;
}

.shell.is-collapsed .nav-item {
  justify-content: center;
}

.shell.is-collapsed .nav-item__badge {
  position: absolute;
  transform: translate(14px, -12px);
  margin: 0;
}

.shell.is-collapsed .nav-item {
  position: relative;
}

/* ---------------------------------------------------------------- main */

.main {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.topbar__brand strong {
  color: var(--text);
  font-weight: 650;
}

.topbar__spacer {
  flex: 1;
}

.bell {
  position: relative;
}

.bell__dot {
  position: absolute;
  top: 2px;
  inset-inline-end: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}

.view {
  padding: 26px 26px 34px;
  flex: 1;
  overflow-y: auto;
}

.page-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.page-head__text {
  flex: 1;
  min-width: 220px;
}

.page-head__sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* =========================================================== components */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 11px;
  border: 1px solid transparent;
  padding: 9px 16px;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  background: var(--green-700);
  color: #fff;
  transition: background 0.14s ease, transform 0.06s ease;
  white-space: nowrap;
}

.btn:hover {
  background: var(--green-600);
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn--ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn--ghost:hover {
  background: var(--surface-2);
}

.btn--quiet {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
  padding: 7px 10px;
}

.btn--quiet:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn--danger {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--danger);
}

.btn--danger:hover {
  background: var(--danger-soft);
}

.btn--sm {
  padding: 6px 11px;
  font-size: 0.83rem;
  border-radius: 9px;
}

.btn--block {
  width: 100%;
}

.field {
  display: block;
  margin-bottom: 15px;
}

.field__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.field__label span {
  color: var(--text-faint);
  font-weight: 400;
}

.field__hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 5px;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: 11px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.92rem;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px var(--mint-100);
}

.textarea {
  min-height: 92px;
  resize: vertical;
}

.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-inline-end: 32px;
}

html[dir="rtl"] .select {
  background-position: 12px 50%, 17px 50%;
  background-image: linear-gradient(135deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(45deg, var(--text-muted) 50%, transparent 50%);
}

/* switch --------------------------------------------------------------- */

.switch {
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  user-select: none;
}

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

.switch__track {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--border-strong);
  position: relative;
  transition: background 0.16s ease;
  flex: 0 0 42px;
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease;
}

.switch input:checked + .switch__track {
  background: var(--green-700);
}

.switch input:checked + .switch__track::after {
  transform: translateX(18px);
}

html[dir="rtl"] .switch input:checked + .switch__track::after {
  transform: translateX(-18px);
}

.switch input:focus-visible + .switch__track {
  outline: 2px solid var(--green-600);
  outline-offset: 2px;
}

/* date field with calendar button --------------------------------------
   The native picker indicator is made transparent and stretched over our
   own icon, so a click anywhere on the icon opens the browser's calendar
   even where showPicker() isn't supported.                                */

.date-field {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.date-field .input {
  padding-inline-end: 40px;
  cursor: pointer;
  min-width: 168px;
}

.date-field__icon {
  position: absolute;
  inset-inline-end: 12px;
  color: var(--text-muted);
  pointer-events: none;
  display: grid;
  place-items: center;
  line-height: 0;
}

.date-field .input:focus + .date-field__icon,
.date-field:hover .date-field__icon {
  color: var(--green-600);
}

.date-field input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  width: 40px;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.date-field input[type="date"]::-webkit-inner-spin-button,
.date-field input[type="date"]::-webkit-clear-button {
  display: none;
}

.date-field input[type="date"] {
  appearance: none;
}

/* toolbar -------------------------------------------------------------- */

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}

.toolbar .input,
.toolbar .select {
  width: auto;
}

.search {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 380px;
}

.search .input {
  width: 100%;
  padding-inline-start: 36px;
}

.search svg {
  position: absolute;
  inset-inline-start: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}

/* cards & tables ------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.card--flat {
  background: var(--surface-2);
}

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

.stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 16px;
}

.stat__label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 550;
}

.stat__value {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 3px;
}

/* -------------------------------------------------- colorful dashboard cards
   An optional, brighter treatment for the stat cards. Toggled by the admin;
   the plain cards above stay the default fallback. Each card gets its own
   accent via an --accent / --accent-soft pair set per position below. */
.stat-grid--colorful .stat {
  position: relative;
  overflow: hidden;
  border: none;
  color: #fff;
  background: linear-gradient(135deg, var(--accent, var(--green-600)), var(--accent-strong, var(--green-700)));
  box-shadow: 0 10px 24px -12px var(--accent, var(--green-600));
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-grid--colorful .stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -12px var(--accent, var(--green-600));
}

/* A soft decorative circle in the corner for a bit of depth. */
.stat-grid--colorful .stat::after {
  content: '';
  position: absolute;
  inset-inline-end: -24px;
  top: -24px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.stat-grid--colorful .stat__label {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.stat-grid--colorful .stat__value {
  color: #fff;
  position: relative;
  z-index: 1;
}

/* Per-card accent colours, cycling through a friendly palette. */
.stat-grid--colorful .stat:nth-child(6n + 1) { --accent: #2f7d5b; --accent-strong: #1f5c3b; }
.stat-grid--colorful .stat:nth-child(6n + 2) { --accent: #2f79c4; --accent-strong: #205694; }
.stat-grid--colorful .stat:nth-child(6n + 3) { --accent: #d9843c; --accent-strong: #b5661f; }
.stat-grid--colorful .stat:nth-child(6n + 4) { --accent: #7b56c9; --accent-strong: #5a3aa0; }
.stat-grid--colorful .stat:nth-child(6n + 5) { --accent: #2fa3a3; --accent-strong: #1f7d7d; }
.stat-grid--colorful .stat:nth-child(6n + 6) { --accent: #c94f7c; --accent-strong: #9e3459; }

/* The style toggle row above the cards. */
.dash-style-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 550;
}

.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

table.data th {
  text-align: start;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 650;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.data td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

table.data tr:last-child td {
  border-bottom: none;
}

table.data tbody tr.is-clickable {
  cursor: pointer;
}

table.data tbody tr.is-clickable:hover {
  background: var(--surface-2);
}

table.data tbody tr.is-selected {
  background: var(--mint-100);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.cell-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* badges --------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-muted);
  white-space: nowrap;
}

.badge--ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.badge--warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.badge--info {
  background: var(--info-soft);
  color: var(--info);
}
.badge--danger {
  background: var(--danger-soft);
  color: var(--danger);
}

/* product grid --------------------------------------------------------- */

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

.product {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.16s ease, transform 0.16s ease;
}

.product:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.product__media {
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

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

.product__placeholder {
  color: var(--text-faint);
  font-size: 0.8rem;
}

.product__flag {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
}

.product__body {
  padding: 13px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.product__name {
  font-weight: 650;
  font-size: 0.95rem;
  line-height: 1.3;
}

.product__cat {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.product__price {
  font-weight: 700;
  font-size: 1.02rem;
  margin-top: auto;
  padding-top: 6px;
}

.product__price--hidden {
  font-weight: 550;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.product__actions {
  display: flex;
  gap: 7px;
  padding: 0 14px 14px;
}

/* quantity stepper ----------------------------------------------------- */

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
}

.stepper button {
  border: none;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  width: 32px;
  height: 34px;
  cursor: pointer;
}

.stepper button:hover {
  background: var(--surface-2);
}

.stepper input {
  width: 48px;
  border: none;
  border-inline: 1px solid var(--border-strong);
  text-align: center;
  font: inherit;
  font-size: 0.9rem;
  height: 34px;
  background: var(--surface);
  color: var(--text);
}

.stepper input:focus {
  outline: none;
  background: var(--surface-2);
}

/* image slots ---------------------------------------------------------- */

.image-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.image-slot {
  aspect-ratio: 1;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
  color: var(--text-faint);
  font-size: 0.8rem;
  cursor: pointer;
}

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

.image-slot__remove {
  position: absolute;
  top: 5px;
  inset-inline-end: 5px;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: none;
  background: rgba(15, 25, 20, 0.72);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 0;
}

/* import summary ------------------------------------------------------- */

.import-drop {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 26px 20px;
  text-align: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: border-color 0.14s ease, background 0.14s ease;
}

.import-drop:hover,
.import-drop.is-over {
  border-color: var(--green-600);
  background: var(--mint-100);
  color: var(--text);
}

.import-drop__name {
  font-weight: 650;
  color: var(--text);
  margin-top: 6px;
}

.import-errors {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 10px;
}

.import-errors div {
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem;
}

.import-errors div:last-child {
  border-bottom: none;
}

/* empty state ---------------------------------------------------------- */

.empty {
  text-align: center;
  padding: 54px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.empty__title {
  font-weight: 650;
  margin-bottom: 5px;
}

.empty__hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

/* form message --------------------------------------------------------- */

.notice {
  border-radius: 11px;
  padding: 10px 13px;
  font-size: 0.88rem;
  margin-bottom: 14px;
  border: 1px solid transparent;
}

.notice--error {
  background: var(--danger-soft);
  color: var(--danger);
}

.notice--info {
  background: var(--info-soft);
  color: var(--info);
}

.notice--warn {
  background: var(--warn-soft);
  color: var(--warn);
}

/* pagination ----------------------------------------------------------- */

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 0.87rem;
}

/* ============================================================== login */

.login {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1100px 520px at 50% -10%, var(--mint-100), transparent 70%),
    var(--bg);
}

/* Dark/light toggle pinned to the top-right corner of the login page. */
.theme-corner {
  position: absolute;
  top: 18px;
  inset-inline-end: 18px;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.theme-corner:hover {
  background: var(--mint-100);
  border-color: var(--green-700);
}

.login__box {
  width: 100%;
  max-width: 392px;
}

.login__head {
  text-align: center;
  margin-bottom: 26px;
}

.login__mark {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  margin: 0 auto 14px;
  display: block;
}

.login__title {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login__sub {
  color: var(--text-muted);
  margin-top: 4px;
  font-size: 0.94rem;
}

.login__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
}

.login__langs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 18px;
}

.lang-chip {
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-muted);
  border-radius: 10px;
  padding: 6px 14px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.lang-chip.is-active {
  background: var(--green-700);
  border-color: var(--green-700);
  color: #fff;
}

.login__demo {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

.login__demo code {
  font-family: var(--font-mono);
  color: var(--text);
}

/* ============================================================== modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 22, 17, 0.42);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 60;
  animation: fade 0.14s ease;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal--wide {
  max-width: 760px;
}

.modal__head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal__head h2 {
  flex: 1;
}

.modal__body {
  padding: 20px 22px;
  overflow-y: auto;
}

.modal__foot {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: var(--surface-2);
}

/* ============================================================== toasts */

.toasts {
  position: fixed;
  bottom: 20px;
  inset-inline-end: 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  z-index: 80;
  pointer-events: none;
}

.toast {
  background: var(--text);
  color: var(--bg);
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 0.89rem;
  font-weight: 550;
  box-shadow: var(--shadow-lg);
  max-width: 340px;
  animation: rise 0.18s ease;
}

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

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ============================================================== footer */

.app-footer {
  text-align: center;
  padding: 16px 20px 20px;
  font-size: 0.82rem;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
  background: var(--surface);
  letter-spacing: 0.01em;
}

.app-footer--login {
  border-top: none;
  background: transparent;
  margin-top: 22px;
  padding: 0;
}

/* ============================================================ utilities */

.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0 14px;
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 0.85rem;
}

.spacer {
  flex: 1;
}

.text-end {
  text-align: end;
}

.mt {
  margin-top: 16px;
}

.mb {
  margin-bottom: 16px;
}

.section-title {
  font-weight: 650;
  margin-bottom: 3px;
}

.section-hint {
  color: var(--text-muted);
  font-size: 0.86rem;
  margin-bottom: 14px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 22px 0;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab {
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--text-muted);
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  color: var(--green-700);
  border-bottom-color: var(--green-700);
}

html[data-theme="dark"] .tab.is-active {
  color: #a7d6bd;
  border-bottom-color: #a7d6bd;
}

.sidebar-backdrop {
  display: none;
}

/* ============================================================ responsive
   Tablets are the primary field device for sales reps, so the sidebar
   becomes a drawer below 1024px and the grid tightens.                    */

@media (max-width: 1024px) {
  .shell {
    padding: 10px;
    --gap: 10px;
  }

  .sidebar {
    position: fixed;
    inset-block: 10px;
    inset-inline-start: 10px;
    z-index: 50;
    transform: translateX(calc(-100% - 14px));
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-lg);
    height: auto;
  }

  html[dir="rtl"] .sidebar {
    transform: translateX(calc(100% + 14px));
  }

  .shell.is-drawer-open .sidebar {
    transform: none;
  }

  .shell.is-drawer-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(12, 22, 17, 0.4);
    z-index: 40;
  }

  .shell.is-collapsed .sidebar {
    --sidebar-w: 264px;
  }

  .shell.is-collapsed .nav-item__label,
  .shell.is-collapsed .sidebar__id,
  .shell.is-collapsed .nav-group {
    display: revert;
  }

  .shell.is-collapsed .nav-item {
    justify-content: flex-start;
  }

  .view {
    padding: 20px 16px 34px;
  }

  .topbar {
    padding: 12px 16px;
  }
}

@media (min-width: 1025px) {
  .drawer-toggle {
    display: none;
  }
}

@media (max-width: 620px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .modal__foot {
    flex-direction: column-reverse;
  }

  .modal__foot .btn {
    width: 100%;
  }
}

@media print {
  .sidebar,
  .topbar,
  .toolbar {
    display: none !important;
  }

  .main,
  .shell {
    border: none;
    box-shadow: none;
    padding: 0;
  }
}

/* ====================================================== display settings */

.display-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface);
  color: var(--text);
}

.display-preview__title {
  font-weight: 650;
  margin-bottom: 6px;
}

.size-stepper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  overflow: hidden;
  background: var(--surface);
}

.size-stepper button {
  border: none;
  background: none;
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 14px;
  line-height: 1.2;
}

.size-stepper button:hover:not([disabled]) {
  background: var(--surface-2);
}

.size-stepper button[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.size-stepper__small {
  font-size: 0.82rem;
}

.size-stepper__large {
  font-size: 1.15rem;
}

.size-stepper__value {
  min-width: 62px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  font-weight: 600;
  border-inline: 1px solid var(--border-strong);
  padding: 8px 4px;
}

.colour-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.colour-row input[type="color"] {
  inline-size: 46px;
  block-size: 38px;
  padding: 2px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
}

.colour-row .input {
  max-width: 130px;
  font-family: var(--font-mono);
  text-transform: lowercase;
}

/* Kept on the app's own palette so it stays readable whatever colours the
   user has picked - this is the way back from an unreadable combination. */
.btn--reset,
.btn--reset:hover {
  background: var(--green-700);
  color: #fff;
  border-color: var(--green-700);
}

/* Branding: logo preview in Settings. */
.logo-preview {
  width: 84px;
  height: 84px;
  flex: 0 0 84px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.logo-preview img {
  object-fit: contain;
}
