:root {
  --ink: #173314;
  --muted: #4e6b42;
  --line: rgba(23, 51, 20, 0.1);
  --card: rgba(255, 255, 255, 0.94);
  --green-0: #f4fbe8;
  --green-1: #d7f5b8;
  --green-2: #b6e98a;
  --green-3: #8ed45f;
  --green-4: #69be45;
  --green-5: #4f9d32;
  --red: #e23b32;
  --shadow: 7px 9px 0 rgba(48, 96, 22, 0.2);
  --safe-bottom: env(safe-area-inset-bottom);
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(circle at 8% 0%, rgba(255,255,255,.55), transparent 28%),
    radial-gradient(circle at 100% 0%, rgba(255,255,255,.28), transparent 24%),
    linear-gradient(165deg, #e7f8cf 0%, #c6ee9e 32%, #8ed45f 68%, #69be45 100%);
  color: white;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
img { max-width: 100%; }

.shell { min-height: 100vh; }
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 22px 0;
}
.brand > .brand-logo,
.brand > .brand-logo-btn {
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(62%, 230px);
}
.brand-logo {
  display: block;
  height: auto;
  width: auto;
  max-height: 48px;
  max-width: min(62%, 230px);
  object-fit: contain;
  object-position: left center;
}
.brand-logo-btn .brand-logo { max-width: 100%; }
.brand-logo-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  line-height: 0;
}
.who { flex-shrink: 0; }
.brand-logo-btn:hover { filter: brightness(1.08); }
.brand-logo-btn:focus-visible { outline: 2px solid white; outline-offset: 3px; }
.who { margin-left: auto; text-align: right; font-size: .82rem; line-height: 1.3; }
.who span { display: block; opacity: .85; font-style: italic; }

.launcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
  padding: 26px 22px 8px;
  justify-items: center;
}
.tile-wrap {
  appearance: none;
  border: 0;
  background: transparent;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 6px;
  width: 100%;
}
.tile-wrap:active .tile { transform: translate(2px, 2px); box-shadow: 3px 4px 0 rgba(48, 96, 22, 0.2); }
.tile {
  width: min(40vw, 158px);
  aspect-ratio: 1;
  border-radius: 22px;
  border: 3px solid rgba(255,255,255,.92);
  background: linear-gradient(155deg, #e9ffd4 0%, #b6ee86 38%, #67c247 72%, #4ea332 100%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.75);
  display: grid;
  place-items: center;
  position: relative;
}
.tile::after {
  content: "";
  position: absolute;
  inset: 8px 8px auto 8px;
  height: 38%;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.38), transparent);
  pointer-events: none;
}
.tile svg { width: 52%; height: 52%; filter: drop-shadow(4px 6px 0 rgba(40, 90, 20, .25)); position: relative; z-index: 1; }
.tile-label {
  font-style: italic;
  font-weight: 600;
  font-size: 1.28rem;
  letter-spacing: .01em;
  text-shadow: 0 1px 0 rgba(40, 80, 20, .15);
}
.badge {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 2;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: white;
  color: var(--green-5);
  font-style: normal;
  font-weight: 700;
  font-size: .78rem;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 0 rgba(40,80,20,.15);
}
.divider { grid-column: 1 / -1; height: 1px; background: rgba(255,255,255,.88); width: 100%; margin: 10px 0 4px; }
.cal-ico {
  width: 54%;
  height: 58%;
  background: white;
  border-radius: 10px;
  color: #3d9224;
  display: grid;
  place-items: center;
  font-weight: 750;
  font-size: 1.7rem;
  font-style: normal;
  box-shadow: 4px 6px 0 rgba(40, 90, 20, .25);
  position: relative;
  z-index: 1;
}
.cal-ico i {
  position: absolute;
  top: -6px;
  left: 18%;
  right: 18%;
  height: 8px;
  display: flex;
  justify-content: space-between;
}
.cal-ico i::before, .cal-ico i::after {
  content: "";
  width: 5px;
  height: 12px;
  border-radius: 3px;
  background: white;
}

.dock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px calc(12px + var(--safe-bottom));
  background: linear-gradient(180deg, rgba(126, 196, 74, 0), #67b843 28%, #5aaa3a);
}
.power, .back-btn {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  border: 3px solid white;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.power {
  background: linear-gradient(180deg, #ff5d4e, #d61f18);
  box-shadow: 4px 5px 0 rgba(120, 20, 10, .25);
}
.power svg, .back-btn svg { width: 34px; height: 34px; }
.back-btn {
  background: linear-gradient(160deg, #e7ffd0, #6ec24a);
  box-shadow: var(--shadow);
}
.exit-label {
  font-style: italic;
  font-weight: 650;
  font-size: 1.35rem;
  background: none;
  border: 0;
  color: white;
  padding: 8px 4px;
}
.sync-btn {
  margin-left: auto;
  background: none;
  border: 0;
  color: white;
  font-style: italic;
  font-weight: 750;
  font-size: 1.2rem;
  line-height: 1.05;
  text-align: right;
  position: relative;
  padding: 8px;
}
.count {
  position: absolute;
  top: -2px;
  right: -2px;
  background: white;
  color: var(--red);
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  font-style: normal;
  font-size: .72rem;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.stage { padding: 18px 16px 120px; color: var(--ink); }
.stage h1, .lead { color: var(--ink); }
.stage h1 { margin: 0 0 6px; font-size: 1.7rem; font-weight: 700; }
.lead { margin: 0 0 14px; }

.card {
  background: var(--card);
  color: var(--ink);
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(40, 80, 20, .12);
  margin-bottom: 12px;
}
.card h2 { margin: 0 0 8px; font-size: 1.05rem; }
.card h3 { margin: 14px 0 8px; font-size: .95rem; }
.accordion { padding: 0; overflow: hidden; }
.accordion-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 14px 16px;
}
.accordion-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.accordion-title { font-size: 1.05rem; font-weight: 700; }
.accordion-head .muted { font-size: .88rem; font-weight: 500; }
.accordion-chev { width: 22px; height: 22px; flex: 0 0 auto; color: #246618; transition: transform .18s ease; }
.accordion.open .accordion-chev { transform: rotate(180deg); }
.accordion.open .accordion-head { background: #f4fbe8; }
.accordion-body { padding: 12px 16px 16px; border-top: 1px solid var(--line); }
.chart-stack { margin-top: 12px; }
.chart-split { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.chart-svg { width: 100%; max-width: 520px; height: auto; display: block; }
.chart-svg text { font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif; }
.chart-pie { width: 200px; max-width: 100%; }
.chart-scroll { overflow-x: auto; margin: 0 -4px; padding-bottom: 4px; }
.chart-scroll .chart-svg { width: auto; max-width: none; height: 210px; }
.chart-legend { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-width: 340px; }
.chart-split .chart-legend { margin-top: 0; flex: 1 1 220px; }
.chart-legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: .88rem; }
.chart-legend i { width: 12px; height: 12px; border-radius: 4px; display: block; }
.chart-legend b { font-variant-numeric: tabular-nums; font-weight: 700; }
.chart-note { margin: 8px 0 0; font-size: .82rem; }
.chart-key { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; font-size: .82rem; }
.chart-key span { display: inline-flex; align-items: center; gap: 6px; }
.chart-key i { width: 18px; height: 4px; border-radius: 99px; display: inline-block; }
.chart-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .86rem; max-width: 520px; }
.chart-table th, .chart-table td { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: right; }
.chart-table th:first-child, .chart-table td:first-child { text-align: left; }
.chart-table th { color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 8px; }

.list-btn, .job {
  width: 100%;
  text-align: left;
  border: 0;
  background: var(--card);
  color: var(--ink);
  border-radius: 20px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 10px 24px rgba(40, 80, 20, .1);
}
.job strong, .list-btn strong { display: block; font-size: 1.02rem; }
.job small, .list-btn small { color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip {
  border-radius: 999px;
  padding: 3px 8px;
  background: #e7f6d8;
  color: #2f6d1c;
  font-size: .75rem;
  font-weight: 700;
}
.chip.urgente { background: #fde2dc; color: #9d2b22; }
.chip.warn { background: #fff1cc; color: #8a5a00; }
.chip.local { background: #e7f0ff; color: #1d4f91; }
.chip.ok { background: #ddf5ea; color: #0f6b45; }

.filters { display: flex; gap: 8px; overflow: auto; padding-bottom: 8px; margin-bottom: 8px; }
.filters button, .btn, .btn-ghost, .btn-red {
  border-radius: 14px;
  border: 0;
  padding: 12px 14px;
  font-weight: 700;
}
.filters button {
  background: white;
  color: var(--ink);
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,.55);
}
.filters button.on { background: #2f7d1c; color: white; }
.btn {
  background: linear-gradient(180deg, #8ed85f, #4ea332);
  color: white;
  box-shadow: 0 6px 0 rgba(40, 90, 20, .18);
}
.btn-ghost { background: white; color: var(--ink); }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  padding: 8px 14px 8px 10px;
  border: 0;
  border-radius: 999px;
  background: white;
  color: #246618;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(40, 80, 20, .12);
}
.back-link svg { width: 18px; height: 18px; }
.btn-red { background: var(--red); color: white; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.wide { width: 100%; }

label { display: block; font-size: .82rem; font-weight: 700; margin: 10px 0 4px; color: var(--muted); }
input, select, textarea {
  width: 100%;
  border: 1px solid #d5e8c4;
  background: white;
  color: var(--ink);
  border-radius: 14px;
  padding: 12px 12px;
  font-size: 16px;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
select {
  height: 48px;
  min-height: 48px;
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding: 0 2.5rem 0 12px;
  line-height: 1.2;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23246618' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px 18px;
}
textarea { height: auto; min-height: 92px; resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qty-lines { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.qty-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6.75rem 36px;
  gap: 8px;
  align-items: center;
}
.qty-head { font-size: .78rem; font-weight: 700; color: var(--muted); }
.qty-head span:nth-child(2) { text-align: right; padding-right: 4px; }
.qty-desc { min-width: 0; }
.qty-desc b { display: block; line-height: 1.3; overflow-wrap: anywhere; }
.qty-box { margin: 0; min-width: 0; }
.qty-box input { width: 100%; text-align: right; }
.qty-box span { display: block; margin: 2px 0 0; text-align: right; font-size: .78rem; font-weight: 700; color: var(--muted); }
.qty-add { margin-top: 4px; }
.qty-add select { min-width: 0; }
.qty-add-btn {
  grid-column: 2 / -1;
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  padding: 12px 8px;
  font-weight: 800;
  color: white;
  letter-spacing: .01em;
  background: linear-gradient(160deg, #b6f07a 0%, #5cb83a 46%, #2f7d1c 100%);
  box-shadow: 0 4px 0 rgba(40, 90, 20, .28), inset 0 1px 0 rgba(255,255,255,.45);
  text-shadow: 0 1px 0 rgba(20, 50, 8, .25);
}
.qty-add-btn::before {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  top: 3px;
  height: 42%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.42), transparent);
  pointer-events: none;
}
.qty-add-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(40, 90, 20, .28); }
.qty-table { table-layout: fixed; }
.qty-table td:first-child, .qty-table th:first-child { overflow-wrap: anywhere; }
.qty-table td:nth-child(2), .qty-table th:nth-child(2) { width: 7.5rem; text-align: right; white-space: nowrap; }

.banner {
  background: rgba(255,255,255,.95);
  color: var(--ink);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-weight: 650;
}
.banner.soft { background: rgba(255,255,255,.78); }

.stepper { display: flex; gap: 6px; overflow: auto; padding-bottom: 4px; }
.stepper span {
  flex: 0 0 auto;
  font-size: .72rem;
  font-weight: 700;
  padding: 6px 8px;
  border-radius: 999px;
  background: #eef6e6;
  color: #6d8662;
}
.stepper span.on { background: #4ea332; color: white; }
.stepper span.done { background: #d9f3c4; color: #246618; }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kpi {
  background: #f4fbea;
  border-radius: 16px;
  padding: 12px;
}
button.kpi {
  appearance: none;
  border: 0;
  width: 100%;
  text-align: left;
  color: var(--ink);
}
button.kpi:hover { filter: brightness(.97); }
button.kpi:focus-visible { outline: 2px solid #2f7d1c; outline-offset: 2px; }
.kpi b { display: block; font-size: 1.4rem; }
.kpi span { color: var(--muted); font-size: .78rem; }
.bar { height: 8px; border-radius: 99px; background: #e5f3d6; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #8ed85f, #3f8f28); }

.sign-pad {
  width: 100%;
  height: 160px;
  border-radius: 16px;
  border: 1px dashed #8dba74;
  background: white;
  touch-action: none;
}
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photos figure { margin: 0; background: #f4fbea; border-radius: 14px; overflow: hidden; }
.photos img { width: 100%; height: 120px; object-fit: cover; display: block; }
.photos figcaption { padding: 6px 8px; font-size: .75rem; color: var(--muted); }
.photo-actions { display: flex; gap: 8px; margin-top: 8px; }
.photo-actions .btn { flex: 1; }
.camera-box { margin-top: 10px; }
.camera-box video { width: 100%; max-height: 52dvh; border-radius: 16px; background: #173314; object-fit: cover; }
.photo-tools { display: flex; align-items: center; gap: 6px; }
.photo-tools select { width: auto; flex: 1; min-width: 0; }

.sheet-back, .modal-back {
  position: fixed; inset: 0; background: rgba(18, 40, 10, .35); z-index: 30;
}
.sheet, .modal {
  position: fixed;
  z-index: 50;
  left: 50%;
  right: auto;
  background: white;
  color: var(--ink);
  border-radius: clamp(16px, 2.2vw, 22px);
  padding: clamp(14px, 2.4vw, 18px);
  overflow: auto;
  box-shadow: 0 16px 40px rgba(20,40,10,.22);
}
.sheet {
  bottom: max(12px, env(safe-area-inset-bottom));
  width: min(92vw, 28rem);
  max-height: min(78dvh, 36rem);
  transform: translateX(-50%);
}
.modal {
  top: 50%;
  bottom: auto;
  width: min(92vw, 22rem);
  max-height: min(78dvh, 70vw);
  transform: translate(-50%, -50%);
}
.modal h2 { margin: 0 0 8px; text-align: center; font-size: 1.05rem; }
.modal p { margin: 0; font-size: clamp(.95rem, 2.4vw, 1.05rem); line-height: 1.45; text-align: center; }
.modal .btn-row { margin-top: 14px; justify-content: center; }
.modal .btn, .modal .btn-ghost, .modal .btn-red { flex: 1 1 8rem; padding: clamp(8px, 1.6vw, 12px) 14px; }
.confirm-back, .confirm-modal { z-index: 80; }
#print-root { display: none; }
@media print {
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; }
  #print-root .invoice-paper { width: 180mm; margin: 0 auto; color: #173314; font-family: "Avenir Next", "Segoe UI", sans-serif; }
  #print-root header { display: flex; justify-content: space-between; background: #4f9d32; color: white; padding: 14px 18px; }
  #print-root header span, #print-root header b { display: block; }
  #print-root section { display: flex; justify-content: space-between; gap: 24px; padding: 16px 0; }
  #print-root table { width: 100%; border-collapse: collapse; }
  #print-root th, #print-root td { text-align: left; padding: 6px 4px; border-bottom: 1px solid #d5e8c4; }
  #print-root th:nth-child(n+2), #print-root td:nth-child(n+2) { text-align: right; }
  #print-root footer { display: flex; justify-content: flex-end; gap: 24px; margin-top: 16px; }
  #print-root .tot { background: #4f9d32; color: white; padding: 8px 12px; font-weight: 700; }
}
.modal.pdf-modal {
  width: min(94vw, 56rem);
  height: min(90dvh, 52rem);
  max-height: 90dvh;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pdf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #e4f0d8;
}
.pdf-head h2 { margin: 0; text-align: left; font-size: 1.05rem; }
.pdf-head p { margin: 2px 0 0; text-align: left; }
.pdf-object { flex: 1; width: 100%; min-height: min(68dvh, 36rem); border: 0; background: #eef3ea; }
.pdf-modal .btn-row { margin: 0; padding: 12px 16px 16px; }
@media (min-width: 700px) {
  .modal { width: min(62vw, 26rem); }
  .sheet { width: min(72vw, 32rem); }
  .modal.pdf-modal { width: min(92vw, 56rem); }
}
@media (min-width: 1100px) {
  .modal { width: min(34vw, 28rem); }
  .modal.pdf-modal { width: min(72vw, 60rem); height: min(86dvh, 54rem); }
  .sheet { width: min(40vw, 34rem); top: 50%; bottom: auto; transform: translate(-50%, -50%); max-height: min(72dvh, 40rem); }
}
.same-address {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .72);
  color: var(--ink);
  font-weight: 650;
}
.same-address input { width: auto; margin: 3px 0 0; }
.same-address b { font-weight: 750; }
.new-customer {
  margin-top: 10px;
  padding: 12px;
  border-radius: 16px;
  background: #f4fbe8;
  border: 1px solid #d7ebc6;
}
.customer-miss { margin: 6px 0 0; }
.suggest-wrap { position: relative; }
#customer-search {
  border: 2px solid #3d7c24;
  background: #fff;
  color: #173314;
  font-weight: 700;
}
.suggest {
  position: relative;
  z-index: 6;
  margin-top: 6px;
  background: #fff;
  color: #173314;
  border: 2px solid #3d7c24;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(20, 40, 10, .18);
  max-height: min(52dvh, 24rem);
  overflow: auto;
}
.suggest::-webkit-scrollbar { width: 12px; }
.suggest::-webkit-scrollbar-thumb { background: #69be45; border-radius: 99px; }
.suggest button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #d5e8c4;
  background: #fff;
  color: #173314;
  padding: 12px 14px;
  font-size: 1rem;
}
.suggest button:last-child { border-bottom: 0; }
.suggest button.on, .suggest button:hover { background: #c8eb9e; }
.suggest b { display: block; color: #173314; font-size: 1rem; }
.suggest span { display: block; color: #3d5c32; font-size: .9rem; font-weight: 600; }
.kind-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.kind-row .choice { margin: 0; }
.choice {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid #d7ebc6;
  background: #f7fbf2;
  color: var(--ink);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 8px;
}
.choice.on { border-color: #4ea332; background: #e9f8dc; }
.choice b { display: block; }
.choice span { display: block; color: var(--muted); font-size: .85rem; font-weight: 500; margin-top: 2px; }

.toast {
  position: fixed;
  top: calc(18px + env(safe-area-inset-top, 0px));
  left: 50%;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: min(420px, calc(100vw - 32px));
  margin: 0;
  padding: 8px 16px 8px 8px;
  background: #fff;
  color: var(--ink);
  border: 1px solid rgba(79, 157, 50, .28);
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(23, 51, 20, .2);
  font-weight: 650;
  font-size: .95rem;
  line-height: 1.3;
  text-align: left;
  pointer-events: none;
  transform: translateX(-50%);
}
.toast.toast-in { animation: toast-in .28s ease; }
.toast-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(160deg, #9adf6a, #4f9d32);
  color: white;
  display: grid;
  place-items: center;
  flex: none;
  font-size: .9rem;
  box-shadow: 2px 3px 0 rgba(48, 96, 22, .16);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.icon-actions { display: flex; gap: 6px; justify-content: flex-end; }
.icon-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  padding: 0;
  background: #eef8e4;
  color: #2f6d1c;
  display: inline-grid;
  place-items: center;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.warn { background: #fff3df; color: #9a6200; }
.icon-btn.revive {
  width: auto;
  height: 36px;
  padding: 0 10px 0 8px;
  gap: 4px;
  display: inline-flex;
  background: #e5f6d4;
  color: #246618;
  font-size: .78rem;
  font-weight: 700;
}
.icon-btn.danger { background: #fdecea; color: #b42318; }
.listino tr.off td:not(:last-child) { color: var(--muted); }
.listino tbody tr:hover td { background: #c8eb9e; }
.listino tr.group th { background: #f4fbe8; color: #246618; font-size: .82rem; padding-top: 14px; }
.listino input { width: 100%; min-width: 0; }
.table-wrap { overflow-x: auto; }
.data-table tr[data-nav] { cursor: pointer; }
.data-table tr[data-nav]:hover td { background: rgba(255,255,255,.45); }
.listino-tools { margin: 8px 0 10px; }
.sort-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: .75rem;
  padding: 0;
  text-align: left;
}
.sort-btn.on { color: #2f6d1c; }
.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
}
.pager button {
  border: 0;
  background: #f4fbe8;
  color: var(--ink);
  border-radius: 10px;
  min-width: 32px;
  padding: 6px 10px;
  font-weight: 700;
  font-size: .82rem;
}
.pager button.on { background: #2f7d1c; color: white; }
.pager button:disabled { opacity: .4; }

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.login .card { width: min(440px, 100%); }
.demo { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.demo button {
  border: 0;
  background: #e7f6d8;
  color: #246618;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 700;
  font-size: .78rem;
}

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .75rem; }

.dest-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin: 2px 0 8px; }
.dest-grid label { display: flex; align-items: center; gap: 8px; margin: 0; min-width: 0; font-size: .92rem; font-weight: 650; color: var(--ink); }
.dest-grid input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; flex: 0 0 auto; border-radius: 4px; }
.info-thread { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.info-thread li { background: #f6f8f5; border-radius: 8px; padding: 8px 10px; }
.info-thread time { display: block; color: var(--muted); font-size: .72rem; margin-bottom: 2px; }
.info-thread p, .request-card p { margin: 4px 0; }
.info-reply { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.request-card .row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.timeline time { display: block; color: var(--muted); font-size: .75rem; }

.invoice-sheet { background: white; }
.assign { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.assign p { margin: 0 0 8px; }
.sig-preview { width: 100%; height: 90px; object-fit: contain; background: #f7fbf2; border-radius: 12px; }

@media (min-width: 980px) {
  body { background: linear-gradient(165deg, #e7f8cf, #9adf6a 42%, #6fbe45); }
  .shell {
    display: grid;
    grid-template-columns: 360px 1fr;
    min-height: 100vh;
  }
  aside {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
    padding-bottom: 120px;
  }
  .tile { width: 118px; border-radius: 18px; }
  .tile-label { font-size: 1.05rem; }
  .dock { width: 360px; right: auto; background: linear-gradient(180deg, rgba(126,196,74,0), #5aaa3a 30%); }
  .stage {
    margin: 18px 18px 18px 0;
    background: rgba(255,255,255,.28);
    border-radius: 28px;
    min-height: calc(100vh - 36px);
    padding: 22px;
  }
  .filters button.on { background: #2f7d1c; color: white; }
  .banner { background: white; }
}

.fs-btn {
  position: fixed;
  z-index: 45;
  top: calc(12px + env(safe-area-inset-top));
  right: 14px;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 2px solid white;
  background: linear-gradient(160deg, #e7ffd0, #6ec24a);
  color: white;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  padding: 0;
}
.fs-btn svg { width: 22px; height: 22px; }
.fs-btn[aria-pressed="true"] { background: linear-gradient(160deg, #fff, #9adf6a); }
html:fullscreen,
html:-webkit-full-screen,
html:-moz-full-screen {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 8% 0%, rgba(255,255,255,.55), transparent 28%),
    radial-gradient(circle at 100% 0%, rgba(255,255,255,.28), transparent 24%),
    linear-gradient(165deg, #e7f8cf 0%, #c6ee9e 32%, #8ed45f 68%, #69be45 100%);
}
body.immersive,
body.immersive #app,
body.immersive .shell,
body.immersive .login {
  min-height: 100dvh;
  min-height: -webkit-fill-available;
}

body[data-view="agenda"] .shell { grid-template-columns: 1fr; }
body[data-view="agenda"] .stage {
  padding: 0 0 76px;
  margin: 0;
  border-radius: 0;
  min-height: 100dvh;
  background: #f3f6f1;
}
body[data-view="agenda"] .shell > aside { display: none; }
body[data-view="agenda"] .dock { width: auto; right: 0; left: 0; }

.cal {
  height: calc(100dvh - 76px);
  display: flex;
  flex-direction: column;
  background: #fff;
  color: var(--ink);
  min-height: 0;
}
.cal-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 16px;
  border-bottom: 1px solid #e3ebe0;
  background: #fff;
}
.cal-bar h1 { margin: 0; font-size: 1.25rem; letter-spacing: 0; }
.cal-nav, .cal-legend, .cal-team { display: flex; align-items: center; gap: 8px; }
.cal-nav strong { font-size: .95rem; min-width: 12rem; }
.cal-nav-btn {
  border: 1px solid #d5e2d0;
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 10px;
  font-weight: 650;
  min-width: 2.2rem;
}
.cal-team { margin-left: auto; font-size: .82rem; color: var(--muted); }
.cal-team select { font-weight: 600; width: auto; }
.cal-legend { gap: 12px; font-size: .75rem; font-weight: 700; }
.cal-legend span { display: flex; align-items: center; gap: 6px; }
.cal-legend span::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 2px;
}
.cal-legend .wait::before { background: #e23b32; }
.cal-legend .run::before { background: #e07a12; }
.cal-legend .done::before { background: #3d8f28; }
.cal-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 280px 1fr; }
.cal-side {
  border-right: 1px solid #e3ebe0;
  overflow: auto;
  padding: 12px;
  background: #fbfcfb;
}
.cal-side h2 { margin: 14px 0 4px; font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.cal-side h2:first-child { margin-top: 0; }
.cal-side .muted { margin: 0 0 8px; font-size: .8rem; }
.cal-queue {
  width: 100%;
  text-align: left;
  border: 1px solid #e3ebe0;
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  margin: 0 0 8px;
  display: grid;
  gap: 2px;
  color: var(--ink);
}
.cal-queue b { font-size: .82rem; }
.cal-queue span { font-weight: 700; }
.cal-queue small { color: var(--muted); font-size: .75rem; }
.cal-queue.on { border-color: #3d8f28; box-shadow: inset 3px 0 0 #3d8f28; }
.cal-queue[draggable="true"], .cal-event[draggable="true"] { cursor: grab; }
.cal-queue.dragging, .cal-event.dragging { opacity: .4; cursor: grabbing; }
.cal-scroll { overflow: auto; min-width: 0; }
.cal-sheet { min-width: 920px; }
.cal-head, .cal-board {
  display: grid;
  grid-template-columns: 56px repeat(7, minmax(108px, 1fr));
}
.cal-head { position: sticky; top: 0; z-index: 3; background: #fff; border-bottom: 1px solid #e3ebe0; }
.cal-dow { padding: 8px 6px 10px; text-align: center; color: var(--muted); font-size: .75rem; text-transform: capitalize; }
.cal-dow b { display: block; color: var(--ink); font-size: 1.05rem; }
.cal-dow.today b {
  width: 1.8rem;
  height: 1.8rem;
  margin: 0 auto 2px;
  border-radius: 999px;
  background: #173314;
  color: #fff;
  display: grid;
  place-items: center;
}
.cal-hours { position: relative; }
.cal-hour {
  height: 48px;
  padding: 8px 6px 0;
  font-size: .7rem;
  line-height: 1;
  color: var(--muted);
  text-align: right;
}
.cal-col {
  position: relative;
  height: 576px;
  border-left: 1px solid #e7eee4;
  background-image: repeating-linear-gradient(to bottom, transparent, transparent 47px, #e7eee4 48px);
}
.cal-col.today { background-color: #f7fbf4; }
.cal-slot {
  position: absolute;
  left: 0;
  right: 0;
  height: 24px;
  border: 0;
  padding: 0;
  background: transparent;
  z-index: 1;
}
.cal-slot:hover { background: rgba(61, 143, 40, .08); }
.cal-slot.drop { background: rgba(61, 143, 40, .22); box-shadow: inset 0 0 0 2px #3d8f28; z-index: 2; }
.cal-event {
  position: absolute;
  z-index: 2;
  height: 46px;
  margin: 1px 3px;
  border: 0;
  border-left: 3px solid;
  border-radius: 6px;
  padding: 3px 6px;
  text-align: left;
  overflow: hidden;
  display: grid;
  align-content: start;
  line-height: 1.15;
}
.cal-event strong, .cal-event em, .cal-event span, .cal-event i { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-event strong { font-size: .68rem; }
.cal-event em { font-style: normal; font-weight: 750; font-size: .75rem; }
.cal-event span, .cal-event i { font-size: .66rem; }
.cal-event.wait { background: #fdeceb; color: #8d1d18; border-left-color: #e23b32; }
.cal-event.run { background: #fff3e4; color: #8a4b00; border-left-color: #e07a12; }
.cal-event.done { background: #e8f6df; color: #1d5c14; border-left-color: #3d8f28; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: #e23b32; z-index: 3; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 99px; background: #e23b32; }
.cal-modal {
  width: min(94vw, 40rem);
  max-height: min(88dvh, 44rem);
  overflow: auto;
  text-align: left;
}
.cal-modal h2, .cal-modal h3, .cal-modal p { text-align: left; }
.cal-modal h3 { margin: 16px 0 8px; font-size: .95rem; }
.cal-modal-kicker { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; }
.cal-modal-kicker.wait { color: #e23b32; }
.cal-modal-kicker.run { color: #e07a12; }
.cal-modal-kicker.done { color: #3d8f28; }
.cal-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 12px 0; }
.cal-facts div { margin: 0; }
.cal-facts dt { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.cal-facts dd { margin: 2px 0 0; font-weight: 700; }
.cal-thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cal-thread li { background: #f6f8f5; border-radius: 8px; padding: 8px 10px; font-size: .9rem; }
.cal-thread time { display: block; color: var(--muted); font-size: .72rem; margin-bottom: 2px; }
.cal-modal .stack { margin-top: 12px; }
.cal-modal .btn-row .btn,
.cal-modal .btn-row .btn-ghost,
.cal-modal .btn-row .btn-red {
  flex: 0 0 auto;
  width: auto;
}
.cal-modal textarea { min-height: 4.5rem; }

@media (max-width: 800px) {
  .cal-main { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .cal-side { max-height: 28dvh; border-right: 0; border-bottom: 1px solid #e3ebe0; }
  .cal-team { margin-left: 0; }
  .cal-facts { grid-template-columns: 1fr; }
}

@media (max-width: 979px) {
  body:not([data-view="login"]) .fs-btn {
    top: auto;
    bottom: calc(96px + env(safe-area-inset-bottom));
  }
  body:not([data-view="home"]) aside { display: none; }
  body[data-view="home"] .stage { display: none; }
}

