/* =====================================================================
   Oshop design tokens + shared components
   Palette: jamdani ink-green, marigold, mint wash, cool paper, coral
   ===================================================================== */
@font-face { font-family: "Bricolage Grotesque"; src: url("../fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../fonts/figtree-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../fonts/figtree-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../fonts/figtree-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../fonts/figtree-700.woff2") format("woff2"); font-weight: 700 800; font-display: swap; }

:root {
  --ink: #0D3B35;
  --ink-2: #0A2E29;
  --ink-soft: #1F5A51;
  --marigold: #F5B21B;
  --marigold-soft: #FFF3D1;
  --mint: #E4F1EC;
  --paper: #F6F8F7;
  --white: #FFFFFF;
  --text: #15211F;
  --muted: #5B6B68;
  --faint: #8E9C99;
  --line: #E1E7E5;
  --line-strong: #CBD5D2;
  --coral: #D9472F;
  --coral-soft: #FDECE8;
  --green: #138A5B;
  --green-soft: #E3F5EC;
  --amber: #A86A00;
  --amber-soft: #FFF4DA;
  --blue: #1E63C4;
  --blue-soft: #E7F0FC;
  --violet: #6A3FC1;
  --violet-soft: #F0EAFB;
  --cyan: #0B7F93;
  --cyan-soft: #E2F4F7;
  --slate: #5B6B68;
  --slate-soft: #EEF2F1;

  --font-display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 28px;
  --shadow-1: 0 1px 2px rgba(13, 59, 53, .06), 0 1px 1px rgba(13, 59, 53, .04);
  --shadow-2: 0 10px 30px -12px rgba(13, 59, 53, .25);
  --shadow-3: 0 30px 60px -20px rgba(10, 46, 41, .35);
  --focus: 0 0 0 3px rgba(245, 178, 27, .55);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); color: var(--text); background: var(--paper);
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.12; margin: 0; letter-spacing: -0.02em; font-weight: 700; }
p { margin: 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
[data-lucide] { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 32px; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1; }

/* ---------- brand */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 21px; letter-spacing: -0.03em; color: var(--ink); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--ink); display: grid; place-items: center; position: relative; overflow: hidden; }
.brand-mark::before { content: ""; position: absolute; width: 22px; height: 11px; border: 3px solid var(--marigold); border-top: 0; border-radius: 0 0 14px 14px; top: 10px; }
.brand-mark::after { content: ""; position: absolute; width: 22px; height: 3px; background: #fff; top: 8px; border-radius: 3px; }

/* ---------- buttons */
.btn { --bg: var(--ink); --fg: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px; border: 1px solid transparent; background: var(--bg); color: var(--fg);
  font: 600 14.5px/1.1 var(--font-body); text-decoration: none; cursor: pointer; transition: background .15s, transform .1s, box-shadow .15s;
  white-space: nowrap; }
.btn:hover { background: var(--ink-soft); }
.btn:active { transform: translateY(1px); }
.btn-accent { --bg: var(--marigold); --fg: var(--ink-2); }
.btn-accent:hover { background: #FFC23D; }
.btn-ghost { --bg: transparent; --fg: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--white); border-color: var(--ink); }
.btn-soft { --bg: var(--mint); --fg: var(--ink); }
.btn-soft:hover { background: #D3E8E0; }
.btn-danger { --bg: var(--coral-soft); --fg: var(--coral); }
.btn-danger:hover { background: #FAD9D1; }
.btn-lg { padding: 15px 24px; font-size: 16px; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--white); color: var(--text); cursor: pointer; text-decoration: none; }
.icon-btn:hover { border-color: var(--line-strong); background: var(--paper); }

/* ---------- forms */
.field { display: block; }
.field + .field { margin-top: 16px; }
.field > label, .label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; color: var(--text); }
.field .help { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.field .error, .errorlist { color: var(--coral); font-size: 13px; margin: 6px 0 0; padding: 0; list-style: none; }
.input { width: 100%; padding: 11px 13px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--white);
  font: 15px/1.4 var(--font-body); color: var(--text); transition: border-color .15s, box-shadow .15s; }
.input:hover { border-color: #AEBDB9; }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(13, 59, 53, .12); }
textarea.input { resize: vertical; min-height: 44px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235B6B68' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
input[type=color].input { padding: 4px; height: 44px; cursor: pointer; }
.has-error .input { border-color: var(--coral); }
.checkbox { width: 18px; height: 18px; accent-color: var(--ink); vertical-align: middle; }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check-row label { font-weight: 500; margin: 0; }
.file-input { font: 14px var(--font-body); width: 100%; padding: 10px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); background: var(--white); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 > .field + .field, .grid-3 > .field + .field { margin-top: 0; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--slate-soft); color: var(--slate); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.tone-green { background: var(--green-soft); color: var(--green); }
.tone-amber { background: var(--amber-soft); color: var(--amber); }
.tone-red { background: var(--coral-soft); color: var(--coral); }
.tone-blue { background: var(--blue-soft); color: var(--blue); }
.tone-violet { background: var(--violet-soft); color: var(--violet); }
.tone-cyan { background: var(--cyan-soft); color: var(--cyan); }
.tone-slate { background: var(--slate-soft); color: var(--slate); }

/* ---------- alerts / messages */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: var(--r-md); font-size: 14px; border: 1px solid transparent; }
.alert [data-lucide] { margin-top: 2px; }
.alert-success { background: var(--green-soft); color: #0C5E3E; border-color: #C4E8D6; }
.alert-error { background: var(--coral-soft); color: #9B2C19; border-color: #F6CFC5; }
.alert-info { background: var(--blue-soft); color: #174B93; border-color: #CFE0F7; }
.alert-warning { background: var(--amber-soft); color: #7A4D00; border-color: #F5DFA6; }
.messages { position: fixed; top: 16px; right: 16px; z-index: 100; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.messages .alert { box-shadow: var(--shadow-2); animation: toast-in .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FAFBFB; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FAFCFB; }
.table a.row-link { text-decoration: none; font-weight: 600; }
.table a.row-link:hover { text-decoration: underline; }

/* ---------- pagination */
.pager-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 16px 18px; border-top: 1px solid var(--line); font-size: 13.5px; }
.pager-info { color: var(--muted); }
.pager-info b { color: var(--text); font-weight: 600; }
.pager { display: flex; gap: 4px; align-items: center; justify-content: center; }
.pager a, .pager span { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 10px; display: inline-grid; place-items: center; text-decoration: none; font-weight: 600; color: var(--text); }
.pager a:hover { background: var(--slate-soft); }
.pager span.current { background: var(--ink); color: #fff; }
.pager .pg-gap { min-width: 20px; padding: 0; color: var(--faint); }
.pager .pg-arrow { border: 1px solid var(--line); background: var(--white); }
.pager .pg-arrow.off { opacity: .35; }
.pager [data-lucide] { width: 16px; height: 16px; }
.pager-size { justify-self: end; }
.pager-size label { display: flex; gap: 8px; align-items: center; color: var(--muted); }
.pager-size select { border: 1px solid var(--line-strong); border-radius: 8px; padding: 5px 8px; font: 600 13px var(--font-body); background: var(--white); }
@media (max-width: 700px) { .pager-bar { grid-template-columns: 1fr; justify-items: center; text-align: center; } .pager-size { justify-self: center; } .pager a, .pager span { min-width: 32px; height: 32px; padding: 0 6px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.field + .grid-2, .field + .grid-3, .grid-2 + .field, .grid-3 + .field, .grid-2 + .grid-2 { margin-top: 16px; }
