/* Seema Jewellers web app — plain CSS, Helvetica everywhere (v1.1.5). */

:root {
  --gold-600: #a47a22;
  --gold-500: #bf9535;
  --gold-200: #ecdcae;
  --gold-100: #f6eed6;
  --ivory: #faf6ee;
  --paper: #fffdf9;
  --ink: #2a2118;
  --mut: #807463;
  --line: #eadfca;
  --line2: #f1e9d8;
  --red: #b3372f;
  --red-bg: #fbe9e6;
  --grn: #2b7a4b;
  --grn-bg: #e3f3e8;
  --amb: #8f5f0a;
  --amb-bg: #fdf0d2;
  --title: #43040b;
  --accent: #5b0a14;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--ivory);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}
a { color: var(--accent); }
h1, h2, h3 { margin: 0 0 8px; color: var(--title); }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
.mut { color: var(--mut); font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.r { text-align: right; }
.c { text-align: center; }

header.top {
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
header.top .shop { font-size: 20px; font-weight: 700; letter-spacing: 0.5px; }
header.top .shop small { display: block; font-size: 12px; font-weight: 400; opacity: 0.85; }
header.top .who { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.role-badge {
  background: var(--gold-500); color: #fff; border-radius: 20px;
  padding: 2px 10px; font-size: 12px; font-weight: 700; text-transform: uppercase;
}
/* v1.2.1: header icon button (Settings gear) — icon only, transparent. */
.icon-btn { background: none; border: 0; padding: 6px; min-height: 0; border-radius: 8px; color: inherit; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn.on { color: var(--accent); }

nav.tabs {
  display: flex; gap: 4px; padding: 8px 12px 0;
  max-width: 1020px; margin: 0 auto; flex-wrap: wrap;
}
nav.tabs button {
  font-family: inherit; font-size: 15px; font-weight: 700;
  background: transparent; border: none; border-bottom: 3px solid transparent;
  color: var(--mut); padding: 8px 12px; cursor: pointer;
}
nav.tabs button.on { color: var(--accent); border-bottom-color: var(--gold-500); }
nav.tabs button:hover { color: var(--ink); }

main { max-width: 1020px; margin: 0 auto; padding: 12px; }
section.view { display: none; }
section.view.on { display: block; }

.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 12px;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.stat .v { font-size: 26px; font-weight: 700; }
.stat .k { color: var(--mut); font-size: 13px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 7px 8px; border-bottom: 1px solid var(--line2); text-align: left; vertical-align: top; }
th { color: var(--mut); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.4px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--gold-100); }
.wrap { overflow-x: auto; }

.badge {
  display: inline-block; border-radius: 20px; padding: 1px 9px;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
}
.badge.pending { background: var(--amb-bg); color: var(--amb); }
.badge.approved { background: var(--grn-bg); color: var(--grn); }
.badge.cancelled { background: var(--red-bg); color: var(--red); }
.badge.low { background: var(--red-bg); color: var(--red); }

button, .btn {
  font-family: inherit; font-size: 14.5px; font-weight: 700;
  border: 1px solid var(--gold-600); background: var(--gold-500); color: #fff;
  border-radius: 8px; padding: 8px 14px; cursor: pointer;
}
button:hover, .btn:hover { background: var(--gold-600); }
button.ghost, .btn.ghost { background: var(--paper); color: var(--accent); border-color: var(--line); }
button.ghost:hover { background: var(--gold-100); }
button.danger { background: var(--red); border-color: var(--red); }
button:disabled { opacity: 0.45; cursor: default; }
button.small { padding: 4px 10px; font-size: 13px; }
.linklike { background: none; border: none; color: var(--accent); padding: 0; font-size: inherit; text-decoration: underline; }

label { display: block; font-size: 13px; color: var(--mut); margin: 10px 0 3px; }
input, select, textarea {
  font-family: inherit; font-size: 15px; color: var(--ink);
  width: 100%; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold-200); border-color: var(--gold-500); }
input[type="checkbox"] { width: auto; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 12px; }
.form-row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
.form-row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 12px; }
@media (max-width: 640px) { .form-row, .form-row3, .form-row4 { grid-template-columns: 1fr; } }

.itemrow {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 10px; background: #fff;
}
.itemrow .rowhead { display: flex; justify-content: space-between; align-items: baseline; }
.itemrow .linetotal { font-weight: 700; }

#msg {
  display: none; max-width: 1020px; margin: 10px auto 0; padding: 10px 14px;
  border-radius: 8px; font-size: 14px;
}
#msg.err { display: block; background: var(--red-bg); color: var(--red); border: 1px solid #eec5c1; }
#msg.ok { display: block; background: var(--grn-bg); color: var(--grn); border: 1px solid #bfe0c9; }
.err-text { color: var(--red); font-size: 13px; margin-top: 4px; min-height: 0; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 10px; }
.toolbar .fld { flex: 1 1 160px; }
.toolbar label { margin-top: 0; }
/* v1.2.0: stock toolbar — the "Low stock only" checkbox and the Search
   button share one row instead of floating in the filter grid. */
.toolbar-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.toolbar-row .chk { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--ink); }
/* v1.2.0: reports toolbars — Date full width, From/To side by side,
   Show full width (was an uneven wrap: Date alone, From alone, To+Show). */
#view-reports .toolbar { display: grid; grid-template-columns: 1fr 1fr; }
#view-reports .toolbar .fld:first-child { grid-column: 1 / -1; }
#view-reports .toolbar button { grid-column: 1 / -1; width: 100%; }
/* v1.2.0: empty-state rows are centred, not pushed right by the mobile
   card-table flex layout (see themes.css). */
table.cardtable td.empty-row { text-align: center; }
/* v1.2.0: preset stock catalogue — a scrollable picker of sub-categories. */
.catalog-list { max-height: 180px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; margin-top: 4px; }
.catalog-list button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 10px 12px; color: var(--ink); font-size: 15px; }
.catalog-list button:last-child { border-bottom: 0; }
.catalog-list button.on { background: var(--accent); color: #111; font-weight: 700; }
.catalog-list .mut { padding: 10px 12px; }

/* v1.2.0: Settings is a menu list; each item opens its own page. */
.set-menu-item { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 13px 4px; color: var(--ink); font-size: 15px; font-weight: 600; cursor: pointer; }
.set-menu-item:last-child { border-bottom: 0; }
.set-menu-item:hover { background: none; }
.set-menu-item .sub { display: block; font-size: 12px; color: var(--mut); font-weight: 400; margin-top: 2px; }
.set-menu-item .chev { color: var(--mut); font-size: 20px; line-height: 1; font-weight: 400; }

/* v1.2.0: staff profile photos — round thumbnails, initials fallback. */
.staff-photo { width: 64px; height: 64px; object-fit: cover; border-radius: 50%; border: 1px solid var(--line); }
.staff-photo-sm { width: 36px; height: 36px; object-fit: cover; border-radius: 50%; border: 1px solid var(--line); vertical-align: middle; }
.staff-initials { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--gold-500); color: #fff; font-size: 14px; font-weight: 700; vertical-align: middle; }

.login-box { max-width: 420px; margin: 40px auto; }
.login-box .card { padding: 22px; }
.login-box h1 { text-align: center; font-size: 24px; }

/* ---- Invoice / receipt print views (screen preview + print) ---- */
#print-area { display: none; }
.inv { background: #fff; color: #111; position: relative; }
/* v1.2.0: approved sample bill v2 layout — logo header, faint centre
   watermark, boxed Bill To / meta, BANK DETAILS + PAYMENT INFORMATION,
   signature lines. The watermark is a foreground <img> (not a CSS
   background) so it prints. */
.inv-wm { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); width: 340px; opacity: 0.07; pointer-events: none; z-index: 0; }
.inv-wm img { width: 100%; }
.inv > *:not(.inv-wm) { position: relative; z-index: 1; }
.inv .inv-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1.2px solid #111; padding-bottom: 4px; margin-bottom: 6px; }
.inv .inv-head-c { flex: 1; text-align: center; }
.inv .inv-head .name { font-size: 19px; font-weight: 700; letter-spacing: 1px; }
.inv .inv-head .addr { font-size: 11px; }
.inv .inv-logo { height: 40px; width: auto; flex: none; }
.inv .inv-title { text-align: center; font-size: 14px; font-weight: 700; letter-spacing: 4px; margin: 4px 0 2px; }
.inv .inv-orig { text-align: center; margin-bottom: 4px; }
.inv .inv-orig span { border: 1px solid #111; padding: 1px 10px; font-weight: 700; font-size: 12px; }
.inv .inv-meta { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.inv .inv-boxes { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 6px; }
.inv .inv-box { flex: 1; border: 0.8px solid #111; padding: 4px 8px; font-size: 12px; }
.inv .inv-boxes .inv-tot { flex: none; }
.inv table.inv-meta-t { border: none; font-size: 12px; }
.inv table.inv-meta-t td { border: none; padding: 1px 4px; }
.inv table { font-size: 12px; }
.inv table th, .inv table td { border: 0.6px solid #111; padding: 2px 6px; }
.inv table th { background: #f2f2f2; color: #111; text-transform: none; letter-spacing: 0; font-size: 12px; }
.inv .inv-words { border: 0.8px solid #111; padding: 4px 8px; margin: 6px 0; font-size: 12px; }
.inv .inv-tot { width: 320px; margin-left: auto; font-size: 12px; }
.inv .inv-tot td { border: 0.8px solid #111; padding: 2px 8px; }
.inv .inv-sign { display: flex; justify-content: space-between; margin: 10px 26px 0; font-size: 12px; }
.inv .inv-sign .for { text-align: right; }
.inv .sig-line { display: block; border-top: 1px solid #111; width: 180px; margin: 0 auto 4px; }
.inv .inv-sign .for .sig-line { margin: 4px 0 4px auto; }
.inv .inv-close { text-align: center; font-weight: 700; margin-top: 8px; font-size: 13px; }
.inv .inv-foot { margin-top: 6px; font-size: 11px; color: #777; display: flex; justify-content: space-between; }

@media print {
  body { background: #fff; }
  /* v1.2.0: display:none (not visibility) — visibility:hidden elements still
     take up layout space, which printed the app shell as 2 extra blank
     pages after the invoice. Only the invoice prints now. */
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; position: absolute; left: 0; top: 0; width: 100%; }
  #print-area .inv { border: none; }
  /* v1.2.1: keep the signature block + closing + footer together so a
     signature never strands alone on page 2. */
  #print-area .inv-sign, #print-area .inv-close, #print-area .inv-foot { break-inside: avoid; }
}
