/* Login menu, account area, tickets and live chat. Loaded after styles.css. */

/* ---------- Login menu (header) ---------- */
.btn-outline { background: #fff; color: var(--pink); box-shadow: inset 0 0 0 2px var(--pink); }
.btn-outline:hover { background: #fcebf4; color: var(--pink-dark); }
.site-nav .account { position: relative; margin-left: 12px; }
.site-nav .account .btn { margin: 0; padding: 13px 24px; font-weight: 700; letter-spacing: 0; display: inline-flex; gap: 8px; align-items: center; cursor: pointer; border-bottom: 0; }
.caret { font-size: 11px; }
.account-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; max-height: calc(100vh - 120px); overflow-y: auto; overscroll-behavior: contain; background: #fff; border-radius: 12px; box-shadow: 0 16px 40px rgba(15, 23, 42, .18); padding: 8px; z-index: 60; display: grid; }
.account-menu[hidden] { display: none; }
.account-who { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; line-height: 1.35; }
.account-who b { display: block; color: var(--ink); }
.account-who span { font-size: 13px; color: var(--pink); }
.site-nav .account-menu a, .account-menu button { display: block; text-align: left; padding: 10px 12px; border-radius: 8px; color: #3f3f3f; text-decoration: none; font: 500 14px/1.3 "Poppins", sans-serif; border: 0; background: none; cursor: pointer; margin: 0; }
.site-nav .account-menu a:hover, .account-menu button:hover { background: #fcebf4; color: var(--pink); }
.account-menu .account-logout { border-top: 1px solid var(--line); margin-top: 6px; border-radius: 0 0 8px 8px; }

/* ---------- Sign-in dialog ---------- */
.auth-tabs { display: flex; gap: 6px; background: var(--bg-alt); padding: 4px; border-radius: 10px; margin-bottom: 24px; }
.auth-tabs button { flex: 1; border: 0; background: none; padding: 10px; border-radius: 8px; font: 600 14px var(--body); color: var(--text); cursor: pointer; }
.auth-tabs button[aria-selected="true"] { background: #fff; color: var(--pink); box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
.auth-tabs[hidden] { display: none; }
.field input[type="password"] { width: 100%; font: inherit; color: var(--ink); padding: 11px 14px; border: 1px solid #c9ced6; border-radius: 6px; }
.field input[type="password"]:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(236, 0, 140, .15); }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { display: flex; gap: 10px; align-items: flex-start; border: 1px solid #c9ced6; border-radius: 10px; padding: 12px; cursor: pointer; font-size: 13px; line-height: 1.4; }
.choice b { display: block; color: var(--ink); font-size: 14px; }
.choice input { accent-color: var(--pink); margin-top: 3px; }
.choice:has(input:checked) { border-color: var(--pink); background: #fff6fb; }
.link-btn { border: 0; background: none; color: var(--pink); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
.auth-alt { text-align: center; margin: 16px 0 0; font-size: 14px; }
.auth-done { text-align: center; }
.auth-done h2 { margin-bottom: 12px; }

/* ---------- Account area ---------- */
.app-main { background: var(--bg-site); min-height: 60vh; padding: 48px 0 80px; }
.app-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.app-head h1 { font-size: clamp(26px, 3vw, 34px); margin: 0; }
.app-actions { display: flex; gap: 10px; }
.app-loading, .empty { color: var(--muted); }
.panel { background: #fff; border-radius: 16px; padding: 28px; box-shadow: 0 0 40px rgba(0, 0, 0, .06); margin-bottom: 24px; }
.panel h2 { font-size: 20px; margin: 0 0 18px; }
.narrow-panel { max-width: 480px; }
.app-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.app-grid-2 .panel { margin: 0; }
.panel select, .panel textarea, .toolbar select, .toolbar input, .inline-form input, .data-table input, .data-table select, .copy-row input {
  font: inherit; font-size: 14px; color: var(--ink); padding: 9px 12px; border: 1px solid #c9ced6; border-radius: 6px; background: #fff; max-width: 100%; }
.panel textarea { width: 100%; resize: vertical; }
.field select { width: 100%; }
.panel select:focus, .panel textarea:focus, .toolbar input:focus, .data-table input:focus, .data-table select:focus { outline: none; border-color: var(--pink); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0 0 20px; font-size: 15px; }
.facts dt { font-weight: 700; color: var(--ink); }
.facts dd { margin: 0; }
.quick-links { display: flex; flex-wrap: wrap; gap: 10px; }
.notice { border-radius: 12px; padding: 14px 18px; margin-bottom: 20px; font-size: 15px; background: #eef6ff; border-left: 4px solid #3b82f6; color: var(--ink); }
.notice-warn { background: #fff4e5; border-left-color: #f59e0b; }
.muted { color: var(--muted); font-size: 13px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 14px; font-size: 14px; }
.toolbar label { display: flex; align-items: center; gap: 8px; }
.toolbar input[type="search"] { min-width: 220px; }
.table-scroll { overflow-x: auto; background: #fff; border-radius: 12px; border: 1px solid var(--line); }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; background: #fafafa; color: var(--ink); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table a { color: var(--pink); text-decoration: none; font-weight: 500; }
.data-table code { font-size: 12px; background: var(--bg-alt); padding: 3px 6px; border-radius: 4px; word-break: break-all; }
.row-actions { display: flex; gap: 8px; }
.activity .act-details { font-size: 13px; max-width: 420px; word-break: break-word; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #eef0f3; color: #475467; white-space: nowrap; }
.badge-open, .badge-new, .badge-active { background: #e7f6ec; color: #067647; }
.badge-in_progress, .badge-contacted, .badge-pending, .badge-trial { background: #eef4ff; color: #3538cd; }
.badge-escalated, .badge-urgent, .badge-disabled, .badge-suspended, .badge-cancelled { background: #fdecef; color: #c01048; }
.badge-high, .badge-internal { background: #fff4e5; color: #b54708; }
.badge-resolved, .badge-customer, .badge-approved, .badge-paid { background: #fcebf4; color: var(--pink-dark); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; padding: 12px 22px; border-radius: 10px; color: #fff; background: #067647; font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.toast-err { background: #d92d20; }
.new-ticket summary { list-style: none; display: inline-block; cursor: pointer; }
.new-ticket summary::-webkit-details-marker { display: none; }
.new-ticket[open] summary { margin-bottom: 20px; }
.new-ticket:not([open]) { background: none; box-shadow: none; padding: 0; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.copy-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.copy-row input { flex: 1; min-width: 240px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.tile { background: #fff; border-radius: 14px; padding: 20px; box-shadow: 0 0 40px rgba(0, 0, 0, .06); }
.panel .tile { background: var(--bg-alt); box-shadow: none; }
.tile b { display: block; font: 600 30px/1.1 var(--head); color: var(--pink); }
.tile span { font-size: 14px; }

/* Ticket view */
.ticket-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.ticket-layout .panel { margin: 0; }
.ticket-thread { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 14px; }
.ticket-thread li { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.ticket-thread li.mine { background: #fafafa; }
.ticket-thread li.internal { background: #fffaf0; border-color: #fde7c2; }
.ticket-thread header { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; margin-bottom: 6px; color: var(--ink); }
.ticket-thread time { margin-left: auto; font-size: 12px; color: var(--muted); }
.ticket-thread p { margin: 0; white-space: pre-wrap; }
.reply-bar { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 12px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.check input { accent-color: var(--pink); }
.manage { border-top: 1px solid var(--line); padding-top: 18px; display: grid; gap: 4px; }
.manage .btn { margin-top: 6px; }
.ticket-side .back { margin-top: 16px; }

/* Chat inbox */
.chat-inbox { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; }
.chat-inbox .panel { margin: 0; }
.chat-list { padding: 8px; max-height: 70vh; overflow-y: auto; }
.chat-list ul { list-style: none; margin: 0; padding: 0; }
.chat-list li a { display: block; padding: 12px; border-radius: 10px; text-decoration: none; color: var(--text); font-size: 14px; line-height: 1.4; }
.chat-list li a span, .chat-list li a time { display: block; font-size: 12px; color: var(--muted); }
.chat-list li.active a, .chat-list li a:hover { background: #fcebf4; }
.chat-list li.unread b::after { content: " \2022"; color: var(--pink); }
.chat-list li.empty { padding: 12px; }
.thread-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 14px; }
.thread-head a { color: var(--pink); font-size: 14px; margin-left: 8px; }
.thread-actions { display: flex; gap: 8px; align-items: center; }
.chat-view .chat-log { border-radius: 12px; max-height: 55vh; }

/* ---------- Live chat bubble ---------- */
.chat-widget { position: fixed; right: 20px; bottom: 20px; z-index: 70; font-size: 14px; }
.chat-bubble { display: flex; align-items: center; gap: 10px; border: 0; border-radius: 999px; background: var(--pink); color: #fff; padding: 14px 20px; font: 700 15px var(--body); cursor: pointer; box-shadow: 0 12px 30px rgba(236, 0, 140, .35); margin-left: auto; }
.chat-bubble svg { width: 20px; height: 20px; fill: #fff; }
.chat-panel { position: absolute; right: 0; bottom: calc(100% + 12px); width: min(360px, calc(100vw - 40px)); background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(15, 23, 42, .25); overflow: hidden; }
.chat-panel[hidden] { display: none; }
.chat-panel header { background: linear-gradient(280deg, #002f41 0%, #49022b 100%); color: #fff; padding: 16px 48px 16px 18px; position: relative; }
.chat-panel header b { display: block; font: 600 16px var(--head); }
.chat-panel header span { font-size: 12px; opacity: .85; }
.chat-close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; font-size: 20px; cursor: pointer; }
.chat-start { display: grid; gap: 10px; padding: 18px; }
.chat-start[hidden], .chat-thread[hidden] { display: none; }
.chat-send textarea { flex: 1; resize: none; min-height: 42px; max-height: 150px; line-height: 1.4; }
.chat-send .btn { align-self: flex-end; }
.chat-start input, .chat-start textarea, .chat-send input, .chat-send textarea { font: inherit; padding: 10px 12px; border: 1px solid #c9ced6; border-radius: 8px; width: 100%; }
.chat-start .form-error { margin: 0; }
.chat-log { list-style: none; margin: 0; padding: 16px; display: flex; flex-direction: column; gap: 10px; max-height: 340px; overflow-y: auto; background: #fafafa; }
.chat-log li { max-width: 80%; }
.chat-log li p { margin: 0; padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; }
.chat-log li time { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.chat-log li.me { align-self: flex-end; text-align: right; }
.chat-log li.me p { background: var(--pink); color: #fff; border-bottom-right-radius: 4px; }
.chat-log li.them p { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-send { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat-send[hidden] { display: none; }
.chat-closed { padding: 12px 16px; margin: 0; font-size: 13px; }
.chat-rate { padding: 10px 14px 0; font-size: 13px; text-align: center; border-top: 1px solid var(--line); }
.chat-rate[hidden], .chat-rate [hidden] { display: none; }
.chat-rate p { margin: 0 0 4px; }
.chat-rate-comment { display: flex; gap: 6px; margin-top: 6px; }
.chat-rate-comment input { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.rate-stars { display: inline-flex; gap: 2px; }
.rate-stars button { background: none; border: 0; padding: 0 2px; font-size: 28px; line-height: 1; color: #d1d5db; cursor: pointer; }
.rate-stars button.on, .rate-stars:hover button { color: #f5a623; }
.rate-stars button:hover ~ button { color: #d1d5db; }
.rate-stars button:focus-visible { outline: 2px solid var(--blue, #00b0f0); border-radius: 4px; }
.consent-card .rate-stars button { font-size: 40px; }
.rate-label { margin-top: 4px; font-weight: 500; }
.stars-small { color: #f5a623; letter-spacing: 1px; white-space: nowrap; }
.chat-contact { display: grid; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: #fff6fb; }
.chat-contact[hidden] { display: none; }
.chat-contact p { margin: 0; font-size: 13px; color: var(--ink); }
.chat-contact input[hidden] { display: none; }
.chat-account { margin: 0; padding: 10px 14px; font-size: 13px; background: #f0fdf4; border-top: 1px solid var(--line); }
.chat-account[hidden] { display: none; }
.chat-welcome { margin: 0; font-size: 14px; }
.chat-welcome[hidden] { display: none; }
.visitor-info { padding: 8px 12px; margin: 8px 0; font-size: 13px; background: var(--soft, #f8fafc); border: 1px solid var(--line); border-radius: 10px; }
.visitor-info details { margin-top: 6px; }
.visitor-info ul { margin: 6px 0 0; padding-left: 18px; }
.visitor-info em { color: var(--muted); }
.chat-contact input { font: inherit; padding: 10px 12px; border: 1px solid #c9ced6; border-radius: 8px; width: 100%; }
.chat-contact input.invalid { border-color: #d92d20; }
.chat-contact .form-error { margin: 0; }
.contact-line { display: flex; flex-wrap: wrap; gap: 4px 0; align-items: center; margin-top: 4px; font-size: 14px; }
.thread-head .contact-line a { margin: 0 12px 0 0; }

@media (max-width: 1240px) {
  .site-nav { gap: 22px; }
}
@media (max-width: 960px) {
  .app-grid-2, .ticket-layout, .chat-inbox { grid-template-columns: 1fr; }
  .site-nav { gap: 16px; }
  .site-nav .account .btn { padding: 11px 16px; }
}
@media (max-width: 760px) {
  .site-nav .account { margin: 10px 0 0; }
  .site-nav .account .btn { width: 100%; justify-content: center; }
  .account-menu { position: static; box-shadow: none; border: 1px solid var(--line); margin-top: 8px; }
  .choice-row { grid-template-columns: 1fr; }
  .chat-bubble span { display: none; }
  .chat-bubble { padding: 16px; }
  .panel { padding: 20px; }
}

.badge-affiliate { background: #fcebf4; color: var(--pink-dark); }
.badge-website { background: #eef0f3; color: #475467; }

/* Contact confirmation (affiliate contacts) */
.badge-confirmed { background: #e7f6ec; color: #067647; }
.badge-awaiting { background: #fff4e5; color: #b54708; }
.badge-declined { background: #fdecef; color: #c01048; }
.declaration { background: var(--bg-alt); border-radius: 10px; padding: 16px; }
.declaration .consent { background: none; padding: 0; margin-bottom: 14px; }
.declaration .field { margin: 0; }
.send-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.send-confirm { margin-top: 20px; padding: 18px; border-radius: 12px; background: #fff6fb; border: 1px solid #f8c9e2; }
.send-confirm h3 { margin: 0 0 6px; font-size: 18px; }
.send-confirm p { margin: 0 0 8px; }
.consent-card { max-width: 640px; margin: 0 auto; }
.consent-card h1 { font-size: 28px; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 12px; }

/* Close-chat window */
.case-fields { margin-top: 18px; }
.case-fields[hidden] { display: none; }
#close-chat .choice-row { margin-bottom: 4px; }
#close-chat .notice { margin: 18px 0 16px; font-size: 14px; }

/* Ticket e-mail history */
.mail-history { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
.mail-history h3 { font-size: 15px; margin: 0 0 8px; }
.mail-history ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.mail-history li span, .mail-history li time { display: block; color: var(--muted); font-size: 12px; word-break: break-all; }

/* Admin tools: dialogs, lead conversion, company members */
.dialog-done[hidden] { display: none; }
.dialog-done h2 { margin-top: 0; }
.convert-box { background: #fff6fb; border: 1px solid #f8c9e2; border-radius: 10px; padding: 14px 16px; margin: 4px 0 16px; }
.convert-box p { margin: 4px 0 10px; }
.members { margin: 4px 0 16px; font-size: 14px; }
.members ul { margin: 6px 0 0; padding-left: 18px; }
.members li { margin-bottom: 4px; }
.company-pick[hidden] { display: none; }
.app-actions .btn { white-space: nowrap; }
.link-btn[data-edit] { font-weight: 600; text-decoration: none; color: var(--pink); text-align: left; }

/* Chat inbox: latest activity and waiting chats */
.chat-list li a em { display: block; font-style: normal; font-size: 13px; color: var(--text); margin: 4px 0 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list li.waiting a { border-left: 3px solid #f59e0b; }
.chat-list li.unread a { background: #fff6fb; }
.chat-list li.unread b::after { content: " \2022"; color: var(--pink); font-size: 20px; line-height: 0; }

/* Chat inbox fits the screen: name stays on top, reply box at the bottom, only messages scroll */
@media (min-width: 961px) {
  /* minmax(0, 1fr): the row may not grow with a long conversation (that made it spill over the footer) */
  .chat-inbox { height: calc(100vh - 205px); min-height: 420px; align-items: stretch; grid-template-rows: minmax(0, 1fr); }
  .chat-inbox > .panel { min-height: 0; max-height: none; overflow: hidden; }
  .chat-inbox > .chat-list { overflow-y: auto; height: auto; }
  .chat-list { max-height: none; height: 100%; }
  .chat-view { display: flex; flex-direction: column; height: 100%; padding: 20px 24px; }
  .chat-view .thread-head { flex: none; }
  .chat-view .chat-log { flex: 1; max-height: none; min-height: 0; }
  .chat-view .chat-send, .chat-view > .muted { flex: none; }
  .app-main:has(.chat-inbox) { padding: 24px 0; }
  .app-main:has(.chat-inbox) .app-head { margin-bottom: 14px; }
}
.thread-name { font: 600 20px/1.3 var(--head); color: var(--ink); }
.chat-list li.active a { background: #fcebf4; box-shadow: inset 4px 0 0 var(--pink); }

/* Roles reference and staff "new ticket for a customer" */
.roles-ref summary { cursor: pointer; font-size: 16px; }
.roles-ref[open] summary { margin-bottom: 14px; }
.roles-ref td:first-child { white-space: nowrap; }
.unregistered[hidden] { display: none; }
#staff-ticket .field-row.unregistered { grid-template-columns: 1fr 1fr 1fr; }
.role-info { margin: -6px 0 14px; }
#staff-new:not([open]) + .new-ticket { margin-top: 10px; }

/* Companies list */
.row-inactive td { opacity: .65; }
#company-rows select { min-width: 120px; }

/* Self-service */
.security-grid { align-items: start; }
#team-rows select { min-width: 140px; }

/* Three doors: referral banner, partner page, links in the login window */
.referral-banner { background: #e6f7fe; border-bottom: 1px solid #b8e6fa; }
.referral-banner .container { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding-block: 10px; }
.referral-banner span { color: var(--ink); }
.auth-doors { display: grid; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; }
.auth-doors a { color: var(--text); text-decoration: none; }
.auth-doors a b { color: var(--pink); }
.auth-doors a:hover b { text-decoration: underline; }
.mode-note:empty { display: none; }
.customer-only[hidden] { display: none; }
.partner-page .partner-hero { display: grid; gap: 14px; max-width: 760px; margin-bottom: 28px; }
.partner-page .partner-hero h1 { font-size: clamp(34px, 5vw, 52px); margin: 0; }
.partner-page .hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.partner-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; counter-reset: s; }
.partner-steps li { counter-increment: s; display: grid; gap: 4px; padding: 16px; border-radius: 12px; background: var(--bg-alt); }
.partner-steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--pink); color: #fff; font-weight: 700; }
.partner-steps b { font-family: var(--head); color: var(--ink); }
.partner-facts { margin: 0 0 18px; padding-left: 20px; display: grid; gap: 6px; }

/* Referral history tag */
.tag-btn { margin-top: 4px; border: 0; border-radius: 999px; padding: 3px 10px; font: 700 12px var(--body); background: #e6f7fe; color: #007bab; cursor: pointer; }
.tag-btn:hover { background: #cdeffd; }

/* Referral review (several partners) */
.tag-btn.review { background: #fff4e5; color: #b45309; border-color: #f59e0b; }
.review-facts { margin-top: 16px; }
.review-actions { border-top: 1px solid var(--line, #e5e7eb); padding-top: 14px; margin-top: 4px; }
.review-actions .row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
#rates { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
#rates input { width: 130px; }

.referral-banner .referral-actions { display: flex; flex-wrap: wrap; gap: 8px; }


/* Owner only: delete (into the Archive) */
.btn.btn-danger { color: #b91c1c; border-color: #b91c1c; }
.btn.btn-danger:hover { background: #b91c1c; color: #fff; }
.owner-delete { margin: 12px 0 0; text-align: right; }
.act-archive { color: #b91c1c; }
/* Temporary password: a wide box to type your own, with a small "Suggest one" button beside it */
.pw-row { display: flex; gap: 8px; align-items: stretch; }
.pw-row input { flex: 1 1 auto; min-width: 0; width: auto; }
.plans-form .pw-row .btn { flex: 0 0 auto; width: auto; font-size: 14px; white-space: nowrap; }

/* Website Edit */
.toolbar .toolbar-title { margin: 0; font-size: 18px; }
.plans-form textarea[name="text"] { width: 100%; font: inherit; line-height: 1.5; }
/* E-mails received with an HTML layout (ticket page) */
.ticket-thread .mail-subject { font-weight: 600; margin-bottom: 8px; }
.mail-frame { display: block; width: 100%; height: 240px; border: 0; background: #fff; }
.ticket-thread .mail-text { display: none; }
.ticket-thread li.as-text .mail-text { display: block; }
.ticket-thread li.as-text .mail-frame, .ticket-thread li.as-text .mail-subject { display: none; }
.mail-switch { margin-top: 8px; font-size: 13px; }

/* Customer Journey board: one column per onboarding stage, scrolls sideways */
.journey-docs h2 { font-size: 18px; margin-bottom: 8px; }
.journey-docs p { margin: 0; }
.journey-board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.journey-col { flex: 0 0 240px; background: var(--bg-alt); border-radius: 14px; padding: 12px; min-height: 160px; border: 2px solid transparent; }
.journey-col.drop { border-color: var(--pink); background: #fdeef7; }
.journey-col.lost { background: #eef0f3; }
.journey-col header { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 8px; align-items: center; margin-bottom: 10px; font-size: 14px; color: var(--ink); }
.journey-col header small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.journey-no { background: var(--pink); color: #fff; border-radius: 999px; min-width: 22px; height: 22px; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.journey-col.lost .journey-no { display: none; }
.journey-count { font-weight: 700; color: var(--pink-dark); }
.journey-cards { display: flex; flex-direction: column; gap: 8px; }
.journey-card { display: flex; flex-direction: column; gap: 2px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: 13px/1.4 var(--body); color: var(--text); cursor: grab; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.journey-card:hover { border-color: var(--pink); }
.journey-card b { color: var(--ink); font-size: 14px; overflow-wrap: anywhere; }
.journey-due { color: #b42318; font-weight: 600; }
.journey-empty { color: var(--muted); font-size: 13px; margin: 4px 0; }
.journey-history-title { font-size: 16px; margin: 8px 0; }
.journey-history { list-style: none; padding: 0; margin: 0 0 16px; max-height: 220px; overflow-y: auto; font-size: 14px; }
.journey-history li { padding: 8px 0; border-bottom: 1px solid var(--line); }

/* Subscriptions: client rows with their service lines */
.data-table tr.sub-client td { background: #fbf8fa; border-top: 2px solid #eadde5; }
.data-table td.sub-line { padding-left: 28px; }
.line-pay { margin: 16px 0 0; padding: 14px 16px; background: #fbf8fa; }
.line-pay h3 { margin: 0 0 8px; font-size: 16px; }
.line-pay input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }

/* Commissions */
.comm-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 12px 0; }
.comm-box legend { font-weight: 700; color: var(--ink); padding: 0 6px; }
.rate-list { list-style: none; margin: 0 0 12px; padding: 0; }
.rate-list li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.rate-list li b { color: #c2006f; text-align: right; }

.level-box { padding: 14px 16px; border-radius: 12px; background: #fce6f2; margin: 0 0 8px; }

.journey-service { display: inline-block; font-size: 12px; font-weight: 600; color: #3538cd; background: #eef4ff; border-radius: 999px; padding: 2px 8px; margin-top: 2px; }
.journey-service.upsell { color: #c2006f; background: #fce6f2; }

/* Live chat on clients' websites */
.embed-code { background: var(--bg-alt); padding: 12px; border-radius: 8px; white-space: pre-wrap; word-break: break-all; font-size: 13px; }
.color-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
.api-docs { margin-top: 12px; } .api-docs code { word-break: break-all; }
.form-view { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 6px 16px; margin: 12px 0; }
.form-view dt { font-weight: 600; } .form-view dd { margin: 0; white-space: pre-wrap; }
@media (max-width: 600px) { .form-view { grid-template-columns: 1fr; } }

/* Staff menu headings */
.account-menu .account-group { display: block; padding: 10px 12px 4px; font: 600 11px/1.2 "Poppins", sans-serif; letter-spacing: .06em; text-transform: uppercase; color: #8a8a8a; border-top: 1px solid var(--line); margin-top: 4px; }

/* Performance (065) */
.perf-strip { background: #fff; border-radius: 10px; padding: 8px 14px; margin-bottom: 12px; font-size: 14px; box-shadow: 0 0 20px rgba(0, 0, 0, .05); }
.perf-strip:empty { display: none; }
.perf-periods { flex-wrap: wrap; align-items: center; gap: 8px; }
.perf-tiles .tile b small { display: block; font: 500 13px/1.3 var(--body, inherit); color: var(--ink, #0f172a); margin-top: 4px; }
.perf-bar { display: inline-block; width: 70px; height: 8px; background: #eef0f3; border-radius: 4px; overflow: hidden; vertical-align: middle; margin: 0 4px 0 6px; }
.perf-bar i { display: block; height: 100%; background: var(--pink); border-radius: 4px; }
.perf-table tr.me td { background: #fdf5fa; }
.warn-text { color: #c01048; }
.day-boxes { white-space: nowrap; }
.day-boxes .check { display: inline-flex; margin-right: 6px; font-size: 13px; }
#shift-rows input[name="name"] { min-width: 150px; }
.ticket-rate { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.ticket-rate p { margin: 0 0 4px; }
.rate-comment-row { display: flex; gap: 6px; margin-top: 8px; }
.rate-comment-row input { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.tile-me { outline: 2px solid var(--pink); }

/* Suppliers (068) */
.doc-list { list-style: none; padding: 0; margin: 0 0 12px; }
.doc-list li { padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.upload-row { align-items: flex-end; }
.upload-row .btn { margin-bottom: 14px; }

/* Invoices (069) */
.invoice-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 960px) { .invoice-layout { grid-template-columns: 1fr; } }
.invoice-doc { position: relative; }
.invoice-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 12px; }
.invoice-head h2 { margin: 12px 0 4px; font-size: 22px; }
.invoice-from { text-align: right; color: #475467; font-size: 14px; }
.invoice-lines .num, .invoice-totals .num { text-align: right; white-space: nowrap; }
.invoice-totals { margin: 12px 0 12px auto; border-collapse: collapse; font-size: 15px; }
.invoice-totals td { padding: 3px 10px; }
.invoice-totals tr.grand td { font-weight: 700; border-top: 1px solid var(--line); }
.pay-ways { padding-left: 18px; }
.pay-ways li { margin: 4px 0; }
.invoice-stamp { position: absolute; top: 10px; right: 45%; transform: rotate(-12deg); border: 3px solid #067647; color: #067647; padding: 4px 14px; font: 700 22px var(--head); border-radius: 8px; opacity: .8; }
.invoice-stamp.cancelled { border-color: #c01048; color: #c01048; }
.invoice-side h3 { margin: 16px 0 6px; font-size: 16px; }
.stack-form { display: grid; gap: 8px; margin-bottom: 8px; }
.stack-form input, .stack-form select, .stack-form textarea { width: 100%; }
.decide-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.decide-row input { flex: 1 1 160px; }
#opt-rows input { min-width: 110px; margin-bottom: 4px; }
@media print {
  .site-header, .site-footer, .app-head, .invoice-side, .toast, .chat-widget, .chat-bubble { display: none !important; }
  .invoice-layout { display: block; }
  .panel { box-shadow: none !important; padding: 0 !important; }
  body, .app-page { background: #fff !important; }
}

.part-fields[hidden] { display: none; }
/* Client page and timeline (072) */
.client-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.client-actions { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; max-width: 460px; }
.timeline { list-style: none; margin: 12px 0 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { display: flex; gap: 12px; padding: 8px 0 12px 14px; position: relative; }
.timeline li.empty { color: #6b7280; }
.timeline .tl-icon { flex: 0 0 28px; height: 28px; margin-left: -29px; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: grid; place-items: center; font-size: 14px; }
.timeline time { font-size: 13px; color: #475467; }
.timeline .tl-title { margin: 2px 0; font-weight: 600; }
.timeline .tl-detail { margin: 2px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline p { margin: 0; }
.tl-money .tl-icon { border-color: #067647; } .tl-support .tl-icon { border-color: var(--blue, #00b0f0); } .tl-note .tl-icon, .tl-email .tl-icon { border-color: var(--pink); }

/* Fields without a type (e.g. Subject) and message boxes use the full width of the form, like the other fields */
.field input:not([type]), .field input[type="url"], .field input[type="search"], .field textarea {
  width: 100%; font: inherit; color: var(--ink); padding: 11px 14px; border: 1px solid #c9ced6; border-radius: 6px; background: #fff;
}
.field textarea { resize: vertical; line-height: 1.5; min-height: 110px; }
.field input:not([type]):focus, .field textarea:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(236, 0, 140, .15); }
#cl-mail .field textarea { min-height: 260px; }
#cl-mail { width: min(760px, 100% - 32px); }
