/* RDSS Decor Software — panel + app styles (no build step needed) */
:root {
  --bg: #f4f4f2;
  --surface: #ffffff;
  --surface-2: #faf8f5;
  --ink: #1f1d1a;
  --ink-2: #5d5850;
  --ink-3: #8e877c;
  --line: #e3e2de;
  --brand: #b8900c;        /* RDSS gold (text-safe) */
  --gold: #f2c418;         /* RDSS gold (logo) */
  --silver: #c9c9cc;
  --black: #0e0e0e;
  --brand-ink: #111111;
  --brand-soft: #fbf3d6;
  --accent: #1f6f5c;       /* deep green */
  --ok: #1f7a4d;
  --ok-soft: #e3f3ea;
  --warn: #a8640c;
  --warn-soft: #fbf0dd;
  --bad: #b3261e;
  --bad-soft: #fbe6e4;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(31, 29, 26, .06), 0 2px 8px rgba(31, 29, 26, .04);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Bengali", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; 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 { margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: .95rem; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 1rem; } .mb { margin-bottom: 1rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- Admin shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: var(--black); color: #d6d6d8; padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .6rem; padding: .25rem .5rem 1rem; color: #fff; }
.brand img { height: 40px; width: 40px; object-fit: contain; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--gold); color:#111; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; letter-spacing: .5px; }
.brand b { display: block; font-size: 15px; }
.brand span { font-size: 11px; color: var(--silver); }
.brand b { color: var(--gold); letter-spacing: .04em; }
.nav-group { margin: .9rem 0 .3rem; padding: 0 .6rem; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #77777c; }
.nav a { display: flex; align-items: center; gap: .55rem; padding: .48rem .6rem; border-radius: 7px; color: #d6d6d8; font-size: 13.5px; }
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.nav a.active { background: var(--gold); color: #111; font-weight: 600; }
.nav svg { width: 16px; height: 16px; flex: none; opacity: .85; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1.5rem; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar .who { font-size: 13px; color: var(--ink-2); }
.content { padding: 1.5rem; max-width: 1280px; }
.menu-btn { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--ink); }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -260px; width: 250px; z-index: 50; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .menu-btn { display: block; }
  .content { padding: 1rem; }
}

/* ---------- Cards, tables ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 1rem 1.1rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; font-size: 1rem; }
.stat { padding: 1rem 1.1rem; }
.stat .label { font-size: 12px; color: var(--ink-3); }
.stat .value { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: .2rem; }
.stat .sub { font-size: 12px; color: var(--ink-2); }
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th, .t td { padding: .6rem .8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.t th { font-size: 11.5px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); white-space: nowrap; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: #fcfbf9; }
.t tfoot td { font-weight: 700; background: var(--surface-2); }
.thumb { width: 42px; height: 42px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); display: block; }
.empty { padding: 2.5rem 1rem; text-align: center; color: var(--ink-3); }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: .12rem .5rem; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

/* ---------- Forms ---------- */
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: .3rem; }
.field { margin-bottom: .9rem; }
.input, select.input, textarea.input {
  width: 100%; padding: .55rem .7rem; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid #d8d2c7; border-radius: 8px; outline: none; min-height: 38px;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(242, 196, 24, .25); }
textarea.input { min-height: 80px; resize: vertical; }
.input.sm { padding: .35rem .5rem; min-height: 32px; font-size: 13px; }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 500; color: var(--ink); }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.hint { font-size: 12px; color: var(--ink-3); margin-top: .25rem; }
.error-text { font-size: 12px; color: var(--bad); margin-top: .25rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem 1rem; min-height: 38px; font: inherit; font-weight: 600; font-size: 13.5px; border-radius: 8px; border: 1px solid #d8d2c7; background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--gold); border-color: #d9ae0e; color: #111; }
.btn.primary:hover { background: #e3b512; }
.btn.green { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--bad); border-color: #e9c4c0; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm { padding: .3rem .65rem; min-height: 30px; font-size: 12.5px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn svg { width: 16px; height: 16px; }
form.inline { display: inline; }

.alert { padding: .7rem .9rem; border-radius: 8px; margin-bottom: 1rem; font-size: 13.5px; }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert ul { margin: .3rem 0 0 1.1rem; padding: 0; }

.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.filters .input { width: auto; min-width: 140px; }
.pager { padding: .8rem 1rem; }
.pager nav { display: flex; justify-content: center; }
.pager svg { width: 16px; height: 16px; }
.pager .hidden { display: none; }
.pager nav > div:first-child { display: none; }
.pager nav span, .pager nav a { display: inline-block; padding: .25rem .55rem; border: 1px solid var(--line); margin: 0 -1px 0 0; font-size: 13px; background: #fff; }

/* ---------- Billing items table ---------- */
.items .input { min-height: 34px; padding: .35rem .5rem; font-size: 13px; }
.items td { padding: .35rem .4rem; }
.items .col-desc { min-width: 220px; }
.items .col-sm { width: 82px; }
.items .col-xs { width: 64px; }
.totals { width: 100%; max-width: 360px; margin-left: auto; }
.totals td { padding: .3rem .2rem; }
.totals tr.grand td { font-size: 1.1rem; font-weight: 800; border-top: 2px solid var(--ink); padding-top: .5rem; }
.suggest { position: absolute; z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 260px; overflow-y: auto; width: 100%; }
.suggest div { padding: .5rem .7rem; cursor: pointer; border-bottom: 1px solid var(--line); font-size: 13px; }
.suggest div:hover, .suggest div.on { background: var(--brand-soft); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem;
  background: radial-gradient(circle at 50% 20%, #2a2a2a 0%, #0e0e0e 70%); }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 14px; padding: 1.75rem 1.5rem; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.login-card .logo { display: flex; justify-content: center; margin-bottom: .75rem; }
.login-card .logo img { max-height: 110px; max-width: 200px; }
.login-card .logo { background: var(--black); border-radius: 12px; padding: .9rem; margin: -.4rem -.2rem 1rem; }
.login-card h1 { text-align: center; font-size: 1.25rem; margin-bottom: .2rem; }
.login-card p.sub { text-align: center; color: var(--ink-3); margin: 0 0 1.25rem; font-size: 13px; }

/* ---------- Mobile app (dealer) ---------- */
.app-body { background: var(--bg); padding-bottom: 72px; }
.app-top { position: sticky; top: 0; z-index: 20; background: var(--black); color: #fff; border-bottom: 1px solid #222; padding: .65rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.app-top .title { font-weight: 700; font-size: 16px; }
.app-top img { height: 30px; max-width: 110px; object-fit: contain; }
.app-main { padding: 1rem; max-width: 820px; margin: 0 auto; }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .5rem 0 .55rem; font-size: 11px; color: var(--ink-3); font-weight: 600; }
.tabbar a.active { color: var(--brand); }
.tabbar a:hover { text-decoration: none; }
.tabbar svg { width: 22px; height: 22px; }
.hero { background: linear-gradient(135deg, #0e0e0e, #2b2b2e); color: #fff; border-radius: 14px; padding: 1.2rem; margin-bottom: 1rem; }
.hero h1 { font-size: 1.2rem; margin-bottom: .25rem; }
.hero p { margin: 0 0 .9rem; color: var(--silver); font-size: 13px; }
.hero h1 { color: var(--gold); }
.hero .btn { background: var(--gold); color: #111; border-color: var(--gold); }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; color: var(--ink); display: block; }
.tile:hover { text-decoration: none; box-shadow: var(--shadow); }
.tile .swatch { aspect-ratio: 1 / 1; background: var(--surface-2) center / cover no-repeat; position: relative; }
.tile .swatch .badge { position: absolute; top: 8px; left: 8px; }
.tile .meta { padding: .55rem .65rem .65rem; }
.tile .code { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.tile .name { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.tile .qty { font-size: 12.5px; margin-top: .2rem; }
.chips { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .25rem; margin-bottom: .75rem; scrollbar-width: none; }
.chips a { flex: none; padding: .35rem .8rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.chips a.on { background: var(--black); border-color: var(--black); color: var(--gold); }
.chips a:hover { text-decoration: none; }
.search { display: flex; gap: .5rem; margin-bottom: .75rem; }
