/* RX Orthotic eLab web portal — navy frame (#0B1F3A, white text, the "e" in neon cyan #1FF2F2), light working area */
:root {
  --navy: #0B1F3A; --navy-2: #13294B; --navy-3: #1d3863; --cyan: #1FF2F2; --cyan-ink: #087a86;
  --bg: #f3f5f9; --surface: #ffffff; --ink: #14213a; --muted: #5d6b82; --line: #dfe4ec;
  --ok: #157f3b; --ok-bg: #e3f5ea; --warn: #9a5b00; --warn-bg: #fff2d9; --bad: #b4232c; --bad-bg: #fde7e8; --info: #1f4f99; --info-bg: #e5eefc;
  --r: 10px; --shadow: 0 1px 2px rgba(11, 31, 58, .06), 0 4px 16px rgba(11, 31, 58, .06);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
a { color: var(--info); }
h1 { font-size: 24px; margin: 0 0 14px; } h2 { font-size: 18px; margin: 18px 0 10px; } h3 { font-size: 15px; margin: 14px 0 6px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.brand { font-weight: 700; letter-spacing: .2px; } .brand .e { color: var(--cyan); }
h1 .brand { font-size: 26px; }

/* frame */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 10px 18px; background: var(--navy); color: #fff; }
.top .home { color: #fff; text-decoration: none; font-size: 18px; }
.top .who { margin-left: auto; text-align: right; font-size: 13px; line-height: 1.3; } .top .who .muted { color: #b8c4d8; }
.top .menu { display: none; color: #fff; }
.layout { display: grid; grid-template-columns: 210px 1fr; min-height: calc(100vh - 56px); }
nav.side { background: var(--navy-2); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
nav.side a { color: #dbe4f3; text-decoration: none; padding: 9px 12px; border-radius: 8px; font-weight: 500; }
nav.side a:hover { background: var(--navy-3); color: #fff; }
nav.side a.on { background: var(--navy-3); color: #fff; box-shadow: inset 3px 0 0 var(--cyan); }
main#page { padding: 24px 28px 60px; min-width: 0; outline: none; }
.page { max-width: 1180px; }
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; } nav.side { display: none; } body.nav-open nav.side { display: flex; }
  .top .menu { display: block; } .top .who { display: none; } main#page { padding: 18px 16px 60px; }
}
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--navy); }
.card.auth { width: 100%; max-width: 420px; padding: 28px; }
.card.auth h1 { color: var(--navy); } .card.auth h1 .e { color: var(--cyan-ink); }

/* building blocks */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat .n { font-size: 28px; font-weight: 700; } .stat .l { color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row.end { justify-content: flex-end; } .row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; } @media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: #b9c3d3; } .btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; } .btn.primary:hover { background: var(--navy-3); }
.btn.accent { background: var(--cyan); border-color: var(--cyan); color: var(--navy); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn.link { background: none; border: 0; color: var(--info); padding: 6px 0; font-weight: 500; }
.btn.small { padding: 5px 10px; font-size: 13px; } .btn.wide { width: 100%; margin-top: 8px; }
button.icon { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: inherit; padding: 4px 8px; }
.action { display: inline-flex; flex-direction: column; gap: 4px; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; } .field .lbl { font-weight: 600; font-size: 13px; } .field .hint { color: var(--muted); font-size: 12px; }
input, select, textarea { font: inherit; color: inherit; padding: 9px 11px; border: 1px solid #c9d1de; border-radius: 8px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--cyan-ink); outline-offset: 1px; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--navy); }
textarea { min-height: 90px; resize: vertical; }
input.code { font: 600 26px/1 ui-monospace, Menlo, monospace; letter-spacing: 8px; text-align: center; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; } .check input { margin-top: 3px; }
.field-error { color: var(--bad); font-size: 13px; min-height: 0; } .field-error:empty { display: none; }
.alert { padding: 10px 14px; border-radius: 8px; margin: 10px 0; } .alert.info { background: var(--info-bg); color: var(--info); } .alert.bad { background: var(--bad-bg); color: var(--bad); }
.alert.warn { background: var(--warn-bg); color: var(--warn); } .alert.ok { background: var(--ok-bg); color: var(--ok); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); } .badge.muted { background: #eceff4; color: var(--muted); }
.loading { display: flex; gap: 10px; align-items: center; color: var(--muted); padding: 16px 0; }
.spin { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
.empty { color: var(--muted); padding: 18px 0; }

/* tables */
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
table { border-collapse: collapse; width: 100%; } th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); background: #f8f9fc; } tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: #f6f9ff; }
td.num, th.num { text-align: right; white-space: nowrap; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; } .toolbar input[type=search] { max-width: 320px; } .toolbar select { width: auto; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-decoration: none; color: inherit; }
a.item:hover { border-color: #b9c3d3; }

/* dialogs and toasts */
dialog.modal { border: 0; border-radius: 12px; padding: 0; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); color: var(--ink); }
dialog.modal.wide { width: min(980px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(11, 31, 58, .55); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 1; } .modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 18px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; transition: .25s; background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 9px; z-index: 100; box-shadow: var(--shadow); max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); } .toast.ok { border-left: 4px solid var(--cyan); } .toast.bad { background: var(--bad); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
.desc { white-space: pre-wrap; font-size: 13px; background: #f8f9fc; border-radius: 6px; padding: 8px 10px; margin: 6px 0 0; }
.choice { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.choice button { padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); background: #fff; cursor: pointer; font: inherit; }
.choice button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.choice button.danger.on { background: var(--bad); border-color: var(--bad); }
.timeline { list-style: none; padding: 0; margin: 8px 0; } .timeline li { padding: 6px 0 6px 16px; border-left: 2px solid var(--line); position: relative; font-size: 13px; }
.timeline li::before { content: ''; position: absolute; left: -5px; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--navy); }
.printonly { display: none; }
@media print { .top, nav.side, .toolbar, .noprint { display: none !important; } .layout { display: block; } main#page { padding: 0; } .printonly { display: block; } .card, .tablewrap { box-shadow: none; } }

/* new order wizard */
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 16px; }
.steps .step { display: flex; align-items: center; gap: 8px; padding: 7px 14px 7px 7px; border-radius: 99px; border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.steps .step .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #eceff4; font-size: 12px; }
.steps .step.on { border-color: var(--navy); color: var(--navy); } .steps .step.on .n { background: var(--navy); color: #fff; }
.steps .step.done .n { background: var(--cyan); color: var(--navy); }
.step-body { display: flex; flex-direction: column; gap: 16px; } .step-body .card h2.first, .card h2.first { margin-top: 0; }
.step-nav { margin-top: 18px; position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--line); }
.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.product { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; font: inherit; color: inherit; }
.product.on { border-color: var(--navy); box-shadow: inset 4px 0 0 var(--cyan), var(--shadow); } .product .sel { color: var(--cyan-ink); font-weight: 600; font-size: 13px; }
.choice.small button { padding: 5px 10px; font-size: 13px; }
.nowrap-row { flex-wrap: nowrap; } .nowrap-row .choice { margin: 0; flex-wrap: nowrap; }
input.w-num { width: 80px; } input.w-size { width: 110px; } select.w-sys { width: 80px; }
.hint.warn { color: var(--warn); font-size: 12px; } .hint.warn:empty { display: none; }
.hidden-file { display: none; }
.files { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumb { position: relative; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #f8f9fc; display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; } .thumb .doc { font-weight: 700; color: var(--muted); }
.thumb .x { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(11, 31, 58, .8); color: #fff; cursor: pointer; line-height: 1; }
.scan-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.scan-tile { border: 2px dashed #c9d1de; border-radius: 12px; padding: 18px; min-height: 150px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; background: #fbfcfe; word-break: break-all; }
.scan-tile.drag { border-color: var(--cyan-ink); background: #effcfd; } .scan-tile .side { font-weight: 700; color: var(--navy); text-transform: uppercase; letter-spacing: .5px; font-size: 12px; }
.so { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
dd.pre { white-space: pre-wrap; }
.btn.big { padding: 12px 22px; font-size: 16px; }
.upload { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; } .upload progress { width: 100%; height: 10px; accent-color: var(--navy); }
code.temp { font: 600 22px ui-monospace, Menlo, monospace; letter-spacing: 2px; background: #f3f5f9; padding: 6px 12px; border-radius: 6px; user-select: all; }
.paybar { position: sticky; bottom: 0; display: none; gap: 12px; align-items: center; justify-content: flex-end; padding: 12px 16px; margin-top: 12px; background: var(--navy); color: #fff; border-radius: 10px; }
.paybar.on { display: flex; } .paybar .btn:not(.accent) { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); } .paybar .field-error { color: #ffb4b8; }
