/* PROJEX 9 · folha de estilos (sem dependências externas) */
:root {
  color-scheme: dark;
  --bg: #06111d; --bg2: #071c30; --card: #102235; --card2: #0c1b2b; --text: #f5f9ff; --muted: #91a4b8;
  --sep: rgba(108, 163, 210, .22); --line: #285171; --tint: #0aa8ff; --tint-ink: #fff; --btn1: #0089ed; --btn2: #087cff;
  --red: #ff5a4f; --green: #30d158; --orange: #ff9f0a; --fill: rgba(105, 159, 211, .13); --bar: rgba(5, 17, 30, .96);
  --hero1: #102a43; --hero2: #081523; --hero-line: rgba(40, 165, 255, .55); --shadow: 0 10px 28px rgba(0, 0, 0, .18);
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px);
  --radius: 16px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f7; --bg2: #e3eaf3; --card: #ffffff; --card2: #f5f8fc; --text: #0d1b2a; --muted: #5d6f82;
  --sep: rgba(20, 60, 100, .14); --line: #c4d3e3; --tint: #0077d6; --btn1: #0089ed; --btn2: #0667d8;
  --red: #d92c20; --green: #1f9d49; --orange: #c56f00; --fill: rgba(20, 80, 140, .08); --bar: rgba(255, 255, 255, .94);
  --hero1: #12314f; --hero2: #0a1c2e; --shadow: 0 8px 22px rgba(20, 50, 90, .1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  background: linear-gradient(180deg, var(--bg2), var(--bg) 40%) fixed;
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-text-size-adjust: 100%; touch-action: manipulation;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }
a { color: var(--tint); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ---------- estrutura ---------- */
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; min-height: 62px;
  padding: calc(var(--st) + 10px) 12px 10px; background: var(--bar); border-bottom: .5px solid var(--sep);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: clamp(20px, 5.6vw, 25px); font-weight: 900; font-style: italic; letter-spacing: -1.1px; white-space: nowrap; }
.brand img { width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; }
.brand em { color: var(--tint); font-style: inherit; }
.top .spacer { flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 46vw; min-height: 36px; padding: 6px 11px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--card); font-size: 13px; font-weight: 700;
}
.pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--tint); }
.pill.flag { padding: 4px 9px; font-size: 19px; }
.offline { position: sticky; top: calc(var(--st) + 62px); z-index: 19; padding: 7px 14px; background: #7a4a00; color: #fff; font-size: 13px; text-align: center; }

.chooser { padding: 12px 16px 6px; }
.chooser button {
  width: 100%; min-height: 64px; display: flex; align-items: center; gap: 12px; padding: 8px 13px; text-align: left;
  background: linear-gradient(135deg, var(--card), var(--card2)); border: 1.5px solid var(--line); border-radius: 15px;
  font-size: 16px; font-weight: 750; box-shadow: var(--shadow);
}
.chooser .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chooser svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--muted); }
.thumb { width: 48px; height: 46px; border-radius: 9px; overflow: hidden; display: grid; place-items: center; flex-shrink: 0; background: var(--fill); border: 1px solid var(--line); color: var(--tint); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb svg { width: 22px; height: 22px; }

main { padding-bottom: calc(92px + var(--sb)); }
h1 { font-size: 28px; line-height: 1.1; font-weight: 750; margin: 20px 16px 14px; }
.ghead { margin: 0 30px 7px; font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; display: flex; justify-content: space-between; gap: 10px; }
.gfoot { margin: -12px 30px 22px; font-size: 13px; color: var(--muted); }
.group { background: var(--card); border: 1px solid var(--sep); border-radius: var(--radius); overflow: hidden; margin: 0 16px 22px; box-shadow: var(--shadow); }
.group.pad { padding: 14px; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; min-height: 48px; position: relative; width: 100%; text-align: left; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--sep); }
.row .grow { flex: 1; min-width: 0; }
.row .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .val { color: var(--muted); text-align: right; }
.row .amt { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row.wrap .sub, .row.wrap .title { white-space: normal; }
.chev { color: var(--muted); font-size: 20px; margin-left: -4px; }
a.row { color: inherit; text-decoration: none; }
.row.link { color: var(--tint); font-weight: 600; }
.row.danger { color: var(--red); }
button.row:hover { background: var(--fill); }
button.row:active, label.row:active { background: var(--fill); }
.clickable { cursor: pointer; }
.check { color: var(--tint); font-weight: 800; }
.badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--fill); color: var(--muted); white-space: nowrap; }
.badge.blue { color: var(--tint); }
.badge.red { color: var(--red); }

/* ---------- campos ---------- */
.row label { flex: 0 0 auto; min-width: 104px; }
.row input, .row select, .row textarea { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; padding: 0; -webkit-appearance: none; appearance: none; }
.row input.right, .row select { text-align: right; text-align-last: right; color: var(--muted); }
.row input.right:focus { color: var(--text); }
.row select option { color: #000; background: #fff; }
.row input[type=date] { text-align: right; color: var(--tint); min-height: 24px; }
.row input[type=color] { flex: none; width: 70px; height: 38px; padding: 0; border-radius: 8px; }
.row textarea { resize: none; min-height: 66px; }
::placeholder { color: var(--muted); opacity: .75; }
.field { display: block; margin: 0 0 12px; }
.field > span { display: block; font-size: 12.5px; font-weight: 650; color: var(--muted); margin: 0 0 5px 2px; }
.field input, .field select, .field textarea, .input {
  display: block; width: 100%; padding: 12px 13px; font-size: 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--card2); color: var(--text); outline: none;
}
.field input:focus, .field select:focus, .input:focus { border-color: var(--tint); }
.field textarea { min-height: 120px; resize: vertical; }
.field { min-width: 0; } .field input, .field select { min-width: 0; }
.hoursrow { display: grid; grid-template-columns: 148px 72px 84px; justify-content: start; gap: 0 10px; }
.field input.narrow { text-align: center; padding-left: 4px; padding-right: 4px; }
.field input[type=date] { -webkit-appearance: none; appearance: none; min-height: 49px; }
.hoursrow input[type=date] { padding-left: 10px; padding-right: 8px; }
@media (max-width: 370px) { .hoursrow { grid-template-columns: 72px 84px; } .hoursrow .field:first-child { grid-column: 1 / -1; width: 148px; } }
.fields2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.checkline { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); margin: 4px 2px 14px; }
.checkline input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--tint); }
.btn {
  display: block; width: calc(100% - 32px); margin: 0 16px 12px; padding: 14px; border-radius: 12px; text-align: center;
  background: linear-gradient(120deg, var(--btn1), var(--btn2)); color: #fff; font-weight: 650; font-size: 16px;
}
.btn:active { opacity: .78; } .btn:disabled, .btn[aria-busy=true] { opacity: .5; cursor: wait; }
.btn.plain { background: var(--card); color: var(--tint); border: 1px solid var(--sep); }
.btn.red { background: var(--card); color: var(--red); border: 1px solid var(--sep); }
.btn.inset { width: 100%; margin: 0 0 10px; }
.btn.small { display: inline-block; width: auto; margin: 0; padding: 8px 12px; font-size: 13.5px; border-radius: 9px; }
.linkbtn { color: var(--tint); font-weight: 600; font-size: 14px; }
.msg { margin: 0 0 12px; padding: 11px 13px; border-radius: 11px; font-size: 14px; background: var(--fill); border: 1px solid var(--sep); white-space: pre-line; }
.msg.err { background: rgba(255, 90, 79, .12); border-color: rgba(255, 90, 79, .5); }
.msg.ok { background: rgba(48, 209, 88, .12); border-color: rgba(48, 209, 88, .45); }
.hint { font-size: 12.5px; color: var(--muted); margin: 6px 2px 0; }

/* ---------- resumo ---------- */
.hero { margin: 0 16px 16px; border-radius: 21px; overflow: hidden; color: #fff; background: linear-gradient(165deg, var(--hero1), var(--hero2)); border: 1px solid var(--hero-line); box-shadow: 0 16px 32px rgba(0, 0, 0, .25); }
.hero-cover { height: 205px; position: relative; background: linear-gradient(145deg, #15344f, #071523); }
.hero-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-cover::after { content: ""; position: absolute; inset: 50% 0 0; background: linear-gradient(transparent, rgba(5, 17, 29, .9)); pointer-events: none; }
.hero-cover .cover-title { position: absolute; bottom: 13px; left: 17px; right: 17px; z-index: 1; font-size: 22px; font-weight: 800; text-shadow: 0 2px 8px #000; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-cover .cover-empty { height: 100%; display: grid; place-items: center; color: #7fa2bc; font-size: 15px; font-weight: 900; font-style: italic; letter-spacing: -.5px; }
.cover-edit { position: absolute; right: 12px; top: 12px; z-index: 2; background: #0b2035e8; border: 1px solid #327ab1; border-radius: 50%; width: 42px; height: 42px; display: grid; place-items: center; color: #fff; }
.cover-edit svg { width: 20px; height: 20px; }
.hero-content { padding: 16px 18px 19px; }
.hero .lbl { font-size: 14px; opacity: .85; }
.hero .big { font-size: 34px; font-weight: 750; letter-spacing: -.5px; font-variant-numeric: tabular-nums; color: #16aaff; margin: 2px 0 12px; }
.meter { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; background: #0aa8ff; }
.meter.warn i { background: #ffd60a; } .meter.over i { background: #ff6961; }
.hero .foot { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; margin-top: 8px; opacity: .92; }
.hero .under { color: #fff; font-size: 14px; text-decoration: underline; }
.breakdown { margin: 0 16px 18px; background: var(--card); border: 1px solid var(--sep); border-radius: 15px; padding: 10px 15px; font-size: 14px; }
.breakdown > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; }
.breakdown strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.breakdown .grand { border-top: 1px solid var(--sep); margin-top: 5px; padding-top: 12px; font-weight: 750; }
.breakdown .grand strong { color: var(--tint); }
.shortcuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 16px 18px; }
.shortcuts button { border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(160deg, var(--card), var(--card2)); padding: 14px 2px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; font-size: 11.5px; }
.shortcuts svg { width: 28px; height: 28px; color: var(--tint); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 16px 22px; }
.stat { background: var(--card); border: 1px solid var(--sep); border-radius: 14px; padding: 13px 14px; }
.stat b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
.cbar { height: 6px; border-radius: 99px; background: var(--fill); margin-top: 6px; overflow: hidden; }
.cbar i { display: block; height: 100%; border-radius: 99px; }
.dot { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 700; object-fit: cover; }
.dot.small { width: 12px; height: 12px; flex-basis: 12px; border-radius: 50%; }
.dot.mid { width: 24px; height: 24px; flex-basis: 24px; border-radius: 7px; }
.catline { display: flex; justify-content: space-between; gap: 10px; }
.empty { text-align: center; color: var(--muted); padding: 34px 32px; }
.empty svg { width: 54px; height: 54px; margin-bottom: 8px; color: var(--line); }
.notice { margin: 0 16px 18px; padding: 13px 15px; border-radius: 14px; background: var(--card); border: 1px solid var(--sep); border-left: 4px solid var(--tint); font-size: 14px; }
.notice b { display: block; margin-bottom: 3px; font-size: 15px; }
.notice .actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.editbtn { flex: 0 0 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--tint); background: var(--fill); }
.editbtn svg { width: 17px; height: 17px; }
.detail-total { margin: 0 16px 16px; padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.detail-total b { display: block; font-size: 28px; color: var(--tint); margin-top: 4px; font-variant-numeric: tabular-nums; }
.back { color: var(--tint); font-size: 15px; font-weight: 700; margin: 14px 16px -8px; }
.subtitle { color: var(--muted); font-size: 14px; margin: -8px 16px 18px; overflow-wrap: anywhere; }
.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 16px 22px; }
.photo-tile { border: 1px solid var(--line); background: var(--card); border-radius: 13px; overflow: hidden; text-align: left; }
.photo-tile img { width: 100%; aspect-ratio: 1 / 1; display: block; object-fit: cover; background: var(--fill); }
.photo-tile span { display: block; padding: 9px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- histórico / formulário ---------- */
.search { margin: 0 16px 18px; display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--sep); border-radius: 12px; padding: 9px 12px; color: var(--muted); }
.search svg { width: 17px; height: 17px; flex-shrink: 0; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; -webkit-appearance: none; }
.pgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px 16px; }
.ptile { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--fill); }
.ptile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ptile .del { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0, 0, 0, .65); color: #fff; font-size: 16px; line-height: 26px; text-align: center; }
.padd { position: relative; overflow: hidden; display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; background: var(--fill); color: var(--tint); font-size: 12px; text-align: center; cursor: pointer; }
.padd svg { width: 26px; height: 26px; display: block; margin: 0 auto 2px; }
.linetotal { justify-content: space-between; font-weight: 650; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input, .padd input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; font-size: 0; }
details summary { cursor: pointer; color: var(--tint); font-weight: 600; font-size: 14px; padding: 4px 2px; }
.entry { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: .5px solid var(--sep); }
.entry .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.entry .sub { font-size: 13px; color: var(--muted); }
.box { margin: 0 16px 16px; padding: 15px; background: var(--card); border: 1px solid var(--sep); border-radius: var(--radius); box-shadow: var(--shadow); }
.box h2 { font-size: 17px; margin: 0 0 12px; }
.box p { margin: 6px 0; display: flex; justify-content: space-between; gap: 12px; }
.box p b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 16px 18px; }

/* ---------- barra de separadores ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around; max-width: 560px; margin: 0 auto;
  padding: 6px 4px calc(var(--sb) + 5px); background: var(--bar); border-top: .5px solid var(--sep);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.tabbar button { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 550; color: var(--muted); padding: 3px 0; }
.tabbar button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar button.on { color: var(--tint); }
.tabbar svg { width: 26px; height: 26px; display: block; }

/* ---------- folha, diálogo, visualizador, aviso ---------- */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0); transition: background .25s; }
.backdrop.open { background: rgba(0, 0, 0, .5); }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: 92vh; overflow: auto; -webkit-overflow-scrolling: touch;
  background: var(--bg); border-radius: 16px 16px 0 0; border-top: 1px solid var(--sep); padding-bottom: calc(var(--sb) + 16px);
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.backdrop.open .sheet { transform: none; }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; background: var(--bg); }
.sheet-head b { font-size: 16.5px; flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-head button { color: var(--tint); font-weight: 650; min-width: 62px; text-align: right; }
.sheet-head i { min-width: 62px; }
.grab { width: 36px; height: 5px; border-radius: 3px; background: var(--sep); margin: 7px auto 0; }
.sheet .pad { padding: 0 16px; }
.detail-amt { text-align: center; font-size: 38px; font-weight: 750; font-variant-numeric: tabular-nums; margin: 4px 16px 18px; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 16px 22px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; background: var(--fill); cursor: pointer; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.viewer { position: fixed; inset: 0; z-index: 70; background: #000; display: flex; align-items: center; justify-content: center; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer .vbar { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; padding: calc(var(--st) + 10px) 16px 10px; }
.viewer .vbar button { color: #fff; font-weight: 650; background: rgba(255, 255, 255, .18); padding: 8px 15px; border-radius: 99px; }
.toast {
  position: fixed; left: 50%; bottom: calc(100px + var(--sb)); transform: translateX(-50%) translateY(20px); z-index: 95; opacity: 0; pointer-events: none;
  background: rgba(22, 26, 32, .96); color: #fff; padding: 11px 18px; border-radius: 99px; font-size: 14.5px; font-weight: 550; transition: .25s; max-width: 88vw; text-align: center; border: 1px solid rgba(255, 255, 255, .12);
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.dlg { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .5); display: flex; align-items: center; justify-content: center; padding: 24px; }
.dlg-box { width: min(330px, 100%); background: var(--card); border: 1px solid var(--sep); border-radius: 16px; overflow: hidden; text-align: center; }
.dlg-msg { padding: 20px 16px 16px; font-size: 15px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.dlg-input { padding: 0 16px 16px; }
.dlg-btns { display: flex; border-top: .5px solid var(--sep); }
.dlg-btns button { flex: 1; padding: 13px 8px; font-size: 16px; color: var(--tint); }
.dlg-btns button + button { border-left: .5px solid var(--sep); }
.dlg-btns .danger { color: var(--red); font-weight: 650; } .dlg-btns .strong { font-weight: 650; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--fill); border-top-color: var(--tint); animation: spin .8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- entrada / registo ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: calc(var(--st) + 20px) 16px calc(var(--sb) + 20px); }
.auth-card { width: min(430px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 26px 22px 20px; box-shadow: 0 20px 50px rgba(0, 0, 0, .3); }
.auth-card .brand { font-size: 30px; display: flex; justify-content: center; margin-bottom: 4px; }
.auth-card .brand img { width: 52px; height: 52px; border-radius: 13px; }
.auth-card .tagline { text-align: center; color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.auth-card h2 { font-size: 19px; margin: 0 0 14px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 0 0 18px; border-radius: 12px; background: var(--fill); }
.seg button { padding: 9px; border-radius: 9px; font-weight: 650; font-size: 14.5px; color: var(--muted); }
.seg button.on { background: var(--card2); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.auth-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.auth-foot a { color: var(--muted); }
.langs { display: flex; gap: 4px; }
.langs button { font-size: 20px; padding: 3px 6px; border-radius: 8px; opacity: .55; }
.langs button.on { opacity: 1; background: var(--fill); }
.center { text-align: center; }

/* ---------- relatório ---------- */
#report { display: none; background: #fff; color: #18273b; min-height: 100vh; font: 13px Arial, Helvetica, sans-serif; }
body.reporting #app, body.reporting .tabbar { display: none; }
body.reporting #report { display: block; }
body.reporting { background: #fff; }
.rtools { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: calc(var(--st) + 10px) 14px 10px; background: #f2f4f8; border-bottom: 1px solid #d5dbe4; }
.rtools button { padding: 9px 15px; border-radius: 10px; font-weight: 650; color: #0667d8; background: #fff; border: 1px solid #d5dbe4; }
.rtools button.p { background: #0667d8; color: #fff; border-color: #0667d8; }
.rtools div { display: flex; gap: 8px; flex-wrap: wrap; }
.rbody { padding: 16px; max-width: 1000px; margin: 0 auto; }
.rbody h2 { font-size: 20px; margin: 0 0 4px; }
.rbody h3 { font-size: 16px; border-bottom: 2px solid #243c5a; padding-bottom: 5px; margin: 22px 0 6px; }
.rbody table { width: 100%; border-collapse: collapse; font-size: 11px; margin-top: 8px; }
.rbody th, .rbody td { border: 1px solid #c9d2dc; padding: 5px; text-align: left; overflow-wrap: anywhere; vertical-align: top; }
.rbody th { background: #e9eef5; } .rbody .n { text-align: right; white-space: nowrap; }
.rbody .tot { text-align: right; font-weight: 700; margin: 6px 0; }
.rbody tr { break-inside: avoid; }
.rbody .thumbs-r { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.rbody .thumbs-r img { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; border: 1px solid #ddd; }
.rbody .c-date { white-space: nowrap; }
.rbody .grand { font-size: 18px; font-weight: 700; margin-top: 18px; }
.rbody small { color: #5a6878; white-space: pre-line; }
@media (max-width: 600px) { .rbody .c-cat, .rbody .c-qty { display: none; } }
@media print {
  @page { size: A4; margin: 12mm; }
  .rtools { display: none; }
  #report { min-height: 0; } .rbody { padding: 0; max-width: none; }
  .rbody thead { display: table-header-group; }
  .rbody .c-cat, .rbody .c-qty { display: table-cell; }
  .toast, .tabbar { display: none !important; }
}

/* ---------- páginas legais ---------- */
.legal { max-width: 760px; margin: 0 auto; padding: 28px 20px 60px; line-height: 1.6; }
.legal h1 { margin: 0 0 6px; font-size: 26px; }
.legal h2 { font-size: 18px; margin: 28px 0 8px; }
.legal .todo { background: rgba(255, 159, 10, .16); border: 1px dashed var(--orange); padding: 2px 6px; border-radius: 6px; }
.legal .warnbox { border: 1px solid var(--orange); border-radius: 12px; padding: 12px 14px; margin: 16px 0; background: rgba(255, 159, 10, .1); }
.legal table { border-collapse: collapse; width: 100%; font-size: 14px; }
.legal th, .legal td { border: 1px solid var(--sep); padding: 7px 9px; text-align: left; vertical-align: top; }

/* ---------- ecrãs largos: navegação lateral ---------- */
@media (min-width: 900px) {
  #app { max-width: 1120px; padding-left: 232px; }
  .tabbar {
    left: max(0px, calc(50vw - 560px)); right: auto; top: 0; bottom: 0; width: 220px; margin: 0; flex-direction: column; justify-content: flex-start; gap: 4px;
    padding: 92px 12px 16px; border-top: 0; border-right: .5px solid var(--sep); background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .tabbar button { flex: none; flex-direction: row; gap: 12px; font-size: 15px; padding: 11px 14px; border-radius: 12px; justify-content: flex-start; }
  .tabbar button.on { background: var(--card); }
  main { padding-bottom: 40px; max-width: 860px; }
  .chooser { max-width: 860px; }
  .sheet { bottom: auto; top: 50%; border-radius: 18px; border: 1px solid var(--sep); max-height: 86vh; transform: translateY(-46%) scale(.97); opacity: 0; transition: transform .2s, opacity .2s; }
  .backdrop.open .sheet { transform: translateY(-50%); opacity: 1; }
  .grab { display: none; }
  .toast { bottom: 40px; }
  .hero-cover { height: 260px; }
  .photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gallery { grid-template-columns: repeat(4, 1fr); }
  .pgrid { grid-template-columns: repeat(6, 1fr); }
  .pill { max-width: 280px; }
}
@media (max-width: 360px) { .hero-cover { height: 170px; } .shortcuts { gap: 5px; } .shortcuts button { font-size: 10.5px; } .row label { min-width: 88px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation-duration: .01s !important; } }

/* ---------- campos com relevo (efeito 3D) ---------- */
:root { --field-top: #08131f; --field-bottom: #10243a; --field-shadow: inset 0 3px 6px rgba(0, 0, 0, .55), inset 0 -1px 0 rgba(255, 255, 255, .07), 0 1px 0 rgba(255, 255, 255, .06); --field-edge: #1c3a55; }
:root[data-theme="light"] { --field-top: #e6edf5; --field-bottom: #ffffff; --field-shadow: inset 0 2px 5px rgba(20, 50, 90, .18), inset 0 -1px 0 rgba(255, 255, 255, .9), 0 1px 0 rgba(255, 255, 255, .8); --field-edge: #b9c9da; }
.field input, .field select, .field textarea, .input, .search {
  background: linear-gradient(180deg, var(--field-top), var(--field-bottom)); border-color: var(--field-edge); border-top-color: rgba(0, 0, 0, .55); box-shadow: var(--field-shadow);
}
:root[data-theme="light"] .field input, :root[data-theme="light"] .field select, :root[data-theme="light"] .field textarea, :root[data-theme="light"] .input, :root[data-theme="light"] .search { border-top-color: #a9bbcd; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--tint); box-shadow: var(--field-shadow), 0 0 0 3px rgba(10, 168, 255, .22); }
.search input { box-shadow: none; background: none; }

/* ---------- estrelas do feedback ---------- */
.stars { display: flex; gap: 6px; }
.stars button { font-size: 40px; line-height: 1; padding: 2px 4px; color: var(--muted); }
.stars button.on { color: #ffc531; text-shadow: 0 0 14px rgba(255, 197, 49, .45); }

/* feedback (administração) */
.fbstars { color: #ffc531; letter-spacing: 1px; white-space: nowrap; }
.fbdist .row { gap: 12px; align-items: center; }
.fbdist .cbar { margin-top: 0; }
.fbdist .cbar i { background: #ffc531; }
.fbn { min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; }
.fbtype { display: block; }
.fbitem { align-items: flex-start; }
.fbmsg { margin: 8px 0; font-size: 15px; }

/* linha com botão principal e ação à direita (lista de espaços de trabalho) */
.rowmain { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-align: left; align-self: stretch; }

/* gestão: separadores, etapas de desmontagem/montagem e manutenção */
.seg.three { grid-template-columns: repeat(3, 1fr); margin: 0 16px 16px; }
.seg.three button { font-size: 12.5px; padding: 9px 4px; line-height: 1.2; position: relative; }
.segdot { display: inline-block; min-width: 18px; margin-left: 5px; padding: 1px 5px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; }
.tabbar button.alert svg { filter: drop-shadow(0 0 0 transparent); }
.tabbar button.alert { position: relative; }
.tabbar button.alert::after { content: ""; position: absolute; top: 2px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--red); border: 2px solid var(--bg); }
.meter.track { background: var(--fill); margin: 8px 0 6px; }
.meter.track.full i { background: #19c79b; }
.progress-big { display: flex; align-items: baseline; gap: 12px; }
.progress-big b { font-size: 34px; font-weight: 800; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.progress-big span { color: var(--muted); font-size: 14px; }
.progressbox { display: block; width: calc(100% - 32px); text-align: left; }
.progressbox .sub { font-size: 13px; color: var(--muted); }
.entry.step { align-items: flex-start; }
.entry.step > svg { width: 18px; height: 18px; color: var(--muted); margin-top: 6px; flex: none; }
.stepcheck { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); color: #fff; font-weight: 800; font-size: 16px; line-height: 1; display: grid; place-items: center; margin-top: 1px; }
.stepcheck.on { background: #19c79b; border-color: #19c79b; }
.stepmain { text-align: left; min-width: 0; }
.steptitle { font-weight: 600; overflow-wrap: anywhere; }
.entry.done .steptitle { color: var(--muted); text-decoration: line-through; }
.stepthumbs { display: flex; gap: 6px; margin-top: 7px; }
.stepthumbs img { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; background: var(--fill); }
.steps-add { margin-top: 12px; }
.sheet .pgrid { padding: 12px; }
.tworow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.maint-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.maint-acts { display: flex; gap: 16px; margin-top: 8px; flex-wrap: wrap; }
.linkbtn.strong { font-weight: 700; }
.badge.amber { color: #ffb020; }
.badge.green { color: #19c79b; }
.alertbox { border-left-color: var(--red); display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.alertbox .sub { font-size: 13px; color: var(--muted); }
.alertrow { display: flex; align-items: center; gap: 8px; text-align: left; padding: 5px 0; width: 100%; min-width: 0; }
.alertrow .sub { flex: none; }
.alertrow .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rbody .stage-r { margin-top: 5px; }

/* relatório profissional: a folha fica mais larga e a barra de ferramentas ganha a opção dos custos */
.rbody.probody { max-width: 900px; padding: 20px 16px 40px; }
.rtools .rcheck { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; font-weight: 650; color: #18273b; }
.rtools .rcheck input { width: 18px; height: 18px; }

@media print { :root { color-scheme: light; } html, body { background: #fff !important; } }

/* partilha com o cliente e pedidos de aprovação */
.seg.four { grid-template-columns: 1fr 1fr; margin: 0 16px 16px; }
.seg.four button { font-size: 13px; padding: 9px 4px; line-height: 1.2; }
.checkrow { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 14.5px; }
.checkrow input { width: 20px; height: 20px; flex: none; }
.entry.approval { align-items: flex-start; }
.entry.approval.unread, .entry.approval.pending { border-left: 3px solid var(--red); padding-left: 10px; }
.ap-amount { font-size: 24px; font-weight: 800; letter-spacing: -.5px; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.badge.solid { background: var(--red); color: #fff; }
.thread { display: grid; gap: 6px; margin-top: 10px; }
.msg { justify-self: start; max-width: 88%; padding: 8px 11px; border-radius: 12px; background: var(--fill); font-size: 14.5px; overflow-wrap: anywhere; }
.msg.mine { justify-self: end; background: rgba(10, 132, 255, .2); }
.msg-who { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.msgbox { display: grid; gap: 6px; margin-top: 10px; justify-items: end; }
.msgbox .field { width: 100%; margin: 0; }
.answer-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.answer-btns .btn { margin: 0; width: 100%; }
.btn.accept { background: #19a974; color: #fff; }
.btn.decline { background: transparent; color: var(--red); border: 1.5px solid var(--red); box-shadow: none; }
.sharedbox .sharedrow { padding: 8px 0; gap: 12px; }
.sharedrow .thumb { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--fill); }
.sharedrow .grow { display: grid; white-space: normal; }
.sharedrow .grow .sub { font-size: 13px; color: var(--muted); }
.shared-cover { display: block; width: calc(100% - 32px); margin: 0 16px 10px; max-height: 240px; object-fit: cover; border-radius: 14px; }
.box.flush { padding-top: 6px; padding-bottom: 6px; }
.cstage { margin-top: 8px; }
.stepthumbs.big img { width: 84px; height: 84px; }
.stepthumbs.big { flex-wrap: wrap; margin-top: 4px; }
span.stepcheck { display: grid; }
.costline { display: flex; justify-content: space-between; gap: 12px; margin: 0; padding: 9px 0; border-bottom: 1px solid var(--sep); }
.costline:last-child { border-bottom: 0; }
.costline.total b { font-size: 18px; }

/* 9.9 · peças, livro de bordo, avaliação e notas de voz */
.tabchips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 12px; margin: 0 0 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.tabchips::-webkit-scrollbar { display: none; }
.tabchips button { flex: none; padding: 9px 14px; border-radius: 99px; background: var(--fill); color: var(--muted); font-weight: 650; font-size: 14px; white-space: nowrap; scroll-snap-align: start; }
.tabchips button.on { background: var(--tint); color: #fff; }
.box .statgrid { margin: 0 0 12px; }
.stat.good b { color: #19c79b; } .stat.bad b { color: var(--red); }
.entry.part, .entry.voice { align-items: flex-start; }
.entry.voice audio { width: 100%; margin-top: 8px; height: 40px; }
select.mini { font-size: 13px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--sep); background: var(--fill); color: var(--text); }
.shoplist { margin: 0 16px 16px; padding: 14px; border-radius: 12px; background: var(--fill); font: 13px/1.5 ui-monospace, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; }
.recrow { display: flex; align-items: center; gap: 12px; }
.recrow .btn { margin: 0; flex: 1; }
.recbtn.on { background: var(--red); }
.recclock { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--red); min-width: 44px; }
.limitrow { align-items: end; margin-top: 12px; } .limitrow .linkbtn { margin-bottom: 26px; justify-self: start; }
.warnline { font-size: 13px; color: var(--red); font-weight: 650; margin: 6px 2px 0; }
