/* Perseus RMG — base styles */
:root {
  --ink: #101828; --ink-2: #344054; --muted: #667085; --line: #e4e7ec; --line-2: #f2f4f7;
  --bg: #f6f7f9; --card: #ffffff;
  --brand: #0e7c66; --brand-2: #0a5f4e; --brand-soft: #e6f4f0;
  --side: #0d1b1e; --side-2: #15292d; --side-ink: #b9c7c5; --side-ink-hi: #ffffff;
  --red: #c0352b; --red-soft: #fdecea; --amber: #b54708; --amber-soft: #fef4e6;
  --green: #067647; --green-soft: #e7f6ec; --blue: #175cd3; --blue-soft: #eaf1fd;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans Bengali", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); } .small { font-size: 13px; } .mono { font-family: var(--mono); font-size: 13px; }
.right { text-align: right; } .nowrap { white-space: nowrap; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: var(--side-ink-hi); font-weight: 700; font-size: 16px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 800; flex: none; }
.brand small { display: block; font-weight: 500; font-size: 12px; color: var(--side-ink); }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6f8582; padding: 14px 10px 6px; }
.nav a, .nav span { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; color: var(--side-ink); font-size: 14px; }
.nav a:hover { background: var(--side-2); color: var(--side-ink-hi); text-decoration: none; }
.nav a.on { background: var(--side-2); color: var(--side-ink-hi); box-shadow: inset 3px 0 0 var(--brand); }
.nav span.soon { opacity: .45; cursor: default; }
.nav .tag { margin-left: auto; font-size: 10px; border: 1px solid #36504c; border-radius: 99px; padding: 0 6px; }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.scrim { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { height: 60px; background: var(--card); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 24px; position: sticky; top: 0; z-index: 5; }
.top .title { font-weight: 600; font-size: 16px; }
.top .spacer { flex: 1; }
.top .who { text-align: right; font-size: 13px; line-height: 1.2; }
.top .who b { display: block; font-size: 14px; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px; cursor: pointer; color: var(--ink); }
.content { padding: 24px; max-width: 1200px; width: 100%; }
.banner { padding: 10px 24px; font-size: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.banner.trial { background: var(--amber-soft); color: var(--amber); border-bottom: 1px solid #f7d9b4; }
.banner.imp { background: var(--blue-soft); color: var(--blue); border-bottom: 1px solid #c9dafb; }
.banner form { margin: 0; }

/* ---------- Components ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; flex: 1; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack > * + * { margin-top: 16px; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head > div:first-child { flex: 1; min-width: 200px; }
.page-head h1 { margin: 0; }
.stat { padding: 16px 18px; }
.stat .k { font-size: 13px; color: var(--muted); }
.stat .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12px; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--line-2); text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
.btn-danger { color: var(--red); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: none; color: inherit; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 0; }
.inline { display: inline; margin: 0; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid #d0d5dd; border-radius: 8px; font: inherit; font-size: 15px; color: var(--ink); background: #fff;
}
textarea { height: auto; min-height: 84px; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,124,102,.15); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar input[type=search] { width: 240px; }
.toolbar select { width: auto; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: #fafbfc; }
tr:last-child td { border-bottom: 0; }
tr.off td { color: var(--muted); }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }

.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; border: 1px solid transparent; word-break: break-word; }
.flash-success { background: var(--green-soft); color: var(--green); border-color: #b7e4c7; }
.flash-error { background: var(--red-soft); color: var(--red); border-color: #f5c2bd; }
.flash-info { background: var(--blue-soft); color: var(--blue); border-color: #c9dafb; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 11px 20px; border-bottom: 1px solid var(--line-2); font-size: 14px; display: flex; gap: 10px; }
.list li:last-child { border-bottom: 0; }
.list .when { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); }

.module { padding: 16px; border: 1px dashed #cfd6dd; border-radius: var(--radius); background: #fbfcfc; }
.tile { color: inherit; display: block; }
.tile:hover { text-decoration: none; border-color: var(--brand); }
.tile .k { display: flex; align-items: center; gap: 6px; }
a.module { display: block; color: inherit; }
a.module:hover { text-decoration: none; background: var(--brand-soft); }
.module b { display: block; font-size: 14px; }
.module span { font-size: 13px; color: var(--muted); }
.progress { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); }

/* ---------- Matrix tables (orders, cutting) ---------- */
.matrix td, .matrix th { padding: 8px 10px; }
.matrix input[type=number] { width: 78px; height: 36px; padding: 0 8px; text-align: right; font-variant-numeric: tabular-nums; }
.matrix tfoot th { background: #fafbfc; color: var(--ink); font-size: 14px; text-transform: none; letter-spacing: 0; border-top: 1px solid var(--line); }
.matrix .small { font-size: 12px; }

/* ---------- Sewing / QC ---------- */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; padding: 3px; background: var(--line-2); gap: 2px; flex-wrap: wrap; }
.seg a, .seg button { border: 0; background: none; padding: 7px 12px; border-radius: 7px; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg a:hover { text-decoration: none; }
.seg .on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.stepper { display: flex; align-items: stretch; }
.stepper button { width: 48px; border: 1px solid #d0d5dd; background: var(--line-2); font-size: 22px; font-weight: 700; cursor: pointer; color: var(--ink); }
.stepper button:first-child { border-radius: 8px 0 0 8px; }
.stepper button:last-child { border-radius: 0 8px 8px 0; }
.stepper input[type=number] { border-radius: 0; text-align: center; font-size: 20px; font-weight: 700; height: 48px; border-left: 0; border-right: 0; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid #d0d5dd; background: #fff; border-radius: 99px; padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; user-select: none; -webkit-user-select: none; }
.chip b { color: var(--red); }
.chip.on { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.scanbox { position: relative; border-radius: 12px; overflow: hidden; background: #000; margin-bottom: 12px; aspect-ratio: 4 / 3; }
.scanbox video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanbox .aim { position: absolute; inset: 18% 22%; border: 3px solid rgba(255,255,255,.85); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.board td, .board th { white-space: nowrap; }
.board .now { background: var(--brand-soft); }
.board td.cell { font-weight: 600; font-variant-numeric: tabular-nums; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Guest pages ---------- */
.guest { min-height: 100vh; display: flex; flex-direction: column; }
.guest-top { display: flex; align-items: center; padding: 18px 28px; gap: 12px; }
.guest-top .brand { color: var(--ink); padding: 0; }
.guest-top .brand small { color: var(--muted); }
.guest-top .spacer { flex: 1; }
.auth-box { width: 100%; max-width: 420px; margin: 32px auto; padding: 0 16px; }
.auth-box.wide { max-width: 560px; }
.auth-box .card { padding: 28px; }
.foot { text-align: center; font-size: 13px; color: var(--muted); padding: 24px; margin-top: auto; }

.hero { padding: 56px 28px 40px; max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 2.6rem; letter-spacing: -.03em; line-height: 1.1; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p.lead { font-size: 1.1rem; color: var(--ink-2); max-width: 540px; }
.hero-panel { background: var(--side); border-radius: 16px; padding: 22px; color: var(--side-ink); box-shadow: 0 20px 40px -18px rgba(13,27,30,.55); }
.hero-panel .row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #22393d; font-size: 14px; }
.hero-panel .row:last-child { border-bottom: 0; }
.hero-panel .bar { height: 6px; width: 110px; border-radius: 99px; background: #22393d; overflow: hidden; }
.hero-panel .bar i { display: block; height: 100%; background: #2fc59f; }
.section { max-width: 1100px; margin: 0 auto; padding: 24px 28px 48px; }
.feature { padding: 18px; }
.feature b { display: block; margin-bottom: 4px; }
.feature p { color: var(--muted); font-size: 14px; margin: 0; }
.price { padding: 22px; }
.price .amt { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.price .amt small { font-size: 14px; color: var(--muted); font-weight: 500; }
.price ul { padding-left: 18px; color: var(--ink-2); font-size: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; padding-top: 32px; }
  .hero h1 { font-size: 2rem; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 20; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 15; }
  .menu-btn { display: inline-flex; }
  .top { padding: 0 16px; }
  .top .who span { display: none; }
  .content { padding: 16px; }
  .g2 { grid-template-columns: 1fr; }
  .toolbar input[type=search] { width: 100%; }
  th, td { padding: 10px 12px; }
  .banner { padding: 10px 16px; }
}
@media (max-width: 480px) { .g4 { grid-template-columns: 1fr 1fr; } .stat .v { font-size: 22px; } .guest-top { padding: 14px 16px; } }
