/* MyFlowEasy: demo apps on the example pages. All data in these demos is fictitious. */
.app { position: relative; background: var(--paper); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; font-size: 15px; line-height: 1.5; }
.app-bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); background: var(--paper); flex-wrap: wrap; }
.app-title { display: flex; align-items: center; gap: .55rem; font-family: var(--display); font-weight: 700; font-size: 1.08rem; }
.app-title .dot { width: 12px; height: 12px; border-radius: 4px; background: var(--accent); }
.app-title .dim { color: var(--ink-3); font-weight: 500; }
.badge-demo { font-size: .78rem; font-weight: 600; color: var(--warn); background: var(--warn-bg); padding: .2rem .65rem; border-radius: 999px; }
.app-tabs { display: flex; gap: .25rem; padding: .4rem .75rem 0; border-bottom: 1px solid var(--line); background: var(--paper); overflow-x: auto; }
.app-tabs button { border: 0; background: transparent; padding: .65rem .85rem; font-weight: 600; font-size: .93rem; color: var(--ink-3); border-bottom: 2.5px solid transparent; cursor: pointer; white-space: nowrap; }
.app-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.app-body { padding: 1.1rem; display: grid; gap: 1rem; background: var(--paper-2); min-height: 440px; align-content: start; }
.app-body > [role="tabpanel"] { display: grid; gap: 1rem; min-width: 0; }
.app-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem 1rem; padding: .7rem 1.1rem; border-top: 1px solid var(--line); font-size: .85rem; color: var(--ink-3); background: var(--paper); flex-wrap: wrap; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent-ink); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: inherit; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: .8rem .95rem; display: grid; gap: .1rem; min-width: 0; }
.kpi small { font-family: var(--mono); font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.kpi b { font-family: var(--display); font-size: 1.4rem; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.25; }
.kpi span { font-size: .82rem; color: var(--ink-3); }
.kpi .up { color: var(--ok); font-weight: 600; }
.kpi .down { color: var(--bad); font-weight: 600; }
@media (max-width: 760px) { .kpis, .kpis.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chips button { border: 1px solid var(--line-2); background: var(--paper); padding: .38rem .8rem; border-radius: 999px; font-size: .86rem; font-weight: 500; cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem; display: grid; gap: .85rem; min-width: 0; }
.panel h3 { font-size: 1.02rem; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem 1rem; flex-wrap: wrap; }
.panel-head span { font-size: .85rem; color: var(--ink-3); }
.cols-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
@media (max-width: 860px) { .cols-2 { grid-template-columns: minmax(0, 1fr); } }

.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tbl th { text-align: left; font-family: var(--mono); font-weight: 500; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: .7rem .9rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: .7rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .mono { font-family: var(--mono); font-size: .85rem; color: var(--ink-3); }
.tbl .sub { display: block; font-size: .8rem; color: var(--ink-3); }
.tbl tbody tr:hover { background: var(--paper-2); }
.tbl .empty td { text-align: center; color: var(--ink-3); padding: 2rem 1rem; }
.row-btn { border: 1px solid var(--line-2); background: var(--paper); border-radius: 999px; padding: .32rem .8rem; font-size: .84rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.row-btn:hover { border-color: var(--ink); }
.row-btn.hot { background: var(--accent); border-color: var(--accent); }
@media (max-width: 640px) { .hide-sm { display: none; } }

.toast { position: absolute; left: 50%; bottom: 64px; transform: translate(-50%, 12px); background: var(--ink); color: var(--paper); padding: .75rem 1rem; border-radius: 12px; font-size: .9rem; width: max-content; max-width: min(92%, 520px); opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; box-shadow: 0 10px 30px rgba(27, 22, 17, .25); z-index: 5; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Dialogs */
.dlg { border: 0; padding: 0; border-radius: 18px; width: min(660px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 30px 80px rgba(27, 22, 17, .35); color: var(--ink); background: var(--paper); font-size: 15px; }
.dlg::backdrop { background: rgba(27, 22, 17, .45); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper); z-index: 1; }
.dlg-head h3 { font-size: 1.15rem; }
.dlg-x { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--paper); cursor: pointer; display: grid; place-items: center; }
.dlg-x svg { width: 18px; height: 18px; }
.dlg-body { padding: 1.1rem 1.2rem; display: grid; gap: 1rem; }
.dlg-foot { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end; padding: 1rem 1.2rem; border-top: 1px solid var(--line); background: var(--paper-2); position: sticky; bottom: 0; }
.dlg .field input[type="text"], .dlg .field input[type="email"] { min-height: 46px; }
.line-ed { display: grid; gap: .5rem; }
.line-ed .ln { display: grid; grid-template-columns: minmax(0, 1fr) 80px 44px; gap: .5rem; align-items: center; }
.line-ed select, .line-ed input { font: inherit; font-size: .95rem; border: 1.5px solid var(--line-2); border-radius: 10px; padding: .5rem .6rem; min-height: 44px; width: 100%; background: var(--paper); color: var(--ink); }
.icon-btn { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--paper); cursor: pointer; display: grid; place-items: center; }
.icon-btn svg { width: 16px; height: 16px; }
.totals { display: grid; gap: .25rem; justify-items: end; font-variant-numeric: tabular-nums; }
.totals div { display: flex; gap: 1.5rem; justify-content: space-between; width: min(100%, 280px); }
.totals .grand { font-family: var(--display); font-weight: 750; font-size: 1.25rem; border-top: 1px solid var(--line); padding-top: .4rem; margin-top: .2rem; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; font-size: .9rem; color: var(--ink-2); }
.history li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: .5rem; align-items: center; }
.history li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); justify-self: center; }
.history li:last-child::before { background: var(--accent); }

/* PDF preview */
.pdf { background: #fff; border: 1px solid var(--line); box-shadow: 0 4px 20px rgba(27, 22, 17, .08); padding: 1.8rem 1.6rem; font-size: .88rem; display: grid; gap: 1.1rem; }
.pdf-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.pdf-head b { font-family: var(--display); font-size: 1.2rem; display: block; }
.pdf .meta { text-align: right; font-size: .85rem; color: var(--ink-2); }
.pdf table { width: 100%; border-collapse: collapse; }
.pdf th, .pdf td { padding: .45rem .3rem; border-bottom: 1px solid var(--line); text-align: left; }
.pdf th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; }
.pdf .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pdf .stamp { font-family: var(--mono); font-size: .72rem; color: var(--warn); text-transform: uppercase; letter-spacing: .08em; }

/* Horizontal bar lists (one scale per list, labels in ink, value at the end) */
.barlist { display: grid; gap: .65rem; }
.barlist .item { display: grid; grid-template-columns: minmax(110px, 170px) minmax(0, 1fr) auto; gap: .75rem; align-items: center; font-size: .92rem; }
.barlist .lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barlist .track { height: 14px; position: relative; border-left: 1px solid var(--line-2); }
.barlist .fill { display: block; height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; background: var(--accent); }
.barlist .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; min-width: 6.5rem; }
.barlist .val small { font-weight: 400; color: var(--ink-3); margin-left: .35rem; }
@media (max-width: 560px) {
  .barlist .item { grid-template-columns: minmax(0, 1fr) auto; row-gap: .3rem; }
  .barlist .track { grid-column: 1 / -1; grid-row: 2; }
}

/* Calendar (alojamento local) */
.cal-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.cal { display: grid; grid-template-columns: 150px repeat(14, minmax(34px, 1fr)); min-width: 720px; font-size: .85rem; }
.cal .hd { grid-column: span 2; padding: .55rem .4rem; text-align: center; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); font-weight: 600; }
.cal .hd small { display: block; font-weight: 400; color: var(--ink-3); font-size: .75rem; }
.cal .hd.today { background: var(--tint); }
.cal .corner { border-bottom: 1px solid var(--line); padding: .55rem .75rem; font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: flex-end; }
.cal .unit { grid-column: 1; padding: 0 .75rem; display: flex; align-items: center; font-weight: 600; border-bottom: 1px solid var(--line); height: 48px; }
.cal .cell { border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); height: 48px; }
.cal .bk { align-self: start; margin-top: 6px; height: 24px; margin-left: 2px; margin-right: 2px; border-radius: 7px; display: flex; align-items: center; padding: 0 .5rem; font-size: .78rem; font-weight: 600; white-space: nowrap; overflow: hidden; z-index: 1; border: 1px solid transparent; }
.cal .bk.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.cal .bk.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.cal .bk.src-a { background: #dfe9f7; color: #1d4f8a; border-color: #c3d5ee; }
.cal .bk.src-b { background: #e3f1e8; color: #1d6040; border-color: #c4e0cf; }
.cal .bk.src-d { background: #f3e6f7; color: #6b2f80; border-color: #e2cbe9; }
.cal .bk.new { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal .cl { align-self: end; justify-self: center; margin-bottom: 3px; z-index: 2; font-size: .66rem; font-weight: 700; padding: 0 .35rem; border-radius: 4px; background: var(--ink); color: var(--paper); line-height: 1.5; }
.cal .cl.done { background: var(--ok); }
.cal .cl.prio { background: var(--accent); color: var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .84rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.legend i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; border: 1px solid transparent; }
.legend i.src-a { background: #dfe9f7; border-color: #c3d5ee; }
.legend i.src-b { background: #e3f1e8; border-color: #c4e0cf; }
.legend i.src-d { background: #f3e6f7; border-color: #e2cbe9; }
.legend i.cl { background: var(--ink); }
.legend i.prio { background: var(--accent); }
.legend i.done { background: var(--ok); }

.tasks { display: grid; gap: .9rem; }
.task-day h4 { font-family: var(--mono); font-size: .74rem; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; margin-bottom: .45rem; }
.task { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem 1rem; align-items: center; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); margin-bottom: .45rem; }
.task b { font-weight: 600; }
.task .meta { font-size: .84rem; color: var(--ink-3); grid-column: 1; }
.task .pills { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; grid-row: 1 / span 2; grid-column: 2; }

/* Phone frame */
.phone-stage { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.phone { border: 10px solid var(--ink); border-radius: 36px; background: var(--paper); overflow: hidden; max-width: 340px; width: 100%; box-shadow: var(--shadow); }
.phone-top { background: var(--ink); color: var(--paper); padding: .7rem 1rem .85rem; display: grid; gap: .1rem; }
.phone-top small { color: #c9beb3; font-size: .78rem; }
.phone-top b { font-family: var(--display); font-size: 1.1rem; }
.phone-body { padding: .8rem; display: grid; gap: .7rem; background: var(--paper-2); min-height: 420px; align-content: start; }
.job { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: .75rem .8rem; display: grid; gap: .5rem; }
.job-head { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.job-head b { font-size: .98rem; }
.job .meta { font-size: .8rem; color: var(--ink-3); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.checklist label { display: flex; align-items: center; gap: .6rem; padding: .45rem .2rem; font-size: .92rem; cursor: pointer; border-radius: 8px; }
.checklist input { width: 20px; height: 20px; accent-color: var(--ok); margin: 0; flex: none; }
.checklist input:checked + span { color: var(--ink-3); text-decoration: line-through; }
.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ok); border-radius: 3px; transition: width .25s ease; }
@media (max-width: 760px) { .phone-stage { grid-template-columns: minmax(0, 1fr); justify-items: center; } }

/* Owner report */
.report { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 1.3rem 1.4rem; display: grid; gap: 1rem; }
.report-head { display: flex; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; align-items: flex-end; }
.report-head h3 { font-size: 1.2rem; }
.report table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.report td { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.report td.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.report tr.total td { border-bottom: 0; border-top: 2px solid var(--ink); font-family: var(--display); font-weight: 750; font-size: 1.1rem; padding-top: .7rem; }
.meter { display: grid; gap: .35rem; }
.meter .track { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.meter .track i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.meter span { font-size: .85rem; color: var(--ink-2); }
.select-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.select-row label { font-weight: 600; font-size: .92rem; }
.select-row select { font: inherit; font-size: .95rem; border: 1.5px solid var(--line-2); border-radius: 10px; padding: .45rem .6rem; min-height: 42px; background: var(--paper); color: var(--ink); }

/* Revenue chart */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text, .chart text.axis { fill: var(--ink-3); font-family: var(--mono); font-size: 11px; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: var(--line-2); stroke-width: 1; }
.chart .bar { fill: var(--accent-soft); transition: fill .15s ease; pointer-events: none; }
.chart .bar.on { fill: var(--accent); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:focus-visible { outline: none; }
.chart .hit:focus-visible + .bar, .chart .hit:hover + .bar { fill: #f59a68; }
.chart .hit:hover + .bar.on, .chart .hit:focus-visible + .bar.on { fill: var(--accent); }
.chart .lbl-on { fill: var(--ink); font-family: var(--mono); font-size: 11px; font-weight: 600; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--paper); font-size: .82rem; padding: .45rem .65rem; border-radius: 8px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity .12s ease; z-index: 3; }
.tip.show { opacity: 1; }
.tip b { font-variant-numeric: tabular-nums; }

.answers { display: grid; gap: .6rem; list-style: none; margin: 0; padding: 0; }
.answers li { display: grid; gap: .1rem; padding: .7rem .85rem; border-radius: 10px; background: var(--paper-2); border: 1px solid var(--line); }
.answers li span { font-size: .85rem; color: var(--ink-3); }
.answers li b { font-weight: 600; }
