/* Jewellery Manager Plus – maroon / gold theme, no build step */
:root {
  --maroon-900: #3d0a1d;
  --maroon-800: #5a0e2a;
  --maroon-600: #8e1b3f;
  --maroon-100: #fbeef2;
  --gold: #f5c451;
  --gold-600: #d9a52b;
  --gold-50: #fff8e6;
  --bg: #f7f3ee;
  --card: #ffffff;
  --text: #2a1f22;
  --muted: #7a6a6f;
  --line: #eadfd8;
  --green: #1f7a4a;
  --green-50: #e8f6ee;
  --red: #b42323;
  --red-50: #fdecec;
  --blue: #1f5e9c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(60, 10, 30, .06), 0 4px 14px rgba(60, 10, 30, .06);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", Arial, sans-serif; font-size: 15px; color: var(--text); background: var(--bg); line-height: 1.45; }
a { color: var(--maroon-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .6rem; color: var(--maroon-800); line-height: 1.2; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
.hi { color: var(--muted); font-size: .85em; font-weight: 400; }
small, .muted { color: var(--muted); }
img { max-width: 100%; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 236px; flex-shrink: 0; background: linear-gradient(180deg, var(--maroon-800), var(--maroon-900)); color: #f3e6ea; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 16px; border-bottom: 1px solid rgba(255,255,255,.08); color: #fff; }
.sidebar .brand img { width: 36px; height: 36px; border-radius: 8px; background: #fff; object-fit: contain; }
.sidebar .brand b { display: block; font-size: 15px; }
.sidebar .brand span { color: var(--gold); font-size: 12px; letter-spacing: .5px; }
.nav { padding: 8px 0 24px; }
.nav .group { padding: 14px 18px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: rgba(245,196,81,.75); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 18px; color: #f3e6ea; border-left: 3px solid transparent; }
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.nav a.active { background: rgba(245,196,81,.12); border-left-color: var(--gold); color: #fff; font-weight: 600; }
.nav a .i { width: 20px; text-align: center; }
.nav a .hi { color: rgba(243,230,234,.6); margin-left: auto; font-size: 12px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .title { font-weight: 600; color: var(--maroon-800); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { display: none; background: none; border: 0; font-size: 22px; color: var(--maroon-800); cursor: pointer; padding: 4px 8px; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.content { padding: 20px; max-width: 1280px; width: 100%; }
.footer { margin-top: auto; padding: 14px 20px; font-size: 12px; color: var(--muted); }

/* ---------- bars ---------- */
.imp-bar { background: #1d1d1d; color: #fff; padding: 8px 16px; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: 14px; }
.imp-bar b { color: var(--gold); }
.ro-bar { background: var(--red-50); color: var(--red); border-bottom: 1px solid #f3c5c5; padding: 8px 16px; text-align: center; font-size: 14px; }
.trial-bar { background: var(--gold-50); color: #7a5a00; border-bottom: 1px solid #f1dfa8; padding: 6px 16px; text-align: center; font-size: 13px; }
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }
.flash.success { background: var(--green-50); color: var(--green); border: 1px solid #bfe3cf; }
.flash.error { background: var(--red-50); color: var(--red); border: 1px solid #f3c5c5; }
.flash ul { margin: 0; padding-left: 18px; }

/* ---------- cards / grid ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 14px; }
.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)); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; right: -18px; top: -18px; width: 64px; height: 64px; border-radius: 50%; background: var(--gold-50); }
.stat .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.stat .value { font-size: 1.45rem; font-weight: 700; color: var(--maroon-800); margin-top: 4px; position: relative; z-index: 1; }
.stat .sub { font-size: 12px; color: var(--muted); }
.stat.gold { background: linear-gradient(135deg, var(--maroon-800), var(--maroon-600)); color: #fff; border: 0; }
.stat.gold .label, .stat.gold .sub { color: rgba(255,255,255,.75); }
.stat.gold .value { color: var(--gold); }
.stat.gold::after { background: rgba(245,196,81,.15); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--maroon-800); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { text-decoration: none; background: var(--maroon-100); }
.btn-primary { background: var(--maroon-800); border-color: var(--maroon-800); color: #fff; }
.btn-primary:hover { background: var(--maroon-600); }
.btn-gold { background: var(--gold); border-color: var(--gold-600); color: var(--maroon-900); }
.btn-gold:hover { background: var(--gold-600); }
.btn-danger { color: var(--red); border-color: #f0c4c4; }
.btn-danger:hover { background: var(--red-50); }
.btn-sm { padding: 4px 10px; font-size: 13px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn-google { background: #fff; color: #333; border-color: #dadce0; }
.btn-google img { width: 18px; height: 18px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--maroon-600); font: inherit; cursor: pointer; }
form.inline { display: inline; }

/* ---------- forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: #4d3a40; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=tel], input[type=search], input[type=file], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #d9cbc4; border-radius: 9px; font: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(142,27,63,.25); border-color: var(--maroon-600); }
input[readonly] { background: #faf6f3; }
.field { margin-bottom: 12px; }
.field .err { color: var(--red); font-size: 12px; margin-top: 3px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.check input { width: auto; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 12px; }
.filters > * { flex: 0 1 auto; }
.filters input, .filters select { width: auto; min-width: 140px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); background: #fbf7f4; white-space: nowrap; }
tr:hover td { background: #fffaf6; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tfoot td { font-weight: 700; background: #fbf7f4; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eee; color: #444; white-space: nowrap; }
.badge.green { background: var(--green-50); color: var(--green); }
.badge.red { background: var(--red-50); color: var(--red); }
.badge.gold { background: var(--gold-50); color: #8a6200; }
.badge.maroon { background: var(--maroon-100); color: var(--maroon-800); }
.badge.blue { background: #e7f0fa; color: var(--blue); }
.plus { color: var(--green); } .minus { color: var(--red); }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }

/* ---------- pagination ---------- */
.pager { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.pager a, .pager span { padding: 5px 11px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 13px; }
.pager .current { background: var(--maroon-800); color: #fff; border-color: var(--maroon-800); }
.pager .disabled { color: #bbb; }

/* ---------- bill lines ---------- */
.lines input, .lines select { padding: 6px 7px; font-size: 14px; min-width: 70px; }
.lines td { padding: 5px 4px; }
.lines .desc { min-width: 160px; }
.totals { max-width: 380px; margin-left: auto; }
.totals .row { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--line); gap: 10px; }
.totals .row.grand { font-size: 1.2rem; font-weight: 700; color: var(--maroon-800); border-bottom: 2px solid var(--maroon-800); }
.thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--gold-50); }
.item-card { display: flex; gap: 12px; align-items: center; }

/* ---------- auth / landing ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: radial-gradient(circle at 20% 10%, rgba(245,196,81,.25), transparent 40%), linear-gradient(160deg, var(--maroon-800), var(--maroon-900)); }
.auth-card { background: #fff; width: 100%; max-width: 440px; border-radius: 18px; padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.auth-card .logo { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; }
.auth-card .logo img { width: 46px; height: 46px; }
.auth-card .logo b { color: var(--maroon-800); font-size: 18px; display: block; }
.auth-card .logo span { color: var(--gold-600); font-size: 13px; font-weight: 600; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 14px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.hero { background: radial-gradient(circle at 80% 0%, rgba(245,196,81,.25), transparent 45%), linear-gradient(160deg, var(--maroon-800), var(--maroon-900)); color: #fff; padding: 22px 20px 60px; }
.hero nav { display: flex; align-items: center; gap: 12px; max-width: 1100px; margin: 0 auto 40px; }
.hero nav .brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 18px; flex: 1; }
.hero nav .brand img { width: 40px; height: 40px; background: #fff; border-radius: 10px; }
.hero nav .brand em { color: var(--gold); font-style: normal; }
.hero .inner { max-width: 1100px; margin: 0 auto; }
.hero h1 { color: #fff; font-size: 2.3rem; max-width: 720px; }
.hero h1 em { color: var(--gold); font-style: normal; }
.hero p { color: rgba(255,255,255,.85); font-size: 1.1rem; max-width: 640px; }
.section { max-width: 1100px; margin: 0 auto; padding: 36px 20px; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.feature b { color: var(--maroon-800); display: block; margin-bottom: 4px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.plan { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.plan.default { border: 2px solid var(--gold-600); }
.plan .price { font-size: 2rem; font-weight: 800; color: var(--maroon-800); }
.plan ul { padding-left: 18px; color: #4d3a40; flex: 1; }

/* ---------- print ---------- */
.invoice { background: #fff; }
.invoice .inv-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid var(--maroon-800); padding-bottom: 12px; margin-bottom: 12px; }
.invoice .inv-head img { max-height: 70px; }
@media print {
  .sidebar, .topbar, .imp-bar, .trial-bar, .ro-bar, .no-print, .footer, .flash { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
}

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { box-shadow: 4px 0 24px rgba(0,0,0,.3); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; }
  .menu-btn { display: inline-block; }
  .content { padding: 14px; }
  .g2 { grid-template-columns: 1fr; }
  .user-chip .name { display: none; }
  .hero h1 { font-size: 1.7rem; }
}
@media (max-width: 520px) {
  .g4, .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat .value { font-size: 1.15rem; }
  .filters input, .filters select { min-width: 0; width: 100%; }
  .filters > * { flex: 1 1 45%; }
  .hide-sm { display: none; }
}
