:root {
  --navy: #14285a; --navy2: #1f3a7a; --red: #c8202f; --ink: #15171c; --mut: #626a78;
  --line: #dde1e8; --bg: #f4f5f8; --card: #fff; --ok: #1d7a43; --warn: #a36100; --bad: #b3261e;
  --r: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; -webkit-text-size-adjust: 100%; }
a { color: var(--navy2); }
header.top { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); }
.topin { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 8px 14px; }
.topin img { height: 40px; }
.topin .sp { flex: 1; }
nav.tabs { display: flex; gap: 4px; }
nav.tabs button { border: 0; background: none; padding: 10px 12px; font-weight: 600; font-size: 15px; font-family: inherit; white-space: nowrap; color: var(--mut); border-radius: 8px; cursor: pointer; }
nav.tabs button.on { background: var(--navy); color: #fff; }
main { max-width: 1100px; margin: 0 auto; padding: 14px 14px 120px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 14px; }
.card h2 { margin: 0 0 12px; font-size: 17px; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.card h2 .n { background: var(--navy); color: #fff; width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 13px; }
label { display: block; font-size: 13px; color: var(--mut); font-weight: 600; margin: 0 0 4px; }
input, select, textarea { width: 100%; font-size: 16px; font-family: inherit; padding: 10px 11px; border: 1px solid #c8cdd7; border-radius: 9px; background: #fff; color: var(--ink); }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9fb3e6; border-color: var(--navy2); }
.grid { display: grid; gap: 10px; grid-template-columns: repeat(12, 1fr); }
.g12 { grid-column: span 12; } .g6 { grid-column: span 6; } .g4 { grid-column: span 4; } .g3 { grid-column: span 3; } .g8 { grid-column: span 8; }
@media (max-width: 640px) { .g6, .g4, .g3, .g8 { grid-column: span 12; } .g4.keep, .g3.keep { grid-column: span 6; } nav.tabs button { padding: 9px 8px; font-size: 14px; } .topin img { height: 32px; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--navy); background: #fff; color: var(--navy); padding: 10px 14px; border-radius: 9px; font-weight: 600; font-size: 15px; font-family: inherit; white-space: nowrap; cursor: pointer; text-decoration: none; }
.btn.p { background: var(--navy); color: #fff; }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn.red { border-color: var(--red); color: var(--red); }
.btn:disabled { opacity: .55; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.seg button { border: 2px solid var(--line); background: #fff; border-radius: 11px; padding: 12px 10px; text-align: left; cursor: pointer; font-family: inherit; color: var(--ink); }
.seg button b { display: block; font-size: 15px; }
.seg button span { font-size: 13px; color: var(--mut); }
.seg button.on { border-color: var(--navy); background: #eef2fb; box-shadow: inset 0 0 0 1px var(--navy); }
@media (max-width: 640px) { .seg.stack { grid-auto-flow: row; } }
.hint { font-size: 13px; color: var(--mut); margin-top: 6px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: #eceff4; color: #333; white-space: nowrap; }
.pill.pending { background: #fff3d6; color: #7a4b00; } .pill.shipped, .pill.in_transit { background: #e2ecff; color: #1c3f8f; }
.pill.delivered { background: #dff3e6; color: #135f33; } .pill.exception { background: #fde2e0; color: #8f1d16; }
.pill.cancelled, .pill.draft { background: #eee; color: #666; }
.alert { border-radius: 10px; padding: 11px 13px; margin: 10px 0; font-size: 14px; }
.alert.warn { background: #fff5e0; border: 1px solid #f0cf8a; }
.alert.bad { background: #fdecea; border: 1px solid #f1b6b0; }
.alert.ok { background: #e7f5ec; border: 1px solid #aedcbf; }
.alert.info { background: #eef2fb; border: 1px solid #c6d3f0; }
.results { border: 1px solid var(--line); border-radius: 10px; margin-top: 6px; max-height: 260px; overflow: auto; background: #fff; }
.results div { padding: 9px 11px; border-bottom: 1px solid #eef0f3; cursor: pointer; font-size: 14px; }
.results div:hover { background: #f3f6fc; }
.cta { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); z-index: 15; backdrop-filter: blur(6px); }
.cta .in { max-width: 1100px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.cta .big { flex: 1; background: var(--red); border: 0; color: #fff; font-weight: 800; font-size: 17px; font-family: inherit; letter-spacing: .4px; padding: 15px; border-radius: 12px; cursor: pointer; }
.cta .big:disabled { opacity: .6; }
.mic { border-radius: 50%; width: 46px; height: 46px; padding: 0; font-size: 20px; flex: none; }
.mic.rec { background: var(--red); border-color: var(--red); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(200,32,47,.15); } }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; color: var(--mut); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; padding: 8px 6px; border-bottom: 1px solid var(--line); }
table.list td { padding: 10px 6px; border-bottom: 1px solid #eef0f3; vertical-align: top; }
table.list tr.click { cursor: pointer; } table.list tr.click:hover td { background: #f7f9fd; }
.sub { color: var(--mut); font-size: 13px; }
@media (max-width: 760px) { table.list .hm { display: none; } }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.stats div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.stats b { display: block; font-size: 20px; color: var(--navy); }
.stats span { font-size: 12px; color: var(--mut); }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.modal { position: fixed; inset: 0; background: rgba(10,15,30,.5); z-index: 50; display: flex; align-items: stretch; justify-content: center; }
.modal .box { background: #fff; width: min(980px, 100%); margin: 2vh auto; border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; max-height: 96vh; }
.modal .bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.modal .bar h3 { margin: 0; flex: 1; font-size: 16px; color: var(--navy); }
.modal .body { overflow: auto; padding: 14px; }
.modal iframe { width: 100%; height: 80vh; border: 0; background: #e9ebef; }
@media (max-width: 640px) { .modal .box { margin: 0; border-radius: 0; max-height: 100vh; } }
.auto { display: grid; gap: 6px; }
.auto div { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: #bbb; }
.dot.ok { background: var(--ok); } .dot.failed { background: var(--bad); }
.log { font-size: 13px; color: #444; max-height: 220px; overflow: auto; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 6px; }
.log div { padding: 3px 0; }
.login { max-width: 380px; margin: 10vh auto; }
.login img { display: block; height: 110px; margin: 0 auto 18px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 90px; background: #1b1f2a; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 60; font-size: 14px; max-width: 90vw; }
.hide { display: none !important; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 0 0 12px; }
legend { font-weight: 700; color: var(--navy); padding: 0 6px; }
.imgprev { max-height: 70px; max-width: 220px; border: 1px dashed #ccc; padding: 4px; background: #fff; }
.shot { display: flex; justify-content: center; width: 100%; margin: 0; padding: 14px; font-size: 16px; cursor: pointer; }
.who { font-size: 13px; color: #5b6475; margin-right: 8px; }
@media (max-width: 600px) { .who { display: none; } }
.toggle { display: inline-flex; border: 2px solid var(--navy); border-radius: 10px; overflow: hidden; margin-bottom: 6px; }
.toggle button { border: 0; background: #fff; color: var(--navy); font: inherit; font-weight: 700; font-size: 15px; padding: 9px 22px; cursor: pointer; }
.toggle button.on { background: var(--navy); color: #fff; }
.pill { display: inline-block; margin-top: 10px; padding: 7px 12px; border-radius: 8px; font-size: 14px; font-weight: 700; }
.pill.yes { background: #fff4e0; color: #8a4b00; border: 1px solid #f0c27a; }
.pill.no { background: #eef2f7; color: #4a5568; border: 1px solid #d5dbe5; }
@media (max-width: 420px) { .topin { gap: 6px; padding: 8px 8px; } nav.tabs button { padding: 8px 6px; font-size: 13px; } #logout { padding: 6px 8px; font-size: 13px; } .topin img { height: 28px; } }
