/* Demo-only additions on top of the real Clienora CRM styles (assets/css/app.css). */

.demo-bar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .45rem 1rem;
  background: var(--brand); color: var(--brand-ink); font-size: .9rem; position: relative; z-index: 6; }
.demo-bar .spacer { flex: 1; }
.demo-pill { background: var(--brand-ink); color: var(--brand); border-radius: 999px; padding: .1rem .6rem; font-weight: 700; font-size: .8rem; }
.demo-bar .btn { color: var(--brand-ink); border-color: color-mix(in srgb, var(--brand-ink) 45%, transparent); background: transparent; }
.demo-bar .demo-cta { background: var(--brand-ink); color: var(--brand); border-color: var(--brand-ink); font-weight: 700; }
.demo-bar a:hover, .demo-bar .btn:hover { text-decoration: none; filter: brightness(1.05); }
@media (max-width: 760px) { .demo-text { display: none; } .demo-bar { padding: .35rem .75rem; } }

.app { min-height: calc(100vh - 42px); }
.sidebar { height: calc(100vh - 42px); top: 0; }
.nav a { cursor: pointer; }
.nav .soon { margin-inline-start: auto; font-size: .7rem; color: var(--muted); }
.topbar .spacer { flex: 1; }
.topbar .btn .i { width: 1.2em; height: 1.2em; }
.menu-toggle .i { width: 1.4rem; height: 1.4rem; }

.table tbody tr.clickable { cursor: pointer; }
.table tr.fresh td { background: var(--brand-soft); }
.svc-inline .i { color: var(--brand); }
.chan { display: inline-flex; align-items: center; gap: .3rem; }
.chan .i { color: var(--muted); }

/* Dialogs */
dialog.dlg { border: 0; border-radius: 16px; padding: 0; width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog.dlg::backdrop { background: rgba(10, 20, 16, .45); }
.dlg-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .9rem; }
.dlg-head { display: flex; align-items: center; gap: .5rem; }
.dlg-head h2 { margin: 0; flex: 1; }
.status-row { display: flex; gap: .4rem; flex-wrap: wrap; }
.status-row .btn.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.req-details { background: var(--surface-2); border-radius: 10px; padding: .7rem .9rem; white-space: pre-wrap; }

/* Simulator phone */
dialog.phone-dlg { width: min(400px, calc(100vw - 24px)); background: transparent; box-shadow: none; overflow: visible; }
.sim-phone { background: var(--surface); border-radius: 28px; overflow: hidden; border: 8px solid #1d2321;
  height: min(680px, calc(100vh - 110px)); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.sim-head { display: flex; align-items: center; gap: .5rem; padding: .6rem .7rem; background: var(--wa); color: #fff; }
.sim-head .avatar { background: #fff; color: var(--wa); width: 36px; height: 36px; }
.sim-head .avatar img { width: 26px; height: 26px; }
.sim-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.sim-who strong { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-who small { color: rgba(255,255,255,.85); font-size: .72rem; }
.sim-head .btn { color: #fff; }
.sim-head .sim-reset { font-size: .75rem; }
.sim-body { flex: 1; }
.sim-foot { display: flex; gap: .4rem; padding: .5rem; background: var(--surface-2); }
.sim-foot input { flex: 1; border-radius: 999px; }
.sim-foot .btn { border-radius: 50%; width: 42px; height: 42px; padding: 0; }
[dir="rtl"] .sim-foot .btn .i { transform: scaleX(-1); }
.sim-note { text-align: center; color: #fff; font-size: .85rem; margin: .6rem 0 0; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.bubble .b-options button:hover { background: var(--surface-2); }
.typing { align-self: flex-start; background: var(--surface); border-radius: 10px; padding: .4rem .7rem; color: var(--muted); font-size: .85rem; }

/* Inbox tweaks for the demo */
.inbox { height: calc(100vh - 210px); }
.conv { cursor: pointer; }
.conv.fresh { animation: freshconv 1.6s; }
@keyframes freshconv { from { background: var(--brand-soft); } to { background: transparent; } }

.deal-card { user-select: none; }
.hint-box { display: flex; gap: .6rem; align-items: center; background: var(--brand-soft); color: var(--brand); border-radius: 10px;
  padding: .6rem .9rem; margin-bottom: 1rem; font-weight: 600; flex-wrap: wrap; }
.hint-box .btn { margin-inline-start: auto; }

.toast { position: fixed; bottom: 84px; inset-inline-start: 50%; transform: translateX(-50%); background: var(--text); color: var(--surface);
  padding: .7rem 1.2rem; border-radius: 10px; font-weight: 600; z-index: 50; display: flex; gap: .5rem; align-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
[dir="rtl"] .toast { transform: translateX(50%); }
.toast .i { color: var(--brand-soft); }
@media (prefers-reduced-motion: reduce) { .conv.fresh { animation: none; } }
.table td .muted.num, .chat-head .num { display: block; }
@media (max-width: 480px) { .demo-bar .btn-ghost { display: none; } }

/* Request / deal dialogs: labels line up with their values and fields */
.dlg .kv { align-items: center; row-gap: .55rem; }
.dlg .kv dd select { width: auto; min-width: 200px; max-width: 100%; }
.deal-card { cursor: pointer; }
.deal-card:hover { border-color: var(--brand); }
.deal-amount { font-weight: 700; font-size: 1.1rem; }

/* Guided tour */
.tour-ring { position: fixed; z-index: 1000; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 3px var(--brand), 0 0 0 9999px rgba(8, 20, 16, .55); transition: all .25s ease; }
.tour-pop { position: fixed; z-index: 1001; background: var(--surface); color: var(--text); border-radius: 14px; padding: .9rem 1rem .8rem;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .3); border: 1px solid var(--line); transition: top .25s ease, left .25s ease; }
.tour-pop::before { content: ""; position: absolute; left: calc(var(--arrow-x, 50%) - 8px); width: 16px; height: 16px; background: inherit;
  border: inherit; transform: rotate(45deg); }
.tour-pop[data-side="below"]::before { top: -9px; border-right: 0; border-bottom: 0; }
.tour-pop[data-side="above"]::before { bottom: -9px; border-left: 0; border-top: 0; }
.tour-pop[data-side="over"]::before, .tour-pop[data-side="center"]::before { display: none; }
.tour-top { display: flex; align-items: baseline; gap: .5rem; margin-bottom: .35rem; }
.tour-top strong { flex: 1; color: var(--brand); font-size: 1.02rem; }
.tour-count { color: var(--muted); font-size: .8rem; }
.tour-pop p { margin: 0 0 .75rem; line-height: 1.7; font-size: .93rem; }
.tour-actions { display: flex; justify-content: flex-end; gap: .4rem; }
@media (prefers-reduced-motion: reduce) { .tour-ring, .tour-pop { transition: none; } }

/* "Page guide" button */
.help-fab { position: fixed; bottom: 18px; inset-inline-end: 18px; z-index: 30; display: inline-flex; align-items: center; gap: .4rem;
  background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 999px; padding: .55rem .95rem; font: inherit; font-weight: 700;
  font-size: .9rem; cursor: pointer; box-shadow: 0 6px 18px rgba(0, 0, 0, .2); }
.help-fab .i { width: 1.2em; height: 1.2em; }
.help-fab:hover { filter: brightness(1.08); }
@media (max-width: 900px) { .help-fab { bottom: 78px; padding: .55rem; } .help-fab span { display: none; } }
[dir="rtl"] .dlg .kv dd.num { text-align: right; }
.bar-row > span:last-child { white-space: nowrap; }

/* Business picker */
dialog.biz-dlg { width: min(720px, calc(100vw - 24px)); }
.biz-dlg h2 { margin: 0; }
.biz-dlg p { margin: -.4rem 0 0; }
.biz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.biz-card { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; text-align: start; padding: 1rem; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, transform .15s; }
.biz-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.biz-card.on { border-color: var(--brand); background: var(--brand-soft); }
.biz-card strong { font-size: 1.05rem; }
.biz-card small { color: var(--muted); line-height: 1.6; }
.biz-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: .2rem; }
.biz-ico .i { width: 26px; height: 26px; }
@media (max-width: 560px) { .biz-grid { grid-template-columns: 1fr; } .biz-card { flex-direction: row; flex-wrap: wrap; align-items: center; } .biz-card small { flex-basis: 100%; } }
.biz-switch { display: inline-flex; align-items: center; gap: .35rem; }
@media (max-width: 640px) { .biz-switch span { display: none; } }
