/* ============================================================
   Seema Jewellers web app v1.1.9 - "Mission control" look, softened + decluttered.
   Visual layer only. Loaded AFTER styles.css and themes.css and
   overrides them. No markup or script changes are needed.
   Pure black, hairline rules, softly rounded corners, light numerals,
   tracked caps only on buttons, tabs, badges and card titles. Gold is used for ONE job: showing
   what is active or primary (active tab, focus, New Bill).
   The printed invoice (.inv) is not touched. Everything is
   inside @media screen so printing is unchanged.
   ============================================================ */
@media screen {

html[data-theme="dark"] {
  --backdrop: #000;
  --ivory: #000;
  --ink: #f4f4f5;
  --title: #fff;
  --mut: #c2c6cd;
  --accent: #d1a92b;
  --gold: #e0b62e;
  --line: rgba(255, 255, 255, .12);
  --line2: rgba(255, 255, 255, .10);
  --divider: rgba(255, 255, 255, .10);
  --card: #050505;
  --card-2: #0c0c0d;
  --field: #000;
  --input-border: rgba(255, 255, 255, .22);
  --itemrow-bg: #050505;
  --itemrow-border: rgba(255, 255, 255, .12);
  --hover-row-bg: rgba(255, 255, 255, .05);
  --tabbar-bg: #000;
  --tabbar-border: rgba(255, 255, 255, .12);
  --focus: #fff;
  --shadow: none;
  --shadow-soft: none;
  --btn-primary-bg: #fff;
  --btn-primary-fg: #000;
  --btn-primary-hover: #d9d9dc;
  --ok-bg: transparent; --ok-fg: #7fd69c;
  --bad-bg: transparent; --bad-fg: #ff8d8d;
  --badge-pending-bg: transparent; --badge-pending-fg: #f0c94c;
  --badge-approved-bg: transparent; --badge-approved-fg: #7fd69c;
  --badge-cancelled-bg: transparent; --badge-cancelled-fg: #ff8d8d;
  --badge-low-bg: transparent; --badge-low-fg: #ff8d8d;
}

html, body { background: #000; }
body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: .01em;
}
::selection { background: #fff; color: #000; }
* { scrollbar-width: thin; scrollbar-color: #3a3a3d #000; }

/* ---------- header ---------- */
html[data-theme="dark"] header.top {
  background: #000;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
html[data-theme="dark"] header.top { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 10px; }
header.top .shop { font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; min-width: 0; white-space: nowrap; }
header.top .shop-txt { overflow: hidden; text-overflow: ellipsis; }
header.top .shop small, #who-name { display: none; }   /* address and your own name: shown elsewhere / already known */
header.top .who { flex-shrink: 0; gap: 8px; }
.hdr-logo { border-radius: 8px; }
/* the login card already carries the logo and name - no second header on top of it */
body:has(#login-view[style*="flex"]) header.top { display: none; }
html[data-theme="dark"] .role-badge {
  border-radius: 999px; background: transparent; border: 1px solid var(--line);
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--mut);
}

/* header Logout: quiet outline, not a second primary */
html[data-theme="dark"] header.top .who .ghost.small {
  min-height: 30px; padding: 4px 12px; font-size: 10px; letter-spacing: .16em;
  border-color: var(--line); color: var(--mut);
}
html[data-theme="dark"] header.top .who .ghost.small:hover { background: #fff; color: #000; border-color: #fff; }

/* ---------- surfaces: hairline boxes, no radius, no shadow ---------- */
html[data-theme="dark"] .card,
html[data-theme="dark"] .view section,
html[data-theme="dark"] .login-box .card,
html[data-theme="dark"] .stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: none; overflow: hidden;
}
html[data-theme="dark"] .view section:hover { border-color: var(--line); }

/* ---------- type ---------- */
h2 { font-size: 15px; font-weight: 600; letter-spacing: .02em; color: var(--ink); margin: 4px 0 14px; }
/* section titles that only repeat the highlighted tab stay readable by screen readers but take no space */
#view-bills #bills-list > div:first-child h2, #view-stock > div:first-child h2,
#view-reports > h2, #view-settings > h2 {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
#view-bills #bills-list > div:first-child { min-height: 0; }
#view-stock > div:first-child { justify-content: flex-end !important; }
html[data-theme="dark"] .card h3, html[data-theme="dark"] .view section h3 {
  font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: var(--mut); padding: 0; margin: 0 0 12px; border-bottom: 0;
}
label { font-size: 12px; font-weight: 500; letter-spacing: .02em; color: var(--mut); margin: 12px 0 6px; }
.mut { color: var(--mut); }

/* ---------- the numbers are the hero ---------- */
.stat { padding: 18px 16px 16px; }
.stat .v {
  font-size: 30px; font-weight: 300; letter-spacing: -.01em; line-height: 1.1;
  color: #fff; font-variant-numeric: tabular-nums;
}
.stat:first-child .v { font-size: 40px; }
.stat .k {
  margin-top: 8px; font-size: 12px; font-weight: 400; letter-spacing: .02em; color: var(--mut);
}
#home-rates b, #home-rates .num { font-weight: 300; font-size: 16px; font-variant-numeric: tabular-nums; color: #fff; }
#home-rates > div { border-bottom: 1px solid var(--line2); padding: 9px 0 !important; align-items: baseline; }
#home-rates > div.mut { border-bottom: 0; font-size: 11.5px; padding: 8px 0 0 !important; }
#home-rates > div:nth-last-child(2) { border-bottom: 0; }

/* ---------- inputs ---------- */
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea {
  background: var(--field); border: 1px solid var(--input-border);
  border-radius: 12px; color: #fff; font-size: 15px; letter-spacing: .01em;
}
html[data-theme="dark"] input::placeholder { color: #8a8f98; }
html[data-theme="dark"] input:focus, html[data-theme="dark"] select:focus, html[data-theme="dark"] textarea:focus {
  border-color: #fff; outline: none; box-shadow: none;
}
html[data-theme="dark"] input[readonly], html[data-theme="dark"] input:disabled,
html[data-theme="dark"] select:disabled { background: #0b0b0c; color: #b7bac1; border-style: dashed; }
html[data-theme="dark"] button:focus-visible, html[data-theme="dark"] .linklike:focus-visible,
html[data-theme="dark"] #tabbar button:focus-visible { outline: 1px solid #fff; outline-offset: 2px; }

/* ---------- buttons: white = primary, outline = secondary ---------- */
html[data-theme="dark"] button:not(.linklike), .btn {
  background: #fff; color: #000; border: 1px solid #fff; border-radius: 12px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  box-shadow: none;
}
html[data-theme="dark"] button:not(.linklike):hover { background: #d9d9dc; border-color: #d9d9dc; color: #000; }
html[data-theme="dark"] button:not(.linklike):active { background: #bdbdc2; }
/* v1.2.1: list-row buttons stay dark rows, not white primary buttons. */
html[data-theme="dark"] button.set-menu-item,
html[data-theme="dark"] .catalog-list button:not(.on) {
  background: transparent; color: var(--ink); border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  box-shadow: none; text-transform: none; letter-spacing: 0;
}
html[data-theme="dark"] button.icon-btn {
  background: transparent; color: inherit; border: 0; border-radius: 8px; box-shadow: none;
  text-transform: none; letter-spacing: 0; font-size: inherit;
}
html[data-theme="dark"] button.icon-btn:hover { background: rgba(255, 255, 255, .1); color: inherit; border-color: transparent; }
html[data-theme="dark"] button.icon-btn.on { color: var(--accent); }
html[data-theme="dark"] button.set-menu-item:last-child,
html[data-theme="dark"] .catalog-list button:not(.on):last-child { border-bottom: 0; }
html[data-theme="dark"] button.set-menu-item:hover,
html[data-theme="dark"] .catalog-list button:not(.on):hover {
  background: rgba(255, 255, 255, .06); color: var(--ink); border-color: var(--line);
}
html[data-theme="dark"] .ghost, html[data-theme="dark"] button.ghost {
  background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .55);
}
html[data-theme="dark"] .ghost:hover { background: #fff; color: #000; border-color: #fff; }
html[data-theme="dark"] button.danger {
  background: transparent; color: #ff8d8d; border: 1px solid #ff8d8d;
}
html[data-theme="dark"] button.danger:hover { background: #ff8d8d; color: #000; }
html, button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
html[data-theme="dark"] button:disabled { opacity: .35; background: transparent; color: #fff; border-color: var(--line); }
button.small { font-size: 10.5px; letter-spacing: .14em; }
html[data-theme="dark"] .sticky-action button { border-radius: 12px; }
.sticky-action { background: linear-gradient(to bottom, transparent, #000 30%); }
.linklike { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* the one gold action */
#btn-new-bill {
  background: var(--accent); color: #000; border: 1px solid var(--accent);
  border-radius: 999px; box-shadow: 0 6px 20px rgba(0, 0, 0, .5); font-size: 11.5px; letter-spacing: .16em;
}
#btn-new-bill:hover { background: #e8c24a; border-color: #e8c24a; }

/* ---------- tab bar: gold line marks where you are ---------- */
#tabbar { background: #000; border-top: 1px solid var(--line); }
#tabbar button {
  border-radius: 0; background: none; border: 0; color: var(--mut);
  font-size: 9.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  padding: 10px 2px 8px; gap: 5px; position: relative;
}
#tabbar button:hover { background: none; color: #fff; }
#tabbar button svg { width: 20px; height: 20px; stroke-width: 1.5; }
#tabbar button.on { color: #fff; background: none; }
#tabbar button.on::before {
  content: ""; position: absolute; top: -1px; left: 22%; right: 22%;
  height: 2px; background: var(--accent); border-radius: 0 0 2px 2px;
}
#tabbar button:active { background: rgba(255, 255, 255, .06); }

/* ---------- status badges: outlined, not filled ---------- */
.badge {
  border-radius: 999px; background: transparent; border: 1px solid currentColor;
  font-size: 9.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  padding: 2px 9px;
}
.badge.pending, .badge.approved, .badge.cancelled, .badge.low { background: transparent; }
.badge.pending { color: var(--badge-pending-fg); }
.badge.approved { color: var(--badge-approved-fg); }
.badge.cancelled, .badge.low { color: var(--badge-cancelled-fg); }

/* ---------- tables ---------- */
th { font-size: 11.5px; font-weight: 500; letter-spacing: .02em; text-transform: none; color: var(--mut); border-bottom: 1px solid var(--line); }
td { border-bottom: 1px solid var(--line2); }
html[data-theme="dark"] .clickable:hover { background: var(--hover-row-bg); }
@media (max-width: 430px) {
  table.cardtable tr { border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
  /* each row is already a card - drop the outer card so there is no box inside a box */
  #view-bills .card:has(> .wrap > table.cardtable), #view-stock .card:has(> .wrap > table.cardtable) {
    background: none; border: 0; padding: 0; border-radius: 0; overflow: visible;
  }
  table.cardtable td::before { font-size: 12px; font-weight: 500; letter-spacing: .02em; text-transform: none; }
  /* rows that restate other rows: Paid = Total - Due; Qty = Available + reserved; Gross is rarely needed in a list */
  table.cardtable td[data-label="Paid"], table.cardtable td[data-label="Qty"],
  table.cardtable td[data-label="Gross (g)"] { display: none; }
}

/* ---------- bill form rows, messages ---------- */
html[data-theme="dark"] .itemrow { border-radius: 12px; background: var(--itemrow-bg); border: 1px solid var(--itemrow-border); }
.itemrow .linetotal { font-weight: 300; font-variant-numeric: tabular-nums; }
#msg { border-radius: 0; letter-spacing: .02em; }
#msg.ok, #msg.err { margin-top: 8px; width: calc(100% - 24px); border-radius: 12px; border: 1px solid var(--line); }
#msg.ok { border-left: 3px solid var(--ok-fg); background: #050505; color: var(--ok-fg); }
#msg.err { border-left: 3px solid var(--bad-fg); background: #050505; color: var(--bad-fg); }
.err-text { color: var(--bad-fg); }

/* ---------- login ---------- */
.login-logo img { border-radius: 14px; }
html[data-theme="dark"] .login-box h1 {
  font-size: 15px; font-weight: 600; letter-spacing: .34em; text-transform: uppercase; color: #fff;
}
html[data-theme="dark"] .login-box h1::after {
  width: 36px; height: 1px; margin: 14px auto 0; background: var(--accent); border-radius: 0;
}
.login-box .mut.c { font-size: 12px; letter-spacing: .02em; }
/* v1.2.0: login role heading — follows the picked role (Owner / Staff) and is
   highlighted: gold, bold, tracked caps, so it reads at a glance. */
.login-role-title { font-size: 17px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 6px 0 2px; }

/* ---------- one entrance, only when a screen opens ---------- */
section.view.on { animation: sj-view-in .22s ease-out both; }
@keyframes sj-view-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { section.view.on { animation: none; } }

}
