/* =========================================================================
   Rawasid Panel — shared control panel for every tenant storefront.
   Utilitarian on purpose: this is a tool clients use on a phone in a shop,
   so it favours legibility, big tap targets and calm colour over decoration.
   Written with logical properties so it mirrors for Arabic RTL.
   ========================================================================= */

/* Palette and type lifted from the Rawasid platform itself (rawasid.com), so
   the panel and admin read as part of that product rather than as a separate
   tool. Rawasid distinguishes its client surface (warm brown on cream) from
   its admin surface (indigo/violet on near-black); the only token that changes
   between the two deployments here is the accent. */
:root {
  --ink: #241f30;
  --sidebar: #0d0b1e;
  --sidebar-2: #141130;
  --sidebar-3: #26224a;

  --accent: #8a6d3b;        /* Rawasid client brown */
  --accent-deep: #6f5730;
  --accent-ink: #ffffff;    /* readable text on --accent */

  --paper: #ffffff;
  --wash: #fbf8f2;
  --wash-2: #f4eee3;
  --line: #ece4d5;
  --line-2: #ddd2bd;
  --muted: #948b7e;
  --ok: #1f7a34;
  --danger: #d24b46;
  --danger-wash: #fdece9;

  --radius: 10px;
  --radius-sm: 7px;
  --side-w: 264px;
  --shadow: 0 1px 2px rgba(36, 31, 48, 0.06), 0 10px 28px -14px rgba(36, 31, 48, 0.32);
  --shadow-lg: 0 24px 64px -20px rgba(36, 31, 48, 0.42);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font: 'Tajawal', 'Plus Jakarta Sans', system-ui, sans-serif;
}

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

body {
  margin: 0;
  font-family: var(--font);
  background: var(--wash);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ------------------------------------------------------------- controls */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--sidebar);
  color: #fff;
  font-weight: 500;
  font-size: 0.92rem;
  white-space: nowrap;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), opacity 0.2s var(--ease), transform 0.12s var(--ease);
}
.btn:hover { background: var(--sidebar-3); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn--primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn--primary:hover { background: var(--accent-deep); }
.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn--ghost:hover { background: var(--wash); border-color: var(--muted); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #b93b36; }
.btn--sm { padding: 0.4rem 0.7rem; font-size: 0.85rem; }
.btn--block { width: 100%; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  transition: background 0.2s var(--ease);
}
.icon-btn:hover { background: var(--wash); }
.icon-btn svg { width: 18px; height: 18px; }

.linkish {
  background: none;
  border: 0;
  padding: 0.35rem 0;
  color: var(--muted);
  font-size: 0.86rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.linkish:hover { color: var(--ink); }

.field { display: grid; gap: 0.35rem; margin-bottom: 1rem; }
.field > span { font-size: 0.85rem; font-weight: 500; color: var(--muted); }

input[type='text'], input[type='email'], input[type='password'],
input[type='number'], input[type='search'], textarea, .select {
  width: 100%;
  padding: 0.62rem 0.8rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
input:focus, textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(138, 109, 59, 0.22);
}
textarea { min-height: 5.5rem; resize: vertical; line-height: 1.55; }

.select {
  appearance: none;
  padding-inline-end: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23948b7e' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.8rem center;
}
:root[dir='ltr'] .select { background-position: right 0.8rem center; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.grow { flex: 1; }

/* ---------------------------------------------------------------- login */

.auth { min-height: 100svh; display: grid; place-items: center; padding: 1.5rem; background: var(--sidebar); }
.auth__card {
  width: min(24rem, 100%);
  background: var(--paper);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  display: grid;
}
.brandmark { border-radius: 9px; flex: none; }
.auth__brand { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.75rem; }
.auth__brand strong { display: block; font-size: 1.05rem; }
.auth__brand span { font-size: 0.85rem; color: var(--muted); }
.auth__error {
  margin: 0 0 1rem;
  padding: 0.7rem 0.85rem;
  background: var(--danger-wash);
  color: var(--danger);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.55;
  /* Diagnostics can include a long URL — let it wrap rather than overflow. */
  overflow-wrap: anywhere;
}
.auth__lead { margin: 0 0 1.35rem; color: var(--muted); font-size: 0.92rem; line-height: 1.6; }
.auth__note { margin: 1rem 0 0; color: var(--muted); font-size: 0.82rem; text-align: center; line-height: 1.5; }
.auth .linkish { justify-self: center; margin-top: 1rem; }

/* Google's brand guidelines: white surface, Roboto-ish label, their mark. */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn-google:hover { background: #f7f8f8; border-color: #d2d5d9; box-shadow: 0 1px 3px rgba(60,64,67,0.16); }
.btn-google:active { background: #eef0f2; }
.btn-google svg { flex: none; }

/* The admin console takes Rawasid's admin identity — indigo/violet on
   near-black — so it is instantly distinguishable from a client's panel. */
:root.is-admin {
  --accent: #6d5efc;
  --accent-deep: #4f46e5;
  --accent-ink: #ffffff;
}
:root.is-admin .auth__brand strong,
:root.is-admin .side__brand strong {
  background: linear-gradient(135deg, #6d5efc, #7c3aed 55%, #4f46e5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ------------------------------------------------------------ install */

.btn-install {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  margin-top: 0.9rem;
  padding: 0.65rem 1rem;
  background: transparent;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.88rem;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}
.btn-install:hover { border-color: var(--accent); color: var(--ink); background: rgba(138, 109, 59, 0.07); }
.btn-install svg { flex: none; }

.side__install {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-sm);
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.88rem;
  text-align: start;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}
.side__install svg { width: 17px; height: 17px; flex: none; }
.side__install:hover { border-color: var(--accent); color: #fff; background: var(--sidebar-2); }

.steps-list { margin: 0 0 1.35rem; padding-inline-start: 1.2rem; color: var(--muted); display: grid; gap: 0.5rem; font-size: 0.92rem; line-height: 1.55; }
.steps-list li { padding-inline-start: 0.25rem; }

/* ------------------------------------------------------------ billing */

.billcard {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1rem, 2.2vw, 1.4rem);
  margin-bottom: 1rem;
  max-width: 52rem;
}
.billcard__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.billcard__name { margin: 0 0 0.4rem; font-size: 1.05rem; }
.billcard__meta { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; font-size: 0.85rem; color: var(--muted); }
.billcard__facts { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: 0.9rem 0; font-size: 0.9rem; color: var(--muted); }
.billcard__facts strong { color: var(--ink); }
.billcard__foot { display: flex; justify-content: flex-end; margin-top: -0.4rem; }

.deal { min-height: 5.5rem; font-family: inherit; line-height: 1.6; }

.billcard__hist { margin-top: 0.9rem; border-top: 1px solid var(--line); padding-top: 0.7rem; }
.billcard__hist summary { cursor: pointer; font-size: 0.88rem; color: var(--muted); }
.billcard__hist summary:hover { color: var(--ink); }

.paylist { list-style: none; margin: 0.7rem 0 0; padding: 0; display: grid; gap: 0.4rem; }
.paylist li {
  display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap;
  padding: 0.5rem 0.7rem;
  background: var(--wash-2);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}
.paylist__note { color: var(--muted); font-size: 0.85em; }

.pill--warn { background: #fdf0e6; color: #9a5b12; }

/* The payment dialog needs more room than a yes/no confirm. */
.confirm--wide { max-width: 30rem; width: 100%; }

/* ------------------------------------------------------- access groups */

.accessgroup { margin-top: 1.5rem; }
.accessgroup:first-child { margin-top: 0; }
.accessgroup__title { font-size: 0.98rem; margin: 0 0 0.6rem; display: flex; align-items: baseline; gap: 0.55rem; flex-wrap: wrap; }
.accessgroup__sub { font-size: 0.8rem; color: var(--muted); font-weight: 400; }
.accessgroup .hint { margin: 0; padding: 0.9rem 1rem; background: var(--paper); border: 1px dashed var(--line-2); border-radius: var(--radius); }

/* ---------------------------------------------------------------- shell */

.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100svh; }

.side {
  background: var(--sidebar);
  color: rgba(255, 255, 255, 0.82);
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  height: 100svh;
  z-index: 40;
}
.side__brand { display: flex; align-items: center; gap: 0.6rem; color: #fff; font-size: 1.05rem; }

.side__label { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.45); margin-bottom: 0.4rem; }
:root[dir='rtl'] .side__label { text-transform: none; letter-spacing: 0; font-size: 0.8rem; }
.side__tenant .select {
  background-color: var(--sidebar-2);
  border-color: var(--sidebar-3);
  color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23ffffff' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}
.side__visit { display: inline-block; margin-top: 0.5rem; font-size: 0.82rem; color: var(--accent); text-decoration: none; }
.side__visit:hover { text-decoration: underline; }

.side__nav { display: grid; gap: 0.25rem; }
.side__link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  text-align: start;
  font-size: 0.95rem;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.side__link svg { width: 19px; height: 19px; flex: none; }
.side__link:hover { background: var(--sidebar-2); color: #fff; }
.side__link.is-active { background: var(--accent); color: var(--ink); font-weight: 600; }

.side__foot { margin-top: auto; display: grid; gap: 0.75rem; }
.side__foot .linkish { color: rgba(255,255,255,0.5); justify-self: start; }
.side__foot .linkish:hover { color: #fff; }
.side__user { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.8rem; color: rgba(255,255,255,0.55); }
.side__user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__user .btn--ghost { border-color: var(--sidebar-3); color: rgba(255,255,255,0.8); }
.side__user .btn--ghost:hover { background: var(--sidebar-2); color: #fff; }

.side__scrim { display: none; }

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

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem clamp(1rem, 3vw, 2rem);
  background: rgba(244, 245, 247, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__title { margin: 0; font-size: 1.25rem; font-weight: 600; margin-inline-end: auto; }
.topbar__menu { display: none; }

.view { padding: clamp(1rem, 3vw, 2rem); display: grid; gap: 1.25rem; align-content: start; }

/* ---------------------------------------------------------------- stats */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.75rem; }
.statcard { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.statcard b { display: block; font-size: 1.6rem; line-height: 1.2; }
.statcard span { font-size: 0.85rem; color: var(--muted); }

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

.toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.search { position: relative; flex: 1 1 14rem; }
.search input { padding-inline-start: 2.3rem; }
.search svg { position: absolute; inset-block-start: 50%; inset-inline-start: 0.75rem; translate: 0 -50%; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.toolbar .select { flex: 0 1 11rem; }

/* ---------------------------------------------------------------- lists */

.list { display: grid; gap: 0.6rem; }

.item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.item:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.item.is-hidden { opacity: 0.62; }

.item__thumb {
  width: 56px; height: 56px;
  flex: none;
  border-radius: var(--radius-sm);
  background: var(--wash);
  border: 1px solid var(--line);
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--line-2);
  font-size: 0.7rem;
}
.item__thumb img { width: 100%; height: 100%; object-fit: cover; }

.item__main { min-width: 0; flex: 1; }
.item__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__meta { font-size: 0.82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

.pill { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.75rem; background: var(--wash); border: 1px solid var(--line); }
.pill--ok { background: #eaf6ef; border-color: #cfe9d9; color: var(--ok); }
.pill--off { background: var(--wash); color: var(--muted); }

.item__actions { display: flex; gap: 0.3rem; flex: none; }

/* Empty / loading states */
.empty { background: var(--paper); border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 3rem 1.5rem; text-align: center; color: var(--muted); display: grid; gap: 0.75rem; justify-items: center; }
.empty strong { color: var(--ink); font-size: 1.05rem; }

.skel { height: 74px; border-radius: var(--radius); background: linear-gradient(90deg, #eceef1 25%, #f5f6f8 37%, #eceef1 63%); background-size: 400% 100%; animation: sh 1.4s ease-in-out infinite; }
@keyframes sh { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ------------------------------------------------------------- settings */

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.1rem, 2.5vw, 1.75rem); max-width: 46rem; }
.card__title { font-size: 1rem; margin: 0 0 0.35rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.card__title:first-child { padding-top: 0; border-top: 0; }
.card__foot { display: flex; justify-content: flex-end; padding-top: 1.25rem; margin-top: 0.5rem; border-top: 1px solid var(--line); }

.hint { font-size: 0.83rem; color: var(--muted); margin: 0 0 0.9rem; line-height: 1.5; }
.field .hint { margin: 0.15rem 0 0; }

.checks { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.1rem; }
.check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.92rem;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.check:hover { border-color: var(--muted); }
.check input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.check:has(input:checked) { border-color: var(--accent); background: rgba(138, 109, 59, 0.12); font-weight: 600; }

.switch { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.85rem 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch:last-of-type { border-bottom: 0; }
.switch input { accent-color: var(--accent); width: 18px; height: 18px; margin-top: 0.2rem; flex: none; }
.switch strong { display: block; font-weight: 600; font-size: 0.95rem; }
.switch small { display: block; color: var(--muted); font-size: 0.83rem; line-height: 1.45; }

/* ---------------------------------------------------------------- sheet */

/* Side sheets slide in from the inline edge; centred sheets (confirm dialogs,
   the iOS install guide) must stay centred in BOTH directions — hence the
   :not(), or the RTL rule below would out-specify .sheet--center. */
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; }
.sheet:not(.sheet--center) { justify-content: flex-end; }
.sheet--center { align-items: center; justify-content: center; padding: 1.5rem; }
.sheet__scrim { position: absolute; inset: 0; background: rgba(23, 26, 33, 0.5); backdrop-filter: blur(3px); animation: fade 0.25s var(--ease); }
@keyframes fade { from { opacity: 0; } }

.sheet__panel {
  position: relative;
  width: min(40rem, 100%);
  background: var(--paper);
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slide 0.32s var(--ease);
}
.sheet__panel--sm { width: min(30rem, 100%); }
@keyframes slide { from { transform: translateX(var(--from, 100%)); } }
:root[dir='rtl'] .sheet__panel { --from: -100%; }
:root[dir='rtl'] .sheet:not(.sheet--center) { justify-content: flex-start; }

.sheet__head { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.35rem; border-bottom: 1px solid var(--line); }
.sheet__head h2 { margin: 0; font-size: 1.1rem; margin-inline-end: auto; }
.sheet__body { padding: 1.35rem; overflow-y: auto; flex: 1; }
.sheet__foot { display: flex; align-items: center; gap: 0.6rem; padding: 1rem 1.35rem; border-top: 1px solid var(--line); background: var(--wash); }

.confirm { position: relative; background: var(--paper); border-radius: var(--radius); padding: 1.5rem; width: min(26rem, 100%); box-shadow: var(--shadow-lg); animation: pop 0.25s var(--ease); }
@keyframes pop { from { transform: scale(0.96); opacity: 0; } }
.confirm h3 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.confirm p { margin: 0 0 1.35rem; color: var(--muted); }
.confirm__actions { display: flex; gap: 0.6rem; justify-content: flex-end; }

/* ----------------------------------------------------------------- tabs */

.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; overflow-x: auto; }
.tab {
  border: 0;
  background: none;
  padding: 0.6rem 0.9rem;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
  margin-bottom: -1px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.tab__dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-inline-start: 0.35rem; vertical-align: middle; }

.langpane[hidden] { display: none; }

/* ------------------------------------------------------------- uploader */

.uploader { display: grid; gap: 0.75rem; }
.thumbs { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.thumb { position: relative; width: 88px; height: 88px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: var(--wash); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb__x {
  position: absolute;
  inset-block-start: 3px;
  inset-inline-end: 3px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(23, 26, 33, 0.72);
  color: #fff;
  font-size: 13px;
  line-height: 1;
}
.thumb__x:hover { background: var(--danger); }
.thumb.is-busy::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,0.65) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3C/svg%3E") center no-repeat; }

.drop {
  display: grid;
  gap: 0.2rem;
  place-items: center;
  padding: 1.5rem;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.drop:hover, .drop.is-over { border-color: var(--accent); background: rgba(138, 109, 59, 0.06); }
.drop small { font-size: 0.78rem; opacity: 0.75; }

/* --------------------------------------------------------------- toasts */

.toasts { position: fixed; inset-block-end: 1rem; inset-inline: 1rem auto; z-index: 90; display: grid; gap: 0.5rem; }
.toast {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--sidebar);
  color: #fff;
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  animation: toastIn 0.3s var(--ease);
  max-width: min(26rem, calc(100vw - 2rem));
}
.toast--ok { background: var(--ok); }
.toast--err { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

.blocker { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; background: rgba(244, 245, 247, 0.6); }
.spinner { width: 30px; height: 30px; border: 3px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------- responsive */

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

  .side {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: var(--side-w);
    transform: translateX(-100%);
    transition: transform 0.32s var(--ease);
  }
  :root[dir='rtl'] .side { transform: translateX(100%); }
  .side.is-open { transform: translateX(0); }

  .side__scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(23,26,33,0.45); opacity: 0; visibility: hidden; transition: opacity 0.3s var(--ease), visibility 0.3s; }
  .side__scrim.is-open { opacity: 1; visibility: visible; }

  .topbar__menu { display: inline-grid; }
  .sheet__panel { width: 100%; }
  .row { grid-template-columns: 1fr; }

  .item { flex-wrap: wrap; }
  .item__main { flex: 1 1 60%; }
  .item__actions { margin-inline-start: auto; }
}

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