/* ebndr design system: tokens + base + components. Page layouts live in app.css / storefront.css. */
:root {
  --font: "Tajawal", "Segoe UI", system-ui, -apple-system, Tahoma, sans-serif;
  --serif: "Amiri", "Times New Roman", serif;

  /* neutrals (ink on warm paper) */
  --ink: #1b1a17; --ink-2: #3d3a33; --muted: #77705f; --faint: #a39b86;
  --line: #d9d1bd; --line-2: #e8e1cf; --bg: #f4efe4; --surface: #fbf8f0;

  /* brand: platform accent (companies override --theme on their site) */
  --brand: #8a6a2f; --theme: var(--brand);
  --brand-ink: color-mix(in srgb, var(--theme) 78%, #000);
  --brand-soft: color-mix(in srgb, var(--theme) 9%, #fff);
  --brand-line: color-mix(in srgb, var(--theme) 28%, #fff);

  /* semantic */
  --ok: #15803d;   --ok-bg: #ecfdf3;
  --warn: #b45309; --warn-bg: #fff7e6;
  --err: #b91c1c;  --err-bg: #fef2f2;
  --info: #1d4ed8; --info-bg: #eff6ff;

  --r-sm: 2px; --r: 3px; --r-lg: 4px;
  --shadow-sm: none;
  --shadow: 0 1px 0 var(--line);
  --ring: 0 0 0 3px color-mix(in srgb, var(--theme) 28%, transparent);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.75;
       font-size: 16px; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.3; margin: 0 0 .5em; font-weight: 700; letter-spacing: 0; }
h1 { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.3rem); }
h2 { font-size: 1.45rem; } h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
bdi { unicode-bidi: isolate; }
.muted { color: var(--muted); } small { font-size: .84em; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

/* icons */
.i { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.75;
     stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -.2em; }
.i-lg { width: 1.6em; height: 1.6em; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .6rem 1.1rem;
       border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink);
       font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none; line-height: 1.4;
       transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn:hover { border-color: var(--ink); text-decoration: none; background: #fff; }
.btn:active { transform: translateY(1px); }
.btn.primary, .btn-primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.primary:hover, .btn-primary:hover { background: var(--theme); border-color: var(--theme); color: #fff; }
.btn.danger { color: var(--err); border-color: #fecaca; background: #fff; }
.btn.danger:hover { background: var(--err-bg); border-color: #fca5a5; }
.btn.block { display: flex; width: 100%; }
.btn.lg { padding: .8rem 1.5rem; font-size: 1.02rem; border-radius: var(--r); }
.btn.sm { padding: .35rem .7rem; font-size: .85rem; }
.btn.link { border: 0; background: none; padding: 0; color: var(--brand-ink); font-weight: 600; box-shadow: none; }
.btn.link.danger { color: var(--err); background: none; border: 0; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.25rem;
        margin-bottom: 1rem; box-shadow: var(--shadow-sm); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }

/* forms */
label { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 .3rem; color: var(--ink-2); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date],
input[type=tel], input[type=search], select, textarea {
  width: 100%; padding: .65rem .85rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff;
  font: inherit; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--theme); box-shadow: var(--ring); }
input[type=file] { font: inherit; padding: .4rem 0; max-width: 100%; }
input[type=checkbox], input[type=radio] { width: 1.05rem; height: 1.05rem; accent-color: var(--theme); vertical-align: -.15em; margin-inline-end: .4rem; }
textarea { min-height: 6rem; resize: vertical; }
.errorlist { list-style: none; margin: .25rem 0 .5rem; padding: 0; color: var(--err); font-size: .86rem; }
.helptext { display: block; color: var(--muted); font-size: .82rem; margin-top: .25rem; }
form > div:not([class]) { margin-bottom: 1rem; }
form > div:not([class]) label:has(+ input[type=checkbox]), form > div:not([class]) > label:only-child { display: inline-block; }

/* feedback */
.msg, .notice { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 1rem; border-radius: var(--r-sm);
  background: var(--info-bg); color: #1e3a8a; border: 1px solid #dbeafe; margin-bottom: 1rem; font-size: .95rem; }
.msg.success, .notice.success { background: var(--ok-bg); color: #14532d; border-color: #bbf7d0; }
.msg.error, .notice.error { background: var(--err-bg); color: #7f1d1d; border-color: #fecaca; }
.msg.warning, .notice.warning { background: var(--warn-bg); color: #78350f; border-color: #fde68a; }

/* badges */
.badge, .tag { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .6rem; border-radius: 2px;
  background: var(--line-2); color: var(--ink-2); font-size: .78rem; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.badge::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; opacity: .7; }
.badge-submitted, .badge-awaiting_payment { background: var(--warn-bg); color: var(--warn); }
.badge-approved, .badge-payment_uploaded, .badge-payment_verified, .badge-shipped, .badge-delivered { background: var(--info-bg); color: var(--info); }
.badge-completed { background: var(--ok-bg); color: var(--ok); }
.badge-rejected, .badge-cancelled { background: var(--err-bg); color: var(--err); }
.tag.out { background: var(--err-bg); color: var(--err); }

/* tables */
table { width: 100%; border-collapse: collapse; }
table.card { padding: 0; overflow: hidden; display: table; }
th, td { text-align: start; padding: .8rem 1rem; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
th { background: transparent; border-bottom: 1px solid var(--ink);  font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: none; white-space: nowrap; }
tbody tr:hover td, table tr:hover td { background: #fcfdfe; }
tr:last-child td { border-bottom: 0; }

/* misc */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .i { width: 2.4rem; height: 2.4rem; color: var(--faint); margin-bottom: .6rem; }
.kbd, code { background: var(--line-2); padding: .05rem .4rem; border-radius: 6px; font-size: .85em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.htmx-indicator { opacity: 0; transition: opacity .2s; } .htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* selects match text inputs */
select { appearance: none; -webkit-appearance: none; padding-inline-end: 2.2rem;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2377705f' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat;
  background-size: 1.1rem; background-position: left .7rem center; line-height: 1.75; }
[dir=ltr] select { background-position: right .7rem center; }
