/* Catalogue Master — shared styles, msite.ae-inspired system: Inter, light grey page, white bordered cards, blue primary with blue→violet gradient accents. */
:root {
  --bg: #F9FAFB; --surface: #FFFFFF; --surface-2: #EFF2F7; --surface-3: #F5F7FA; --fg: #070A10; --muted: #6F737C; --line: #DBDEE5;
  --primary: #1B4ED8; --primary-fg: #FAFAFA; --primary-soft: #EEF2F9; --violet: #7C3AED; --grad: linear-gradient(100deg, #1B4ED8 0%, #4F46E5 55%, #7C1AF0 100%);
  --accent: #1B4ED8; --accent-ink: #FFFFFF;
  --ok: #009B63; --warn: #D98B09; --bad: #E40014; --purple: #AC4AFF; --wa: #25D366;
  --display: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif; --body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif; --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --radius: 10px; --radius-lg: 16px; --shadow: 0 1px 2px rgba(7,10,16,.04), 0 8px 24px rgba(27,78,216,.06); --shadow-lg: 0 20px 60px rgba(27,78,216,.12);
}
:root[data-theme="dark"] { --bg: #0B0F17; --surface: #121826; --surface-2: #1A2234; --surface-3: #10151F; --fg: #F2F4F8; --muted: #9AA3B2; --line: #263044; --primary: #4F7BFF; --primary-fg: #FFFFFF; --primary-soft: #16213A; --accent: #4F7BFF; color-scheme: dark; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--display); margin: 0; line-height: 1.1; text-wrap: balance; letter-spacing: -0.025em; }
h1 { font-size: clamp(30px, 4.4vw, 48px); font-weight: 800; }
h2 { font-size: clamp(22px, 3vw, 36px); font-weight: 800; }
h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.015em; }
h4 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.eyebrow { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wrap { max-width: 1160px; margin: 0 auto; padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; min-width: 0; }
.hidden, [hidden] { display: none !important; }
.cc { display: grid; grid-template-columns: 120px 1fr; gap: 8px; }
.keybox { font-family: var(--mono); font-size: 20px; letter-spacing: .08em; background: var(--primary-soft); color: var(--primary); padding: 14px; border-radius: var(--radius); text-align: center; user-select: all; border: 1px solid var(--line); }

/* theme toggle */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }
.theme-toggle:hover { color: var(--fg); background: var(--surface-2); }
.theme-toggle.wide { width: auto; padding: 0 12px; font-size: 13px; font-weight: 500; }

/* badges & pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.pill.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.pill.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.pill.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.pill.blue { background: var(--primary-soft); color: var(--primary); }
.badge-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--line)); background: var(--primary-soft); color: var(--primary); font-size: 13px; font-weight: 600; }
.icon-tile { width: 48px; height: 48px; border-radius: 12px; background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--line)); display: grid; place-items: center; color: var(--primary); font-size: 20px; }
.icon-tile.violet { background: color-mix(in srgb, var(--violet) 10%, var(--surface)); color: var(--violet); border-color: color-mix(in srgb, var(--violet) 22%, var(--line)); }
.icon-tile.green { background: color-mix(in srgb, var(--ok) 10%, var(--surface)); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 22%, var(--line)); }
.icon-tile.orange { background: color-mix(in srgb, var(--warn) 10%, var(--surface)); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, var(--line)); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 500; min-height: 42px; text-decoration: none; transition: transform .08s ease, background .15s ease, box-shadow .15s ease; color: var(--fg); }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn.primary { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); box-shadow: 0 6px 16px rgba(27,78,216,.22); }
.btn.primary:hover { filter: brightness(1.06); background: var(--primary); }
.btn.accent { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.btn.wa { background: var(--wa); color: #06351C; border-color: var(--wa); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--fg); background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 6px 12px; min-height: 32px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.icon { width: 42px; padding: 0; }
.btn.white { background: #fff; color: var(--primary); border-color: #fff; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.18); }

/* forms */
label.field { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--fg); }
label.field > span.hint { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=tel], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--fg); min-height: 42px; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); outline: none; }
textarea { min-height: 90px; resize: vertical; }
input[type=color] { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--surface); }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; color: var(--fg); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px 18px; margin: 0; display: grid; gap: 12px; min-width: 0; background: var(--surface); }
legend { font-family: var(--display); font-weight: 700; padding-inline: 6px; letter-spacing: -0.01em; }
.error { color: var(--bad); font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; min-width: 0; box-shadow: var(--shadow); }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow); z-index: 50; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.avatar { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: var(--surface-2); }
.thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 12px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.drop { border: 2px dashed var(--line); border-radius: var(--radius-lg); padding: 18px; text-align: center; color: var(--muted); cursor: pointer; background: var(--surface-3); }
.drop.over { border-color: var(--primary); color: var(--fg); }
.imgs { display: flex; gap: 8px; flex-wrap: wrap; }
.imgs .im { position: relative; }
.imgs .im img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.imgs .im button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--fg); color: var(--bg); cursor: pointer; font-size: 12px; line-height: 1; }
.imgs .im.hero img { outline: 2px solid var(--primary); }
.kbd { font-family: var(--mono); font-size: 12px; background: var(--surface-2); padding: 2px 6px; border-radius: 4px; }
/* stat tiles (msite style: label above, coloured number) */
.stat { display: grid; gap: 4px; }
.stat .eyebrow { font-size: 11px; }
.stat .big { font-family: var(--display); font-size: 28px; font-weight: 800; letter-spacing: -0.03em; color: var(--primary); }
.stat.green .big { color: var(--ok); } .stat.violet .big { color: var(--purple); } .stat.orange .big { color: var(--warn); }
/* gradient band */
.cta-band { background: var(--grad); color: #fff; border-radius: 0; }
.cta-band .wrap { text-align: center; padding-block: 72px; display: grid; gap: 16px; justify-items: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.85); max-width: 52ch; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
