/*
 * Jawaher Market dashboard — design tokens.
 *
 * Extracted from admin-dashboard/tailwind.config.js + src/index.css.
 * Colours are HSL triplets ("H S% L%") so they can take an alpha:
 *   background: hsl(var(--jm-primary) / .1);
 *
 * Every variable is prefixed --jm- so it cannot collide with the variables
 * of the host site's theme or plugins.
 *
 * NOTE: in the original dashboard the primary colour is the hard-coded hex
 * #6D28D9 (tailwind.config.js), not the --primary CSS variable. The value
 * below (263 70% 50%) is that hex expressed as HSL, i.e. what users see.
 */

:root,
.jm-root {
  /* Surfaces */
  --jm-background: 0 0% 100%;
  --jm-foreground: 240 10% 3.9%;
  --jm-card: 0 0% 100%;
  --jm-card-foreground: 240 10% 3.9%;
  --jm-popover: 0 0% 100%;
  --jm-popover-foreground: 240 10% 3.9%;
  --jm-secondary: 240 4.8% 95.9%;
  --jm-secondary-foreground: 240 5.9% 10%;
  --jm-muted: 240 4.8% 95.9%;
  --jm-muted-foreground: 240 3.8% 46.1%;

  /* Brand - Dallni Original Green Theme */
  --jm-primary: 155 70% 29%;            /* #167c52 Dallni Green */
  --jm-primary-hover: 154 71% 23%;      /* #116641 Dallni Green Dark */
  --jm-primary-foreground: 0 0% 100%;   /* #ffffff */
  --jm-accent: 154 48% 55%;             /* #57c494 Dallni Green Accent */
  --jm-accent-foreground: 0 0% 100%;

  /* Feedback */
  --jm-destructive: 0 84.2% 60.2%;
  --jm-destructive-foreground: 0 0% 98%;
  --jm-success: 142 71% 29%;            /* text on success badge */
  --jm-warning: 32 95% 34%;
  --jm-info: 221 83% 40%;

  /* Lines & focus */
  --jm-border: 240 5.9% 90%;
  --jm-input: 240 5.9% 90%;
  --jm-ring: 155 70% 29%;               /* used at 50% alpha */

  /* Shape */
  --jm-radius: 0.75rem;                 /* buttons, inputs  (rounded-lg) */
  --jm-radius-md: calc(var(--jm-radius) - 2px);   /* nav links */
  --jm-radius-sm: calc(var(--jm-radius) - 4px);
  --jm-radius-card: 1rem;               /* cards, modals    (rounded-2xl) */

  /* Elevation (Tailwind defaults, as used by the dashboard) */
  --jm-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --jm-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --jm-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --jm-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Type */
  --jm-font: 'Noto Sans Arabic', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Layout */
  --jm-sidebar-w: 16rem;
  --jm-topbar-h: 4rem;
  --jm-topbar-h-sm: 3.5rem;

  /* 1 in RTL, -1 in LTR. Used to slide the drawer toward the inline-start edge. */
  --jm-dir: 1;
}

.jm-root[dir="ltr"] {
  --jm-dir: -1;
}

/* Dark mode: add class="dark" or data-jm-theme="dark" on <html> or on .jm-root. */
.dark,
[data-jm-theme="dark"],
.dark .jm-root,
[data-jm-theme="dark"] .jm-root,
.jm-root.dark,
.jm-root[data-jm-theme="dark"] {
  --jm-background: 240 10% 3.9%;
  --jm-foreground: 0 0% 98%;
  --jm-card: 240 10% 3.9%;
  --jm-card-foreground: 0 0% 98%;
  --jm-popover: 240 10% 3.9%;
  --jm-popover-foreground: 0 0% 98%;
  --jm-secondary: 240 3.7% 15.9%;
  --jm-secondary-foreground: 0 0% 98%;
  --jm-muted: 240 3.7% 15.9%;
  --jm-muted-foreground: 240 5% 64.9%;
  --jm-border: 240 3.7% 15.9%;
  --jm-input: 240 3.7% 15.9%;
  --jm-primary: 154 55% 42%;
  --jm-primary-hover: 154 55% 36%;
  --jm-accent: 154 50% 55%;
  --jm-ring: 154 55% 42%;
  --jm-destructive: 0 72% 51%;          /* original 0 62.8% 30.6% is too dark for text */
  --jm-success: 142 69% 58%;
  --jm-warning: 43 96% 56%;
  --jm-info: 213 94% 68%;
}
