/* =========================================================================
   app.css — casca (menu, cabeçalho, abas), telas, balões-linha e galeria.
   ========================================================================= */

body.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
body.app.nav-collapsed { --sidebar-w: 92px; }

/* ---- Menu lateral --------------------------------------------------- */
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 20px 16px; z-index: 30; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 4px 22px; flex: none; }
.brand-mark { width: 48px; height: 48px; border-radius: 14px; flex: none; background: linear-gradient(145deg, var(--blue-500), var(--blue-800)); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(31, 95, 168, .3); }
.brand-mark .ic { width: 26px; height: 26px; }
.brand-mark .logo { width: 40px; height: 40px; }
.brand-txt { min-width: 0; line-height: 1.2; flex: 1; }
.brand-name { font-weight: 700; font-size: 18px; color: var(--blue-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sys { font-size: 14px; color: var(--text-3); }
.nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin: 0 -4px; padding: 0 4px; }
.nav-sep { display: flex; align-items: center; gap: 8px; margin: 18px 14px 6px; font-size: 13px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
.nav a { display: flex; align-items: center; gap: 14px; min-height: var(--nav-h); padding: 8px 14px; border-radius: 14px; color: var(--ink-600); font-weight: 560; white-space: nowrap; text-decoration: none; }
.nav a .ic { width: 22px; height: 22px; }
.nav a:hover { background: var(--blue-50); color: var(--blue-700); }
.nav a.active { background: var(--blue-100); color: var(--blue-800); }
.nav a.active .ic { color: var(--blue-600); }
.nav a .count { margin-left: auto; min-width: 26px; height: 24px; font-size: 13px; background: var(--surface-2); color: var(--ink-700); }
.nav a.active .count { background: #fff; color: var(--blue-700); }
.nav a .nav-label small { display: block; font-size: 13px; font-weight: 400; color: var(--text-3); line-height: 1.2; }
.nav-locked { margin: 18px 4px 0; padding: 14px; border: 1px dashed var(--border-strong); border-radius: 14px; color: var(--text-3); font-size: 14px; }
.nav-locked strong { display: flex; align-items: center; gap: 8px; color: var(--ink-600); }
.nav-foot { display: flex; flex-direction: column; gap: 4px; padding-top: 12px; }
.nav-foot a, .nav-foot button { display: flex; align-items: center; gap: 14px; min-height: 44px; padding: 0 14px; border-radius: 14px; color: var(--text-2); font-weight: 560; background: none; border: 0; cursor: pointer; white-space: nowrap; width: 100%; text-align: left; text-decoration: none; }
.nav-foot a:hover, .nav-foot button:hover { background: var(--blue-50); color: var(--blue-700); }
.shop-open { margin-top: 6px; padding: 12px 14px; border-radius: 14px; background: var(--blue-50); font-size: 14px; color: var(--ink-600); display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.shop-open i { width: 10px; height: 10px; border-radius: 50%; background: var(--ok-700); flex: none; }
body.nav-collapsed .brand-txt, body.nav-collapsed .nav-label, body.nav-collapsed .nav a .count,
body.nav-collapsed .nav-sep span, body.nav-collapsed .nav-locked span, body.nav-collapsed .nav-locked .lb, body.nav-collapsed .shop-open span { display: none; }
body.nav-collapsed .brand { justify-content: center; }
body.nav-collapsed .nav-sep { justify-content: center; margin: 18px 0 6px; }
body.nav-collapsed .nav a, body.nav-collapsed .nav-foot a, body.nav-collapsed .nav-foot button { justify-content: center; padding: 0; }
body.nav-collapsed .nav-locked { display: flex; justify-content: center; padding: 10px; }
body.nav-collapsed .shop-open { justify-content: center; }
body.nav-collapsed .collapse-ic { transform: scaleX(-1); }

/* ---- Coluna principal ---------------------------------------------- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.topbar { height: var(--header-h); display: flex; align-items: center; gap: 12px; padding: 0 32px; position: sticky; top: 0; z-index: 20; background: rgba(243, 246, 251, .92); backdrop-filter: blur(8px); }
.menu-btn { display: none !important; }
.search { position: relative; flex: 1; max-width: 560px; }
.search > .ic { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search .input { height: 48px; padding-left: 48px; padding-right: 48px; border-radius: var(--pill); border-color: var(--border); box-shadow: var(--sh-1); }
.search kbd { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); }
.search-pop { position: absolute; top: calc(100% + 10px); left: 0; right: 0; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--sh-2); max-height: 70vh; overflow-y: auto; padding: 10px; z-index: 50; }
.sp-group { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding: 10px 12px 4px; }
.sp-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; color: var(--text); min-height: 48px; }
.sp-item:hover, .sp-item.kb { background: var(--blue-50); text-decoration: none; }
.sp-item .sp-sub { color: var(--text-3); font-size: 14px; margin-left: auto; white-space: nowrap; }
.sp-item mark { background: var(--blue-100); color: inherit; border-radius: 3px; }
.sp-item .ph-thumb { width: 34px; height: 42px; border-radius: 8px; }
.sp-foot { border-top: 1px solid var(--line-100); margin-top: 8px; padding: 10px 12px 4px; font-size: 13.5px; color: var(--text-3); display: flex; gap: 14px; flex-wrap: wrap; }
.topbar-spacer { flex: 1; }
.bell { position: relative; }
.bell .dot-n { position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--err-700); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.anchor { position: relative; }
.pop { position: absolute; top: calc(100% + 10px); right: 0; width: 400px; max-width: calc(100vw - 24px); background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--sh-2); z-index: 50; padding: 8px; }
.pop-h { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; }
.pop-f { padding: 10px 12px 6px; text-align: center; border-top: 1px solid var(--line-100); margin-top: 4px; }
.notif { display: flex; gap: 12px; padding: 12px; border-radius: 14px; color: var(--text); align-items: flex-start; }
.notif:hover { background: var(--blue-50); text-decoration: none; }
.notif .n-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.n-ic.err { background: var(--err-50); color: var(--err-700); }
.n-ic.warn { background: var(--warn-50); color: var(--warn-700); }
.n-ic.info { background: var(--blue-100); color: var(--blue-600); }
.n-ic.ok { background: var(--ok-50); color: var(--ok-700); }
.notif .n-t { font-weight: 650; }
.notif .n-s { font-size: 14px; color: var(--text-2); }
.user-btn { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 14px 4px 4px; border-radius: var(--pill); border: 1px solid var(--border); background: var(--panel); cursor: pointer; box-shadow: var(--sh-1); text-align: left; }
.user-btn:hover { border-color: var(--border-strong); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; font-weight: 700; background: var(--blue-100); color: var(--blue-700); flex: none; }
.avatar.sm { width: 32px; height: 32px; font-size: 12.5px; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.avatar.xl { width: 72px; height: 72px; font-size: 26px; }
.avatar.dona { background: var(--blue-700); color: #fff; }
.user-btn .u-name { font-weight: 650; font-size: 15px; line-height: 1.2; }
.user-btn .u-role { font-size: 13px; color: var(--text-3); line-height: 1.2; }
.menu-list { padding: 4px; }
.menu-list button, .menu-list a { display: flex; width: 100%; align-items: center; gap: 12px; min-height: 48px; padding: 6px 12px; background: none; border: 0; border-radius: 12px; cursor: pointer; color: var(--text); text-align: left; text-decoration: none; }
.menu-list button:hover, .menu-list a:hover { background: var(--blue-50); }
.menu-list .check-mark { margin-left: auto; color: var(--blue-600); }
.menu-list hr { border: 0; border-top: 1px solid var(--line-100); margin: 6px 4px; }

/* ---- Barra de abas (pílulas) ---------------------------------------- */
.tabbar { display: flex; align-items: center; gap: 10px; padding: 0 32px; position: sticky; top: var(--header-h); z-index: 15; background: rgba(243, 246, 251, .92); backdrop-filter: blur(8px); }
.tabs { display: flex; gap: 6px; overflow-x: auto; flex: 1; min-width: 0; padding: 4px 2px 12px; border-bottom: 1px solid var(--border); scrollbar-width: thin; }
.tab { display: flex; align-items: center; flex: none; max-width: 240px; min-width: 0; border-radius: 12px; color: var(--ink-600); border: 1px solid transparent; }
.tab:hover { background: var(--panel); }
.tab.active { background: var(--panel); color: var(--blue-700); border-color: var(--border); box-shadow: var(--sh-1); }
.tab .t-link { display: flex; align-items: center; gap: 8px; padding: 0 4px 0 14px; min-height: var(--tab-h); color: inherit; font-weight: 560; font-size: 15px; min-width: 0; text-decoration: none; }
.tab .t-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab .ic.t-ic { width: 18px; height: 18px; }
.tab .t-close { width: 30px; height: 30px; margin-right: 5px; border-radius: 8px; border: 0; background: transparent; color: var(--text-3); cursor: pointer; display: grid; place-items: center; flex: none; }
.tab .t-close:hover { background: var(--blue-100); color: var(--err-700); }
.tab .t-close .ic { width: 16px; height: 16px; }
.tab-count { font-size: 13px; color: var(--text-3); padding-bottom: 12px; white-space: nowrap; }
.tabs-mobile { display: none; }

/* ---- Conteúdo ------------------------------------------------------ */
.views { flex: 1; min-width: 0; }
.view { padding: 24px 32px 64px; display: flex; flex-direction: column; gap: var(--section-gap); max-width: 1400px; margin: 0 auto; animation: surge .18s ease-out; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-h .ph-txt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.page-h .crumbs { font-size: 15px; color: var(--text-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.page-h .crumbs a { color: var(--text-2); }
.page-h h1 { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.page-h h1 .count { font-size: 15px; height: 32px; min-width: 32px; }
.page-h .muted { font-size: 16px; color: var(--text-3); }
.hello h1 { font-size: 34px; }
.toolbar { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.toolbar .field { min-width: 160px; }
.toolbar .field.grow { flex: 1; min-width: 220px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border: 1px solid var(--border); border-radius: var(--pill); background: var(--panel); color: var(--ink-700); cursor: pointer; box-shadow: var(--sh-1); }
.chip:hover { border-color: var(--blue-300); }
.chip .count { height: 24px; min-width: 24px; font-size: 13px; }
.chip[aria-pressed="true"] { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.chip[aria-pressed="true"] .count { background: rgba(255,255,255,.22); color: #fff; }
.sum-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.sum-pills .badge { font-size: 15px; padding: 6px 14px 6px 11px; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.grid-main-wide { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 24px; align-items: start; }
.grid-wide-left { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.stack-sm { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.row { display: flex; gap: var(--gap-sm); align-items: center; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: var(--gap-sm); flex-wrap: wrap; }

/* =====================================================================
   BALÃO-LINHA — um balão por item, com CONJUNTOS de informação lado a lado.
   ===================================================================== */
.band { display: flex; flex-direction: column; gap: 14px; }
.band-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.band-h h2 { display: flex; align-items: center; gap: 12px; font-size: 21px; }
.band-h h2 .b-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-100); color: var(--blue-600); }
.band-h .band-sub { color: var(--text-3); font-size: 15px; }
.band-h .band-act { margin-left: auto; }
.band.b-late .band-h h2 { color: var(--err-700); }
.band.b-late .band-h h2 .b-ic { background: var(--err-50); color: var(--err-700); }

.baloes { display: flex; flex-direction: column; gap: 12px; container-type: inline-size; }
.balao {
  --cols: minmax(0, 1fr);
  display: grid; grid-template-columns: var(--cols); align-items: center;
  background: var(--panel); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--sh-1);
  padding: 16px 6px; position: relative; color: var(--text);
  transition: box-shadow .15s, border-color .15s, transform .15s;
}
.balao[data-href] { cursor: pointer; }
.balao[data-href]:hover { box-shadow: var(--sh-2); border-color: var(--blue-200); transform: translateY(-1px); }
.balao.is-late { border-color: var(--err-200); box-shadow: inset 5px 0 0 var(--err-700), var(--sh-1); }
.balao.is-warn { box-shadow: inset 5px 0 0 var(--warn-700), var(--sh-1); }
.balao.is-done { background: var(--surface-1); }
.balao.is-done .bl-t { color: var(--text-2); }
.bl { padding: 4px 18px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bl + .bl { border-left: 1px solid var(--line-100); }
.bl-k { font-size: 12.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.bl-t { font-weight: 650; font-size: 16.5px; line-height: 1.3; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.bl-t:hover { color: var(--blue-700); }
.bl-s { font-size: 14px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-s .ic { width: 15px; height: 15px; color: var(--text-3); margin-right: 2px; }
.bl-v { font-size: 19px; font-weight: 750; color: var(--blue-800); font-variant-numeric: tabular-nums; line-height: 1.25; }
.bl-v.neg { color: var(--err-700); }
.bl-v.ok { color: var(--ok-700); }
.bl-act { flex-direction: row; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.bl-who { flex-direction: row; align-items: center; gap: 14px; }
.bl-who > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bl-time { align-items: flex-start; }
.bl-time .hora { font-size: 26px; font-weight: 750; color: var(--blue-800); font-variant-numeric: tabular-nums; line-height: 1.1; letter-spacing: -.01em; }
.bl-time .hora.late { color: var(--err-700); }
.bl-time .hora-s { font-size: 13px; color: var(--text-3); font-weight: 600; }
.bl-date { align-items: center; }
.date-chip { width: 60px; height: 64px; border-radius: 16px; background: var(--blue-50); border: 1px solid var(--blue-200); display: grid; place-items: center; align-content: center; line-height: 1.1; flex: none; }
.date-chip b { font-size: 22px; color: var(--blue-800); }
.date-chip small { font-size: 12.5px; color: var(--blue-700); text-transform: uppercase; font-weight: 650; }
.date-chip.late { background: var(--err-50); border-color: var(--err-200); }
.date-chip.late b, .date-chip.late small { color: var(--err-700); }
.thumbs { display: flex; gap: 8px; align-items: center; }
.thumbs .ph-thumb { width: 42px; height: 52px; border-radius: 10px; border: 1px solid var(--line-100); }
.thumbs a:hover .ph-thumb { border-color: var(--blue-400); }
.thumbs .more { font-size: 13px; font-weight: 700; color: var(--blue-700); background: var(--blue-50); border-radius: 10px; width: 42px; height: 52px; display: grid; place-items: center; }
.contact { display: flex; align-items: center; gap: 6px; font-size: 14.5px; color: var(--ink-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact .ic { width: 16px; height: 16px; color: var(--text-3); }
.chev { color: var(--text-3); justify-self: end; padding-right: 14px; }
.balao[data-href]:hover .chev { color: var(--blue-600); }
.mini-list { display: flex; flex-direction: column; gap: 6px; }
.mini-list .ml { display: flex; align-items: center; gap: 10px; font-size: 14.5px; min-width: 0; }
.mini-list .ml .ml-d { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list .ml .ml-v { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.mini-list .ml .ml-v.neg { color: var(--err-700); }

/* colunas por tipo de balão */
.b-agenda { --cols: 108px minmax(0, 1.25fr) minmax(0, 1.25fr) minmax(0, 1fr) minmax(170px, auto); }
.b-cli    { --cols: minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(0, 1.5fr) minmax(0, 1fr) 40px; }
.b-res    { --cols: 92px minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, .9fr) 40px; }
.b-fin    { --cols: 92px minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, .8fr) minmax(150px, auto); }
.b-cau    { --cols: minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, .8fr) minmax(150px, auto); }
.b-lan    { --cols: 92px minmax(0, 3fr) minmax(0, 1fr); }
.b-lav    { --cols: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(190px, auto); }
.b-avi    { --cols: 72px minmax(0, 2fr) minmax(0, 1fr) auto; }
.b-pec    { --cols: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) auto; }
.bl-icon { align-items: center; }
.bl-icon .n-ic { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; }

@container (max-width: 900px) {
  .balao { display: flex; flex-wrap: wrap; row-gap: 12px; padding: 16px 8px; }
  .bl { flex: 1 1 210px; }
  .bl + .bl { border-left: 0; }
  .bl-time, .bl-date, .bl-icon { flex: 0 0 auto; }
  .bl-act { flex: 1 1 100%; justify-content: flex-start; border-top: 1px solid var(--line-100); padding-top: 12px; }
  .chev { display: none; }
}
@container (max-width: 520px) {
  .bl { flex-basis: 100%; }
  .bl-time, .bl-date, .bl-icon { flex-basis: auto; }
  .bl-t, .bl-s { white-space: normal; }
}

/* Próximos dias */
.days { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.day { padding: 18px; border-radius: var(--radius); background: var(--surface-1); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 7px; color: var(--text); min-height: 150px; }
a.day:hover { border-color: var(--blue-400); background: var(--blue-50); text-decoration: none; }
.day .d-name { font-size: 14px; color: var(--text-3); text-transform: capitalize; font-weight: 600; }
.day .d-num { font-size: 26px; font-weight: 750; color: var(--blue-800); line-height: 1; margin-bottom: 4px; }
.day .d-line { font-size: 14px; color: var(--ink-600); display: flex; align-items: center; gap: 7px; }
.day .d-line .ic { width: 16px; height: 16px; color: var(--blue-600); }
.day .d-line.zero { color: var(--text-3); }
.day .d-line.zero .ic { color: var(--line-300); }

/* Calendário mensal */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; padding: 0 var(--card-p) var(--card-p); }
.cal .cal-dow { font-size: 13px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; text-align: center; padding: 4px 0; }
.cal .cal-day { min-height: 116px; padding: 8px; border-radius: 14px; background: var(--surface-1); border: 1px solid transparent; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cal .cal-day.out { background: transparent; }
.cal .cal-day.today { border-color: var(--blue-600); background: var(--blue-50); }
.cal .cal-day.today .cd-num { background: var(--blue-600); color: #fff; }
.cd-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.cd-num { font-weight: 650; font-variant-numeric: tabular-nums; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 14.5px; color: var(--ink-700); }
.cd-occ { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.occ-bar { height: 6px; border-radius: 3px; background: var(--line-200); overflow: hidden; }
.occ-bar span { display: block; height: 100%; background: var(--blue-500); border-radius: 3px; }
.cd-ev { font-size: 12.5px; line-height: 1.3; padding: 3px 8px; border-radius: 8px; background: var(--blue-600); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.cd-ev:hover { background: var(--blue-800); text-decoration: none; }
.cd-ev.late { background: var(--err-700); }
.cd-more { font-size: 12.5px; color: var(--text-2); }
.mini-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.mini-cal .mc-dow { font-size: 12.5px; color: var(--text-3); font-weight: 700; padding: 4px 0; }
.mini-cal button { font-size: 14.5px; border: 0; background: var(--surface-1); height: 44px; border-radius: 12px; cursor: pointer; color: var(--text); font-variant-numeric: tabular-nums; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.mini-cal button:hover { background: var(--blue-100); }
.mini-cal button.has { font-weight: 750; color: var(--blue-800); background: var(--blue-50); }
.mini-cal button.has::after { content: attr(data-n); font-size: 11px; font-weight: 700; color: var(--blue-600); }
.mini-cal button.today { box-shadow: inset 0 0 0 2px var(--blue-600); }
.mini-cal button[aria-pressed="true"] { background: var(--blue-600); color: #fff; }
.mini-cal button[aria-pressed="true"]::after { color: #fff; }
.mini-cal .mc-empty { height: 44px; }

/* ---- Peças: vitrine com várias fotos -------------------------------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 24px; }
.pcard { position: relative; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--sh-1); overflow: hidden; color: var(--text); transition: box-shadow .15s, transform .15s; }
.pcard:hover { box-shadow: var(--sh-2); transform: translateY(-3px); }
.pcard .pc-link { position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.pcard .pc-photo { position: relative; aspect-ratio: 4 / 5; }
.pcard .pc-photo .ph { position: absolute; inset: 0; border-radius: 0; }
.pcard .pc-photo > .badge { position: absolute; top: 12px; left: 12px; z-index: 1; background-color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.pcard .pc-photo > .badge.b-blue { background-color: var(--blue-700); }
.pc-count { position: absolute; top: 12px; right: 12px; z-index: 1; display: inline-flex; align-items: center; gap: 5px; background: rgba(11, 36, 67, .78); color: #fff; font-size: 13px; font-weight: 650; padding: 4px 10px; border-radius: var(--pill); font-variant-numeric: tabular-nums; }
.pc-count .ic { width: 14px; height: 14px; }
.pc-nav { position: absolute; top: 50%; z-index: 3; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.94); color: var(--blue-800); box-shadow: var(--sh-1); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s; }
.pc-nav.prev { left: 10px; } .pc-nav.next { right: 10px; }
.pc-nav:hover { background: #fff; color: var(--blue-600); }
.pc-dots { position: absolute; bottom: 12px; left: 0; right: 0; z-index: 1; display: flex; gap: 6px; justify-content: center; pointer-events: none; opacity: 0; transition: opacity .15s; }
.pc-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.6); box-shadow: 0 0 0 1px rgba(11,36,67,.18); }
.pc-dots i.on { background: #fff; width: 18px; border-radius: 4px; }
.pc-angle { position: absolute; bottom: 30px; left: 0; right: 0; text-align: center; z-index: 1; font-size: 12.5px; font-weight: 650; color: var(--ink-700); opacity: 0; transition: opacity .15s; pointer-events: none; }
.pcard:hover .pc-nav, .pcard:focus-within .pc-nav, .pcard:hover .pc-dots, .pcard:focus-within .pc-dots, .pcard:hover .pc-angle { opacity: 1; }
@media (hover: none) { .pc-nav, .pc-dots { opacity: 1; } }
.pcard .pc-b { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 5px; }
.pcard .pc-code { font-family: var(--mono); font-size: 13px; color: var(--text-3); }
.pcard .pc-name { font-weight: 650; font-size: 16px; line-height: 1.3; }
.pcard .pc-meta { font-size: 14px; color: var(--text-2); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pcard .pc-price { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; gap: 8px; }
.pcard .pc-price b { font-size: 18px; color: var(--blue-800); }
.pcard .pc-price small { font-size: 13px; color: var(--text-3); }
.grade-mini { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.grade-mini span { font-size: 12.5px; border-radius: 8px; padding: 1px 8px; background: var(--blue-50); color: var(--ink-700); font-variant-numeric: tabular-nums; }
.grade-mini span.zero { color: var(--text-3); text-decoration: line-through; background: var(--surface-2); }
.photo-n { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-3); }
.photo-n .ic { width: 14px; height: 14px; }

/* ---- Detalhe da peça: galeria --------------------------------------- */
.piece-hero { display: grid; grid-template-columns: minmax(300px, 440px) minmax(0, 1fr); gap: 28px; align-items: start; }
.gal { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.gal-main { position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--sh-1); border: 1px solid var(--border); background: var(--surface-1); }
.gal-main .ph { position: absolute; inset: 0; border-radius: 0; }
.gal-open { position: absolute; inset: 0; z-index: 1; border: 0; background: transparent; cursor: zoom-in; border-radius: inherit; }
.gal-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.94); color: var(--blue-800); box-shadow: var(--sh-1); display: grid; place-items: center; cursor: pointer; }
.gal-btn:hover { background: #fff; color: var(--blue-600); }
.gal-btn.prev { left: 14px; } .gal-btn.next { right: 14px; }
.gal-count { position: absolute; top: 14px; right: 14px; z-index: 2; background: rgba(11, 36, 67, .8); color: #fff; font-size: 14px; font-weight: 650; padding: 5px 12px; border-radius: var(--pill); font-variant-numeric: tabular-nums; pointer-events: none; }
.gal-label { position: absolute; bottom: 14px; left: 14px; z-index: 2; background: #fff; color: var(--ink-700); font-size: 14px; font-weight: 650; padding: 6px 12px; border-radius: var(--pill); box-shadow: var(--sh-1); pointer-events: none; display: inline-flex; align-items: center; gap: 6px; }
.gal-full { position: absolute; bottom: 14px; right: 14px; z-index: 2; }
.gal-full.btn { background: rgba(255,255,255,.94); border-color: transparent; box-shadow: var(--sh-1); }
.gal-thumbs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.gal-th { border: 0; background: none; padding: 0; cursor: pointer; display: flex; flex-direction: column; gap: 5px; align-items: stretch; text-align: center; min-width: 0; }
.gal-th .ph { border-radius: 12px; border: 2px solid transparent; }
.gal-th span { font-size: 12.5px; color: var(--text-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gal-th:hover .ph { border-color: var(--blue-300); }
.gal-th[aria-current="true"] .ph { border-color: var(--blue-600); box-shadow: 0 0 0 3px var(--blue-100); }
.gal-th[aria-current="true"] span { color: var(--blue-700); }
.gal-th .capa { display: none; }
.gal-th:first-child .capa { display: inline; color: var(--blue-600); }
.specs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.spec { padding: 16px 18px; border-radius: var(--radius); background: var(--surface-1); border: 1px solid var(--border); min-width: 0; }
.spec small { display: block; color: var(--text-3); font-size: 13.5px; }
.spec b { font-size: 17px; display: flex; align-items: center; gap: 8px; }
.cod { font-family: var(--mono); font-size: 14px; padding: 3px 10px; border-radius: 8px; background: var(--blue-50); border: 1px solid var(--blue-200); color: var(--blue-700); }

/* ---- Tela cheia ----------------------------------------------------- */
.lightbox { position: fixed; inset: 0; z-index: 150; background: rgba(8, 24, 45, .94); color: #fff; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 14px; padding: 18px 24px 16px; animation: surge .15s ease-out; }
.lb-top { display: flex; align-items: center; gap: 16px; }
.lb-top > div { flex: 1; min-width: 0; }
.lb-top strong { display: block; font-size: 18px; }
.lb-sub { font-size: 14px; color: #B9CBE2; }
.lb-count { font-variant-numeric: tabular-nums; font-weight: 650; background: rgba(255,255,255,.12); padding: 6px 14px; border-radius: var(--pill); }
.lb-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.lb-btn:hover { background: rgba(255,255,255,.24); }
.lb-btn .ic { width: 24px; height: 24px; }
.lb-stage { display: flex; align-items: center; justify-content: center; gap: 20px; min-height: 0; }
.lb-img { height: 100%; max-height: 100%; aspect-ratio: 4 / 5; max-width: calc(100vw - 180px); border-radius: var(--radius-lg); }
.lb-thumbs { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.lb-th { width: 72px; border: 0; background: none; padding: 0; cursor: pointer; color: #B9CBE2; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.lb-th .ph { border-radius: 10px; border: 2px solid transparent; opacity: .7; }
.lb-th.on { color: #fff; }
.lb-th.on .ph { border-color: #fff; opacity: 1; }
.lb-hint { text-align: center; font-size: 13.5px; color: #B9CBE2; }
.lb-hint kbd { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }

/* ---- Cadastro: editor de várias fotos -------------------------------- */
.fotos-ed { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.fe { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 18px; border: 1.5px solid var(--border); background: var(--panel); box-shadow: var(--sh-1); }
.fe.is-capa { border-color: var(--blue-600); box-shadow: 0 0 0 3px var(--blue-100); }
.fe.dragging { opacity: .45; }
.fe.drop-before { box-shadow: -6px 0 0 -2px var(--blue-600), var(--sh-1); }
.fe .fe-photo { position: relative; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; cursor: grab; }
.fe .fe-photo .ph { position: absolute; inset: 0; border-radius: 0; }
.fe .fe-n { position: absolute; top: 8px; left: 8px; z-index: 1; width: 26px; height: 26px; border-radius: 50%; background: rgba(11,36,67,.78); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.fe .fe-capa { position: absolute; top: 8px; right: 8px; z-index: 1; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: var(--pill); background: var(--blue-600); color: #fff; }
.fe .fe-capa .ic { width: 13px; height: 13px; fill: currentColor; }
.fe .fe-grip { position: absolute; bottom: 8px; left: 8px; z-index: 1; color: var(--ink-600); background: rgba(255,255,255,.9); border-radius: 8px; padding: 2px; }
.fe .select { min-height: 40px; font-size: 14.5px; border-radius: 10px; }
.fe-tools { display: flex; gap: 4px; justify-content: space-between; }
.fe-tools .btn { min-height: 36px; width: 36px; padding: 0; border-radius: 10px; }
.fe-tools .btn.on { background: var(--blue-100); color: var(--blue-700); border-color: var(--blue-200); }
.fe-tools .btn.on .ic { fill: currentColor; }
.fe-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 260px; border: 2px dashed var(--border-strong); border-radius: 18px; background: var(--surface-1); color: var(--blue-700); font-weight: 650; cursor: pointer; padding: 16px; text-align: center; }
.fe-add:hover { border-color: var(--blue-400); background: var(--blue-50); }
.fe-add .fe-add-ic { width: 56px; height: 56px; border-radius: 50%; background: var(--blue-100); display: grid; place-items: center; }
.fe-add small { font-weight: 400; color: var(--text-3); font-size: 13.5px; }

/* Medidas */
.measures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.measure { padding: 18px 12px; border-radius: var(--radius); background: var(--blue-50); border: 1px solid var(--blue-200); text-align: center; }
.measure .m-l { font-size: 14px; color: var(--ink-600); }
.measure .m-v { font-size: 28px; font-weight: 750; color: var(--blue-800); font-variant-numeric: tabular-nums; line-height: 1.15; }
.measure .m-v small { font-size: 14px; font-weight: 500; color: var(--text-3); }

/* Resumo lateral */
.summary { position: sticky; top: calc(var(--header-h) + var(--tab-h) + 40px); }
.sum-line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--line-100); align-items: center; }
.sum-line:last-child { border-bottom: 0; }
.sum-line.total { font-weight: 750; font-size: 19px; color: var(--blue-800); }
.sum-line.neg { color: var(--err-700); }
.forma-box { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--radius); background: var(--blue-50); border: 1px solid var(--blue-200); margin-bottom: 8px; }
.forma-box strong { display: block; }
.forma-box small { color: var(--text-2); font-size: 14px; }
.parcela { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--surface-1); margin-top: 8px; }
.parcela .p-d { display: flex; flex-direction: column; min-width: 0; }
.parcela .p-d span { font-size: 13.5px; color: var(--text-3); }
.parcela .p-v { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-weight: 650; font-variant-numeric: tabular-nums; }

/* Escolha (radio em cartões) */
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.choice { position: relative; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 18px 20px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; background: var(--panel); }
.choice:hover { border-color: var(--blue-400); }
.choice input { position: absolute; opacity: 0; }
.choice .c-t { font-weight: 650; display: flex; align-items: center; gap: 10px; font-size: 16px; }
.choice .c-t .radio-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--ink-500); flex: none; }
.choice .c-s { font-size: 14px; color: var(--text-2); }
.choice:has(input:checked) { border-color: var(--blue-600); background: var(--blue-50); }
.choice:has(input:checked) .radio-dot { border-color: var(--blue-600); background: radial-gradient(circle, var(--blue-600) 45%, transparent 50%); }
.choice:has(input:focus-visible) { box-shadow: var(--focus); }

/* Seletor de peças (nova reserva) */
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; max-height: 520px; overflow-y: auto; padding: 2px; }
.pick { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: var(--radius); border: 1.5px solid var(--border); cursor: pointer; background: var(--panel); }
.pick:hover { border-color: var(--blue-400); }
.pick:has(input:checked) { border-color: var(--blue-600); background: var(--blue-50); }
.pick > input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--primary); flex: none; }
.pick .ph-thumb { width: 52px; height: 64px; border-radius: 10px; }
.pick .pk-main { flex: 1; min-width: 0; font-size: 14.5px; display: flex; flex-direction: column; gap: 3px; }
.pick .pk-main strong { font-size: 15px; }
.pick .pk-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-weight: 650; font-variant-numeric: tabular-nums; }
.pick.unavailable { border-color: var(--err-200); background: var(--surface-1); }   /* indisponível nas datas: dá para marcar, mas o salvar recusa */
.pick .pk-valor { display: flex; align-items: center; gap: 4px; font-weight: 500; }
.pick .pk-valor .input { width: 92px; min-height: 36px; padding: 0 8px; text-align: right; }
.acc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.acc { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: var(--radius); border: 1.5px solid var(--border); }
.acc .ph-thumb { width: 52px; height: 64px; border-radius: 10px; }
.acc .acc-f { display: flex; gap: 8px; margin-top: 6px; }
.acc .acc-f .select, .acc .acc-f .input { min-height: 40px; font-size: 14.5px; border-radius: 10px; }

/* Checklist de devolução */
.checklist { display: flex; flex-direction: column; gap: 8px; }
.checklist .check { padding: 10px 14px; border-radius: 12px; background: var(--surface-1); min-height: 48px; }
.checklist .check:has(input:checked) { background: var(--ok-50); color: var(--ok-700); }
.check-progress { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--text-2); }
.progress { flex: 1; height: 8px; background: var(--blue-100); border-radius: 4px; overflow: hidden; min-width: 100px; }
.progress span { display: block; height: 100%; background: var(--blue-600); border-radius: 4px; transition: width .15s; }
.piece-check { border: 1px solid var(--border); border-radius: 20px; overflow: hidden; }
.piece-check + .piece-check { margin-top: 18px; }
.piece-check .pc-h { display: flex; gap: 14px; align-items: center; padding: 14px 18px; background: var(--surface-1); flex-wrap: wrap; }
.piece-check .pc-h .ph-thumb { width: 52px; height: 64px; border-radius: 10px; }
.piece-check .pc-b { padding: 16px 18px 18px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; }
.dano-fields { display: flex; flex-direction: column; gap: 10px; }
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-row label { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--border); border-radius: var(--pill); cursor: pointer; font-weight: 600; }
.radio-row label:has(input:checked) { border-color: var(--blue-600); background: var(--blue-50); color: var(--blue-700); }
.radio-row input { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; }

/* Gráficos (relatórios) */
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar { display: grid; grid-template-columns: minmax(150px, 240px) minmax(0, 1fr) 44px; gap: 12px; align-items: center; font-size: 14.5px; }
.hbar .hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); display: flex; align-items: center; gap: 10px; }
.hbar .hb-l .ph-thumb { width: 32px; height: 40px; border-radius: 8px; }
.hbar .hb-track { height: 14px; background: var(--blue-50); border-radius: 7px; }
.hbar .hb-fill { height: 100%; background: var(--blue-500); border-radius: 7px; }
.hbar:hover .hb-fill { background: var(--blue-700); }
.hbar .hb-v { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.vbars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; align-items: end; height: 220px; padding-top: 22px; padding-left: 36px; border-bottom: 1px solid var(--border-strong); position: relative; }
.vbars .vb { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.vbars .vb-fill { width: 70%; max-width: 40px; background: var(--blue-500); border-radius: 8px 8px 0 0; position: relative; }
.vbars .vb:hover .vb-fill { background: var(--blue-700); }
.vbars .vb-fill.fc { background: repeating-linear-gradient(135deg, var(--blue-200) 0 4px, var(--blue-100) 4px 8px); border: 1px dashed var(--blue-400); border-bottom: 0; }
.vbars .vb-v { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-size: 12.5px; font-weight: 700; color: var(--ink-700); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vbars .gridline { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line-200); font-size: 11.5px; color: var(--text-3); }
.vlabels { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; text-align: center; font-size: 13px; color: var(--text-2); padding-top: 8px; padding-left: 36px; }
.legend { display: flex; gap: 16px; font-size: 14px; color: var(--text-2); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; background: var(--blue-500); }
.legend i.fc { background: repeating-linear-gradient(135deg, var(--blue-200) 0 3px, var(--blue-100) 3px 6px); border: 1px dashed var(--blue-400); }

/* Usuários (balões) */
.usr { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) 150px 160px auto; gap: 16px; align-items: center; padding: 14px 18px; border-radius: 18px; border: 1px solid var(--border); background: var(--panel); }
.usr + .usr { margin-top: 10px; }
.usr strong { display: block; }
.usr small { color: var(--text-3); font-size: 14px; display: block; }
.perm td:not(:first-child), .perm th:not(:first-child) { text-align: center; }

.shortcuts { display: grid; grid-template-columns: auto 1fr; gap: 12px 18px; align-items: center; }
.blocked { max-width: 600px; margin: 40px auto; width: 100%; }
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.log li { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-100); font-size: 15px; }
.log li:last-child { border-bottom: 0; }
.log time { color: var(--text-3); font-variant-numeric: tabular-nums; }
.occ { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line-100); align-items: flex-start; }
.occ:last-child { border-bottom: 0; }
.occ .o-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--ink-600); }
.occ .o-ic.dano { background: var(--err-50); color: var(--err-700); }
.occ .o-ic.ajuste { background: var(--warn-50); color: var(--warn-700); }
.occ .o-ic.lavanderia { background: var(--blue-100); color: var(--blue-600); }
.diff-ok { color: var(--ok-700); font-weight: 600; } .diff-warn { color: var(--warn-700); font-weight: 600; } .diff-err { color: var(--err-700); font-weight: 600; }
.client-mini { display: flex; gap: 14px; align-items: center; }
.client-mini .cm-name { font-weight: 650; font-size: 18px; color: var(--text); }
.peca-linha { display: flex; gap: 16px; align-items: center; padding: 12px 16px 12px 12px; border-radius: 18px; border: 1px solid var(--border); color: var(--text); cursor: pointer; }
.peca-linha + .peca-linha { margin-top: 12px; }
.peca-linha:hover { border-color: var(--blue-400); background: var(--blue-50); }
.peca-linha .ph-thumb { width: 72px; height: 90px; border-radius: 12px; }
.peca-linha .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.peca-linha .info strong { font-size: 16px; }
.peca-linha .valor { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 17px; }
.ellip { display: block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-link { display: flex; align-items: center; justify-content: space-between; gap: 14px; }

/* ---- Responsivo ---------------------------------------------------- */
.scrim { display: none; }
@media (max-width: 1240px) {
  .grid-main, .grid-main-wide, .grid-wide-left { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; }
  .days { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .piece-hero { grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); }
  .specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .usr { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .usr > :nth-child(3), .usr > :nth-child(5) { display: none; }
}
@media (max-width: 900px) {
  body.app, body.app.nav-collapsed { grid-template-columns: minmax(0, 1fr); --sidebar-w: 272px; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-105%); transition: transform .22s; box-shadow: var(--sh-2); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(11, 36, 67, .4); z-index: 25; }
  body.nav-collapsed .brand-txt, body.nav-collapsed .nav-label, body.nav-collapsed .nav a .count, body.nav-collapsed .nav-sep span, body.nav-collapsed .shop-open span { display: revert; }
  .collapse-btn { display: none !important; }
  .menu-btn { display: inline-flex !important; }
  .topbar { padding: 0 16px; gap: 8px; height: 68px; }
  .user-btn .u-txt, .user-btn > .ic, .search kbd, .topbar .new-label { display: none; }
  .user-btn { padding: 3px; }
  .search .input { height: 44px; }
  .tabbar { top: 68px; padding: 8px 16px; border-bottom: 1px solid var(--border); }
  .tabs, .tab-count { display: none; }
  .tabs-mobile { display: flex; align-items: center; gap: 8px; width: 100%; }
  .tabs-mobile .select { flex: 1; min-height: 44px; }
  .view { padding: 20px 16px 48px; }
  h1 { font-size: 26px; } .hello h1 { font-size: 28px; }
  .grid-2, .grid-3, .piece-hero, .choice-grid { grid-template-columns: minmax(0, 1fr); }
  .gal { max-width: 440px; }
  .measures { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: repeat(3, 1fr); row-gap: 20px; }
  .steps li:nth-child(3)::before { right: 50%; } .steps li:nth-child(4)::before { left: 50%; }
  .cal { gap: 4px; padding: 0 10px 12px; }
  .cal .cal-day { min-height: 64px; padding: 4px; }
  .cal .cd-ev, .cal .cd-more { display: none; }
  .hbar { grid-template-columns: 120px minmax(0, 1fr) 36px; }
  .form-grid .span-2 { grid-column: auto; }
  .vbars .vb-v { font-size: 10px; }
  .days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-h .btn-group { width: 100%; }
  .piece-check .pc-b { grid-template-columns: minmax(0, 1fr); }
  .card-h { padding-left: 18px; padding-right: 18px; }
  .card-b { padding-left: 18px; padding-right: 18px; }
  .card-flush .card-b { padding-left: 0; padding-right: 0; }
  .lb-img { max-width: calc(100vw - 48px); height: auto; width: 100%; }
  .lb-stage { position: relative; }
  .lb-prev, .lb-next { position: absolute; z-index: 2; } .lb-prev { left: 4px; } .lb-next { right: 4px; }
  .lightbox { padding: 12px; }
  .lb-thumbs { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; }
  .lb-th { flex: none; width: 60px; }
  .gal-thumbs { grid-template-columns: repeat(6, 64px); overflow-x: auto; }
}
@media (max-width: 560px) {
  .usr { grid-template-columns: auto minmax(0, 1fr); }
  .usr > :nth-child(n+4) { grid-column: 2; }
  .kpi .k-value { font-size: 26px; }
  .gal-btn { width: 40px; height: 40px; }
  .topbar .btn-primary { padding: 0 12px; }
  .search { min-width: 0; }
  .specs { grid-template-columns: minmax(0, 1fr); }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
}

/* ---- Perfil: atendente não vê Gestão ------------------------------- */
body.perfil-atendente .gestao { display: none !important; }
body:not(.perfil-atendente) .so-atendente { display: none !important; }

/* ---- Complementos ------------------------------------------------- */
.band-empty { display: flex; align-items: center; gap: 12px; padding: 22px 24px; border-radius: 22px; border: 1.5px dashed var(--border-strong); background: var(--surface-1); color: var(--text-3); }
.band-empty .ic { color: var(--ok-700); }
.step-n { width: 32px; height: 32px; border-radius: 50%; background: var(--blue-600); color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 700; flex: none; }
.grid-res { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.res-aside { display: flex; flex-direction: column; gap: 20px; position: sticky; top: calc(var(--header-h) + var(--tab-h) + 40px); }
@media (max-width: 1500px) {
  .grid-res { grid-template-columns: minmax(0, 1fr); }
  .res-aside { order: -1; position: static; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
}
@media (max-width: 900px) { .res-aside { grid-template-columns: minmax(0, 1fr); } }
.res-aside .mini-cal button { height: 40px; }
.bl-date .hora-s { display: block; margin-top: 4px; width: 60px; }
.b-lan .bl-date { flex-direction: column; align-items: center; }

/* ---- Novidades (histórico das versões) ---- */
.nov-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.nov-list li { list-style: disc; }
.nov-sec { display: grid; gap: 8px; }
.nov-sec h3 { margin: 0; }
.nav-foot a.versao { color: var(--text-3); font-size: 14px; }
.nov-sec h3 { font-weight: 700; }
.nov-list strong { font-weight: 700; }

/* Subabas: quebram em linha (nenhuma fica escondida no celular) */
.subtabs { display: flex; flex-wrap: wrap; border-radius: 24px; }
.subtabs button { flex: 0 1 auto; }
.b-func, .b-forn { --cols: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, .8fr) minmax(190px, auto); }
.b-med { --cols: 110px minmax(0, 1fr) repeat(4, minmax(0, .6fr)); }
.lgpd-linha { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lgpd-linha + .lgpd-linha { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-100); }
.b-func .bl .badge, .b-forn .bl .badge { align-self: flex-start; }

/* ---- Ajustes de costura (v0.3) ---- */
.aj-linha { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 12px 0; }
.aj-linha + .aj-linha { border-top: 1px solid var(--line-100); }
.aj-main { display: grid; gap: 4px; min-width: 0; }
.aj-main strong { font-weight: 650; overflow-wrap: anywhere; }
.aj-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.aj-fila { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 12px; align-items: start; }
.aj-fila + .aj-fila { border-top: 1px solid var(--line-100); }
.aj-fila .aj-linha { padding: 12px 0; border: 0; }
.aj-pos { display: grid; place-items: center; width: 40px; height: 40px; margin-top: 10px; border-radius: 50%; background: var(--blue-100); color: var(--blue-800); font-weight: 700; }
.aj-fila.is-first .aj-pos { background: var(--blue-700); color: #fff; }
.aj-first { grid-column: 2; padding-bottom: 8px; }
.soneca { display: inline-flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 600px) {
  .aj-linha { grid-template-columns: minmax(0, 1fr); }
  .aj-side { align-items: flex-start; }
}
/* campo com prefixo/sufixo curto não quebra linha (ex.: "dias antes") */
.input-group .prefix { white-space: nowrap; }
/* balão de alerta de ajuste: texto quebra em linhas (não corta com reticências) */
.b-ajuste { --cols: 108px minmax(0, 1fr) minmax(0, .85fr) minmax(0, 1.6fr) minmax(0, auto); }
.b-ajuste .bl-t, .b-ajuste .bl-s, .b-ajuste .bl-k { white-space: normal; overflow: visible; text-overflow: clip; }
.b-ajuste .bl-act { flex-wrap: wrap; justify-content: flex-end; max-width: 300px; }
