/* Prolit brand palette taken from prolit.com.tr */
:root {
  --yellow: #fbe312;
  --yellow-soft: #fff7b8;
  --yellow-deep: #f9de58;
  --ink: #03000f;
  --ink-2: #1d1d1d;
  --muted: #6b6b6b;
  --line: #e7e2de;
  --bg: #f8f8f8;
  --card: #ffffff;
  --green: #0f8c0f;
  --green-dark: #0b6e0b;
  --green-soft: #e3f4e3;
  --orange: #fd4f01;
  --orange-soft: #ffe8dc;
  --red: #e80b02;
  --red-soft: #fde4e3;
  --blue: #0489ed;
  --blue-soft: #e1f1fd;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(3, 0, 15, .06), 0 4px 16px rgba(3, 0, 15, .06);
  --font-head: 'Baloo 2', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
/* Always reserve the scrollbar's space, so the centred header doesn't shift between short and long pages. */
html { overflow-y: scroll; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- Top bar ---------- */
.utility {
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 6px 16px;
  letter-spacing: .02em;
}
.topbar {
  background: var(--yellow);
  border-bottom: 3px solid var(--ink);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { height: 44px; display: block; }
.brand span {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 13px;
  background: var(--ink);
  color: var(--yellow);
  border-radius: 999px;
  padding: 2px 10px;
}
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a {
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 15px;
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.nav a:hover { background: rgba(3, 0, 15, .08); text-decoration: none; }
.nav a.active { background: var(--ink); color: var(--yellow); }
.nav .badge { margin-left: 6px; }
/* Seven admin menu items have to fit next to the logo and the user box. */
.topbar-inner { gap: 14px; }
.nav { gap: 2px; }
.nav a { font-size: 14px; padding: 8px 10px; letter-spacing: 0; }
.user-box .who small { display: none; }
.user-box { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.user-box .who { text-align: right; line-height: 1.2; }
.user-box .who strong { display: block; font-size: 14px; }
.user-box .who small { color: rgba(3, 0, 15, .65); font-size: 12px; }
.lang { display: flex; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.lang a { color: var(--ink); font-size: 12px; font-weight: 700; padding: 2px 8px; }
.lang a.on { background: var(--ink); color: var(--yellow); }
.lang a:hover { text-decoration: none; }

/* ---------- Layout ---------- */
main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px 16px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 0; }
.footer { text-align: center; padding: 20px 16px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); background: #fff; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 20px; align-items: start; }
.grid-2 { grid-template-columns: 2fr 1fr; }
/* Grid columns may shrink below their content (wide tables scroll inside .table-wrap). */
.grid > * { min-width: 0; }
.grid-half { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .grid-2, .grid-half { grid-template-columns: 1fr; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-head); font-weight: 600; font-size: 15px;
  border: 2px solid var(--ink); border-radius: 999px;
  padding: 9px 20px; cursor: pointer; text-decoration: none;
  background: #fff; color: var(--ink);
  transition: transform .05s ease, background .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; box-shadow: 0 3px 0 var(--ink); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn-primary { background: var(--yellow); }
.btn-dark { background: var(--ink); color: var(--yellow); }
.btn-green { background: var(--green); border-color: var(--green-dark); color: #fff; }
.btn-green:hover { box-shadow: 0 3px 0 var(--green-dark); }
.btn-danger { background: #fff; border-color: var(--red); color: var(--red); }
.btn-danger:hover { box-shadow: 0 3px 0 var(--red); }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; color: var(--red); cursor: pointer; font: inherit; padding: 0; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url],
input[type=tel], input:not([type]), select, textarea {
  width: 100%; font: inherit; color: var(--ink);
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 12px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--yellow); }
textarea { min-height: 90px; resize: vertical; }
.checkbox { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 14px; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--green); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid .full { grid-column: 1 / -1; }

.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto; gap: 10px; align-items: end; }
.filters .field { margin: 0; }
@media (max-width: 1000px) { .filters { grid-template-columns: 1fr 1fr; } }

/* ---------- Alerts ---------- */
.alert { border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 16px; font-weight: 600; border-left: 5px solid; }
.alert-success { background: var(--green-soft); border-color: var(--green); color: var(--green-dark); }
.alert-error { background: var(--red-soft); border-color: var(--red); color: #9b0701; }
.alert-info { background: var(--yellow-soft); border-color: var(--ink); }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; font-size: 12px; font-weight: 800; line-height: 1;
  padding: 5px 10px; border-radius: 999px; white-space: nowrap;
}
.badge-count { background: var(--orange); color: #fff; padding: 3px 7px; }
.status-pending { background: var(--orange-soft); color: #b13600; }
.status-confirmed { background: var(--green-soft); color: var(--green-dark); }
.status-shipped { background: var(--blue-soft); color: #035ea3; }
.status-cancelled { background: #eee; color: #666; }
.badge-on { background: var(--green-soft); color: var(--green-dark); }
.badge-off { background: #eee; color: #777; }
.badge-admin { background: var(--ink); color: var(--yellow); }
.badge-reseller { background: var(--yellow-soft); color: var(--ink); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
/* Stock sync: one column per marketplace; keep product names readable and scroll sideways. */
.sync-table th:first-child, .sync-table td:first-child { min-width: 190px; }
.sync-table td.num, .sync-table th.num { white-space: nowrap; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 800; background: #fcfcfa; }
tbody tr:hover { background: #fffdf0; }
td.num, th.num { text-align: right; white-space: nowrap; }
tfoot td { font-weight: 800; border-bottom: 0; }
.thumb { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; background: var(--yellow-soft); }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .btn { margin-top: 12px; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 24px; }
.stats > * { min-width: 0; }
@media (max-width: 600px) { .stats { gap: 10px; } .stat { padding: 14px; } .stat .value { font-size: 21px !important; } .stat .value small { font-size: 13px; } }
@media (max-width: 1000px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; border-top: 5px solid var(--line); color: var(--ink); display: block; }
.stat:hover { text-decoration: none; }
.stat .label { font-size: 13px; font-weight: 700; color: var(--muted); }
.stat .value { font-family: var(--font-head); font-size: 30px; font-weight: 600; margin-top: 4px; }
.stat.pending { border-color: var(--orange); }
.stat.confirmed { border-color: var(--green); }
.stat.shipped { border-color: var(--blue); }
.stat.money { border-color: var(--yellow); }
.stat.people { border-color: var(--ink); }

/* ---------- Catalog ---------- */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.product {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column;
  border: 2px solid transparent; transition: border-color .15s;
}
.product:hover { border-color: var(--yellow-deep); }
.product .img { background: radial-gradient(circle at 50% 55%, var(--yellow) 0 42%, var(--yellow-soft) 43%); aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; }
.product .img img { max-width: 80%; max-height: 90%; object-fit: contain; }
.product .body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product h3 { margin: 0; }
.product .desc { color: var(--muted); font-size: 13px; flex: 1; }
.product .price { font-family: var(--font-head); font-size: 22px; font-weight: 600; }
.product .price small { font-family: var(--font-body); font-size: 13px; color: var(--muted); font-weight: 600; }
.product .in-cart { font-size: 12px; font-weight: 700; color: var(--green); }
.product .buy { display: flex; gap: 8px; margin-top: 8px; }

.qty { display: inline-flex; align-items: center; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.qty button { border: 0; background: none; width: 32px; height: 36px; font-size: 18px; font-weight: 700; cursor: pointer; color: var(--ink); }
.qty button:hover { background: var(--yellow-soft); }
.qty input { width: 56px; border: 0; text-align: center; padding: 6px 0; border-radius: 0; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input:focus { box-shadow: none; }

.sticky-bar {
  position: sticky; bottom: 16px; margin-top: 24px;
  background: var(--ink); color: #fff; border-radius: 999px;
  padding: 10px 10px 10px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  box-shadow: 0 8px 24px rgba(3, 0, 15, .25);
}
.sticky-bar .btn { border-color: var(--yellow); }

/* ---------- Totals ---------- */
.totals { margin-left: auto; max-width: 340px; }
.totals div { display: flex; justify-content: space-between; padding: 6px 0; }
.totals .grand { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 10px; font-family: var(--font-head); font-size: 20px; font-weight: 600; }

dl.info { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.info dt { color: var(--muted); font-weight: 700; font-size: 13px; }
dl.info dd { margin: 0; }

.note-box { background: var(--yellow-soft); border-radius: var(--radius-sm); padding: 12px 14px; white-space: pre-wrap; }

/* ---------- Login ---------- */
.login-page { background: var(--yellow); }
.login-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 16px; position: relative; overflow: hidden; }
.login-wrap::before {
  content: ''; position: absolute; width: 640px; height: 640px; border-radius: 50%;
  background: var(--yellow-deep); right: -200px; bottom: -260px; opacity: .7;
}
.login-card { position: relative; background: #fff; border: 3px solid var(--ink); border-radius: 24px; padding: 36px 32px; width: 100%; max-width: 420px; box-shadow: 8px 8px 0 var(--ink); }
.login-card .logo { display: block; height: 70px; margin: 0 auto 18px; }
.login-card h1 { text-align: center; font-size: 22px; }
.login-card p { text-align: center; color: var(--muted); margin-top: 0; }
.register-card { max-width: 620px; }
.register-card .form-grid { text-align: left; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.login-card .lang { position: absolute; top: 14px; right: 14px; }

@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; gap: 8px 12px; }
  .brand img { height: 36px; }
  .nav { order: 3; flex-basis: 100%; }
  .user-box { margin-left: auto; }
  .user-box .who { display: none; }
  h1 { font-size: 24px; }
  .sticky-bar { border-radius: var(--radius); }
}
@media print {
  .topbar, .utility, .footer, .no-print { display: none !important; }
  .card { box-shadow: none; }
}

.grid > .card + .card, .grid > * + .card { margin-top: 0; }
.grid > div > .card + .card { margin-top: 20px; }
::placeholder { color: #b0b0b0; }
@media (max-width: 600px) {
  .products { grid-template-columns: 1fr 1fr; gap: 12px; }
  .product .img { aspect-ratio: 1 / 1; }
  .product .body { padding: 12px; }
  .product h3 { font-size: 15px; }
  .product .desc { display: none; }
  .product .price { font-size: 18px; }
  .product .buy { flex-direction: column; }
  .product .buy .qty { justify-content: space-between; }
  .product .buy .qty input { flex: 1; width: auto; min-width: 0; }
  .sticky-bar { flex-wrap: wrap; padding: 12px 16px; }
}

.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.buy.disabled .qty { opacity: .45; }
.pay-card { border: 2px solid var(--green); }
.stock-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.stock-form select { width: auto; padding: 6px 8px; }
.stock-form input[type=number] { width: 90px; padding: 6px 8px; }
.stock-form input[type=text] { width: 160px; padding: 6px 8px; }
.change-pos { color: var(--green-dark); font-weight: 800; }
.change-neg { color: var(--red); font-weight: 800; }
.product .body > .badge { align-self: flex-start; }

/* ---------- Marketplaces ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 20px; border-bottom: 2px solid var(--line); overflow-x: auto; }
.tabs a { padding: 10px 16px; font-family: var(--font-head); font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); border-color: var(--yellow-deep); }
.channel-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-bottom: 20px; }
.channel-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; border-top: 5px solid var(--yellow); }
.channel-card h2 { margin: 0; }
.channel-card.add { border-top-color: var(--line); background: #fcfcfa; }
.channel-card.add .field { margin: 10px 0; }
.steps { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.steps span { padding: 6px 14px; border-radius: 999px; background: #eee; color: var(--muted); font-weight: 700; font-size: 13px; }
.steps span.on { background: var(--ink); color: var(--yellow); }
.steps span.done { background: var(--green-soft); color: var(--green-dark); }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 16px; }
table.sample td, table.sample th { font-size: 12px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.filters-3 { grid-template-columns: 2fr 1fr 1fr auto; }
@media (max-width: 1000px) { .filters-3 { grid-template-columns: 1fr 1fr; } }
.state-new { background: var(--green-soft); color: var(--green-dark); }
.state-cancel { background: var(--orange-soft); color: #b13600; }
.state-unmatched, .state-invalid { background: var(--red-soft); color: #9b0701; }
.state-duplicate, .state-cancelled { background: #eee; color: #666; }
.add-sale-box { margin-bottom: 20px; }
.add-sale-box summary { cursor: pointer; font-family: var(--font-head); font-size: 17px; }
.add-sale { display: grid; grid-template-columns: 1fr 1.2fr 2fr .7fr 1fr 1.5fr auto; gap: 10px; align-items: end; margin-top: 14px; }
.add-sale .field { margin: 0; }
@media (max-width: 1000px) { .add-sale { grid-template-columns: 1fr 1fr; } }
a.badge:hover { text-decoration: none; }
@media (max-width: 600px) { .table-wrap table { min-width: 620px; } }
.badge-api { background: #f27a1a; color: #fff; vertical-align: middle; font-size: 11px; }
.api-card { border-left: 5px solid #f27a1a; margin-bottom: 20px; }
.listing-cell { white-space: nowrap; margin: 2px 0; }
.listing-cell .badge { margin-left: 4px; }
tr.row-warn { background: #fff6f2; }
tr.row-new td { background: #fcfcfa; }
.api-card + .card, form.card + form.card { margin-top: 20px; }
.pay-admin { border-left: 5px solid var(--green); }
.invoice-card { border-left: 5px solid var(--ink); }
.cargo-card { border-left: 5px solid #f27a1a; }
/* Executive dashboard */
.exec { --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6; --series-8: #e34948;
  --good: #0a7d32; --good-bg: #e3f4e8; --warn: #8a5a00; --warn-bg: #fff3d6; --serious: #a64500; --serious-bg: #ffe8d9;
  --critical: #b0101f; --critical-bg: #fde4e6; --neutral: #5d5d5d; --neutral-bg: #efefef; }
.exec > .card, .exec > .grid { margin-top: 20px; }
.exec > .stats { margin-bottom: 0; }
.exec-head { align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.seg-control { display: inline-flex; background: var(--card); border: 2px solid var(--ink); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
/* Same width selected or not: the bold label's width is reserved by a hidden copy. */
.seg-control a { display: inline-grid; padding: 6px 14px; border-radius: 999px; color: var(--ink); font-weight: 600; font-size: 14px; white-space: nowrap; }
.seg-control a::after { content: attr(data-label); font-weight: 800; height: 0; overflow: hidden; visibility: hidden; }
.seg-control a.on { background: var(--ink); color: var(--yellow); font-weight: 800; }
.seg-control a:hover { text-decoration: none; }
.seg-control a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 1px; }
.exec-alerts { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.exec-alerts a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; color: inherit; }
.exec-alerts a:hover { text-decoration: none; filter: brightness(.97); }
.exec-alerts .ico, .status-pill .ico { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 999px; font-size: 11px; font-weight: 800; color: #fff; flex: none; }
.lvl-warn a, .status-pill.lvl-warn { background: var(--warn-bg); color: var(--warn); } .lvl-warn .ico { background: var(--warn); }
.lvl-serious a, .status-pill.lvl-serious { background: var(--serious-bg); color: var(--serious); } .lvl-serious .ico { background: var(--serious); }
.lvl-critical a, .status-pill.lvl-critical { background: var(--critical-bg); color: var(--critical); } .lvl-critical .ico { background: var(--critical); }
.status-pill.lvl-good { background: var(--good-bg); color: var(--good); } .lvl-good .ico { background: var(--good); }
.status-pill.lvl-neutral { background: var(--neutral-bg); color: var(--neutral); } .lvl-neutral .ico { background: var(--neutral); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.exec-allgood { color: var(--good); font-weight: 600; margin: 0 0 20px; }
.exec-kpis { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .exec-kpis { grid-template-columns: repeat(2, 1fr); } }
.delta { display: block; margin-top: 6px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.delta .muted { font-weight: 400; }
.delta.up { color: var(--good); } .delta.down { color: var(--critical); } .delta.flat { color: var(--muted); font-weight: 400; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0; margin: 0 0 8px; font-size: 13px; color: var(--ink); }
.legend li, .share-top > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.key { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex: none; }
.chart-wrap { position: relative; overflow-x: auto; }
@media (max-width: 600px) { .chart { min-width: 560px; } }
.exec-table td:first-child { min-width: 170px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: #e7e5df; stroke-width: 1; }
.chart .grid.base { stroke: #b9b6ad; }
.chart .axis { fill: #6b6a65; font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .hit { fill: transparent; cursor: crosshair; outline: none; }
.chart .hit:hover, .chart .hit:focus-visible { fill: rgba(3, 0, 15, .05); }
.chart .hit:focus-visible { stroke: var(--ink); stroke-width: 1.5; }
.chart-table { margin-top: 10px; }
.chart-table summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.chart-tip { position: fixed; z-index: 50; pointer-events: none; background: #fff; border: 1px solid #d9d7d0; box-shadow: 0 6px 20px rgba(0,0,0,.12);
  border-radius: 10px; padding: 8px 10px; font-size: 13px; min-width: 180px; color: var(--ink); }
.chart-tip .tip-title { font-weight: 700; margin-bottom: 4px; }
.chart-tip .tip-row { display: flex; justify-content: space-between; gap: 16px; font-variant-numeric: tabular-nums; }
.chart-tip .tip-row span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.chart-tip .tip-total { border-bottom: 1px solid #eee; padding-bottom: 3px; margin-bottom: 3px; font-weight: 700; }
.share-list { list-style: none; padding: 0; margin: 0; }
.share-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.share-list li:last-child { border-bottom: 0; }
.share-top, .share-sub { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.share-sub .delta { margin: 0; display: inline; }
.bar-track { height: 8px; background: #f0efea; border-radius: 4px; margin: 6px 0 4px; overflow: hidden; }
.bar-track span { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.mini-stack { display: flex; gap: 2px; height: 10px; min-width: 90px; max-width: 220px; }
.mini-stack span:first-child { border-radius: 3px 0 0 3px; } .mini-stack span:last-child { border-radius: 0 3px 3px 0; }
.mini-stack span:only-child { border-radius: 3px; }
.exec-table td { vertical-align: middle; }
.kv { margin: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); font-size: 14px; } .kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.top-list { list-style: none; padding: 0; margin: 0; }
.top-list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); align-items: center; }
.top-list li:last-child { border-bottom: 0; }
/* Raw materials */
.stats-4 { grid-template-columns: repeat(4, 1fr); }
.stat.overdue { border-top-color: #d7263d; }
.num-value, .mat-table .num, .purchase-amount { font-variant-numeric: tabular-nums; }
.text-red { color: #b0101f; }
.badge-danger { background: #fde4e6; color: #9b0710; }
.mat-table td { vertical-align: top; }
.inline-add { position: relative; }
.inline-add summary { list-style: none; }
.inline-add summary::-webkit-details-marker { display: none; }
.inline-add-form { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: min(340px, 86vw); background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.purchase { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; scroll-margin-top: 90px; }
.purchase.is-overdue { border-color: #e9a3ab; background: #fff8f8; }
.purchase:target { outline: 3px solid var(--yellow); }
.purchase-main { display: flex; justify-content: space-between; gap: 12px; }
.purchase-amount { font-size: 18px; font-weight: 700; white-space: nowrap; margin-bottom: 4px; }
.purchase-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.purchase-sub .push-right { margin-left: auto; }
.note-line { overflow-wrap: anywhere; }
.upload-label { color: var(--ink); text-decoration: underline; cursor: pointer; }
.receipt-link { white-space: nowrap; }
.pay-list { list-style: none; margin: 8px 0 0; padding: 0; font-size: 14px; }
.pay-list li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; color: var(--green); }
.pay-add { margin-top: 8px; }
.pay-add summary { list-style: none; display: inline-flex; }
.pay-add summary::-webkit-details-marker { display: none; }
.muted-on-green { opacity: .85; font-weight: normal; margin-left: 4px; }
.pay-form { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 8px; align-items: end; margin-top: 10px; }
.pay-form .field { margin: 0; }
@media (max-width: 760px) { .pay-form { grid-template-columns: 1fr 1fr; } .stats-4 { grid-template-columns: 1fr 1fr; } }
.mat-form + .mat-form, .mat-form + details.card { margin-top: 20px; }
details.card > summary { cursor: pointer; }
.quick-pay { display: inline; }
/* Lightbox for photo receipts */
.lightbox { padding: 0; border: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: rgba(15, 15, 15, .94); color: #fff; }
.lightbox::backdrop { background: rgba(0, 0, 0, .6); }
.lightbox-bar { position: absolute; inset: 0 0 auto 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; z-index: 2; background: linear-gradient(rgba(0,0,0,.6), transparent); }
.lightbox-caption { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.lightbox-tools { display: flex; gap: 6px; flex: none; }
.lightbox-tools button, .lightbox-tools a { min-width: 44px; height: 44px; border-radius: 999px; border: 1px solid rgba(255,255,255,.4); background: rgba(0,0,0,.4); color: #fff; font-size: 20px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.lightbox-tools :focus-visible { outline: 3px solid var(--yellow); }
.lightbox-stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; cursor: zoom-in; }
.lightbox-stage.zoomed { cursor: grab; }
.lightbox-stage img { max-width: 100%; max-height: 100%; transform-origin: center; user-select: none; -webkit-user-drag: none; }
@media (prefers-reduced-motion: no-preference) { .lightbox-stage img { transition: transform .15s ease-out; } .lightbox-stage.dragging img { transition: none; } }
.ship-block { margin-top: 6px; }
.ship-fields { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 4px; margin: 10px 0 0; }
.ship-fields legend { font-weight: 700; padding: 0 4px; }
.ship-summary { background: var(--yellow-soft); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }
.list-price { color: var(--muted); font-weight: normal; font-size: .85em; }
.list-price-row { color: var(--muted); font-size: 14px; margin-top: 6px; }
.list-price-row s { font-weight: 600; }
.special-label { font-size: 13px; font-weight: 600; color: var(--green); }
.badge-discount { background: #d7263d; color: #fff; font-size: 11px; vertical-align: middle; }
.prices-table input { max-width: 130px; text-align: right; }
.cargo-pkg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-items: end; }
.cargo-pkg .field { margin: 0; }
.cargo-pkg .btn { grid-column: 1 / -1; justify-self: start; }
.box-row { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 8px 40px 10px 12px; margin: 0 0 8px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; align-items: end; }
.box-row legend { font-weight: 700; font-size: 13px; padding: 0 4px; }
.box-row .field { margin: 0; }
.box-remove { position: absolute; top: 8px; right: 6px; width: 30px; height: 30px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; }
.box-remove:hover { background: var(--red-soft); color: #9b0701; }
.box-remove:focus-visible { outline: 3px solid var(--yellow); }
@media (max-width: 600px) { .box-row { grid-template-columns: 1fr 1fr; } }
.cargo-boxes td { vertical-align: top; }
.track-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.cargo-offers td, .cargo-offers th { padding-top: 6px; padding-bottom: 6px; }
.cargo-offers .num { text-align: right; white-space: nowrap; }
.cargo-offers label { cursor: pointer; }
@media (max-width: 600px) { .cargo-pkg { grid-template-columns: 1fr 1fr; } }
