:root {
  --navy: #002752;
  --navy-deep: #001b3b;
  --navy-light: #0d4a83;
  --red: #c22020;
  --red-dark: #951818;
  --ink: #142238;
  --muted: #637187;
  --line: #dfe6ef;
  --line-strong: #cbd7e6;
  --soft: #f4f7fb;
  --soft-blue: #edf5ff;
  --white: #fff;
  --green: #167a4d;
  --amber: #9a6500;
  --danger: #a52828;
  --shadow: 0 24px 60px rgba(0, 39, 82, .16);
  --shadow-soft: 0 14px 35px rgba(0, 39, 82, .09);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--soft);
}
button, input, select, textarea { font: inherit; }
a { color: var(--navy); }
code, pre, .mono-label { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; }

.shell { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, .9fr) minmax(420px, 1.1fr); }
.brand-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(42px, 8vw, 110px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--white);
  background: linear-gradient(145deg, var(--navy-deep) 0%, var(--navy) 58%, #063b73 100%);
}
.brand-panel::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border: 90px solid rgba(255, 255, 255, .05);
  border-radius: 50%;
  right: -210px;
  bottom: -160px;
}
.mark {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: var(--white);
  color: var(--navy);
  font-weight: 900;
  letter-spacing: -2px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .2);
  margin-bottom: 34px;
}
.eyebrow { font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 14px; }
.brand-panel .eyebrow { color: #bdd7f3; }
.brand-panel h1 { font-size: clamp(3rem, 7vw, 6.4rem); letter-spacing: -.06em; line-height: .9; margin: 0 0 28px; }
.intro { font-size: clamp(1rem, 1.6vw, 1.25rem); line-height: 1.7; max-width: 650px; color: #d9e8f8; margin: 0; }
.status { margin-top: 42px; display: flex; align-items: center; gap: 10px; font-weight: 700; color: #dcecff; }
.status span, .secure-indicator span { width: 10px; height: 10px; border-radius: 50%; background: #56d58c; box-shadow: 0 0 0 7px rgba(86, 213, 140, .14); }
.milestone-strip { position: relative; z-index: 1; margin-top: 34px; display: flex; flex-wrap: wrap; gap: 8px; }
.milestone-strip span, .milestone-strip strong { padding: 7px 10px; border-radius: 999px; font-size: .75rem; background: rgba(255,255,255,.09); color: #dcecff; }
.milestone-strip strong { background: rgba(86,213,140,.18); color: #e9fff2; }

.login-panel { padding: clamp(28px, 7vw, 94px); display: grid; place-items: center; }
.card { width: min(620px, 100%); padding: clamp(30px, 5vw, 58px); background: var(--white); border: 1px solid var(--line); border-radius: 30px; box-shadow: var(--shadow); }
.card .eyebrow { color: var(--red); }
.card h2 { font-size: clamp(2rem, 4vw, 3.45rem); line-height: 1.04; letter-spacing: -.045em; margin: 0 0 22px; color: var(--navy); }
.card > p { font-size: 1.03rem; line-height: 1.75; color: var(--muted); }
dl { margin: 34px 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
dl div { display: flex; justify-content: space-between; gap: 24px; padding: 17px 20px; background: #fff; }
dl div + div { border-top: 1px solid var(--line); }
dt { color: var(--muted); }
dd { font-weight: 800; color: var(--navy); margin: 0; text-align: right; }
.notice { padding: 18px 20px; border-left: 4px solid var(--red); background: #fff5f5; border-radius: 0 14px 14px 0; color: #603232 !important; }
.login-help { margin: 28px 0 0; padding: 18px; border: 1px solid #cfe0f2; border-radius: 16px; background: var(--soft-blue); }
.login-help strong { color: var(--navy); }
.login-help p { margin: 8px 0 0; color: var(--muted); line-height: 1.6; }

.form-stack { display: grid; gap: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .form-action { align-self: end; }
label { display: grid; gap: 8px; font-weight: 750; color: var(--ink); }
input, select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--navy-light); box-shadow: 0 0 0 4px rgba(13, 74, 131, .12); }
.checkbox-line { display: flex; align-items: flex-start; gap: 10px; font-weight: 650; }
.checkbox-line input, .check-grid input { width: 18px; min-height: 18px; height: 18px; margin-top: 2px; }
.field-note { display: block; font-size: .84rem; line-height: 1.5; color: var(--muted); }
.password-guidance { display: flex; flex-wrap: wrap; gap: 8px; padding: 15px; border-radius: 14px; background: var(--soft); }
.password-guidance strong { width: 100%; color: var(--navy); }
.password-guidance span { padding: 5px 8px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
.form-feedback { min-height: 24px; margin: 0; color: var(--danger); }
.form-feedback.valid { color: var(--green); }
.validation-list { margin: 0 0 20px; padding: 14px 14px 14px 34px; background: #fff7ea; border-radius: 12px; color: #664400; }

.button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.button.primary { background: var(--navy); color: var(--white); }
.button.primary:hover { background: var(--navy-light); }
.button.secondary { background: var(--white); color: var(--navy); border-color: var(--line-strong); }
.button.secondary:hover { background: var(--soft-blue); }
.button.danger { background: #fff4f4; color: var(--danger); border-color: #efc6c6; }
.button.small { min-height: 37px; padding: 7px 11px; font-size: .82rem; }
.button.wide { width: 100%; }
.link-button { border: 0; padding: 0; background: none; color: #cfe3f8; cursor: pointer; font-weight: 750; }
.alert { padding: 14px 16px; margin: 0 0 20px; border-radius: 12px; font-weight: 650; line-height: 1.5; }
.alert.success { color: #075e3a; background: #e9f8f0; border: 1px solid #b8e5ce; }
.alert.error { color: #7a1717; background: #fff0f0; border: 1px solid #efc5c5; }

/* Admin application */
.admin-body { background: #eef3f8; }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.admin-sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 26px 20px; color: var(--white); background: linear-gradient(180deg, var(--navy-deep), var(--navy)); }
.admin-brand { display: flex; align-items: center; gap: 12px; color: var(--white); text-decoration: none; }
.admin-brand span { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: var(--white); color: var(--navy); font-weight: 900; }
.admin-brand strong { font-size: 1.07rem; }
.admin-nav { display: grid; gap: 7px; margin-top: 42px; }
.admin-nav a { padding: 12px 14px; border-radius: 11px; color: #cfe3f8; text-decoration: none; font-weight: 700; }
.admin-nav a:hover, .admin-nav a.active { color: var(--white); background: rgba(255,255,255,.12); }
.admin-user { margin-top: auto; padding: 16px 14px; border: 1px solid rgba(255,255,255,.13); border-radius: 14px; background: rgba(0,0,0,.1); }
.admin-user strong, .admin-user span { display: block; }
.admin-user span { margin: 4px 0 12px; color: #bdd7f3; font-size: .82rem; }
.admin-workspace { min-width: 0; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px clamp(22px, 4vw, 52px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); }
.admin-topbar .eyebrow { color: var(--red); margin-bottom: 6px; }
.admin-topbar h1 { margin: 0; color: var(--navy); font-size: clamp(1.8rem, 3vw, 2.7rem); letter-spacing: -.04em; }
.secure-indicator { display: flex; align-items: center; gap: 10px; color: var(--green); font-weight: 750; }
.admin-content { display: grid; gap: 24px; padding: clamp(22px, 4vw, 52px); }
.admin-footer { padding: 20px clamp(22px, 4vw, 52px) 34px; color: var(--muted); font-size: .82rem; }

.hero-card { display: flex; justify-content: space-between; gap: 30px; padding: clamp(24px, 4vw, 38px); border-radius: 22px; background: linear-gradient(135deg, var(--navy), #0c4b86); color: var(--white); box-shadow: var(--shadow-soft); }
.hero-card.compact { align-items: center; }
.hero-card .eyebrow { color: #bcd8f4; }
.hero-card h2 { margin: 0 0 10px; font-size: clamp(1.7rem, 3vw, 2.6rem); }
.hero-card p { max-width: 760px; margin: 0; line-height: 1.65; color: #dceafb; }
.mode-panel { width: min(320px, 100%); padding: 18px; border-radius: 16px; background: rgba(255,255,255,.1); }
.mode-panel strong, .mode-panel small { display: block; }
.mode-panel strong { margin: 10px 0 7px; }
.mode-panel small { line-height: 1.5; color: #dceafb; }

.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.metric-grid.compact-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric { padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: var(--white); box-shadow: var(--shadow-soft); }
.metric span, .metric small { display: block; color: var(--muted); }
.metric strong { display: block; margin: 7px 0 4px; color: var(--navy); font-size: 2rem; }
.metric small { font-size: .78rem; line-height: 1.4; }

.content-grid { display: grid; gap: 24px; }
.content-grid.two-thirds { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.content-grid.two-columns { grid-template-columns: 1fr 1fr; }
.panel { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 19px; background: var(--white); box-shadow: var(--shadow-soft); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.panel-heading .eyebrow { color: var(--red); margin-bottom: 5px; }
.panel-heading h2 { margin: 0; color: var(--navy); font-size: 1.45rem; }
.panel-heading a { font-weight: 750; text-decoration: none; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px; color: var(--muted); font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; text-align: left; border-bottom: 1px solid var(--line); }
td { padding: 15px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
td strong, td small { display: block; }
td small { margin-top: 4px; color: var(--muted); }

.badge { display: inline-flex; align-items: center; width: max-content; padding: 5px 9px; border-radius: 999px; font-size: .72rem; font-weight: 850; text-transform: capitalize; }
.badge.positive { color: #0c5c38; background: #e7f7ee; }
.badge.notice { color: #174f82; background: #e9f3fd; }
.badge.warning { color: #765000; background: #fff4d9; }
.badge.negative { color: #8a1e1e; background: #ffeded; }
.badge.neutral { color: #536173; background: #eef1f5; }

.channel-list { display: grid; gap: 10px; }
.channel-list article, .channel-admin-card header { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.channel-list article { padding: 14px; border: 1px solid var(--line); border-radius: 13px; }
.channel-list strong, .channel-list small { display: block; }
.channel-list small { color: var(--muted); margin-top: 4px; }
.channel-state { display: grid; justify-items: end; gap: 6px; }
.governance-panel > p { color: var(--muted); line-height: 1.7; }
.governance-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.governance-grid div { padding: 17px; border-radius: 14px; background: var(--soft); }
.governance-grid strong { color: var(--navy); }
.governance-grid p { margin: 8px 0 0; color: var(--muted); line-height: 1.55; font-size: .87rem; }

.secure-share { display: grid; gap: 16px; padding: 22px; border: 1px solid #a9d9c2; border-radius: 18px; background: #edfaf3; }
.secure-share h2 { margin: 0; color: var(--green); }
.secure-share p { margin: 5px 0 0; color: #315c49; }
.copy-row { display: flex; gap: 10px; }
.copy-row input { font-family: ui-monospace, monospace; }
.operator-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.operator-card { padding: 19px; border: 1px solid var(--line); border-radius: 17px; background: #fcfdff; }
.operator-card > header { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.operator-card h3, .operator-card p { margin: 0; }
.operator-card p { margin-top: 3px; color: var(--muted); font-size: .84rem; }
.avatar { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: var(--white); background: var(--navy); font-weight: 900; }
.compact-list { margin: 16px 0; border-radius: 12px; }
.compact-list div { padding: 10px 12px; font-size: .83rem; }
.inline-form { display: flex; align-items: end; gap: 10px; padding-top: 13px; border-top: 1px solid var(--line); }
.inline-form label { flex: 1; }
.department-form { display: grid; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
fieldset { margin: 0; padding: 13px; border: 1px solid var(--line); border-radius: 12px; }
legend { padding: 0 6px; color: var(--navy); font-weight: 800; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; }
.check-grid label { display: flex; gap: 8px; font-size: .78rem; font-weight: 600; }
.danger-zone { margin-top: 14px; }

.channel-admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.channel-admin-card header { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.channel-admin-card h2 { margin: 0; color: var(--navy); }
.mono-label { margin: 5px 0 0; color: var(--muted); font-size: .78rem; }
.metadata-details { margin-top: 16px; }
details summary { color: var(--navy); font-weight: 750; cursor: pointer; }
details pre { max-width: 100%; overflow: auto; padding: 13px; border-radius: 11px; color: #dbe9f7; background: #10243b; font-size: .76rem; white-space: pre-wrap; overflow-wrap: anywhere; }

.filter-bar { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(145px, .8fr)) auto; gap: 12px; align-items: end; margin-bottom: 20px; padding: 15px; border-radius: 14px; background: var(--soft); }
.filter-bar.audit-filters { grid-template-columns: 1fr 1fr auto; }
.conversation-list, .audit-list { display: grid; gap: 11px; }
.conversation-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 16px; border: 1px solid var(--line); border-radius: 15px; }
.conversation-channel { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--white); background: var(--navy); font-weight: 900; }
.conversation-channel.whatsapp { background: #17724a; }
.conversation-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.conversation-main > p { margin: 8px 0; color: var(--muted); line-height: 1.55; }
.conversation-meta { display: flex; flex-wrap: wrap; gap: 7px 13px; color: var(--muted); font-size: .76rem; }
.conversation-state { display: grid; justify-items: end; gap: 7px; }
.priority { font-size: .72rem; font-weight: 800; text-transform: uppercase; color: var(--muted); }
.priority.high, .priority.urgent { color: var(--danger); }
.conversation-state small { color: var(--muted); font-size: .7rem; }

.audit-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 170px; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; }
.audit-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: #e9f8f0; font-weight: 900; }
.audit-heading { display: flex; justify-content: space-between; gap: 12px; }
.audit-heading span { color: var(--muted); font-size: .78rem; }
.audit-main p { margin: 7px 0; color: var(--muted); line-height: 1.5; }
.audit-hash { display: grid; align-content: start; gap: 4px; }
.audit-hash span { color: var(--muted); font-size: .68rem; text-transform: uppercase; }
.audit-hash code { margin-bottom: 7px; color: var(--navy); font-size: .72rem; }
.empty-state { padding: 50px 24px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 17px; background: var(--white); }
.empty-state.compact { padding: 28px 18px; }
.empty-state h2, .empty-state h3 { color: var(--navy); }
.empty-state p { color: var(--muted); line-height: 1.6; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .content-grid.two-thirds, .content-grid.two-columns { grid-template-columns: 1fr; }
  .governance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .operator-grid, .channel-admin-grid { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .brand-panel { min-height: 48vh; padding: 48px 28px; }
  .brand-panel h1 { font-size: 3.6rem; }
  .login-panel { padding: 26px 18px 44px; }
  .card { border-radius: 24px; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; height: auto; padding: 18px; }
  .admin-nav { display: flex; gap: 6px; overflow-x: auto; margin: 20px 0; }
  .admin-nav a { white-space: nowrap; }
  .admin-user { margin-top: 0; }
  .admin-topbar, .hero-card { align-items: flex-start; flex-direction: column; }
  .metric-grid, .metric-grid.compact-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .conversation-row { grid-template-columns: 42px minmax(0, 1fr); }
  .conversation-state { grid-column: 2; justify-items: start; }
  .audit-row { grid-template-columns: 34px minmax(0, 1fr); }
  .audit-hash { grid-column: 2; }
}

@media (max-width: 560px) {
  .form-grid, .metric-grid, .metric-grid.compact-metrics, .governance-grid, .filter-bar, .filter-bar.audit-filters, .check-grid { grid-template-columns: 1fr; }
  .copy-row, .inline-form { align-items: stretch; flex-direction: column; }
  .admin-topbar { padding: 20px; }
  .admin-content { padding: 18px; }
  .panel { padding: 18px; }
  .operator-card > header { grid-template-columns: auto 1fr; }
  .operator-card > header .badge { grid-column: 2; }
  .audit-heading { flex-direction: column; }
}


/* M8 omnichannel operations */
.metric-grid.compact-metrics { grid-template-columns: repeat(5,minmax(0,1fr)); }
.admin-brand img { width: 46px; height: 46px; object-fit: contain; padding: 4px; border-radius: 13px; background: #fff; }
.admin-brand .brand-copy { display: grid; gap: 2px; }
.admin-brand .brand-copy small { color: #bcd8f4; font-size: .67rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.admin-menu-toggle { display: none; width: 44px; height: 44px; border: 1px solid rgba(255,255,255,.2); border-radius: 12px; color: #fff; background: rgba(255,255,255,.1); font-size: 1.25rem; }
.user-identity { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.user-identity .agent-avatar { flex: 0 0 auto; }
.user-copy { min-width: 0; }
.user-copy strong, .user-copy span, .user-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy small { display: block; color: #8fb9e0; font-size: .7rem; }
.agent-avatar, .message-avatar { display: grid; place-items: center; overflow: hidden; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #0d4a83, #002752); font-weight: 900; }
.agent-avatar { width: 46px; height: 46px; }
.message-avatar { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 12px; font-size: .72rem; }
.agent-avatar img, .message-avatar img { width: 100%; height: 100%; object-fit: cover; }

.conversation-command-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow-soft); }
.conversation-command-bar h2 { margin: 2px 0 8px; color: var(--navy); }
.command-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.handover-pill { padding: 6px 10px; border-radius: 999px; color: #174f82; background: #e9f3fd; font-size: .72rem; font-weight: 850; text-transform: capitalize; }
.handover-pill.queued, .handover-pill.requested { color: #7a4100; background: #fff1d2; }
.handover-pill.human_active { color: #075e3a; background: #e9f8f0; }
.sla-timer { min-width: 150px; padding: 7px 10px; border-radius: 10px; color: #765000; background: #fff4d9; font-size: .76rem; font-weight: 800; text-align: center; }
.sla-timer.breached { color: #8a1e1e; background: #ffeded; animation: nac-sla-pulse 1.8s ease-in-out infinite; }
@keyframes nac-sla-pulse { 50% { box-shadow: 0 0 0 5px rgba(194,32,32,.1); } }

.support-desk-grid { display: grid; grid-template-columns: minmax(235px, .78fr) minmax(430px, 1.7fr) minmax(285px, .95fr); gap: 16px; min-height: calc(100vh - 245px); }
.support-desk-grid > .panel { padding: 0; overflow: hidden; }
.conversation-queue, .conversation-centre, .conversation-inspector { min-height: 680px; }
.conversation-queue { display: flex; flex-direction: column; }
.sticky-heading { margin: 0; padding: 18px; border-bottom: 1px solid var(--line); }
.queue-search { padding: 12px; border-bottom: 1px solid var(--line); background: #f8fbfe; }
.queue-search input { min-height: 40px; }
.queue-items { display: grid; align-content: start; overflow-y: auto; max-height: calc(100vh - 355px); }
.queue-item { position: relative; display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 10px; padding: 13px 14px; color: var(--ink); border-bottom: 1px solid var(--line); text-decoration: none; }
.queue-item:hover { background: #f5f9fd; }
.queue-item.active { background: #eaf3fc; box-shadow: inset 4px 0 0 var(--navy-light); }
.queue-item .conversation-channel { width: 38px; height: 38px; border-radius: 12px; }
.queue-item-body { min-width: 0; }
.queue-item-body strong, .queue-item-body small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-item-body strong { font-size: .84rem; }
.queue-item-body small { margin-top: 5px; color: var(--muted); font-size: .69rem; }
.queue-alert { position: absolute; top: 10px; right: 10px; width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px rgba(194,32,32,.15); }

.conversation-centre { display: grid; grid-template-rows: auto minmax(320px,1fr) auto auto; }
.transcript-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 18px; border-bottom: 1px solid var(--line); background: #fcfdff; }
.assigned-identity { display: flex; align-items: center; gap: 10px; }
.assigned-identity strong, .assigned-identity small { display: block; }
.assigned-identity small { margin-top: 3px; color: var(--muted); font-size: .74rem; }
.secure-transcript { color: var(--green); font-size: .73rem; font-weight: 800; }
.conversation-centre .support-timeline { display: flex; flex-direction: column; gap: 15px; max-height: calc(100vh - 460px); min-height: 360px; overflow-y: auto; padding: 20px; background: linear-gradient(180deg,#f8fbfe,#f2f7fb); scroll-behavior: smooth; }
.timeline-message { display: flex; align-items: flex-start; gap: 10px; max-width: 82%; }
.timeline-message.client { align-self: flex-start; }
.timeline-message.operator, .timeline-message.virtual { align-self: flex-end; flex-direction: row-reverse; }
.message-card { min-width: 160px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 5px 17px 17px; background: #fff; box-shadow: 0 7px 20px rgba(0,39,82,.06); }
.timeline-message.operator .message-card { color: #fff; border-color: var(--navy); border-radius: 17px 5px 17px 17px; background: var(--navy); }
.timeline-message.virtual .message-card { border-color: #bfd9f0; border-radius: 17px 5px 17px 17px; background: #eaf4fd; }
.message-card header { display: flex; align-items: flex-start; gap: 10px; }
.message-card header > div { flex: 1; min-width: 0; }
.message-card header strong, .message-card header small { display: block; }
.message-card header small { margin-top: 2px; color: var(--muted); font-size: .68rem; }
.timeline-message.operator .message-card header small, .timeline-message.operator .message-card time, .timeline-message.operator .message-card footer { color: #bdd7f3; }
.message-card time { color: var(--muted); font-size: .64rem; white-space: nowrap; }
.timeline-body { margin-top: 9px; line-height: 1.55; overflow-wrap: anywhere; }
.message-card footer { display: flex; gap: 10px; margin-top: 9px; color: var(--muted); font-size: .64rem; text-transform: capitalize; }

.composer-shell { border-top: 1px solid var(--line); background: #fff; }
.composer-tabs { display: flex; border-bottom: 1px solid var(--line); }
.composer-tabs button { padding: 10px 16px; border: 0; border-bottom: 3px solid transparent; color: var(--muted); background: none; font-weight: 800; cursor: pointer; }
.composer-tabs button.active { color: var(--navy); border-bottom-color: var(--red); }
.composer-form { display: grid; gap: 10px; padding: 14px; }
.composer-form textarea { min-height: 82px; resize: vertical; }
.composer-form textarea:disabled { color: #637183; background: #f2f4f7; cursor: not-allowed; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.composer-actions > span { color: var(--muted); font-size: .73rem; line-height: 1.4; }
.composer-actions select { width: auto; min-width: 150px; min-height: 40px; }
.button:disabled { opacity: .55; cursor: not-allowed; }
.hidden { display: none !important; }
.internal-note-drawer { border-top: 1px solid var(--line); padding: 12px 16px; background: #fff9e9; }
.internal-note-drawer article { margin-top: 10px; padding: 12px; border-radius: 12px; background: #fff; }
.internal-note-drawer article header { display: flex; justify-content: space-between; gap: 10px; }
.internal-note-drawer article header span { color: var(--muted); font-size: .7rem; }
.internal-note-drawer article p { margin: 8px 0 0; line-height: 1.55; }

.conversation-inspector { overflow-y: auto !important; max-height: calc(100vh - 245px); }
.inspector-section, .inspector-action { display: grid; gap: 10px; padding: 17px; border-bottom: 1px solid var(--line); }
.inspector-section h2 { margin: 0; color: var(--navy); font-size: 1.18rem; }
.inspector-section .compact-list { margin: 0; }
.inspector-action summary { color: var(--navy); font-weight: 850; cursor: pointer; }
.inspector-action.priority-action { margin: 12px; border: 1px solid #efc77a; border-radius: 14px; background: #fff8e9; }
.inspector-action.priority-action p { margin: -4px 0 3px; color: #765000; font-size: .78rem; }
.inspector-action.accounts-action { background: #f1f7fd; }
.amount-grid { display: grid; grid-template-columns: .7fr 1.3fr; gap: 8px; }
.payment-card, .handover-card { display: grid; gap: 5px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.payment-card span, .handover-card span { color: var(--muted); font-size: .74rem; }

@media (max-width: 1380px) {
  .support-desk-grid { grid-template-columns: minmax(220px,.75fr) minmax(410px,1.55fr) minmax(260px,.85fr); }
  .admin-content { padding: 24px; }
}
@media (max-width: 1120px) {
  .metric-grid.compact-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .support-desk-grid { grid-template-columns: minmax(220px,.7fr) minmax(430px,1.4fr); }
  .conversation-inspector { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); max-height: none; }
  .conversation-inspector > * { border-right: 1px solid var(--line); }
}
@media (max-width: 860px) {
  .metric-grid.compact-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .admin-menu-toggle { display: inline-grid; place-items: center; }
  .admin-brand { justify-content: space-between; }
  .admin-brand .brand-copy { margin-right: auto; }
  .admin-nav { display: none; flex-direction: column; overflow: visible; }
  .admin-sidebar.menu-open .admin-nav { display: flex; }
  .admin-user { display: none; }
  .admin-sidebar.menu-open .admin-user { display: block; }
  .conversation-command-bar { align-items: flex-start; flex-direction: column; }
  .command-status { justify-content: flex-start; }
  .support-desk-grid { grid-template-columns: 1fr; min-height: auto; }
  .conversation-queue, .conversation-centre, .conversation-inspector { min-height: auto; }
  .queue-items { max-height: 260px; }
  .conversation-centre .support-timeline { max-height: 52vh; min-height: 340px; }
  .conversation-inspector { grid-column: auto; grid-template-columns: 1fr; max-height: none; }
  .timeline-message { max-width: 94%; }
}
@media (max-width: 560px) {
  .metric-grid.compact-metrics { grid-template-columns: 1fr; }
  .admin-content { padding: 12px; gap: 13px; }
  .admin-topbar { padding: 15px 16px; }
  .admin-topbar h1 { font-size: 1.45rem; }
  .secure-indicator { font-size: .73rem; }
  .conversation-command-bar { padding: 15px; border-radius: 14px; }
  .command-status { width: 100%; }
  .sla-timer { flex: 1 1 100%; }
  .support-desk-grid { gap: 12px; }
  .conversation-centre .support-timeline { padding: 14px 10px; }
  .message-avatar { width: 32px; height: 32px; }
  .message-card { padding: 11px 12px; }
  .timeline-message { gap: 7px; max-width: 98%; }
  .message-card header { flex-wrap: wrap; }
  .message-card time { width: 100%; }
  .composer-actions { align-items: stretch; flex-direction: column; }
  .composer-actions .button, .composer-actions select { width: 100%; }
  .amount-grid { grid-template-columns: 1fr; }
}

.brand-panel .brand-logo{width:82px;height:82px;padding:8px;background:#fff}.brand-panel .brand-logo img{width:100%;height:100%;object-fit:contain}
