/* ECO moulding app — dark, high contrast, glove-sized targets (min 56-72px). */
:root {
  --bg: #181d24; --panel: #212936; --panel2: #1a2230; --line: #2e3d50; --text: #ecf0f1; --muted: #9fb0bd;
  --green: #2ecc71; --green-d: #27ae60; --amber: #f39c12; --red: #e74c3c; --blue: #3498db;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--bg); color: var(--text); font: 17px/1.4 'Segoe UI', system-ui, -apple-system, sans-serif; min-height: 100%; }
body { padding-bottom: env(safe-area-inset-bottom); }
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }

.top { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 14px; background: var(--panel); border-bottom: 2px solid var(--green); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { height: 38px; width: auto; filter: brightness(0) invert(1); opacity: .92; }
.title { font-weight: 800; font-size: 18px; }
.sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.net { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; padding: 6px 10px; border-radius: 20px; background: rgba(0,0,0,.3); }
.net .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.net.ok .dot { background: var(--green); } .net.off .dot { background: var(--red); } .net.wait .dot { background: var(--amber); }

.tabs { display: flex; background: var(--panel2); border-bottom: 1px solid var(--line); }
.tab { flex: 1; min-height: 60px; background: none; border: 0; border-bottom: 4px solid transparent; color: var(--muted); font-size: 18px; font-weight: 700; cursor: pointer; }
.tab.active { color: var(--green); border-bottom-color: var(--green); }

main { max-width: 1100px; margin: 0 auto; padding: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; min-width: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.card h2 { font-size: 20px; color: var(--green); margin-bottom: 10px; }
.card h3 { font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 14px 0 8px; }
.muted { color: var(--muted); } .warn { color: var(--amber); } .bad { color: var(--red); }

.btn { min-height: 52px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line); background: #2a3545; color: var(--text);
  font-weight: 700; cursor: pointer; touch-action: manipulation; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--green); border-color: var(--green); color: #0d1b12; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: none; }
.btn.small { min-height: 40px; padding: 6px 12px; font-size: 14px; }
.btn.big { min-height: 72px; font-size: 22px; width: 100%; }
.btn.chip { min-height: 56px; font-size: 18px; }
.btn.chip.on { background: var(--green); color: #0d1b12; border-color: var(--green); }

input[type=text], input[type=search], input[type=number], select, textarea {
  width: 100%; min-height: 56px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: #10161d; font-size: 20px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); }
textarea { min-height: 90px; font-size: 17px; }
label { display: block; color: var(--muted); font-size: 15px; margin: 12px 0 6px; font-weight: 600; }
.search { font-size: 24px !important; min-height: 68px !important; text-transform: uppercase; }

.mz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.mz-btn { min-height: 96px; text-align: left; padding: 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel); cursor: pointer; }
.mz-btn .mz { font-size: 24px; font-weight: 800; letter-spacing: .5px; }
.mz-btn .d { color: var(--muted); font-size: 15px; margin-top: 4px; }
.mz-btn:active, .mz-btn:focus { border-color: var(--green); }

.mz-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mz-big { font-size: 34px; font-weight: 900; letter-spacing: 1px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo { position: relative; border-radius: 10px; overflow: hidden; background: #0d1218; aspect-ratio: 4 / 3; border: 1px solid var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.photo .lbl { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 6px; background: rgba(0,0,0,.65); font-size: 13px; }
.photo .rm { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0,0,0,.75); color: #fff; font-size: 22px; cursor: pointer; }
.photo .ph { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-size: 13px; padding: 6px; text-align: center; }

table.settings { width: 100%; border-collapse: collapse; font-size: 19px; }
table.settings td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.settings td:last-child { font-weight: 800; text-align: right; color: #fff; }
table.edit td { padding: 4px; }
table.edit input { min-height: 48px; font-size: 17px; }
table.edit td:last-child { width: 56px; }

.events .ev { border-left: 3px solid var(--green); padding: 8px 12px; margin-bottom: 8px; background: rgba(0,0,0,.2); border-radius: 0 8px 8px 0; }
.events .ev .t { color: var(--muted); font-size: 13px; }
.runs .run { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.runs .run.pending { color: var(--amber); } .runs .run.failed { color: var(--red); }

.numrow { display: flex; gap: 8px; align-items: stretch; }
.numrow input { text-align: center; font-size: 30px; font-weight: 800; }
.numrow .btn { min-width: 72px; font-size: 28px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; transition: all .25s;
  background: var(--green); color: #0d1b12; font-weight: 800; padding: 14px 22px; border-radius: 12px; z-index: 200; pointer-events: none; max-width: 92vw; }
.toast.err { background: var(--red); color: #fff; } .toast.show { opacity: 1; transform: translateX(-50%); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.94); z-index: 150; display: flex; align-items: center; justify-content: center; padding: 12px; }
.lightbox img { max-width: 100%; max-height: 94vh; border-radius: 8px; }
.scanner { position: fixed; inset: 0; z-index: 160; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; }
.scanner video { width: 100%; max-height: 70vh; object-fit: cover; border-radius: 12px; }
.scan-hint { color: #fff; font-size: 20px; }
.empty { text-align: center; padding: 50px 10px; color: var(--muted); }
.banner { padding: 12px 16px; border-radius: 12px; margin-bottom: 12px; background: rgba(243,156,18,.15); border: 1px solid var(--amber); }
.banner.bad { background: rgba(231,76,60,.15); border-color: var(--red); }
.spinner { display: inline-block; width: 28px; height: 28px; border: 3px solid rgba(255,255,255,.25); border-top-color: var(--green); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 600px) { .mz-big { font-size: 28px; } .title { font-size: 16px; } .logo { height: 30px; } }
