/*
 * Jawaher Market dashboard — component styles (plain CSS, no build step).
 *
 * Mirrors the Tailwind classes used by admin-dashboard/src/components.
 * Requires tokens.css. Everything is prefixed .jm- and the base styles are
 * scoped to .jm-root, so the host theme is left alone.
 *
 * Usage:  <div class="jm-root" dir="rtl"> ... </div>
 * Uses logical properties, so it also works with dir="ltr".
 */

/* ---------- Base (scoped) ---------- */
.jm-root {
  font-family: var(--jm-font);
  font-variant-numeric: lining-nums tabular-nums;
  color: hsl(var(--jm-foreground));
  background: hsl(var(--jm-background));
  line-height: 1.5;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}
.jm-root:not([dir]) { direction: rtl; }
/* Fixed overlays that carry .jm-root themselves must not paint a page-sized background. */
.jm-root.jm-modal-wrap, .jm-root.jm-toasts { background: transparent; }
.jm-root *, .jm-root *::before, .jm-root *::after { box-sizing: border-box; border-color: hsl(var(--jm-border)); }
.jm-root button, .jm-root input, .jm-root select, .jm-root textarea { font: inherit; color: inherit; }
.jm-root button, .jm-root a, .jm-root input, .jm-root select, .jm-root textarea { touch-action: manipulation; }
.jm-root a { color: inherit; text-decoration: none; }
.jm-root h1, .jm-root h2, .jm-root h3, .jm-root h4, .jm-root p { margin: 0; }
.jm-root svg { flex-shrink: 0; }

.jm-muted { color: hsl(var(--jm-muted-foreground)); }
.jm-primary-text { color: hsl(var(--jm-primary)); }
.jm-stack > * + * { margin-block-start: 1.5rem; }
.jm-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }

/* Scrollbar (App.css) */
.jm-root ::-webkit-scrollbar { width: 6px; height: 6px; }
.jm-root ::-webkit-scrollbar-track { background: transparent; }
.jm-root ::-webkit-scrollbar-thumb { background: hsl(var(--jm-muted-foreground) / .3); border-radius: 3px; }
.jm-root ::-webkit-scrollbar-thumb:hover { background: hsl(var(--jm-muted-foreground) / .5); }

/* ---------- App shell ---------- */
.jm-shell { display: flex; min-height: 100svh; overflow: visible; background: hsl(var(--jm-background)); }
.jm-shell--embedded { height: auto; min-height: 36rem; border: 1px solid hsl(var(--jm-border)); border-radius: var(--jm-radius-card); }
.jm-shell-col { display: flex; flex-direction: column; flex: 1; min-width: 0; max-width: 100%; overflow: visible; }
.jm-content { flex: 1; overflow: visible; padding: .75rem; padding-block-end: max(.75rem, env(safe-area-inset-bottom)); }
.jm-backdrop { position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / .5); border: 0; }

/* Sidebar */
.jm-sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 50;
  width: min(18rem, calc(100vw - 2rem));
  display: flex; flex-direction: column;
  background: hsl(var(--jm-card)); border-inline-end: 1px solid hsl(var(--jm-border));
  transform: translateX(calc(var(--jm-dir) * 100%)); transition: transform .3s;
}
.jm-sidebar.is-open { transform: none; }
.jm-sidebar__brand {
  height: var(--jm-topbar-h-sm); display: flex; align-items: center; justify-content: space-between;
  padding-inline: 1rem; border-bottom: 1px solid hsl(var(--jm-border));
  font-size: 1.125rem; font-weight: 700; color: hsl(var(--jm-primary)); gap: .5rem;
}
.jm-sidebar__brand > span { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.jm-sidebar__brand > span > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jm-nav { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: .75rem; display: flex; flex-direction: column; gap: .25rem; }
.jm-nav__divider { margin-block: .5rem; border-top: 1px solid hsl(var(--jm-border)); }
.jm-nav__link {
  display: flex; align-items: center; gap: .75rem; width: 100%;
  padding: .75rem; border-radius: var(--jm-radius-md);
  font-size: .875rem; font-weight: 500; line-height: 1.25rem;
  color: hsl(var(--jm-muted-foreground)); background: transparent; border: 0; cursor: pointer;
  text-align: start; transition: background-color .15s, color .15s;
}
.jm-nav__link > .jm-nav__label { flex: 1; }
.jm-nav__link:hover { background: hsl(var(--jm-secondary)); color: hsl(var(--jm-foreground)); }
.jm-nav__link.is-active { background: hsl(var(--jm-primary)); color: hsl(var(--jm-primary-foreground)); }
.jm-nav__link.is-group-active { background: hsl(var(--jm-primary) / .1); color: hsl(var(--jm-primary)); }
.jm-nav__chev { transition: transform .15s; }
.jm-nav__link[aria-expanded="true"] .jm-nav__chev { transform: rotate(180deg); }
.jm-nav__sub { margin-block-start: .25rem; margin-inline-start: 1rem; padding-inline-start: .75rem; border-inline-start: 1px solid hsl(var(--jm-border)); display: flex; flex-direction: column; gap: .25rem; }
.jm-nav__sub[hidden] { display: none; }
.jm-nav__sub .jm-nav__link { padding: .5rem .75rem; font-weight: 400; }
.jm-nav__sub .jm-nav__link.is-active { font-weight: 500; }
.jm-sidebar__user { padding: 1rem; border-top: 1px solid hsl(var(--jm-border)); }
.jm-sidebar__user > div { display: flex; align-items: center; gap: .75rem; padding: .5rem .75rem; }
.jm-avatar {
  width: 2rem; height: 2rem; border-radius: 9999px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: hsl(var(--jm-primary) / .2); color: hsl(var(--jm-primary)); font-weight: 700; font-size: .875rem;
}
.jm-avatar--soft { background: hsl(var(--jm-primary) / .1); font-size: .75rem; }

/* Topbar */
.jm-topbar {
  height: var(--jm-topbar-h-sm); flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding-inline: .75rem; background: hsl(var(--jm-card)); border-bottom: 1px solid hsl(var(--jm-border));
}
.jm-topbar__start { display: flex; align-items: center; flex: 1; gap: .75rem; min-width: 0; }
.jm-topbar__end { display: flex; align-items: center; gap: .25rem; flex-shrink: 0; }
.jm-search {
  display: flex; align-items: center; gap: .5rem; width: 100%; min-width: 0;
  padding: .5rem .75rem; border: 0; border-radius: var(--jm-radius);
  background: hsl(var(--jm-secondary)); color: hsl(var(--jm-muted-foreground));
  font-size: .875rem; text-align: start; cursor: pointer; transition: background-color .15s;
}
.jm-search:hover { background: hsl(var(--jm-secondary) / .8); }
.jm-search > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jm-icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  padding: .625rem; border: 0; border-radius: 9999px; cursor: pointer;
  background: transparent; color: hsl(var(--jm-muted-foreground)); transition: background-color .15s, color .15s;
}
.jm-icon-btn:hover { background: hsl(var(--jm-secondary)); }
.jm-icon-btn--square { border-radius: var(--jm-radius-md); padding: .375rem; }
.jm-icon-btn__dot { position: absolute; top: .25rem; inset-inline-end: .25rem; width: .5rem; height: .5rem; border-radius: 9999px; background: hsl(var(--jm-destructive)); border: 2px solid hsl(var(--jm-card)); }
.jm-link-btn { display: none; align-items: center; gap: .375rem; padding: .375rem .75rem; border: 0; border-radius: var(--jm-radius-md); background: transparent; color: hsl(var(--jm-muted-foreground)); font-size: .875rem; cursor: pointer; transition: background-color .15s, color .15s; }
.jm-link-btn:hover { background: hsl(var(--jm-secondary)); color: hsl(var(--jm-primary)); }
.jm-only-mobile { display: inline-flex; }

@media (min-width: 640px) {
  .jm-topbar { height: var(--jm-topbar-h); padding-inline: 1.5rem; gap: .75rem; }
  .jm-topbar__end { gap: 1rem; }
  .jm-sidebar__brand { height: var(--jm-topbar-h); }
  .jm-sidebar { width: 18rem; }
  .jm-content { padding: 1.5rem; padding-block-end: max(.75rem, env(safe-area-inset-bottom)); }
  .jm-search { max-width: 28rem; padding-block: .5rem; gap: .75rem; }
  .jm-icon-btn { padding: .5rem; }
  .jm-link-btn { display: inline-flex; }
  .jm-nav__link { padding-block: .625rem; }
}
@media (min-width: 1024px) {
  .jm-sidebar { position: relative; inset: auto; transform: none; width: var(--jm-sidebar-w); }
  .jm-backdrop, .jm-only-mobile { display: none; }
}

/* ---------- Page structure ---------- */
.jm-page { display: flex; flex-direction: column; gap: 1.5rem; animation: jm-in .5s ease-out both; }
.jm-page-header { display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; justify-content: space-between; }
@media (min-width: 640px) { .jm-page-header { flex-direction: row; align-items: center; } }
.jm-title { display: flex; align-items: center; gap: .5rem; font-size: 1.5rem; line-height: 2rem; font-weight: 700; letter-spacing: -.025em; }
.jm-title svg { color: hsl(var(--jm-primary)); }
.jm-title--lg { font-size: 1.875rem; line-height: 2.25rem; }
.jm-subtitle { margin-block-start: .25rem; font-size: .875rem; color: hsl(var(--jm-muted-foreground)); }
.jm-breadcrumbs { display: flex; align-items: center; gap: .375rem; margin-block-end: 1rem; font-size: .875rem; color: hsl(var(--jm-muted-foreground)); }
.jm-breadcrumbs a:hover { color: hsl(var(--jm-primary)); }
.jm-breadcrumbs strong { color: hsl(var(--jm-foreground)); font-weight: 500; }
.jm-tabs { display: flex; flex-wrap: wrap; gap: .5rem; border-bottom: 1px solid hsl(var(--jm-border)); }
.jm-tab {
  display: inline-flex; align-items: center; gap: .5rem; margin-block-end: -1px; padding: .625rem 1rem;
  border: 0; border-bottom: 2px solid transparent; background: transparent; cursor: pointer;
  font-size: .875rem; font-weight: 500; color: hsl(var(--jm-muted-foreground)); transition: color .15s;
}
.jm-tab:hover { color: hsl(var(--jm-foreground)); }
.jm-tab.is-active { border-bottom-color: hsl(var(--jm-primary)); color: hsl(var(--jm-primary)); }

@keyframes jm-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Surfaces ---------- */
.jm-card { background: hsl(var(--jm-card)); color: hsl(var(--jm-card-foreground)); border: 1px solid hsl(var(--jm-border)); border-radius: var(--jm-radius-card); box-shadow: var(--jm-shadow-sm); }
.jm-card--pad { padding: 1.5rem; }
.jm-card__title { margin-block-end: 1rem; font-weight: 600; }
.jm-grid-stats { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .jm-grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .jm-grid-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.jm-stat { display: flex; flex-direction: column; gap: 1rem; padding: 1.5rem; transition: box-shadow .15s; }
.jm-stat:hover { box-shadow: var(--jm-shadow-md); }
.jm-stat__head { display: flex; align-items: center; justify-content: space-between; }
.jm-stat__label { font-size: .875rem; font-weight: 500; color: hsl(var(--jm-muted-foreground)); }
.jm-stat__icon { padding: .5rem; border-radius: var(--jm-radius); background: hsl(var(--jm-primary) / .1); color: hsl(var(--jm-primary)); display: inline-flex; }
.jm-stat__value { font-size: 1.875rem; line-height: 2.25rem; font-weight: 700; }
.jm-stat__trend { margin-block-start: .5rem; display: flex; align-items: center; gap: .25rem; font-size: .875rem; font-weight: 500; color: hsl(142 76% 36%); }
.jm-stat__trend.is-down { color: hsl(var(--jm-destructive)); }
.dark .jm-stat__trend:not(.is-down), [data-jm-theme="dark"] .jm-stat__trend:not(.is-down) { color: hsl(142 69% 58%); }

/* ---------- Buttons ---------- */
.jm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .375rem;
  padding: .5rem 1rem; border-radius: var(--jm-radius); border: 1px solid transparent;
  font-size: .875rem; font-weight: 500; line-height: 1.25rem; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, opacity .15s;
}
.jm-btn:focus-visible, .jm-icon-btn:focus-visible, .jm-nav__link:focus-visible, .jm-tab:focus-visible { outline: 2px solid hsl(var(--jm-ring) / .5); outline-offset: 2px; }
.jm-btn:disabled { opacity: .6; cursor: not-allowed; }
.jm-btn--primary { background: hsl(var(--jm-primary)); color: #ffffff !important; }
.jm-btn--primary:hover:not(:disabled) { background: hsl(var(--jm-primary-hover)); color: #ffffff !important; }
.jm-btn--secondary { background: hsl(var(--jm-secondary)); color: hsl(var(--jm-secondary-foreground)); border-color: hsl(var(--jm-border)); }
.jm-btn--secondary:hover:not(:disabled) { background: hsl(var(--jm-secondary) / .8); }
.jm-btn--outline { background: transparent; border-color: hsl(var(--jm-border)); }
.jm-btn--outline:hover:not(:disabled) { background: hsl(var(--jm-secondary)); }
.jm-btn--ghost { background: transparent; color: hsl(var(--jm-muted-foreground)); }
.jm-btn--ghost:hover:not(:disabled) { background: hsl(var(--jm-primary) / .1); color: hsl(var(--jm-primary)); }
.jm-btn--danger { background: hsl(0 72% 51%); color: #fff; }
.jm-btn--danger:hover:not(:disabled) { background: hsl(0 74% 42%); }
.jm-btn--sm { padding: .375rem .75rem; }
.jm-btn--block { width: 100%; }

/* ---------- Forms ---------- */
.jm-field { display: flex; flex-direction: column; gap: .5rem; }
.jm-label { display: block; font-size: .875rem; font-weight: 500; }
.jm-hint { font-size: .75rem; color: hsl(var(--jm-muted-foreground)); }
.jm-error { font-size: .75rem; color: hsl(0 72% 51%); }
.jm-input, .jm-select, .jm-textarea {
  width: 100%; max-width: 100%; min-height: 2.75rem; padding: .625rem 1rem;
  background: hsl(var(--jm-background)); border: 1px solid hsl(var(--jm-border)); border-radius: var(--jm-radius);
  font-size: 1rem; line-height: 1.25rem; box-shadow: none; transition: box-shadow .15s, border-color .15s;
}
@media (min-width: 640px) { .jm-input, .jm-select, .jm-textarea { font-size: .875rem; } }
.jm-textarea { resize: vertical; }
.jm-input::placeholder, .jm-textarea::placeholder { color: hsl(var(--jm-muted-foreground)); }
.jm-input:focus, .jm-select:focus, .jm-textarea:focus { outline: none; box-shadow: 0 0 0 2px hsl(var(--jm-ring) / .5); }
.jm-check { width: 1rem; height: 1rem; border-radius: .25rem; accent-color: hsl(var(--jm-primary)); }

/* Toggle switch: <label class="jm-switch"><input type="checkbox"><span></span></label> */
.jm-switch { position: relative; display: inline-block; width: 2.75rem; height: 1.5rem; flex-shrink: 0; cursor: pointer; }
.jm-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.jm-switch span { position: absolute; inset: 0; border-radius: 12px; background: hsl(var(--jm-muted)); transition: background .3s; }
.jm-switch span::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .3s; }
.jm-switch input:checked + span { background: hsl(var(--jm-primary)); }
.jm-switch input:checked + span::after { transform: translateX(calc(var(--jm-dir) * -20px)); }
.jm-switch input:focus-visible + span { outline: 2px solid hsl(var(--jm-ring) / .5); outline-offset: 2px; }

/* ---------- Data table ---------- */
.jm-table-card { display: flex; flex-direction: column; overflow: hidden; }
.jm-table-toolbar { display: flex; flex-direction: column; gap: .75rem; padding: 1rem; background: hsl(var(--jm-secondary) / .3); border-bottom: 1px solid hsl(var(--jm-border)); }
@media (min-width: 640px) { .jm-table-toolbar { flex-direction: row; align-items: center; justify-content: space-between; } }
.jm-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scrollbar-width: thin; }
.jm-table { width: 100%; font-size: .875rem; text-align: start; border-collapse: separate; border-spacing: 0; }
.jm-table th { padding: 1rem 1.5rem; white-space: nowrap; text-align: start; font-size: .75rem; font-weight: 600; text-transform: uppercase; background: hsl(var(--jm-secondary) / .5); color: hsl(var(--jm-muted-foreground)); }
.jm-table td { padding: 1rem 1.5rem; border-top: 1px solid hsl(var(--jm-border)); }
.jm-table tbody tr { transition: background-color .15s; }
.jm-table tbody tr:hover { background: hsl(var(--jm-secondary) / .2); }
.jm-pagination { display: flex; flex-direction: column; gap: .75rem; padding: 1rem; font-size: .875rem; color: hsl(var(--jm-muted-foreground)); background: hsl(var(--jm-secondary) / .2); border-top: 1px solid hsl(var(--jm-border)); }
@media (min-width: 640px) { .jm-pagination { flex-direction: row; align-items: center; justify-content: space-between; } }
.jm-pagination__btns { display: flex; gap: .25rem; }
.jm-pagination__btns button { min-height: 2.5rem; padding: .5rem .75rem; background: transparent; border: 1px solid hsl(var(--jm-border)); border-radius: var(--jm-radius-md); cursor: pointer; display: inline-flex; align-items: center; }
.jm-pagination__btns button:hover:not(:disabled) { background: hsl(var(--jm-secondary)); }
.jm-pagination__btns button:disabled { opacity: .4; cursor: not-allowed; }
@media (max-width: 640px) { .jm-table { min-width: 42rem; } .jm-table th, .jm-table td { padding-inline: 1rem; } }

/* ---------- Badges ---------- */
.jm-badge { display: inline-flex; align-items: center; padding: .125rem .625rem; border-radius: 9999px; border: 1px solid hsl(var(--jm-border)); background: hsl(var(--jm-secondary)); font-size: .75rem; font-weight: 500; line-height: 1rem; }
.jm-badge--success  { background: hsl(142 76% 94%); color: hsl(142 72% 24%); border-color: hsl(141 79% 85%); }
.jm-badge--info     { background: hsl(214 95% 93%); color: hsl(224 64% 33%); border-color: hsl(213 97% 87%); }
.jm-badge--warning  { background: hsl(48 96% 89%); color: hsl(26 83% 24%); border-color: hsl(48 97% 77%); }
.jm-badge--pending  { background: hsl(55 97% 88%); color: hsl(35 92% 24%); border-color: hsl(53 98% 77%); }
.jm-badge--danger   { background: hsl(0 93% 94%); color: hsl(0 70% 35%); border-color: hsl(0 96% 89%); }
.jm-badge--neutral  { background: hsl(220 14% 96%); color: hsl(217 19% 27%); border-color: hsl(220 13% 91%); }
.jm-badge--purple   { background: hsl(269 100% 95%); color: hsl(272 72% 34%); border-color: hsl(269 100% 92%); }
.dark .jm-badge--success, [data-jm-theme="dark"] .jm-badge--success { background: hsl(142 70% 45% / .15); color: hsl(142 69% 70%); border-color: hsl(142 70% 45% / .3); }
.dark .jm-badge--info,    [data-jm-theme="dark"] .jm-badge--info    { background: hsl(213 94% 60% / .15); color: hsl(213 94% 75%); border-color: hsl(213 94% 60% / .3); }
.dark .jm-badge--warning, [data-jm-theme="dark"] .jm-badge--warning { background: hsl(43 96% 56% / .15); color: hsl(43 96% 70%); border-color: hsl(43 96% 56% / .3); }
.dark .jm-badge--pending, [data-jm-theme="dark"] .jm-badge--pending { background: hsl(50 97% 55% / .15); color: hsl(50 97% 70%); border-color: hsl(50 97% 55% / .3); }
.dark .jm-badge--danger,  [data-jm-theme="dark"] .jm-badge--danger  { background: hsl(0 84% 60% / .15); color: hsl(0 90% 78%); border-color: hsl(0 84% 60% / .3); }
.dark .jm-badge--neutral, [data-jm-theme="dark"] .jm-badge--neutral { background: hsl(220 14% 60% / .15); color: hsl(220 14% 80%); border-color: hsl(220 14% 60% / .3); }
.dark .jm-badge--purple,  [data-jm-theme="dark"] .jm-badge--purple  { background: hsl(270 90% 65% / .15); color: hsl(270 95% 80%); border-color: hsl(270 90% 65% / .3); }

/* ---------- Alerts, toasts, empty, loading ---------- */
.jm-alert { display: flex; align-items: flex-start; gap: .75rem; padding: .75rem 1rem; border-radius: .75rem; border: 1px solid; font-size: .875rem; }
.jm-alert--warning { background: hsl(48 100% 96%); border-color: hsl(48 97% 77%); color: hsl(26 83% 24%); }
.jm-alert--success { background: hsl(138 76% 97%); border-color: hsl(141 79% 85%); color: hsl(144 61% 20%); }
.jm-alert--danger  { background: hsl(0 86% 97%); border-color: hsl(0 96% 89%); color: hsl(0 63% 31%); }
.jm-alert--info    { background: hsl(214 100% 97%); border-color: hsl(213 97% 87%); color: hsl(224 64% 33%); }
.dark .jm-alert--warning, [data-jm-theme="dark"] .jm-alert--warning { background: hsl(43 96% 56% / .1); border-color: hsl(43 96% 56% / .3); color: hsl(43 96% 75%); }
.dark .jm-alert--success, [data-jm-theme="dark"] .jm-alert--success { background: hsl(142 70% 45% / .1); border-color: hsl(142 70% 45% / .3); color: hsl(142 69% 75%); }
.dark .jm-alert--danger,  [data-jm-theme="dark"] .jm-alert--danger  { background: hsl(0 84% 60% / .1); border-color: hsl(0 84% 60% / .3); color: hsl(0 90% 82%); }
.dark .jm-alert--info,    [data-jm-theme="dark"] .jm-alert--info    { background: hsl(213 94% 60% / .1); border-color: hsl(213 94% 60% / .3); color: hsl(213 94% 80%); }

.jm-toasts { position: fixed; bottom: 1rem; inset-inline-end: 1rem; z-index: 100; display: flex; flex-direction: column; gap: .5rem; width: 100%; max-width: 24rem; pointer-events: none; }
.jm-toast { pointer-events: auto; display: flex; align-items: flex-start; gap: .75rem; padding: .75rem 1rem; border-radius: .75rem; border: 1px solid; box-shadow: var(--jm-shadow-lg); font-size: .875rem; animation: jm-in .2s ease-out both; }
.jm-toast p { flex: 1; }
.jm-toast--success { background: hsl(138 76% 97%); border-color: hsl(141 79% 85%); color: hsl(144 61% 20%); }
.jm-toast--error   { background: hsl(0 86% 97%); border-color: hsl(0 96% 89%); color: hsl(0 63% 31%); }
.jm-toast--info    { background: hsl(214 100% 97%); border-color: hsl(213 97% 87%); color: hsl(224 64% 33%); }
.dark .jm-toast--success, [data-jm-theme="dark"] .jm-toast--success { background: hsl(142 40% 12%); border-color: hsl(142 70% 45% / .4); color: hsl(142 69% 80%); }
.dark .jm-toast--error,   [data-jm-theme="dark"] .jm-toast--error   { background: hsl(0 40% 13%); border-color: hsl(0 84% 60% / .4); color: hsl(0 90% 85%); }
.dark .jm-toast--info,    [data-jm-theme="dark"] .jm-toast--info    { background: hsl(215 40% 13%); border-color: hsl(213 94% 60% / .4); color: hsl(213 94% 82%); }

.jm-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem; padding: 4rem 1rem; text-align: center; color: hsl(var(--jm-muted-foreground)); }
.jm-skeleton { display: block; height: 1rem; border-radius: .25rem; background: hsl(var(--jm-secondary) / .8); animation: jm-pulse 2s cubic-bezier(.4, 0, .6, 1) infinite; }
@keyframes jm-pulse { 50% { opacity: .5; } }
.jm-spinner { width: 2rem; height: 2rem; border-radius: 9999px; border: 3px solid hsl(var(--jm-primary) / .2); border-top-color: hsl(var(--jm-primary)); animation: jm-spin 1s linear infinite; }
.jm-spinner--sm { width: 1rem; height: 1rem; border-width: 2px; border-color: currentColor; border-top-color: transparent; opacity: .8; }
@keyframes jm-spin { to { transform: rotate(360deg); } }

/* ---------- Overlays ---------- */
.jm-modal-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.jm-modal-wrap[hidden] { display: none; }
.jm-modal-wrap > .jm-modal-scrim { position: absolute; inset: 0; border: 0; background: rgb(0 0 0 / .5); backdrop-filter: blur(4px); }
.jm-modal {
  position: relative; display: flex; flex-direction: column; width: 100%; max-width: 32rem;
  height: calc(100svh - env(safe-area-inset-top)); max-height: 100svh;
  background: hsl(var(--jm-card)); border: 1px solid hsl(var(--jm-border));
  border-radius: var(--jm-radius-card) var(--jm-radius-card) 0 0; box-shadow: var(--jm-shadow-xl);
  animation: jm-in .2s ease-out both;
}
.jm-modal--sm { max-width: 28rem; } .jm-modal--lg { max-width: 42rem; } .jm-modal--xl { max-width: 56rem; }
.jm-modal__head { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; padding: .75rem 1rem; border-bottom: 1px solid hsl(var(--jm-border)); }
.jm-modal__head h3 { font-size: 1.125rem; font-weight: 600; }
.jm-modal__body { overflow-y: auto; overscroll-behavior: contain; padding: 1rem; }
.jm-modal__foot { display: flex; flex-direction: column-reverse; gap: .75rem; margin-block-start: 1rem; padding-block-start: 1rem; border-top: 1px solid hsl(var(--jm-border)); }
@media (min-width: 640px) {
  .jm-modal-wrap { align-items: center; padding: 1rem; }
  .jm-modal { height: auto; max-height: 90vh; border-radius: var(--jm-radius-card); }
  .jm-modal__head { padding: 1rem 1.5rem; } .jm-modal__body { padding: 1.5rem; }
  .jm-modal__foot { flex-direction: row; align-items: center; justify-content: flex-end; }
}

.jm-bulkbar { position: sticky; bottom: 0; z-index: 30; display: flex; flex-direction: column; gap: .75rem; margin: 0 1rem 1rem; padding: .75rem 1rem; border: 1px solid hsl(var(--jm-primary) / .3); border-radius: .75rem; background: hsl(var(--jm-primary) / .05); backdrop-filter: blur(8px); box-shadow: var(--jm-shadow-lg); }
@media (min-width: 640px) { .jm-bulkbar { flex-direction: row; align-items: center; } }
.jm-bulkbar__count { display: inline-flex; padding: .125rem .625rem; border-radius: 9999px; background: hsl(var(--jm-primary)); color: hsl(var(--jm-primary-foreground)); font-size: .75rem; }

.jm-dropdown { position: absolute; z-index: 50; margin-block-start: .5rem; width: 13rem; padding: .5rem; background: hsl(var(--jm-popover)); color: hsl(var(--jm-popover-foreground)); border: 1px solid hsl(var(--jm-border)); border-radius: .75rem; box-shadow: var(--jm-shadow-lg); }
.jm-dropdown__item { display: flex; align-items: center; gap: .5rem; width: 100%; padding: .5rem; border: 0; border-radius: .5rem; background: transparent; font-size: .875rem; text-align: start; cursor: pointer; }
.jm-dropdown__item:hover { background: hsl(var(--jm-secondary) / .6); }
.jm-dropdown__item.is-selected { background: hsl(var(--jm-primary) / .1); color: hsl(var(--jm-primary)); font-weight: 500; }

/* ---------- Progress (monthly goal widget) ---------- */
.jm-progress { height: .5rem; border-radius: 9999px; background: hsl(var(--jm-secondary)); overflow: hidden; }
.jm-progress > span { display: block; height: 100%; border-radius: inherit; background: hsl(var(--jm-primary)); transition: width .3s; }

@media (prefers-reduced-motion: reduce) {
  .jm-root *, .jm-root *::before, .jm-root *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
