/* ERP: order cycle, boards, chat, designs — shared by the admin panel and the customer order page */

/* progress steps */
.steps { display: grid; grid-template-columns: repeat(var(--n, 7), 1fr); gap: 4px; margin: 6px 0 4px; counter-reset: st; }
.steps li { list-style: none; text-align: center; font-size: 11.5px; color: var(--muted); position: relative; padding-top: 30px; }
.steps li::before { counter-increment: st; content: counter(st); position: absolute; top: 0; inset-inline: 0; margin: auto; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--card-2); border: 1px solid var(--line); color: var(--muted); z-index: 1; }
.steps li::after { content: ""; position: absolute; top: 11px; inset-inline-start: 50%; width: 100%; height: 2px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps li.done::before { content: "✓"; background: var(--gold-grad); color: var(--ink); border-color: transparent; }
.steps li.done::after { background: var(--gold); }
.steps li.now { color: var(--text); font-weight: 700; }
.steps li.now::before { background: var(--ink); color: var(--gold); border: 2px solid var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
@media (max-width: 560px) { .steps li { font-size: 10px; } }

/* next-step box */
.next-box { border: 1px solid var(--gold-3, var(--gold)); background: linear-gradient(180deg, var(--gold-soft), transparent 80%); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.next-box h3 { font-size: 15.5px; margin: 0 0 4px; display: flex; gap: 8px; align-items: center; }
.next-box p { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.next-box form + form { margin-top: 10px; }
.gate { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 700; color: var(--bad); background: rgba(220, 80, 80, .08); border: 1px solid rgba(220, 80, 80, .3); border-radius: 8px; padding: 3px 9px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--card-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.gold { color: var(--gold); border-color: var(--gold-3, var(--gold)); }
.pill.red { color: var(--bad); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.inline-form .field { margin: 0; flex: 1 1 160px; }

/* design versions */
.ver { border: 1px solid var(--line-soft); border-radius: 14px; padding: 12px; margin-bottom: 12px; background: var(--card-2); }
.ver-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ver-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.ver-imgs a { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #fff; aspect-ratio: 4 / 3; }
.ver-imgs img { width: 100%; height: 100%; object-fit: contain; }
.ver.big .ver-imgs { grid-template-columns: 1fr; }
.ver.big .ver-imgs a { aspect-ratio: auto; }
.ver-note { font-size: 14px; padding: 8px 10px; border-radius: 10px; background: var(--card); margin-top: 8px; white-space: pre-line; }
.ver-note.cust { border-inline-start: 3px solid var(--bad); }

/* chat */
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 460px; overflow-y: auto; padding: 4px 2px 8px; }
.msg { max-width: 82%; padding: 9px 12px; border-radius: 14px; font-size: 14px; background: var(--card-2); border: 1px solid var(--line-soft); white-space: pre-line; word-break: break-word; }
.msg small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.msg.me { align-self: flex-start; background: var(--gold-soft); border-color: var(--gold-3, var(--gold)); }
.msg.them { align-self: flex-end; }
.msg img { max-width: 220px; border-radius: 10px; display: block; margin-top: 6px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.chat-form textarea { min-height: 44px; height: 44px; flex: 1; resize: vertical; }
.chat-form .att { position: relative; overflow: hidden; flex: none; }
.chat-form .att input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.chat-empty { color: var(--muted); font-size: 14px; text-align: center; padding: 16px 0; }

/* job cards on boards */
.jobs { display: grid; gap: 10px; }
@media (min-width: 900px) { .jobs.cols { grid-template-columns: repeat(2, 1fr); } }
.job { display: block; padding: 13px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line-soft); transition: border-color .2s; color: inherit; }
.job:hover { border-color: var(--gold-3, var(--gold)); }
.job-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 4px; }
.job-top b { font-size: 15px; }
.job p { margin: 0; font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.job-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.job.late { border-color: var(--bad); }
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 0 10px; }
.board-head h2 { font-size: 16px; margin: 0; display: flex; align-items: center; gap: 8px; }
.board-head .n { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 99px; background: var(--gold-grad); color: var(--ink); font-size: 12.5px; font-weight: 800; display: inline-grid; place-items: center; }
.empty-box { padding: 18px; border-radius: 14px; border: 1px dashed var(--line); color: var(--muted); text-align: center; font-size: 14px; }

/* target ring */
.target { display: flex; align-items: center; gap: 14px; }
.target .ring { --p: 0; width: 74px; height: 74px; border-radius: 50%; flex: none; background: conic-gradient(var(--gold) calc(var(--p) * 1%), var(--line-soft) 0); display: grid; place-items: center; }
.target .ring span { width: 58px; height: 58px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-weight: 800; font-size: 15px; }

/* line items editor */
.lines-tbl { width: 100%; border-collapse: collapse; }
.lines-tbl td { padding: 4px; vertical-align: top; }
.lines-tbl .input { height: 40px; }
.lines-tbl .q { width: 90px; } .lines-tbl .p { width: 130px; } .lines-tbl .t { width: 110px; text-align: left; font-weight: 700; padding-top: 12px; white-space: nowrap; }
@media (max-width: 640px) {
  .lines-tbl tr { display: grid; grid-template-columns: 1fr 1fr 40px; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
  .lines-tbl td:first-child { grid-column: 1 / -1; } .lines-tbl .q, .lines-tbl .p { width: auto; } .lines-tbl .t { display: none; }
}

/* photos */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.thumbs a { display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--card-2); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* signature */
.sig-wrap { border: 1px dashed var(--line); border-radius: 12px; background: #fff; position: relative; touch-action: none; }
.sig-wrap canvas { width: 100%; height: 170px; display: block; border-radius: 12px; }
.sig-wrap button { position: absolute; top: 6px; inset-inline-start: 6px; }

/* bell */
.bell { position: relative; }
.bell .badge-count { top: 2px; inset-inline-end: 0; }
.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-list li a { display: block; padding: 11px 6px; border-bottom: 1px solid var(--line-soft); color: inherit; }
.alert-list li.unread a { font-weight: 700; }
.alert-list li.unread a::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-inline-end: 8px; }
.alert-list small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; margin-top: 2px; }

/* key numbers */
.money-box { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.money-box div { padding: 10px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line-soft); text-align: center; }
.money-box small { display: block; color: var(--muted); font-size: 12px; }
.money-box b { font-size: 16px; }
.money-box .due b { color: var(--gold); }
.side .sep-role { font-size: 11.5px; }
.code-box { font-size: 30px; font-weight: 800; letter-spacing: 8px; text-align: center; color: var(--gold); padding: 6px 0; font-variant-numeric: tabular-nums; }
:root[data-theme="light"] .ver-imgs a, :root[data-theme="light"] .sig-wrap { background: #fff; }

/* grouped sidebar */
.side-nav .nav-group { margin-bottom: 2px; }
.side-nav .nav-group summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; color: var(--text); font-size: 14.5px; font-weight: 700; cursor: pointer; user-select: none; }
.side-nav .nav-group summary::-webkit-details-marker { display: none; }
.side-nav .nav-group summary:hover { background: var(--card); }
.side-nav .nav-group summary.on { color: var(--gold-2); }
.side-nav .nav-group summary .count { margin-inline-start: auto; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--gold); color: var(--ink); }
.side-nav .nav-group summary .chev { margin-inline-start: auto; transition: transform .2s; opacity: .6; }
.side-nav .nav-group summary .count + .chev { margin-inline-start: 6px; }
.side-nav .nav-group[open] summary .chev { transform: rotate(180deg); }
.side-nav .nav-sub { margin: 2px 0 8px; padding-inline-start: 14px; border-inline-start: 1px solid var(--line-soft); margin-inline-start: 20px; }
.side-nav .nav-sub a { font-size: 14px; padding: 8px 10px; }
.side-nav .nav-foot { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line-soft); }

/* mobile drawer */
@media (max-width: 991.98px) {
  body.nav-open .side { display: block; position: fixed; inset-block: 0; inset-inline-start: 0; width: min(84vw, 320px); height: 100%; z-index: 120; box-shadow: 0 0 40px rgba(0,0,0,.5); padding-bottom: 90px; }
  .nav-backdrop { display: none; }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 110; background: rgba(0,0,0,.55); }
  body.nav-open { overflow: hidden; }
  .hide-xs { display: none; }
}

/* attendance */
.att-cam { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 3 / 4; max-width: 360px; margin: 0 auto; }
.att-cam video, .att-cam img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scaleX(-1); }
.att-cam img { transform: none; }
.att-cam .att-msg { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; text-align: center; padding: 20px; font-size: 14px; }
.att-loc { display: flex; align-items: center; gap: 8px; justify-content: center; font-size: 13.5px; margin: 10px 0; color: var(--muted); }
.att-loc.ok { color: var(--ok); } .att-loc.bad { color: var(--bad); }
.att-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); vertical-align: middle; }
.big-clock { text-align: center; font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; margin: 4px 0; }
.admin [hidden] { display: none !important; }
.side-nav .nav-group summary { white-space: nowrap; }
.side-nav .nav-group summary .lbl { overflow: hidden; text-overflow: ellipsis; }

/* product media on order lines */
.item-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 8px; }
.item-media video { grid-column: span 2; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: #000; border: 1px solid var(--line); }
.item-media a { display: block; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--card-2); }
.item-media img { width: 100%; height: 100%; object-fit: cover; }

/* checkout: payment logos drop under the text on phones */
@media (max-width: 600px) {
  .pay-opt { flex-wrap: wrap; }
  .pay-opt .p-text { min-width: 0; flex: 1 1 60%; }
  .pay-logos { order: 3; width: 100%; justify-content: flex-start; padding-inline-start: 32px; }
}

.timer { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: rgba(80, 160, 255, .1); color: var(--info); border: 1px solid rgba(80, 160, 255, .3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.timer.stopped { background: var(--card-2); color: var(--muted); border-color: var(--line); }
.stage-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.stage-times div { padding: 10px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line-soft); }
.stage-times small { display: block; color: var(--muted); font-size: 12px; }
.stage-times b { display: block; font-size: 13px; margin-bottom: 4px; }

/* ── reports ── */
.rep-group { font-size: 15px; color: var(--gold); margin: 18px 0 10px; }
.rep-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.rep-card { display: grid; gap: 6px; padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line-soft); color: inherit; text-decoration: none; transition: border-color .2s, transform .2s; }
.rep-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.rep-card small { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.rep-filters { align-items: center; }
.rep-seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; border-radius: 12px; border: 1px solid var(--line-soft); }
.rep-seg label { cursor: pointer; }
.rep-seg input { position: absolute; opacity: 0; pointer-events: none; }
.rep-seg span { display: block; padding: 8px 12px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--muted); }
.rep-seg input:checked + span { background: var(--gold-grad); color: #1a1406; }
.rpt-title { margin: 6px 0 14px; }
.rpt-title h1 { font-size: 20px; margin: 0 0 4px; }
.rep-note { padding: 10px 14px; border-radius: 12px; border: 1px dashed var(--gold); color: var(--gold); margin-bottom: 14px; font-size: 13.5px; }
.rep-bars { display: grid; gap: 8px; }
.rep-bar { display: grid; grid-template-columns: minmax(90px, 210px) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.rep-bar .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.rep-bar .t { height: 12px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.rep-bar .t i { display: block; height: 100%; border-radius: 99px; background: var(--gold-grad); }
.rep-bar b { min-width: 80px; text-align: end; font-variant-numeric: tabular-nums; }
.rep-tables { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 1100px) { .rep-tables { grid-template-columns: 1fr 1fr; } .rep-tables > .panel:not(.half) { grid-column: 1 / -1; } }
.rep-tbl td.n, .rep-tbl th.n { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rep-tbl tfoot th { border-top: 2px solid var(--gold); color: var(--gold); }
@media (max-width: 760px) { .rep-bar { grid-template-columns: 1fr auto; } .rep-bar .t { grid-column: 1 / -1; grid-row: 2; } }
@media print {
  .rep-tables { grid-template-columns: 1fr !important; }
  .rep-bar .t { border: 1px solid #999; } .rep-bar .t i { background: #333 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rpt-title h1 { color: #000; }
}
