/* ============================================================
   BBT Inventory — minimal: white, dark green, black
   ============================================================ */
:root {
  --green: #0f3d2e;
  --green-2: #16573f;
  --green-3: #1f7a58;
  --green-soft: #eaf3ef;
  --ink: #0d1110;
  --ink-2: #414845;
  --muted: #7b8380;
  --line: #e8eae9;
  --line-2: #d6dad8;
  --surface: #f7f8f7;
  --white: #ffffff;
  --red: #c0392b;
  --red-soft: #fdf0ee;
  --red-line: #f1c9c3;

  /* aliases used across templates */
  --paper: var(--white);
  --sand: var(--white);
  --sand-2: var(--surface);
  --terra: var(--red);
  --terra-soft: var(--red-soft);
  --amber: var(--ink);
  --amber-soft: #f0f1f0;
  --blue: var(--ink);
  --blue-soft: #eef0ef;
  --rattan: var(--green);
  --rattan-soft: var(--green-soft);

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(13, 17, 16, .04);
  --shadow-lg: 0 24px 60px -20px rgba(13, 17, 16, .25);
  --font: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--green-2); text-decoration: none; }
a:hover { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--font); line-height: 1.3; margin: 0 0 .6em; letter-spacing: -.02em; color: var(--ink); }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0 0 1em; }
b, strong { font-weight: 600; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; background: var(--surface); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; font-size: .88em; }
kbd { font-family: var(--font); font-size: 11px; border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 6px; color: var(--muted); background: var(--white); line-height: 1.4; }
small, .small { font-size: 12.5px; line-height: 1.55; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; }
.ic { flex: none; vertical-align: middle; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
::selection { background: var(--green); color: #fff; }

/* ---------- custom scrollbars ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #b9bfbc; background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-corner { background: transparent; }
.side { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.side::-webkit-scrollbar { width: 6px; }
.side::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border: 0; border-radius: 99px; }
.side::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.3); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
  color: rgba(255,255,255,.78);
  background: var(--green);
  padding: 22px 14px 16px;
}
.brand { display: flex; align-items: center; gap: 11px; color: #fff; text-decoration: none !important; padding: 2px 8px 22px; }
.brand:hover { color: #fff; }
.brand-text { font-size: 16px; font-weight: 500; letter-spacing: -.01em; white-space: nowrap; }
.brand-text b { font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #fff; color: var(--green); flex: none; }
.side nav { flex: 1; }
.nav-group { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: rgba(255,255,255,.4); margin: 20px 12px 6px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 1px 0; border-radius: 10px; color: rgba(255,255,255,.75); font-weight: 500; font-size: 13.5px; text-decoration: none !important; transition: background .15s, color .15s; }
.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-link.on { background: #fff; color: var(--green); font-weight: 600; }
.nav-link .ic { opacity: .9; }
.side-foot { display: flex; align-items: center; gap: 6px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1); margin-top: 16px; }
.me { flex: 1; display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none !important; min-width: 0; padding: 6px; border-radius: 10px; }
.me:hover { background: rgba(255,255,255,.07); color: #fff; }
.me b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }
.me small { display: block; font-size: 11.5px; color: rgba(255,255,255,.55); line-height: 1.35; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-weight: 700; font-size: 13px; flex: none; }
.side .avatar { background: rgba(255,255,255,.14); color: #fff; }
.side .icon-btn { color: rgba(255,255,255,.7); }
.side .icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; background: var(--white); }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 36px; background: rgba(255,255,255,.88); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--line); }
.search { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid transparent; border-radius: 12px; padding: 0 14px; color: var(--muted); transition: border-color .15s, background .15s, box-shadow .15s; }
.search:focus-within { background: #fff; border-color: var(--green); box-shadow: 0 0 0 4px rgba(15,61,46,.08); }
.search input { flex: 1; border: 0 !important; outline: 0; background: transparent !important; padding: 10px 0 !important; font: inherit; color: var(--ink); min-width: 0; box-shadow: none !important; }
.menu-btn { display: none; }
.content { padding: 32px 36px 72px; max-width: 1380px; width: 100%; }

/* ---------- page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin: 8px 0 0; line-height: 1.6; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--green); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 13px/1.2 var(--font); padding: 10px 16px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--white); color: var(--ink);
  cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.btn:hover { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-2); border-color: var(--green-2); color: #fff; }
.btn-danger { color: var(--red); border-color: var(--red-line); }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface); border-color: transparent; }
.btn-sm { padding: 7px 11px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.btn-lg { padding: 13px 22px; font-size: 14px; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; transition: background .15s; }
.icon-btn:hover { background: var(--surface); color: var(--ink); text-decoration: none; }
form.inline { display: inline; margin: 0; }

/* ---------- cards / layout ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card > h2:first-child, .card-head h2 { margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-head { padding: 18px 22px 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; color: inherit; text-decoration: none !important; position: relative; transition: border-color .15s, box-shadow .15s; }
a.stat:hover { border-color: var(--line-2); box-shadow: 0 6px 20px -12px rgba(13,17,16,.25); color: inherit; }
.stat .label { font-size: 12.5px; font-weight: 500; color: var(--muted); display: flex; align-items: center; gap: 7px; line-height: 1.4; }
.stat .value { font-size: 28px; font-weight: 700; letter-spacing: -.03em; margin-top: 8px; line-height: 1.2; color: var(--ink); }
.stat .hint { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.stat.good .value { color: var(--green); }
.stat.bad { border-color: var(--red-line); }
.stat.bad .value { color: var(--red); }
.stat.warn .value { color: var(--ink); }
.stat.warn::before, .stat.bad::before, .stat.good::before { content: ""; position: absolute; left: 20px; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; }
.stat.good::before { background: var(--green); }
.stat.bad::before { background: var(--red); }
.stat.warn::before { background: var(--ink); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); line-height: 1.4; }
.field > span .req { color: var(--red); font-weight: 600; }
.field small { color: var(--muted); font-size: 12px; line-height: 1.5; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], input[type=date], input[type=tel], input:not([type]), select, textarea {
  font: 500 13.5px/1.4 var(--font); color: var(--ink); background: var(--white); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 10px 12px; width: 100%; min-width: 0; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #a4aaa7; font-weight: 400; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b8380' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
textarea { min-height: 90px; resize: vertical; line-height: 1.6; }
input:hover, select:hover, textarea:hover { border-color: #c3c8c5; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--green); box-shadow: 0 0 0 4px rgba(15,61,46,.08); }
input[type=number] { font-variant-numeric: tabular-nums; }
input[type=checkbox], input[type=radio] { accent-color: var(--green); }
input.qty { width: 84px; text-align: right; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 8px; flex-wrap: wrap; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; cursor: pointer; line-height: 1.5; }
.check input { margin-top: 2px; width: 16px; height: 16px; flex: none; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.filters input[type=search], .filters input:not([type]) { max-width: 280px; }
.filters select { width: auto; max-width: 230px; }
.filters .chip-check { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--white); font-size: 12.5px; font-weight: 500; cursor: pointer; line-height: 1.2; transition: all .15s; }
.filters .chip-check:hover { border-color: #b9bfbc; }
.filters .chip-check:has(input:checked) { background: var(--green); border-color: var(--green); color: #fff; }
.filters .chip-check input { display: none; }
.filters.card { padding: 16px 18px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; margin: 0; }
legend { font-weight: 600; padding: 0 8px; font-size: 13px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--white); white-space: nowrap; line-height: 1.4; }
.t td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; line-height: 1.5; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background .1s; }
.t tbody tr:hover td { background: #fafbfa; }
.t .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t tfoot td { font-weight: 700; background: var(--surface); border-top: 1px solid var(--line); }
.t .item-cell { display: flex; align-items: center; gap: 12px; min-width: 210px; color: inherit; }
a.item-cell:hover { text-decoration: none; }
a.item-cell:hover b { color: var(--green); }
.t .item-cell b { display: block; font-weight: 600; line-height: 1.4; }
.t .item-cell small { color: var(--muted); display: block; }
.t tr.group td { background: var(--surface); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }

/* ---------- thumbs / photos ---------- */
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: #fff; border: 1px solid var(--line); flex: none; display: block; }
.thumb-lg { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); flex: none; background: #fff; display: block; }
.nophoto {
  display: grid; place-items: center; color: #a4aaa7; font-size: 8.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; text-align: center; line-height: 1.25;
  background: var(--surface);
  border: 1px dashed var(--line-2) !important;
}
.nophoto span { padding: 2px; }
.thumb-lg.nophoto { font-size: 10px; }

/* item cards grid */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.icard { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: inherit; text-decoration: none !important; display: flex; flex-direction: column; transition: border-color .2s, box-shadow .2s, transform .2s; }
.icard:hover { border-color: var(--line-2); box-shadow: 0 14px 30px -18px rgba(13,17,16,.35); transform: translateY(-2px); color: inherit; }
.icard .ph { aspect-ratio: 4/3; background: #fff; display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--line); position: relative; padding: 10px; }
.icard .ph img { width: 100%; height: 100%; object-fit: contain; }
.icard .ph .nophoto { position: absolute; inset: 0; width: auto; height: auto; font-size: 11px; border: 0 !important; }
.icard .ph .tagline { position: absolute; top: 10px; left: 10px; display: flex; gap: 4px; flex-wrap: wrap; }
.icard .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.icard .name { font-weight: 600; line-height: 1.4; }
.icard .meta { font-size: 12px; color: var(--muted); line-height: 1.5; }
.icard .foot { display: flex; justify-content: space-between; align-items: baseline; margin-top: auto; padding-top: 10px; font-size: 12.5px; gap: 8px; }
.icard .qty-big { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* gallery */
.gallery { display: grid; grid-template-columns: 1fr; gap: 12px; }
.gallery .main-photo { aspect-ratio: 1; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); display: grid; place-items: center; overflow: hidden; }
.gallery .main-photo img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; padding: 12px; }
.gallery .main-photo .nophoto { width: 100%; height: 100%; font-size: 12px; border: 0 !important; }
.gallery .strip { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery .strip .ph { position: relative; }
.gallery .strip img { width: 60px; height: 60px; object-fit: cover; border-radius: 10px; border: 2px solid var(--line); cursor: pointer; background: #fff; transition: border-color .15s; }
.gallery .strip img:hover { border-color: var(--line-2); }
.gallery .strip .ph.primary img { border-color: var(--green); }
.gallery .strip .ph-actions { display: flex; gap: 2px; justify-content: center; margin-top: 2px; }
.gallery .strip .ph-actions button { border: 0; background: none; font-size: 11px; color: var(--muted); cursor: pointer; padding: 0 4px; }
.gallery .strip .ph-actions button:hover { color: var(--red); }

.dropzone { border: 1.5px dashed var(--line-2); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--ink-2); background: var(--white); cursor: pointer; transition: border-color .15s, background .15s; display: block; line-height: 1.6; }
.dropzone:hover, .dropzone.drag { border-color: var(--green); background: var(--green-soft); }
.dropzone .ic { color: var(--green); margin-bottom: 4px; }
.dropzone input { display: none; }
.dropzone .previews { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.dropzone .previews:empty { display: none; }
.dropzone .previews img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.5; border: 1px solid transparent; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-amber { background: #fff; color: var(--ink); border-color: var(--ink); }
.badge-blue { background: var(--ink); color: #fff; }
a.badge-blue:hover { color: #fff; text-decoration: none; background: var(--green); }
.badge-grey { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.badge-rattan { background: #fff; color: var(--green); border-color: #c5d9cf; }
a.badge:hover { text-decoration: none; }

/* progress */
.bar { height: 6px; border-radius: 99px; background: #eceeed; overflow: hidden; min-width: 80px; }
.bar > i { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.bar.amber > i { background: var(--ink); }
.bar.red > i { background: var(--red); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 11px 14px; color: var(--muted); font-weight: 600; font-size: 13px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none !important; transition: color .15s; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--green); }
.tabs .count { display: inline-block; min-width: 20px; padding: 0 7px; border-radius: 99px; background: var(--surface); color: var(--ink-2); font-size: 11px; text-align: center; margin-left: 6px; line-height: 1.7; }
.tabs a.on .count { background: var(--green); color: #fff; }

/* ---------- flash ---------- */
.flash { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; border: 1px solid; line-height: 1.55; font-weight: 500; animation: rise .25s both; }
.flash > .ic { margin-top: 2px; }
.flash > div { flex: 1; }
.flash-success { background: var(--green-soft); border-color: #c5ddd1; color: var(--green); }
.flash-error { background: var(--red-soft); border-color: var(--red-line); color: #9b2c20; }
.flash-info { background: var(--surface); border-color: var(--line); color: var(--ink); }
.flash-warning { background: #fff; border-color: var(--ink); color: var(--ink); }
.flash-x { border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; opacity: .5; }
.flash-x:hover { opacity: 1; }
.flash-float { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 50; }

/* ---------- empty ---------- */
.empty { text-align: center; padding: 56px 20px; color: var(--ink-2); }
.empty-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: var(--green-soft); color: var(--green); margin-bottom: 16px; font-size: 28px; }
.empty h2, .empty h3 { margin-bottom: 8px; }
.empty p { max-width: 460px; margin: 0 auto 18px; color: var(--muted); line-height: 1.65; }

/* ---------- pager ---------- */
.pager { display: flex; gap: 4px; justify-content: center; margin: 22px 0 0; flex-wrap: wrap; }
.pager a, .pager b, .pager span { min-width: 36px; padding: 7px 10px; border-radius: 9px; text-align: center; font-size: 13px; font-weight: 600; }
.pager a { background: var(--white); border: 1px solid var(--line); color: var(--ink-2); }
.pager a:hover { border-color: var(--line-2); text-decoration: none; }
.pager b { background: var(--green); color: #fff; }

/* ---------- definition list ---------- */
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 10px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.dl dd { margin: 0; font-weight: 500; line-height: 1.6; }

/* ---------- project setups ---------- */
.venue { margin-bottom: 32px; }
.venue-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.venue-head h2 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.setup { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.setup-head { display: flex; gap: 16px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.setup-head .title { flex: 1; min-width: 180px; }
.setup-head .title b { font-size: 15px; font-weight: 700; display: block; line-height: 1.4; }
.setup-head .title small { display: block; color: var(--muted); margin-top: 2px; }
.setup-head .sets { font-weight: 700; font-size: 15px; background: var(--green); color: #fff; border-radius: 9px; padding: 4px 11px; line-height: 1.4; }
.setup .t td { padding: 10px 18px; }
.setup .note { padding: 10px 18px; font-size: 12.5px; color: var(--ink-2); background: var(--surface); border-top: 1px solid var(--line); line-height: 1.6; }

/* ---------- calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--white); }
.cal .dow { padding: 10px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-bottom: 1px solid var(--line); }
.cal .day { min-height: 112px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px; font-size: 11.5px; }
.cal .day:nth-child(7n) { border-right: 0; }
.cal .day.other { background: #fbfbfb; color: #b0b5b3; }
.cal .day.today .dnum { background: var(--green); color: #fff; }
.cal .dnum { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 600; margin-bottom: 4px; }
.cal .ev { display: block; padding: 3px 7px; border-radius: 6px; margin-bottom: 3px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none !important; line-height: 1.5; }
.ev-draft { background: var(--surface); color: var(--ink-2); border: 1px dashed var(--line-2); }
.ev-confirmed { background: var(--ink); color: #fff; }
.ev-out { background: var(--green); color: #fff; }
.ev-closed { background: var(--green-soft); color: var(--green); }
.ev:hover { opacity: .85; }

/* ---------- modal ---------- */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(640px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); background: var(--white); color: var(--ink); }
dialog[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
dialog::backdrop { background: rgba(13,17,16,.45); backdrop-filter: blur(3px); }
dialog .dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
dialog .dlg-head h2 { margin: 0; font-size: 17px; }
dialog .dlg-body { padding: 22px; max-height: 70vh; overflow-y: auto; }
dialog .dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px; border-top: 1px solid var(--line); }
dialog.lightbox { width: auto; max-width: 92vw; background: #fff; padding: 0; }
dialog.lightbox img { display: block; max-width: 92vw; max-height: 88vh; }

/* item picker */
.picker { position: relative; }
.picker-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 320px; overflow-y: auto; display: none; padding: 4px; }
.picker-list.open { display: block; }
.picker-opt { display: flex; gap: 12px; align-items: center; padding: 8px 10px; cursor: pointer; border-radius: 8px; line-height: 1.4; }
.picker-opt:hover, .picker-opt.active { background: var(--green-soft); }
.picker-opt img, .picker-opt .nophoto { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex: none; }
.picker-opt small { color: var(--muted); display: block; }
.picker-chosen { display: flex; align-items: center; gap: 12px; padding: 7px 8px 7px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; line-height: 1.35; }
.picker-chosen img, .picker-chosen .nophoto { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
.picker-chosen button { margin-left: auto; }

.rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.rowline { display: grid; grid-template-columns: minmax(0, 1fr) 100px auto; gap: 8px; align-items: center; }

/* activity */
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.55; }
.activity li:last-child { border: 0; }
.activity .when { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-top: 8px; flex: none; }

/* role matrix */
.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix input { width: 17px; height: 17px; cursor: pointer; }
.matrix .ic { color: var(--green); }

/* labels (print) */
.labels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.lbl { border: 1px dashed var(--line-2); border-radius: 10px; padding: 12px 14px; background: #fff; display: flex; gap: 12px; align-items: center; page-break-inside: avoid; }
.lbl .lbl-text { flex: 1; min-width: 0; }
.lbl b { display: block; font-size: 12.5px; line-height: 1.35; }
.lbl small { font-size: 11px; color: var(--muted); }
.lbl svg.barcode { display: block; width: 100%; height: 44px; margin-top: 6px; }
.lbl img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; }

/* ---------- login ---------- */
.login-page { background: var(--white); }
.login-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.login-art { position: relative; overflow: hidden; background: var(--green); color: #fff; display: flex; align-items: flex-end; padding: 64px; }
.login-art::after { content: ""; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 0 0 70px rgba(255,255,255,.018), 0 0 0 150px rgba(255,255,255,.012); }
.login-quote { position: relative; max-width: 480px; animation: rise .6s both .1s; }
.login-quote h2 { font-size: 36px; line-height: 1.2; letter-spacing: -.03em; margin: 14px 0 16px; color: #fff; font-weight: 700; }
.login-quote p { color: rgba(255,255,255,.7); font-size: 15px; line-height: 1.7; margin: 0; }
.eyebrow { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.6); font-weight: 600; }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: 64px clamp(24px, 7vw, 110px); max-width: 580px; width: 100%; margin: 0 auto; animation: rise .5s both; }
.login-card .brand { color: var(--ink); padding: 0; }
.login-card .brand:hover { color: var(--ink); }
.login-card .brand-mark { background: var(--green); color: #fff; }
.login-card h1 { font-size: 28px; margin: 40px 0 8px; }
.login-sub { color: var(--muted); margin: 0 0 28px; line-height: 1.6; }
.login-card .stack { gap: 18px; }
.login-card .btn-lg { margin-top: 6px; width: 100%; }
.login-help { color: var(--muted); font-size: 12.5px; line-height: 1.7; margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }

/* ---------- misc ---------- */
.kv { display: flex; gap: 24px; flex-wrap: wrap; }
.kv div { min-width: 110px; }
.kv small { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; }
.kv b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.3; }
.notice { padding: 13px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: 13px; line-height: 1.6; margin-bottom: 20px; }
.notice b { color: var(--ink); }
.help { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; padding: 6px 0 6px 38px; position: relative; line-height: 1.6; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 11.5px; }
.only-print, .only-print-inline, .only-print-cell { display: none; }
.tick-box { display: inline-block; width: 16px; height: 16px; border: 1.5px solid var(--ink); border-radius: 4px; }
.print-head { justify-content: space-between; align-items: flex-end; padding-bottom: 12px; margin-bottom: 18px; border-bottom: 2px solid var(--green); }
.print-head div { display: flex; flex-direction: column; gap: 2px; }
.print-head b { font-size: 11px; font-weight: 700; color: var(--green); text-transform: uppercase; letter-spacing: .14em; }
.print-head strong { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.print-head span { font-size: 11px; color: var(--muted); }
.sticky-bar { position: sticky; bottom: 0; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 14px 22px; display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin: 0 -24px -24px; border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .split { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: 264px; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .menu-btn { display: inline-grid; }
  .top { padding: 10px 14px; }
  .search kbd { display: none; }
  .content { padding: 22px 16px 60px; }
  .grid-2, .grid-3, .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
  h1 { font-size: 22px; }
  .labels { grid-template-columns: 1fr 1fr; }
  .dl { grid-template-columns: 110px 1fr; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
  .stat { padding: 14px 16px; }
  .stat .value { font-size: 22px; }
  .page-head .actions { width: 100%; }
  .card { padding: 18px; }
  .sticky-bar { margin: 0 -18px -18px; }
}

/* ---------- print ---------- */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; font-size: 11px; }
  .side, .top, .no-print, .flash, .tabs, .page-head .actions, .filters, .btn { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .card, .setup, .stat { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .only-print { display: block; }
  .only-print-inline { display: inline; }
  .only-print-cell { display: table-cell; text-align: center; width: 60px; }
  .print-head.only-print { display: flex; }
  .page-head { margin-bottom: 10px; }
  .page-head .sub { display: none; }
  .shop { border: 0; border-radius: 0; margin-bottom: 18px; overflow: visible; }
  body:has(.print-head) .page-head { display: none; }
  .card.flush.shop > .card-head { padding: 0 0 6px; }
  .shop h2 { font-size: 13px; }
  .shop .t th { padding: 6px 8px; border-bottom: 1.5px solid #333; color: #333; }
  .shop .t td { padding: 6px 8px; border-bottom: 1px solid #ddd; }
  .shop .thumb { width: 30px; height: 30px; }
  .t tbody tr:hover td { background: none; }
  .t tr { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  .labels { grid-template-columns: repeat(3, 1fr); }
  .lbl { border: 1px solid #bbb; }
  .icard { animation: none; }
}
