/* Supplemental styles for the exclusion tabs (HIPAA / AI opt-out).
   The page reuses the Everest app shell and design system from styles.css; this
   file only adds the few pieces that view needs (the tab switcher, the
   Zendesk-style email conversation, the reason surfaces). Everything below
   builds on the brand tokens already defined in styles.css and follows the
   brand guideline: white panels, warm neutrals, forest green for key accents
   only, semantic colour for state, and restrained use of bold. */

/* ---- View header + tab switcher ---- */
.x-head { margin: 2px 0 6px; }
.x-sub { font-size: 12.5px; color: var(--txt-2); margin-top: 2px; }

.xtabs { display: flex; gap: 8px; margin: 16px 0 4px; }
.xtab {
  appearance: none; display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--line); background: var(--panel); color: var(--txt-2);
  border-radius: 9px; padding: 9px 12px; font: inherit; font-size: 12.5px; cursor: pointer;
  text-align: left;
}
.xtab:hover { background: var(--panel-2); }
.xtab.active { background: var(--accent-bg); border-color: var(--accent-dim); color: var(--accent); }
.xtab .xt-ic { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.xtab .xt-main { display: flex; flex-direction: column; min-width: 0; }
.xtab .xt-name { color: var(--txt); }
.xtab.active .xt-name { color: var(--accent); }
.xtab .xt-meta { font-size: 11px; color: var(--txt-3); }
.xtab .xt-count {
  font-family: var(--mono); font-size: 11px; min-width: 20px; height: 19px; padding: 0 6px;
  border-radius: 999px; display: flex; align-items: center; justify-content: center;
  background: var(--panel-2); color: var(--txt-2); margin-left: 2px;
}
.xtab.active .xt-count { background: var(--accent-soft); color: var(--accent); }

/* ---- Status + priority on list rows ---- */
.xstatus { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--txt-2); white-space: nowrap; }
.xstatus .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.xstatus.s-new { color: var(--info); background: var(--info-bg); border-color: transparent; }
.xstatus.s-open { color: var(--txt-2); background: var(--panel-2); border-color: var(--line); }
.xstatus.s-pending { color: var(--warning); background: var(--warning-bg); border-color: transparent; }
.xstatus.s-solved { color: var(--success); background: var(--success-bg); border-color: transparent; }
.xprio { display: inline-flex; align-items: center; gap: 6px; }
.xprio .pd { width: 7px; height: 7px; border-radius: 2px; background: var(--txt-3); flex: 0 0 auto; }
.xprio.p-urgent .pd { background: var(--error); }
.xprio.p-high .pd { background: var(--warning); }
.xprio.p-normal .pd { background: var(--accent-dim); }

/* ---- Reason banner (shown on the opened ticket) ---- */
.xreason {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--warning-bg); border: 1px solid var(--warm-300); border-radius: 10px;
  padding: 11px 14px; margin: 0 0 18px; font-size: 12.5px; color: var(--brown-700); line-height: 1.5;
}
.xreason .xr-ic { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; color: var(--warning); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.xreason .xr-strong { font-weight: 600; color: var(--brown-800); }

/* ---- Zendesk affordance chip ---- */
.xzd-chip {
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 10.5px;
  color: var(--txt-2); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 3px 9px;
}
.xzd-chip .zd-mark { width: 15px; height: 15px; border-radius: 4px; background: var(--brown-700); color: var(--white); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 10px; font-family: 'Inter', sans-serif; }
.xzd-chip .live { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

/* ---- Opened ticket: Zendesk-style email conversation (Everest skin) ---- */
.xticket-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 8px 0 16px; font-size: 12px; color: var(--txt-2); }
.xticket-meta .mk { color: var(--txt-3); }
.xticket-meta .mv { color: var(--txt); }
.xticket-meta .sep { width: 1px; height: 12px; background: var(--line); }

.xmail-thread { display: flex; flex-direction: column; gap: 18px; }
.xmail { display: flex; gap: 12px; }
.xmail-av { width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--white); font-size: 11px; background: var(--brown-400); }
.xmail-av img { width: 100%; height: 100%; object-fit: cover; }
.xmail-body { flex: 1; min-width: 0; }
.xmail-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.xmail-author { font-size: 13px; font-weight: 600; color: var(--txt); }
.xmail-role { font-size: 11px; color: var(--txt-3); }
.xmail-via { font-family: var(--mono); font-size: 10px; color: var(--txt-3); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
.xmail-time { margin-left: auto; font-size: 11px; color: var(--txt-3); white-space: nowrap; }
.xmail-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 13px; color: var(--txt); line-height: 1.55; white-space: pre-wrap; }
.xmail.is-agent .xmail-card { background: var(--accent-bg); border-color: var(--accent-dim); color: var(--brown-700); }
.xmail.is-internal .xmail-card { background: var(--warning-bg); border-color: var(--warm-300); }
.xmail-note-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--warning); margin-bottom: 6px; }
.xmail-note-tag svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.xmail-system { text-align: center; font-size: 11px; color: var(--txt-3); position: relative; margin: 2px 0; }
.xmail-system span { background: var(--bg); padding: 0 10px; position: relative; z-index: 1; }
.xmail-system::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line-soft); }

/* ---- Manual reply composer (Zendesk public reply / internal note) ---- */
.xreply { margin-top: 22px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); overflow: hidden; }
.xreply.k-internal { background: var(--warning-bg); border-color: var(--warm-300); }
.xreply-tabs { display: flex; gap: 2px; padding: 8px 10px 0; }
.xreply-tab { appearance: none; border: 0; background: transparent; font: inherit; font-size: 12px; color: var(--txt-2); padding: 7px 11px; border-radius: 7px 7px 0 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.xreply-tab .ct-d { width: 7px; height: 7px; border-radius: 50%; }
.xreply-tab[data-kind="public"] .ct-d { background: var(--accent); }
.xreply-tab[data-kind="internal"] .ct-d { background: var(--warning); }
.xreply-tab.active { color: var(--txt); background: var(--bg); }
.xreply.k-internal .xreply-tab.active[data-kind="internal"] { background: #f6e9cd; color: var(--warning); }
.xreply-to { display: flex; align-items: center; gap: 7px; padding: 9px 14px 0; font-size: 11.5px; color: var(--txt-3); }
.xreply-to .tov { color: var(--txt-2); }
.xreply textarea { width: 100%; border: 0; background: transparent; resize: none; padding: 10px 14px; font: inherit; font-size: 13px; color: var(--txt); min-height: 78px; line-height: 1.55; }
.xreply textarea:focus { outline: 0; }
.xreply textarea::placeholder { color: var(--txt-3); }
.xreply-bar { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line-soft); }
.xreply-ai { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--txt-3); }
.xreply-ai svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.xreply-tool { appearance: none; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 11.5px; color: var(--txt-2); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px; cursor: pointer; }
.xreply-tool:hover { background: var(--panel-2); color: var(--txt); }
.xreply-tool svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.xreply-tpl-wrap { position: relative; display: inline-flex; }
.xreply-tpl-menu { position: fixed; width: 330px; max-height: 184px; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 10px 28px rgba(0, 0, 0, .14); padding: 5px; z-index: 1000; }
.xreply-tpl-menu[hidden] { display: none; }
.xreply-tpl-item { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; appearance: none; border: 0; background: transparent; font: inherit; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.xreply-tpl-item + .xreply-tpl-item { margin-top: 1px; }
.xreply-tpl-item:hover { background: var(--panel-2); }
.xreply-tpl-item .tpl-label { font-size: 12.5px; font-weight: 600; color: var(--txt); }
.xreply-tpl-item .tpl-prev { font-size: 11.5px; color: var(--txt-3); line-height: 1.45; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.xreply-bar .sp { flex: 1; }
.xreply-status { font-size: 12px; color: var(--txt-2); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; font-family: 'Inter', sans-serif; }
.xreply.k-internal .xreply-status { background: var(--panel); }
.xbtn { appearance: none; border: 0; border-radius: 8px; font: inherit; font-size: 12.5px; padding: 8px 15px; cursor: pointer; background: var(--accent); color: var(--white); }
.xbtn:hover:not(:disabled) { background: var(--accent-hover); }
.xbtn:disabled { background: var(--panel-2); color: var(--txt-3); cursor: default; }
.xreply-confirm { display: none; align-items: center; gap: 7px; padding: 10px 14px; font-size: 11.5px; color: var(--success); border-top: 1px solid var(--line-soft); }
.xreply-confirm.show { display: flex; }
.xreply-confirm.err { color: var(--error); }
.xreply-confirm svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Right panel: customer context + reason (no Buddy AI) ---- */
.x-rt { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.x-rt-h { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--txt-3); margin-bottom: 10px; font-weight: 600; }

.xreason-card { display: flex; gap: 11px; align-items: flex-start; border: 1px solid var(--warm-300); background: var(--warning-bg); border-radius: 11px; padding: 13px 14px; }
.xreason-card .rc-ic { width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto; background: var(--white); border: 1px solid var(--warm-300); color: var(--warning); display: flex; align-items: center; justify-content: center; }
.xreason-card .rc-ic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.xreason-card .rc-title { font-size: 13px; font-weight: 600; color: var(--brown-800); }
.xreason-card .rc-note { font-size: 12px; color: var(--brown-700); line-height: 1.5; margin-top: 3px; }

.x-acct { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.x-acct-head { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.x-acct-logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-bg); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 12px; flex: 0 0 auto; }
.x-acct-name { font-size: 13px; font-weight: 600; }
.x-acct-dom { font-size: 11px; color: var(--txt-3); font-family: var(--mono); }
.x-acct-grid { display: grid; grid-template-columns: 1fr 1fr; }
.x-acct-cell { padding: 10px 14px; border-top: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); }
.x-acct-cell:nth-child(2n) { border-right: 0; }
.x-acct-cell .ck { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--txt-3); }
.x-acct-cell .cv { font-size: 13px; color: var(--txt); margin-top: 3px; }
.x-acct-cell .cv.hl { color: var(--accent); }
.x-contact { display: flex; align-items: center; gap: 9px; padding: 10px 14px; border-top: 1px solid var(--line-soft); }
.x-contact .ca { width: 26px; height: 26px; border-radius: 50%; background: var(--warm-200); color: var(--txt-2); display: flex; align-items: center; justify-content: center; font-size: 10px; flex: 0 0 auto; }
.x-contact .cn { font-size: 12.5px; color: var(--txt); }
.x-contact .cr { font-size: 11px; color: var(--txt-3); }
.x-contact .cprimary { margin-left: auto; font-size: 9.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--accent); background: var(--accent-bg); border-radius: 4px; padding: 2px 6px; }

.home-sla-done { color: var(--txt-3); }

/* ---- Empty / loading ---- */
.x-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 60px 24px; color: var(--txt-3); text-align: center; }
.x-empty svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.5; }
