@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --ink: #172522;
  --muted: #6d7c78;
  --line: #e3e9e7;
  --line-strong: #d4ddda;
  --brand: #0f766e;
  --brand-dark: #0b5f59;
  --brand-soft: #e5f4f1;
  --lime: #c7f166;
  --wa: #1fae70;
  --web: #5e6ad2;
  --warning: #c87922;
  --warning-soft: #fff1d9;
  --danger: #d04b4b;
  --note: #fff8dc;
  --shadow-sm: 0 1px 2px rgba(17, 38, 33, .05);
  --shadow-md: 0 16px 42px rgba(15, 50, 43, .12);
  --radius: 16px;
  font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; }
body { margin: 0; overflow: hidden; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(15, 118, 110, .18); outline-offset: 2px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.is-hidden { display: none !important; }
.subtle { color: var(--muted); }

.auth-shell { min-height: 100%; display: grid; grid-template-columns: minmax(430px, 1.05fr) minmax(480px, .95fr); background: var(--surface); }
.auth-brand { position: relative; overflow: hidden; display: flex; padding: 58px clamp(42px, 6vw, 92px); color: white; background: #0b5f59; }
.auth-brand::before, .auth-brand::after { content: ''; position: absolute; border-radius: 999px; pointer-events: none; }
.auth-brand::before { width: 620px; height: 620px; left: -270px; bottom: -370px; border: 1px solid rgba(255,255,255,.1); box-shadow: 0 0 0 80px rgba(255,255,255,.025), 0 0 0 160px rgba(255,255,255,.018); }
.auth-brand::after { width: 360px; height: 360px; right: -180px; top: -160px; background: rgba(199,241,102,.1); }
.auth-brand__content { position: relative; z-index: 1; width: min(600px, 100%); display: flex; flex-direction: column; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font: 800 21px 'Manrope', sans-serif; text-decoration: none; letter-spacing: -.04em; }
.brand > span:last-child > span { color: var(--brand); }
.brand--light { color: white; }
.brand--light > span:last-child > span { color: var(--lime); }
.brand-mark { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--lime); color: #16433d; font: 800 20px 'Manrope'; box-shadow: inset 0 -2px 0 rgba(0,0,0,.07); }
.brand-logo-link { display: inline-flex; width: max-content; align-items: center; text-decoration: none; }
.brand-logo-link--dark { padding: 8px 12px; border: 1px solid rgba(255,255,255,.28); border-radius: 15px; background: rgba(255,255,255,.96); box-shadow: 0 9px 26px rgba(3,37,33,.18); }
.brand-logo-wide { display: block; width: clamp(154px, 14vw, 190px); height: auto; object-fit: contain; }
.brand-symbol { display: block; width: 100%; height: 100%; border-radius: 10px; object-fit: contain; }
.auth-copy { margin: auto 0; max-width: 560px; }
.eyebrow { display: block; color: var(--lime); font-size: 12px; line-height: 1.4; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow--green { color: var(--brand); }
.eyebrow--danger { color: var(--danger); }
.auth-copy h1 { margin: 18px 0 20px; max-width: 530px; font: 800 clamp(40px, 4.4vw, 68px)/1.08 'Manrope', sans-serif; letter-spacing: -.055em; }
.auth-copy p { max-width: 520px; margin: 0; color: rgba(255,255,255,.73); font-size: 17px; line-height: 1.7; }
.auth-proof { display: flex; flex-wrap: wrap; gap: 22px; color: rgba(255,255,255,.72); font-size: 13px; }
.auth-proof span { display: inline-flex; align-items: center; gap: 7px; }
.auth-proof svg { width: 16px; color: var(--lime); }
.auth-panel { display: grid; place-items: center; padding: 50px clamp(35px, 7vw, 105px); }
.login-card { width: min(430px, 100%); }
.login-mobile-brand { display: none; margin-bottom: 48px; }
.login-card h2 { margin: 10px 0 8px; font: 800 34px/1.18 'Manrope', sans-serif; letter-spacing: -.045em; }
.login-card > .subtle { margin: 0 0 35px; }
.field-label { display: block; margin: 18px 0 8px; font-size: 13px; font-weight: 700; }
.input-wrap { position: relative; }
.input-wrap input, .input-wrap select { width: 100%; height: 48px; border: 1px solid var(--line-strong); border-radius: 11px; padding: 0 14px; background: var(--surface); transition: .2s border, .2s box-shadow; }
.input-wrap input:hover, .input-wrap select:hover { border-color: #aebdb9; }
.input-wrap input:focus, .input-wrap select:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,118,110,.1); }
.input-wrap--password input { padding-right: 50px; }
.input-action { position: absolute !important; right: 5px; top: 5px; }
.form-error { min-height: 20px; margin-top: 8px; color: var(--danger); font-size: 13px; }
.primary-btn, .secondary-btn, .danger-btn { border: 0; border-radius: 11px; min-height: 42px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; transition: .18s transform, .18s background, .18s border; }
.primary-btn { background: var(--brand); color: white; box-shadow: 0 5px 14px rgba(15,118,110,.18); }
.primary-btn:hover { background: var(--brand-dark); transform: translateY(-1px); }
.primary-btn:disabled { opacity: .55; cursor: wait; transform: none; }
.secondary-btn { background: white; color: var(--ink); border: 1px solid var(--line-strong); }
.secondary-btn:hover { background: var(--surface-soft); border-color: #bac8c4; }
.danger-btn { background: var(--danger); color: white; box-shadow: 0 5px 14px rgba(208,75,75,.18); }
.danger-btn:hover { background: #b73d3d; transform: translateY(-1px); }
.danger-btn:disabled { opacity: .55; cursor: wait; transform: none; }
.secondary-btn svg, .primary-btn svg, .danger-btn svg { width: 17px; }
.login-btn { width: 100%; min-height: 50px; margin-top: 5px; justify-content: space-between; padding: 0 17px 0 20px; }
.login-btn svg { width: 18px; }
.secure-note { display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted); font-size: 12px; margin-top: 22px; }
.super-link { display: block; margin-top: 13px; color: var(--brand); font-size: 11px; font-weight: 600; text-align: center; text-decoration: none; }
.super-link:hover { text-decoration: underline; }
.status-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #2bb673; box-shadow: 0 0 0 3px rgba(43,182,115,.12); }

.app-shell { width: 100%; height: 100dvh; display: grid; grid-template-columns: 76px minmax(0, 1fr); background: var(--surface); transition: grid-template-columns .22s ease; }
.app-shell.sidebar-expanded { grid-template-columns: 256px minmax(0, 1fr); }
.rail { position: relative; z-index: 40; display: flex; flex-direction: column; align-items: center; overflow: visible; background: #0b5f59; padding: 18px 10px; color: white; transition: padding .22s ease, background .22s ease; }
.brand-mark--app { width: 44px; height: 44px; padding: 4px; overflow: hidden; border: 1px solid rgba(255,255,255,.42); background: #fff; box-shadow: 0 7px 18px rgba(3,42,37,.2); transition: width .22s ease, height .22s ease, padding .22s ease, border-radius .22s ease; }
.brand-mark--app .rail-logo-wide { display: none; }
.sidebar-toggle { position: absolute; z-index: 4; top: 73px; right: -13px; width: 27px; height: 27px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(11,95,89,.22); border-radius: 50%; background: white; color: var(--brand-dark); box-shadow: 0 5px 14px rgba(9,49,43,.16); transition: transform .2s ease, background .2s ease; }
.sidebar-toggle:hover { background: var(--lime); }
.sidebar-toggle svg { width: 15px; height: 15px; transition: transform .22s ease; }
.rail-nav { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 34px; }
.rail-link { position: relative; width: 100%; height: 50px; padding: 0; display: grid; place-items: center; background: transparent; color: rgba(255,255,255,.62); border: 0; border-radius: 12px; transition: color .18s ease, background .18s ease; }
.rail-link:hover { color: white; background: rgba(255,255,255,.08); }
.rail-link.is-active { color: var(--lime); background: rgba(255,255,255,.12); }
.rail-link svg { width: 22px; height: 22px; }
.rail-link span { display: none; }
.rail-link::after { content: attr(data-tooltip); position: absolute; left: 58px; top: 50%; z-index: 10; transform: translate(4px,-50%); padding: 6px 9px; border-radius: 7px; background: #1b2a27; color: white; font-size: 12px; opacity: 0; visibility: hidden; transition: .15s; white-space: nowrap; box-shadow: var(--shadow-md); }
.rail-link:hover::after { opacity: 1; visibility: visible; transform: translate(0,-50%); }
.rail-account { width: 100%; margin-top: auto; position: relative; }
.rail-account-trigger { width: 100%; display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: white; text-align: left; }
.rail-account-copy,.rail-account-chevron { display: none; }
.rail-account-copy { min-width: 0; }
.rail-account-copy strong,.rail-account-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-account-copy strong { font-size: 11px; }
.rail-account-copy small { margin-top: 2px; color: rgba(255,255,255,.56); font-size: 9px; }
.rail-account-chevron { width: 17px; height: 17px; color: rgba(255,255,255,.78); }
.avatar, .mobile-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); background: #d9efb0; color: #315048; font-weight: 800; }
.account-menu { position: absolute; left: 51px; bottom: 0; z-index: 100; width: 265px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: white; color: var(--ink); box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; transform: translateX(-6px); transition: .18s; }
.account-menu.is-open { opacity: 1; pointer-events: auto; transform: none; }
.account-menu > div { padding: 7px 8px 11px; border-bottom: 1px solid var(--line); }
.account-menu strong, .account-menu small { display: block; overflow: hidden; text-overflow: ellipsis; }
.account-menu small { color: var(--muted); margin-top: 3px; }
.build-label { margin-top: 4px !important; color: #9aa7a3 !important; font-size: 8px !important; font-family: ui-monospace,SFMono-Regular,Consolas,monospace; }
.presence-control { display: flex; align-items: center; gap: 8px; margin: 8px 0 2px; padding: 8px; border-bottom: 1px solid var(--line); }
.presence-control select { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 11px; font-weight: 700; }
.notification-control { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 8px 5px; color: #31433f; font-size: 10.5px; font-weight: 700; }
.notification-control span { display: inline-flex; align-items: center; gap: 7px; }
.notification-control svg,.mobile-notification svg { width: 16px; height: 16px; }
.notification-control input,.mobile-notification input { width: 34px; height: 19px; accent-color: var(--brand); cursor: pointer; }
.notification-help { padding: 0 8px 7px; color: var(--muted) !important; font-size: 8.5px !important; line-height: 1.4; }
.notification-sound-control { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 8px 5px; padding: 7px 0 9px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9.5px; font-weight: 700; }
.notification-sound-control select { width: 105px; height: 30px; padding: 0 7px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--ink); font-size: 9.5px; }
.presence-dot,.member-presence::before { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #2bb673; box-shadow: 0 0 0 3px rgba(43,182,115,.12); }
.presence-control.is-busy .presence-dot,.member-presence.is-busy::before { background: #d47b25; box-shadow: 0 0 0 3px rgba(212,123,37,.12); }
.presence-control.is-away .presence-dot,.member-presence.is-away::before { background: #d2a72b; box-shadow: 0 0 0 3px rgba(210,167,43,.12); }
.presence-control.is-offline .presence-dot,.member-presence.is-offline::before { background: #9ca8a5; box-shadow: none; }
.account-menu button { width: 100%; margin-top: 6px; display: flex; align-items: center; gap: 9px; border: 0; background: transparent; border-radius: 8px; padding: 9px 8px; color: var(--danger); font-weight: 600; }
.account-menu button:hover { background: #fff3f3; }
.account-menu svg { width: 18px; }

.app-shell.sidebar-expanded .rail { align-items: stretch; padding: 25px 18px; background: #0b5f59; }
.app-shell.sidebar-expanded .brand-mark--app { width: 186px; height: auto; min-height: 70px; padding: 7px 10px; border-radius: 14px; }
.app-shell.sidebar-expanded .brand-mark--app .rail-logo-wide { display: block; width: 166px; max-width: 100%; height: auto; object-fit: contain; }
.app-shell.sidebar-expanded .brand-mark--app .brand-symbol { display: none; }
.app-shell.sidebar-expanded .sidebar-toggle { top: 81px; }
.app-shell.sidebar-expanded .sidebar-toggle svg { transform: rotate(180deg); }
.app-shell.sidebar-expanded .rail-nav { margin-top: 42px; }
.app-shell.sidebar-expanded .rail-link { height: 48px; display: flex; justify-content: flex-start; gap: 12px; padding: 0 14px; font-weight: 700; text-align: left; }
.app-shell.sidebar-expanded .rail-link span { display: inline; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-shell.sidebar-expanded .rail-link::after { display: none; }
.app-shell.sidebar-expanded .rail-account { padding-top: 17px; border-top: 1px solid rgba(255,255,255,.1); }
.app-shell.sidebar-expanded .rail-account-trigger { grid-template-columns: 38px minmax(0,1fr) 20px; gap: 10px; place-items: center stretch; border-radius: 11px; }
.app-shell.sidebar-expanded .rail-account-trigger:hover { background: rgba(255,255,255,.06); }
.app-shell.sidebar-expanded .rail-account-copy { display: block; }
.app-shell.sidebar-expanded .rail-account-chevron { display: block; justify-self: end; }
.app-shell.sidebar-expanded .account-menu { left: calc(100% + 14px); }

.workspace { position: relative; min-width: 0; min-height: 0; display: grid; grid-template-columns: 350px minmax(360px,1fr) 305px; overflow: hidden; }
.workspace.details-closed { grid-template-columns: 350px minmax(360px,1fr) 0; }
.workspace.details-closed .details-pane { display: none; }
.inbox-pane, .chat-pane, .details-pane { min-width: 0; min-height: 0; background: white; }
.inbox-pane { display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.pane-header { min-height: 91px; display: flex; align-items: center; justify-content: space-between; padding: 17px 20px 11px; }
.workspace-name { display: block; margin-bottom: 3px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .075em; text-transform: uppercase; }
.inbox-heading h1, .page-header h1 { display: flex; align-items: center; gap: 9px; margin: 0; font: 800 25px 'Manrope', sans-serif; letter-spacing: -.04em; }
.count-pill { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); font: 700 12px 'DM Sans'; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted); }
.icon-btn:hover { background: var(--surface-soft); color: var(--ink); }
.icon-btn svg { width: 19px; }
.inbox-tools { padding: 0 14px 12px; border-bottom: 1px solid var(--line); }
.scope-row { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 8px; padding: 4px; border-radius: 10px; background: #eef3f1; }
.scope-chip { min-height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; }
.scope-chip.is-active { background: white; color: var(--brand-dark); box-shadow: var(--shadow-sm); }
.search-box { height: 42px; display: flex; align-items: center; gap: 9px; padding: 0 12px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 11px; color: #84918e; }
.search-box:focus-within { background: white; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,118,110,.08); }
.search-box svg { width: 17px; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 13px; }
.filter-row { display: flex; gap: 6px; margin-top: 11px; overflow-x: auto; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; height: 30px; padding: 0 11px; border: 1px solid var(--line); border-radius: 99px; background: white; color: var(--muted); font-size: 12px; font-weight: 600; }
.filter-chip:hover { border-color: #b8c7c3; color: var(--ink); }
.filter-chip.is-active { background: var(--brand-soft); color: var(--brand-dark); border-color: transparent; }
.conversation-list { flex: 1; overflow-y: auto; padding: 7px; scrollbar-color: #dbe4e1 transparent; scrollbar-width: thin; }
.conversation-item { width: 100%; display: grid; grid-template-columns: 44px minmax(0,1fr) auto; gap: 11px; align-items: start; padding: 12px 11px; border: 0; border-radius: 12px; background: transparent; text-align: left; transition: .15s background; }
.conversation-item:hover { background: var(--surface-soft); }
.conversation-item.is-active { background: var(--brand-soft); }
.customer-avatar { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; border-radius: 13px; background: #e8eceb; color: #43534f; font-weight: 800; text-transform: uppercase; }
.conversation-item:nth-child(5n+2) .customer-avatar { background: #f3eadb; color: #755a35; }
.conversation-item:nth-child(5n+3) .customer-avatar { background: #e7e8f7; color: #555c9e; }
.conversation-item:nth-child(5n+4) .customer-avatar { background: #e3f0e9; color: #327157; }
.conversation-body { min-width: 0; }
.conversation-name-row { display: flex; align-items: center; gap: 7px; }
.conversation-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 700; }
.channel-badge { flex: 0 0 auto; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; }
.channel-badge svg { width: 12px; height: 12px; stroke-width: 2.2; }
.channel-badge--whatsapp { color: var(--wa); background: #e6f7ef; }
.channel-badge--website { color: var(--web); background: #eceefe; }
.session-badge { flex: 0 0 auto; padding: 2px 6px; border-radius: 99px; background: #edf2f1; color: #60706b; font-size: 8.5px; font-weight: 800; }
.conversation-preview { margin-top: 4px; color: var(--muted); font-size: 12.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.conversation-submeta { display: flex; align-items: center; gap: 5px; min-width: 0; margin-top: 4px; }
.conversation-meta { min-width: 45px; text-align: right; }
.conversation-time { color: #8a9794; font-size: 10.5px; white-space: nowrap; }
.conversation-status-pill { display: block; width: max-content; margin: 9px 0 0 auto; padding: 3px 6px; border-radius: 99px; background: #e7f6ef; color: #168456; font-size: 8px; font-weight: 800; white-space: nowrap; }
.conversation-status-pill.is-pending { background: var(--warning-soft); color: #a5631e; }
.conversation-status-pill.is-resolved { background: #edf1f0; color: #74827e; }
.assignee-live { min-width: 0; display: inline-flex; align-items: center; gap: 4px; overflow: hidden; color: #6c7b77; font-size: 8.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.assignee-live i { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: #2bb673; }
.assignee-live.is-busy i { background: #d47b25; }
.assignee-live.is-away i { background: #d2a72b; }
.assignee-live.is-offline i,.assignee-live.is-unassigned i { background: #a8b2af; }
.list-empty, .list-loading { padding: 65px 22px; color: var(--muted); text-align: center; }
.list-empty svg { width: 34px; height: 34px; color: #9aaba7; margin-bottom: 12px; }
.list-empty strong { display: block; color: var(--ink); margin-bottom: 5px; }
.skeleton { height: 68px; margin: 3px 4px; border-radius: 11px; background: linear-gradient(90deg,#f2f5f4 25%,#fafbfb 42%,#f2f5f4 60%); background-size: 400% 100%; animation: shimmer 1.25s ease infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

.chat-pane { position: relative; min-width: 0; max-width: 100%; overflow: hidden; background: #f7f9f8; }
.chat-empty { height: 100%; display: grid; place-content: center; justify-items: center; padding: 30px; text-align: center; }
.chat-empty h2 { margin: 28px 0 7px; font: 800 22px 'Manrope'; letter-spacing: -.035em; }
.chat-empty p { max-width: 360px; margin: 0; color: var(--muted); font-size: 14px; }
.empty-illustration { position: relative; width: 230px; height: 125px; }
.bubble { position: absolute; padding: 12px 16px; border-radius: 17px 17px 17px 5px; box-shadow: 0 7px 18px rgba(44,76,68,.08); font-size: 13px; }
.bubble--one { top: 0; left: 0; background: white; }
.bubble--two { top: 49px; right: 0; background: var(--brand); color: white; border-radius: 17px 17px 5px; }
.bubble--three { bottom: 0; left: 30px; background: var(--lime); color: #25443d; }
.chat-active { width: 100%; max-width: 100%; height: 100%; min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
.chat-header { min-height: 72px; display: flex; align-items: center; gap: 11px; padding: 10px 18px; background: white; border-bottom: 1px solid var(--line); }
.back-button { display: none; }
.read-only-badge { margin-left: 5px; padding: 3px 6px; border-radius: 6px; background: #eef2f1; color: #667570; font-size: 8.5px; font-weight: 700; }
.takeover-btn { min-height: 34px; padding: 0 10px; border: 0; border-radius: 9px; background: var(--brand); color: white; font-size: 10.5px; font-weight: 700; }
.takeover-btn:hover { background: var(--brand-dark); }
.takeover-btn:disabled,.action-row:disabled,.composer-tool:disabled { cursor: not-allowed; opacity: .5; }
.chat-heading { min-width: 0; flex: 1; }
.chat-heading strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.chat-heading > span { display: flex; align-items: center; gap: 5px; margin-top: 3px; color: var(--muted); font-size: 11px; }
.channel-mini { width: 6px; height: 6px; border-radius: 50%; background: var(--wa); }
.channel-mini.is-website { background: var(--web); }
.chat-actions { display: flex; align-items: center; gap: 5px; }
.status-select-wrap { height: 34px; display: flex; align-items: center; gap: 5px; padding-left: 10px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.status-select-wrap select { max-width: 105px; height: 100%; padding: 0 7px 0 2px; border: 0; outline: 0; background: transparent; color: #485752; font-size: 11.5px; font-weight: 600; }
.status-select-wrap.is-pending .status-dot { background: var(--warning); box-shadow: 0 0 0 3px rgba(200,121,34,.12); }
.status-select-wrap.is-resolved .status-dot { background: #9aa8a4; box-shadow: none; }
.message-feed { width: 100%; max-width: 100%; min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 22px clamp(18px, 4vw, 55px) 18px; background-color: #f7f9f8; background-image: radial-gradient(#dce4e1 0.75px, transparent 0.75px); background-size: 18px 18px; scrollbar-width: thin; scrollbar-color: #d4ddda transparent; }
.date-divider { display: flex; align-items: center; gap: 13px; margin: 3px 0 22px; color: #87938f; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.date-divider::before, .date-divider::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.message-row { width: 100%; max-width: 100%; min-width: 0; display: flex; margin: 8px 0; }
.message-row.is-out { justify-content: flex-end; }
.message-bubble { min-width: 0; max-width: min(70%, 570px); overflow: hidden; padding: 10px 12px 7px; border: 1px solid var(--line); border-radius: 5px 15px 15px 15px; background: white; box-shadow: var(--shadow-sm); }
.message-row.is-out .message-bubble { border-color: #cce9e3; border-radius: 15px 5px 15px 15px; background: #dff3ee; }
.message-row.is-note { justify-content: center; margin: 13px 0; }
.message-row.is-note .message-bubble { max-width: 86%; border-color: #eadfa7; border-radius: 11px; background: var(--note); color: #66581a; }
.note-label { display: flex; align-items: center; gap: 5px; margin-bottom: 5px; color: #9b7a18; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.note-label svg { width: 12px; height: 12px; }
.message-text { font-size: 13.5px; line-height: 1.52; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-quote { display: grid; gap: 2px; margin: -3px -4px 8px; padding: 8px 9px; border-left: 3px solid var(--brand); border-radius: 8px; background: #f1f6f4; }
.message-row.is-out .message-quote { background: rgba(255,255,255,.6); }
.message-quote strong { overflow: hidden; color: var(--brand-dark); font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.message-quote span { overflow: hidden; color: #687873; font-size: 10.5px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.message-meta { display: flex; align-items: center; justify-content: flex-end; gap: 5px; min-height: 12px; margin-top: 4px; color: #81908c; font-size: 9.5px; }
.message-reply-button { width: 22px; height: 20px; display: grid; place-items: center; margin-right: auto; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #75847f; opacity: 0; transition: .15s; }
.message-bubble:hover .message-reply-button,.message-reply-button:focus-visible { background: rgba(255,255,255,.65); opacity: 1; outline: 0; }
.message-reply-button svg { width: 13px; height: 13px; }
.message-check { color: var(--brand); font-weight: 800; letter-spacing: -2px; }
.message-loading { height: 100%; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.composer-wrap { position: relative; z-index: 30; width: 100%; max-width: 100%; min-width: 0; overflow: visible; padding: 12px 16px 15px; background: white; border-top: 1px solid var(--line); }
.composer { position: relative; width: 100%; max-width: 100%; min-width: 0; border: 1px solid var(--line-strong); border-radius: 13px; background: white; box-shadow: 0 3px 13px rgba(28,60,52,.05); transition: .2s; }
.composer:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,118,110,.07); }
.composer.is-note { border-color: #dfc96d; background: #fffdf4; }
.composer textarea { display: block; width: 100%; max-height: 140px; min-height: 44px; resize: none; border: 0; outline: 0; padding: 13px 14px 4px; background: transparent; font-size: 13.5px; line-height: 1.5; }
.composer-footer { min-height: 42px; display: flex; align-items: center; justify-content: space-between; padding: 4px 7px 7px 9px; }
.composer-footer > div:first-child { min-width: 0; display: flex; align-items: center; gap: 2px; }
.composer-tool { height: 30px; display: inline-flex; align-items: center; gap: 6px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; }
.composer-tool:hover, .composer-tool.is-active { background: var(--warning-soft); color: #8a631a; }
.composer-tool svg { width: 15px; }
.emoji-picker { position: absolute; z-index: 30; left: 7px; bottom: 48px; width: min(310px,calc(100% - 14px)); display: grid; grid-template-columns: repeat(8,1fr); gap: 3px; padding: 9px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: var(--shadow-md); }
.emoji-picker button { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; font-size: 20px; }
.emoji-picker button:hover,.emoji-picker button:focus-visible { background: var(--brand-soft); }
.reply-template-picker { position: absolute; z-index: 35; left: 7px; bottom: 48px; width: min(440px,calc(100% - 14px)); max-height: min(430px,62vh); overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 18px 46px rgba(17,48,40,.18); }
.template-search { display: flex; align-items: center; gap: 8px; padding: 10px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.template-search svg { width: 17px; flex: 0 0 17px; color: var(--muted); }
.template-search input { width: 100%; height: 36px; border: 1px solid var(--line-strong); border-radius: 9px; padding: 0 10px; background: white; outline: 0; font-size: 11.5px; }
.template-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,118,110,.07); }
.template-picker-list { max-height: min(350px,50vh); overflow-y: auto; padding: 7px; }
.template-option { width: 100%; display: grid; gap: 3px; padding: 10px; border: 0; border-radius: 10px; background: white; color: var(--ink); text-align: left; }
.template-option:hover,.template-option:focus-visible { background: var(--brand-soft); outline: 0; }
.template-option strong { font-size: 11.5px; }
.template-option span { color: #53635f; font-size: 10.5px; line-height: 1.45; }
.template-option small { color: var(--brand); font-size: 9px; }
.template-picker-empty { padding: 28px 14px; color: var(--muted); font-size: 11px; text-align: center; }
.composer-wrap.locked { opacity: .68; }
.composer-wrap.locked .composer { pointer-events: none; }
.send-group { display: flex; align-items: center; gap: 10px; }
.keyboard-hint { color: #98a39f; font-size: 9px; }
.send-btn { width: 35px; height: 35px; display: grid; place-items: center; border: 0; border-radius: 10px; background: var(--brand); color: white; }
.send-btn:hover { background: var(--brand-dark); }
.send-btn:disabled { opacity: .45; cursor: wait; }
.send-btn svg { width: 17px; }
.note-banner { min-height: 37px; display: flex; align-items: center; gap: 8px; margin-bottom: 7px; padding: 3px 5px 3px 12px; border-radius: 10px; background: var(--warning-soft); color: #805b16; font-size: 11px; font-weight: 600; }
.note-banner > svg { width: 15px; }
.note-banner span { flex: 1; }
.note-banner .icon-btn { width: 28px; height: 28px; color: #805b16; }
.file-banner { background: var(--brand-soft); color: var(--brand-dark); }
.file-banner .icon-btn { color: var(--brand-dark); }
.reply-context-banner { min-height: 48px; display: grid; grid-template-columns: 18px minmax(0,1fr) 28px; align-items: center; gap: 9px; margin-bottom: 7px; padding: 7px 5px 7px 11px; border-left: 3px solid var(--brand); border-radius: 10px; background: var(--brand-soft); color: var(--brand-dark); }
.reply-context-banner > svg { width: 16px; height: 16px; }
.reply-context-banner span,.reply-context-banner strong,.reply-context-banner small { min-width: 0; display: block; }
.reply-context-banner strong,.reply-context-banner small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-context-banner strong { font-size: 10.5px; }
.reply-context-banner small { margin-top: 2px; color: #5f746e; font-size: 9.5px; }
.reply-context-banner .icon-btn { width: 28px; height: 28px; color: var(--brand-dark); }

.details-pane { border-left: 1px solid var(--line); }
.details-header { position: relative; z-index: 2; min-height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 17px; border-bottom: 1px solid var(--line); background: white; }
.details-header .icon-btn { position: relative; z-index: 3; flex: 0 0 38px; pointer-events: auto; }
.details-header h2 { margin: 0; font: 800 14px 'Manrope'; }
.details-scroll { height: calc(100% - 72px); overflow-y: auto; }
.profile-card { padding: 24px 20px 20px; text-align: center; }
.customer-avatar--large { width: 62px; height: 62px; margin: 0 auto 11px; border-radius: 20px; font-size: 20px; background: #e3f0e9; color: #326853; }
.profile-card h3 { margin: 0; font: 800 15px 'Manrope'; }
.profile-card p { margin: 5px 0 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.detail-section { padding: 17px; border-top: 1px solid var(--line); }
.section-label { display: block; margin-bottom: 12px; color: #93a09c; font-size: 9.5px; font-weight: 800; letter-spacing: .09em; }
.detail-row { display: flex; justify-content: space-between; gap: 15px; margin: 10px 0; font-size: 11.5px; }
.detail-row span { color: var(--muted); }
.detail-row strong { max-width: 55%; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.customer-history { display: grid; gap: 7px; margin-top: 9px; }
.history-card { width: 100%; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 8px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: white; text-align: left; }
.history-card:hover { border-color: #b8ccc6; background: var(--surface-soft); }
.history-card.is-current { border-color: #a8d5ca; background: var(--brand-soft); }
.history-card strong { overflow: hidden; color: var(--ink); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.history-card time,.history-card small { color: var(--muted); font-size: 8.5px; }
.history-card small { grid-column: 1/-1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-empty { color: var(--muted); font-size: 10px; line-height: 1.5; }
.compact-field { display: block; color: var(--muted); font-size: 10.5px; }
.compact-field select { width: 100%; height: 37px; margin-top: 7px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; background: white; font-size: 11px; outline: 0; }
.compact-field select:focus { border-color: var(--brand); }
.action-row { width: 100%; display: grid; grid-template-columns: 36px minmax(0,1fr) auto; gap: 9px; align-items: center; margin-top: 8px; padding: 8px; border: 0; border-radius: 10px; background: transparent; text-align: left; }
.action-row:hover { background: var(--surface-soft); }
.action-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; }
.action-icon svg { width: 17px; }
.action-icon--purple { background: #eceafe; color: #6659bf; }
.action-icon--orange { background: #fff0df; color: #b96c28; }
.action-row strong, .action-row small { display: block; }
.action-row strong { font-size: 11.5px; }
.action-row small { margin-top: 2px; color: var(--muted); font-size: 9.5px; }
.row-chevron { width: 15px; color: #9aa6a3; }
.toggle { position: relative; width: 29px; height: 17px; border-radius: 99px; background: #cfd8d5; transition: .18s; }
.toggle::after { content: ''; position: absolute; width: 13px; height: 13px; top: 2px; left: 2px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .18s; }
.toggle.is-on { background: var(--brand); }
.toggle.is-on::after { transform: translateX(12px); }
.details-backdrop { display: none; }

.channels-view { min-width: 0; height: 100%; overflow-y: auto; padding: 30px clamp(22px, 4vw, 52px) 50px; background: var(--bg); }
.admin-view { min-width: 0; height: 100%; overflow-y: auto; padding: 30px clamp(22px, 4vw, 52px) 50px; background: var(--bg); }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 25px; max-width: 1200px; margin: 0 auto 25px; }
.page-header h1 { font-size: 30px; }
.page-header p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.channel-stats { max-width: 1200px; display: grid; grid-template-columns: repeat(4,1fr); gap: 13px; margin: 0 auto 20px; }
.stat-card { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: var(--shadow-sm); }
.stat-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.stat-icon svg { width: 20px; }
.stat-card strong, .stat-card small { display: block; }
.stat-card strong { font: 800 20px 'Manrope'; }
.stat-card small { color: var(--muted); font-size: 11px; }
.channel-section { max-width: 1200px; margin: 0 auto; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font: 800 17px 'Manrope'; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11.5px; }
.channel-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.channel-card { display: grid; grid-template-columns: 46px minmax(0,1fr); gap: 12px; align-items: start; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: white; transition: .18s border, .18s box-shadow; }
.channel-card:hover { border-color: #c2d0cc; box-shadow: 0 7px 20px rgba(26,53,46,.06); }
.channel-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; }
.channel-icon--whatsapp { background: #e7f7ef; color: var(--wa); }
.channel-icon--website { background: #ebedfc; color: var(--web); }
.channel-icon--instagram { background: linear-gradient(135deg,#fce7f3,#ffedd5); color: #c026d3; }
.channel-icon svg { width: 21px; }
.channel-info { min-width: 0; }
.channel-info h3 { margin: 1px 0 4px; font-size: 13.5px; }
.channel-info p { margin: 0; color: var(--muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.small-tag { display: inline-flex; align-items: center; gap: 5px; min-height: 22px; padding: 0 7px; border-radius: 6px; background: var(--surface-soft); color: #65736f; font-size: 9.5px; font-weight: 600; }
.small-tag .status-dot { width: 5px; height: 5px; flex-basis: 5px; box-shadow: none; }
.small-tag.is-offline .status-dot { background: #a5afac; }
.channel-actions { grid-column: 2/-1; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 6px; }
.channel-delete { color: var(--danger); }
.channel-delete:hover { background: #fff0f0; color: #b83f3f; }
.connect-btn { min-height: 33px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--brand); font-size: 10.5px; font-weight: 700; }
.connect-btn:hover { background: var(--brand-soft); border-color: transparent; }
.bot-state-btn { display: inline-flex; align-items: center; gap: 5px; color: #7a8783; }
.bot-state-btn.is-active { border-color: #bde1d7; background: var(--brand-soft); color: var(--brand-dark); }
.channel-empty { grid-column: 1/-1; padding: 65px 25px; text-align: center; color: var(--muted); }
.channel-empty .channel-icon { margin: 0 auto 13px; }
.channel-empty strong { display: block; margin-bottom: 5px; color: var(--ink); }
.usage-grid, .ticket-summary, .report-grid { max-width: 1200px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 0 auto 19px; }
.usage-card, .summary-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: var(--shadow-sm); }
.usage-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.usage-card span, .summary-card span { color: var(--muted); font-size: 10.5px; }
.usage-card strong, .summary-card strong { display: block; margin: 5px 0 9px; font: 800 22px 'Manrope'; }
.usage-track { height: 6px; overflow: hidden; border-radius: 99px; background: #edf1f0; }
.usage-track i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.usage-card.is-full .usage-track i { background: var(--danger); }
.admin-section { max-width: 1200px; margin: 0 auto; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.data-list { display: grid; gap: 9px; }
.routing-team-section { margin-bottom: 16px; }
.routing-team-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.routing-team-card { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.routing-team-main { min-width: 0; display: flex; align-items: center; gap: 10px; }
.routing-team-main > div { min-width: 0; }
.routing-team-main strong,.routing-team-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.routing-team-main strong { font-size: 12px; }
.routing-team-main small { margin-top: 4px; color: var(--muted); font-size: 9.5px; }
.routing-team-icon { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.routing-team-icon svg { width: 17px; height: 17px; }
.routing-team-actions { display: flex; flex: 0 0 auto; gap: 5px; }
.routing-team-actions .tiny-btn { display: inline-flex; align-items: center; gap: 4px; }
.routing-team-actions svg { width: 12px; height: 12px; }
.team-member-picker { max-height: 240px; overflow-y: auto; display: grid; gap: 7px; margin-top: 7px; padding: 9px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.team-member-picker label { min-width: 0; display: flex; align-items: center; gap: 9px; padding: 9px; border-radius: 9px; background: white; cursor: pointer; }
.team-member-picker input { width: 17px; height: 17px; flex: 0 0 17px; accent-color: var(--brand); }
.team-member-picker span,.team-member-picker strong,.team-member-picker small { min-width: 0; display: block; }
.team-member-picker strong,.team-member-picker small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-member-picker strong { font-size: 10.5px; }
.team-member-picker small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.member-row { display: grid; grid-template-columns: 42px minmax(0,1.4fr) minmax(100px,.5fr) auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 11px; }
.member-row .customer-avatar { width: 40px; height: 40px; }
.member-main strong,.member-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-main strong { font-size: 12.5px; }
.member-main small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.member-presence { display: inline-flex; align-items: center; gap: 6px; margin-top: 5px; color: var(--muted); font-size: 9px; text-transform: capitalize; }
.member-presence::before { content: ''; width: 6px; height: 6px; flex-basis: 6px; box-shadow: none; }
.member-controls { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.member-capacity { width: 78px; height: 34px; padding: 0 7px; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: 10px; }
.member-capacity-label { display: grid; gap: 3px; color: var(--muted); font-size: 9px; }
.role-badge,.priority-badge { display: inline-flex; align-items: center; width: max-content; min-height: 24px; padding: 0 8px; border-radius: 7px; background: var(--brand-soft); color: var(--brand-dark); font-size: 9.5px; font-weight: 700; text-transform: capitalize; }
.role-badge.is-admin { background: #eceafe; color: #6259ad; }
.role-badge.is-supervisor { background: #fff0df; color: #a96020; }
.member-row select,.ticket-controls select,.inline-filter { height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: white; color: #52615d; font-size: 10px; outline: 0; }
.member-row select:focus,.ticket-controls select:focus,.inline-filter:focus { border-color: var(--brand); }
.ticket-row { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(120px,.6fr) auto; gap: 15px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 11px; }
.ticket-main { min-width: 0; }
.ticket-main__top { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.ticket-number { color: var(--brand); font-size: 9.5px; font-weight: 800; }
.ticket-main h3 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.ticket-main p { margin: 4px 0 0; color: var(--muted); font-size: 9.5px; }
.priority-badge { background: #eef2f1; color: #687571; }
.priority-badge.is-high { background: #fff0df; color: #a85f20; }
.priority-badge.is-urgent { background: #ffebeb; color: #b54444; }
.ticket-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.ticket-assignee { color: var(--muted); font-size: 9.5px; }
.knowledge-intro { max-width: 1200px; display: flex; align-items: center; gap: 13px; margin: 0 auto 18px; padding: 15px 18px; border: 1px solid #d5e8e3; border-radius: 14px; background: #edf8f5; }
.knowledge-intro strong { font-size: 12.5px; }
.knowledge-intro p { margin: 3px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.knowledge-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.knowledge-card { padding: 15px; border: 1px solid var(--line); border-radius: 12px; }
.knowledge-card.is-inactive { opacity: .62; }
.knowledge-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.knowledge-card h3 { margin: 0; font-size: 13px; }
.knowledge-card p { margin: 8px 0; color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.knowledge-answer { padding: 10px; border-radius: 9px; background: var(--surface-soft); color: #3c4d48 !important; }
.knowledge-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 9px; }
.knowledge-actions { display: flex; gap: 5px; }
.knowledge-card__image { width: 100%; max-height: 170px; margin-top: 10px; border-radius: 10px; object-fit: cover; background: var(--surface-soft); }
.knowledge-scope { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-dark); font-size: 9px; font-weight: 700; }
.wide-modal { width: min(680px,100%); }
.knowledge-channel-picker { max-height: 155px; overflow-y: auto; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin-top: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.knowledge-channel-picker label { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px; border-radius: 8px; background: white; color: #40504c; font-size: 10.5px; font-weight: 600; }
.knowledge-channel-picker input { width: 16px; height: 16px; flex: 0 0 16px; accent-color: var(--brand); }
.file-input { width: 100%; padding: 10px; border: 1px dashed var(--line-strong); border-radius: 11px; background: var(--surface-soft); font-size: 11px; }
.knowledge-image-preview { display: grid; grid-template-columns: 58px minmax(0,1fr) auto; align-items: center; gap: 10px; margin-top: 9px; padding: 9px; border: 1px solid var(--line); border-radius: 11px; }
.knowledge-image-preview img { width: 58px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--surface-soft); }
.knowledge-image-preview span { overflow: hidden; color: #40504c; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-action-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.knowledge-action-head strong,.knowledge-action-head small { display: block; }
.knowledge-action-head strong { font-size: 12px; }
.knowledge-action-head small { margin-top: 3px; color: var(--muted); font-size: 9.5px; }
.compact-button { min-height: 34px; padding: 0 10px; font-size: 10px; }
.knowledge-action-list { display: grid; gap: 8px; margin-top: 9px; }
.knowledge-action-editor { display: grid; grid-template-columns: 135px minmax(120px,.75fr) minmax(160px,1fr) 34px; gap: 7px; align-items: center; padding: 9px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.knowledge-action-editor select,.knowledge-action-editor input { width: 100%; height: 38px; min-width: 0; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: white; font-size: 10.5px; outline: 0; }
.knowledge-action-editor select:focus,.knowledge-action-editor input:focus { border-color: var(--brand); }
.knowledge-action-editor .icon-btn { width: 34px; height: 34px; color: var(--danger); }
.tiny-btn { min-height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--muted); font-size: 9px; font-weight: 700; }
.tiny-btn:hover { color: var(--brand); background: var(--brand-soft); }
.tiny-btn.is-danger { color: var(--danger); }
.reply-template-section { margin-top: 16px; margin-bottom: 30px; }
.scope-settings { margin-top: 18px; padding: 13px; border: 1px solid #cfe3dd; border-radius: 12px; background: #f4faf8; }
.scope-settings > strong,.scope-settings > small { display: block; }
.scope-settings > strong { font-size: 12px; }
.scope-settings > small { margin: 3px 0 11px; color: var(--muted); font-size: 10px; }
#knowledgeScope,#replyTemplateScope { border-color: #b9d8cf; background: #f8fcfb; }
label[for="knowledgeScope"] { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
label[for="knowledgeScope"]::before { content: 'PENGATURAN CHANNEL'; display: block; margin-bottom: 5px; color: var(--brand); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.report-grid .summary-card strong { margin-bottom: 0; }
.report-page-header { max-width: 1200px; align-items: flex-start; }
.report-toolbar { max-width: 760px; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: flex-end; gap: 8px; }
.report-toolbar label { display: grid; gap: 4px; color: var(--muted); font-size: 8.5px; font-weight: 700; }
.report-toolbar input,.report-toolbar select { min-width: 125px; height: 38px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 9px; background: white; color: var(--text); font: inherit; outline: 0; }
.report-toolbar input:focus,.report-toolbar select:focus { border-color: var(--brand); }
.report-toolbar button { min-height: 38px; padding: 0 12px; font-size: 10px; }
.report-period { max-width: 1200px; margin: -13px auto 14px; color: var(--muted); font-size: 10px; }
.report-sla-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.sla-summary { border-color: #cfe5df; background: linear-gradient(135deg,#fff,#f1faf7); }
.sla-summary small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.report-split { max-width: 1200px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px auto; }
.report-split .admin-section { width: 100%; min-width: 0; margin: 0; }
.report-visual-grid { max-width: 1200px; display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); gap: 16px; margin: 16px auto; }
.report-visual-card { width: 100%; min-width: 0; margin: 0; }
.report-agent-chart-card { margin-top: 0; }
.donut-report { min-height: 220px; display: grid; grid-template-columns: 150px minmax(0,1fr); align-items: center; gap: 24px; }
.donut-ring { position: relative; width: 145px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(15,118,110,.06); }
.donut-ring::after { content: ''; position: absolute; width: 82px; aspect-ratio: 1; border-radius: 50%; background: white; box-shadow: 0 3px 14px rgba(19,55,47,.08); }
.donut-ring > span { position: relative; z-index: 1; text-align: center; }
.donut-ring strong,.donut-ring small { display: block; }
.donut-ring strong { font: 800 24px 'Manrope'; color: var(--ink); }
.donut-ring small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.donut-legend { display: grid; gap: 11px; }
.donut-legend > div { display: grid; grid-template-columns: 9px minmax(0,1fr) auto; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.donut-legend i { width: 9px; height: 9px; border-radius: 3px; }
.donut-legend strong { color: var(--ink); font-size: 11px; }
.horizontal-chart { min-height: 220px; display: grid; align-content: center; gap: 14px; }
.horizontal-row { display: grid; grid-template-columns: minmax(125px,.7fr) minmax(150px,1.3fr); align-items: center; gap: 14px; }
.horizontal-row > div:first-child { min-width: 0; }
.horizontal-row strong,.horizontal-row span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.horizontal-row strong { color: var(--ink); font-size: 10.5px; }
.horizontal-row span { margin-top: 2px; color: var(--muted); font-size: 8.5px; }
.horizontal-track { height: 9px; overflow: hidden; border-radius: 99px; background: #edf3f1; }
.horizontal-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--brand),#36b6a6); }
.agent-chart { min-height: 160px; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 34px; }
.report-ticket-section { margin-bottom: 30px; }
.report-table-wrap { width: 100%; overflow-x: auto; }
.report-table { width: 100%; border-collapse: collapse; font-size: 10px; white-space: nowrap; }
.report-table th { padding: 9px 10px; border-bottom: 1px solid var(--line-strong); color: var(--muted); text-align: left; font-size: 8.5px; letter-spacing: .03em; text-transform: uppercase; }
.report-table td { padding: 10px; border-bottom: 1px solid var(--line); color: #465650; }
.report-table tbody tr:last-child td { border-bottom: 0; }
.report-table td strong,.report-table td small { display: block; }
.report-table td small { margin-top: 2px; color: var(--muted); font-size: 8.5px; }
.status-badge { display: inline-flex; padding: 4px 7px; border-radius: 99px; background: #eef2f1; color: #5d6c68; font-size: 8.5px; font-weight: 800; text-transform: capitalize; }
.status-badge.status-open { background: #eaf8f4; color: var(--brand-dark); }
.status-badge.status-pending { background: #fff4df; color: #9b641d; }
.status-badge.status-resolved { background: #e9f1ff; color: #46699c; }
.bar-chart { height: 260px; display: flex; align-items: flex-end; gap: 7px; padding: 20px 5px 5px; overflow-x: auto; }
.bar-item { min-width: 28px; height: 100%; display: flex; flex: 1 0 28px; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; }
.bar-item i { width: min(28px,75%); min-height: 3px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg,#20a395,var(--brand)); }
.bar-item b { color: #4d5e59; font-size: 8px; }
.bar-item span { color: #8a9793; font-size: 7.5px; white-space: nowrap; }
.modal-textarea { width: 100%; resize: vertical; border: 1px solid var(--line-strong); border-radius: 11px; padding: 11px 13px; background: white; font-size: 12px; line-height: 1.5; outline: 0; }
.modal-textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,118,110,.08); }
.check-field { display: flex; align-items: flex-start; gap: 10px; margin-top: 15px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.check-field input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--brand); }
.check-field span { min-width: 0; }
.check-field strong,.check-field small { display: block; }
.check-field strong { font-size: 11.5px; }
.check-field small { margin-top: 3px; color: var(--muted); font-size: 9.5px; line-height: 1.45; }
.channel-access-settings { margin-top: 10px; overflow: hidden; border: 1px solid #cfe3dd; border-radius: 12px; background: #f4faf8; }
.channel-access-head { display: grid; grid-template-columns: minmax(0,1fr) 106px; align-items: end; gap: 10px; padding: 12px; border-bottom: 1px solid #dbeae6; }
.channel-access-head strong,.channel-access-head small { display: block; }
.channel-access-head strong { font-size: 11.5px; }
.channel-access-head small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.channel-access-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; color: var(--muted); font-size: 8px; font-weight: 800; text-align: center; text-transform: uppercase; }
.channel-access-targets { max-height: 230px; overflow-y: auto; padding: 7px; }
.channel-access-row { display: grid; grid-template-columns: minmax(0,1fr) 49px 49px; align-items: center; gap: 8px; padding: 9px 5px 9px 9px; border-radius: 9px; cursor: pointer; }
.channel-access-row:hover { background: white; }
.channel-access-name,.channel-access-name strong,.channel-access-name small { min-width: 0; display: block; }
.channel-access-name strong,.channel-access-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-access-name strong { font-size: 10.5px; }
.channel-access-name small { margin-top: 2px; color: var(--muted); font-size: 8.5px; }
.channel-access-row > input { width: 17px; height: 17px; justify-self: center; accent-color: var(--brand); }
.channel-access-row > input:disabled { opacity: .35; }
.service-settings { max-width: 980px; margin: 0 auto; display: grid; gap: 16px; }
.settings-card { width: 100%; margin: 0; }
.sla-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.sla-fields label,.settings-select { display: grid; gap: 7px; color: var(--text-soft); font-size: 11px; font-weight: 700; }
.sla-fields input,.settings-select select,.schedule-times input { width: 100%; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 12px; background: white; padding: 0 13px; color: var(--text); font: inherit; outline: 0; }
.sla-fields input:focus,.settings-select select:focus,.schedule-times input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,118,110,.08); }
.clock-options { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 18px 0; padding: 0; border: 0; }
.clock-options legend { width: 100%; margin-bottom: 2px; font-size: 11px; font-weight: 800; }
.clock-options label { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.clock-options input { width: 17px; height: 17px; accent-color: var(--brand); }
.settings-select { max-width: 320px; }
.weekly-schedule { display: grid; gap: 8px; }
.schedule-row { display: grid; grid-template-columns: minmax(100px,.7fr) minmax(260px,1.3fr); align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.schedule-day { display: flex; align-items: center; gap: 9px; font-size: 11px; font-weight: 800; }
.schedule-day input { width: 17px; height: 17px; accent-color: var(--brand); }
.schedule-times { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 9px; color: var(--muted); font-size: 10px; }
.schedule-times input { min-height: 38px; }
.schedule-times input:disabled { opacity: .45; background: #edf2f0; }
.settings-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; }
.member-controls .tiny-btn { min-height: 34px; display: inline-flex; align-items: center; gap: 5px; }
.member-controls .tiny-btn svg { width: 13px; height: 13px; }
.attachment-card { display: flex; align-items: center; gap: 8px; margin-top: 7px; padding: 8px; border-radius: 8px; background: rgba(255,255,255,.55); color: var(--brand-dark); text-decoration: none; font-size: 10.5px; font-weight: 600; }
.attachment-card img { max-width: 220px; max-height: 180px; border-radius: 7px; object-fit: cover; }
.media-sticker { display: block; width: max-content; margin-top: 7px; }
.media-sticker img { display: block; width: min(150px,42vw); max-height: 150px; object-fit: contain; }
.media-audio { width: 100%; max-width: 330px; display: grid; gap: 5px; margin-top: 7px; padding: 8px; border-radius: 10px; background: rgba(255,255,255,.58); color: var(--text-soft); font-size: 9.5px; font-weight: 700; }
.media-audio audio { width: 100%; height: 34px; }
.media-audio a { width: max-content; color: var(--brand); font-size: 8.5px; font-weight: 700; text-decoration: none; }
.media-video { width: 100%; max-width: 360px; display: grid; gap: 5px; margin-top: 7px; color: var(--muted); font-size: 9px; }
.media-video video { display: block; width: 100%; max-height: 320px; border-radius: 10px; background: #0c1714; }
.location-card { width: 100%; max-width: 340px; min-width: 0; display: flex; align-items: flex-start; gap: 10px; margin-top: 7px; padding: 11px; border: 1px solid rgba(15,118,110,.18); border-radius: 11px; background: rgba(255,255,255,.65); color: var(--brand-dark); text-decoration: none; }
.location-card > svg { width: 21px; height: 21px; flex: 0 0 21px; }
.location-card span,.location-card strong,.location-card small { display: block; min-width: 0; }
.location-card strong { font-size: 10.5px; }
.location-card small { margin-top: 3px; color: var(--muted); font-size: 8.5px; line-height: 1.4; }
.location-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 15px; }
.location-grid label { display: grid; gap: 6px; color: var(--text-soft); font-size: 10.5px; font-weight: 700; }
.location-grid input { width: 100%; min-height: 42px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 10px; outline: 0; }
.location-grid input:focus { border-color: var(--brand); }
.location-search-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.location-search-row input { min-width: 0; height: 42px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 10px; outline: 0; }
.location-search-row input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,118,110,.08); }
.location-search-row button { min-height: 42px; }
.location-results { max-height: 170px; margin-top: 8px; overflow-y: auto; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: var(--shadow-sm); }
.location-results button { width: 100%; display: grid; gap: 3px; padding: 10px 11px; border: 0; border-bottom: 1px solid var(--line); background: white; text-align: left; }
.location-results button:last-child { border-bottom: 0; }
.location-results button:hover { background: var(--brand-soft); }
.location-results strong,.location-results span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.location-results strong { font-size: 10.5px; }
.location-results span { color: var(--muted); font-size: 8.5px; }
.location-result-empty { padding: 12px; color: var(--muted); font-size: 9.5px; text-align: center; }
.location-map { height: 230px; margin: 12px 0 5px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #eaf1ef; }
.location-map-help { display: block; margin-bottom: 13px; color: var(--muted); font-size: 8.5px; line-height: 1.45; }
.location-map .maplibregl-ctrl-attrib { font-size: 8px; }
.location-current { width: 100%; margin-top: 12px; }
.sla-label { color: var(--warning); font-size: 9px; font-weight: 700; }
.sla-label.is-breached { color: var(--danger); }
.mobile-nav { display: none; }
.mobile-account-sheet,.mobile-account-backdrop { display: none; }

.modal-backdrop { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(11, 31, 27, .5); backdrop-filter: blur(4px); animation: fade-in .15s ease; }
@keyframes fade-in { from { opacity: 0; } }
.modal-card { width: min(510px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 22px; border-radius: 18px; background: white; box-shadow: 0 28px 80px rgba(5,31,25,.25); }
.modal-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.modal-card h2 { margin: 5px 0 0; font: 800 22px 'Manrope'; letter-spacing: -.035em; }
.modal-card footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; padding-top: 17px; border-top: 1px solid var(--line); }
.confirm-copy { margin: 0 0 14px; color: #42534e; font-size: 13px; line-height: 1.6; }
.confirm-copy strong { color: var(--ink); }
.confirm-warning { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid #f1cccc; border-radius: 11px; background: #fff4f4; color: #9f4141; font-size: 11px; line-height: 1.55; }
.confirm-warning svg { width: 18px; flex: 0 0 18px; margin-top: 1px; }
.compact-modal { width: min(440px, 100%); }
.channel-type-picker { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.channel-type-picker input { position: absolute; opacity: 0; pointer-events: none; }
.channel-type-picker label > span { min-height: 116px; display: grid; align-content: center; justify-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 12px; text-align: center; cursor: pointer; transition: .18s; }
.channel-type-picker label > input:checked + span { border-color: var(--brand); background: #f3faf8; box-shadow: 0 0 0 2px rgba(15,118,110,.09); }
.type-icon { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 7px; border-radius: 10px; }
.type-icon svg { width: 18px; }
.type-icon--wa { background: #e4f7ed; color: var(--wa); }
.type-icon--web { background: #e9ebfb; color: var(--web); }
.type-icon--instagram { background: linear-gradient(135deg,#fce7f3,#ffedd5); color: #c026d3; }
.channel-type-picker strong, .channel-type-picker small { display: block; }
.channel-type-picker strong { font-size: 12.5px; }
.channel-type-picker small { margin-top: 3px; color: var(--muted); font-size: 9.5px; }
.channel-type-picker.is-locked { opacity: .68; }
.channel-type-picker.is-locked label { cursor: not-allowed; }
.field-help { display: block; margin-top: 5px; color: var(--muted); font-size: 10.5px; }
.widget-brand-fields { display: grid; grid-template-columns: 1fr 100px; gap: 10px; margin-top: 12px; }
.widget-brand-fields label > span { display: block; margin-bottom: 6px; color: #31423e; font-size: 11px; font-weight: 700; }
.widget-brand-fields input { width: 100%; height: 42px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: white; }
.widget-brand-fields input[type="color"] { padding: 4px; cursor: pointer; }
.color-field { height: 48px; display: flex; align-items: center; gap: 10px; padding: 5px 11px 5px 5px; border: 1px solid var(--line-strong); border-radius: 10px; }
.color-field input { width: 48px; height: 36px; padding: 2px; border: 0; background: transparent; cursor: pointer; }
.color-field span { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; }
.qr-card { width: min(410px,100%); }
.qr-frame { width: 238px; height: 238px; display: grid; place-items: center; margin: 0 auto 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-soft); }
.qr-frame img { width: 218px; height: 218px; border-radius: 8px; }
.qr-frame p { padding: 25px; color: var(--muted); font-size: 12px; text-align: center; }
.qr-card ol { margin: 0 0 20px; padding-left: 37px; color: var(--muted); font-size: 12px; line-height: 1.9; }
.full-width { width: 100%; }
.spinner { width: 25px; height: 25px; border: 3px solid #dbe6e3; border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast-region { position: fixed; z-index: 500; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { min-width: 250px; max-width: 360px; display: flex; align-items: center; gap: 9px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: #183f38; color: white; box-shadow: var(--shadow-md); font-size: 12px; animation: toast-in .25s ease; }
.toast.is-error { background: #7e3333; }
.toast svg { width: 17px; color: var(--lime); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 335px minmax(350px,1fr); }
  .details-pane { position: absolute; z-index: 60; top: 0; right: 0; bottom: 0; width: 315px; transform: translateX(105%); box-shadow: -15px 0 35px rgba(17,42,36,.12); transition: transform .22s ease; }
  .workspace.details-open .details-pane { transform: none; }
  .details-backdrop { position: absolute; inset: 0; z-index: 55; border: 0; background: rgba(15,35,30,.28); opacity: 0; pointer-events: none; transition: .2s; }
  .workspace.details-open .details-backdrop { display: block; opacity: 1; pointer-events: auto; }
}

@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-panel { padding: 35px 24px; }
  .login-mobile-brand { display: flex; }
  .app-shell,.app-shell.sidebar-expanded { grid-template-columns: 64px minmax(0,1fr); }
  .app-shell.sidebar-expanded .rail { align-items: center; padding: 18px 10px; background: #0b5f59; }
  .app-shell.sidebar-expanded .brand-mark--app { width: 44px; height: 44px; min-height: 44px; padding: 4px; border-radius: 12px; }
  .app-shell.sidebar-expanded .brand-mark--app .rail-logo-wide { display: none; }
  .app-shell.sidebar-expanded .brand-mark--app .brand-symbol { display: block; }
  .app-shell.sidebar-expanded .rail-nav { margin-top: 34px; }
  .app-shell.sidebar-expanded .rail-link { display: grid; place-items: center; height: 50px; padding: 0; }
  .app-shell.sidebar-expanded .rail-link span,.app-shell.sidebar-expanded .rail-account-copy,.app-shell.sidebar-expanded .rail-account-chevron { display: none; }
  .app-shell.sidebar-expanded .rail-link::after { display: block; }
  .app-shell.sidebar-expanded .rail-account { padding-top: 0; border-top: 0; }
  .app-shell.sidebar-expanded .rail-account-trigger { display: grid; grid-template-columns: 1fr; place-items: center; }
  .app-shell.sidebar-expanded .account-menu { left: 51px; }
  .sidebar-toggle { display: none; }
  .workspace { grid-template-columns: 310px minmax(320px,1fr); }
  .channels-view { padding-left: 20px; padding-right: 20px; }
  .admin-view { padding-left: 20px; padding-right: 20px; }
  .channel-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .sla-fields { grid-template-columns: 1fr; }
  .schedule-row { grid-template-columns: 1fr; gap: 8px; }
  .schedule-times { grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); }
  .settings-actions { align-items: stretch; flex-direction: column; }
  body { min-width: 0; }
  .app-shell { display: block; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .rail { display: none; }
  .workspace { display: block; height: 100%; }
  .inbox-pane { width: 100%; height: 100%; border: 0; }
  .chat-pane { position: absolute; inset: 0; z-index: 20; display: none; }
  .workspace.mobile-chat .chat-pane { display: block; }
  .workspace.mobile-chat .inbox-pane { visibility: hidden; }
  .chat-empty { display: none; }
  .back-button { display: grid !important; position: relative; z-index: 3; flex: 0 0 38px; width: 38px; height: 38px; pointer-events: auto; touch-action: manipulation; }
  .back-button svg { display: block; width: 20px; height: 20px; }
  .chat-header { position: relative; z-index: 25; min-height: calc(65px + env(safe-area-inset-top)); padding: calc(8px + env(safe-area-inset-top)) 10px 8px; }
  .back-button { border: 1px solid var(--line); background: white; color: var(--brand-dark); }
  .chat-header > .customer-avatar { width: 36px; height: 36px; flex-basis: 36px; border-radius: 11px; }
  .status-select-wrap { padding-left: 8px; }
  .status-select-wrap select { width: 78px; padding-right: 2px; }
  .message-feed { padding: 18px 12px; }
  .message-bubble { max-width: calc(100% - 38px); }
  .message-reply-button { opacity: .75; }
  .reply-template-picker { position: fixed; left: 10px; right: 10px; bottom: calc(72px + env(safe-area-inset-bottom)); width: auto; max-height: 60dvh; }
  .composer-wrap { padding: 8px 9px calc(9px + env(safe-area-inset-bottom)); }
  .composer-footer { min-width: 0; gap: 4px; padding-left: 4px; padding-right: 4px; }
  .composer-footer > div:first-child { flex: 1 1 auto; justify-content: space-around; overflow: hidden; }
  .composer-tool { min-width: 0; flex: 1 1 0; justify-content: center; padding: 0 4px; gap: 3px; }
  .send-group { flex: 0 0 auto; gap: 4px; }
  .keyboard-hint { display: none; }
  .details-pane { position: fixed; z-index: 110; width: min(90%, 340px); bottom: calc(64px + env(safe-area-inset-bottom)); }
  .workspace.details-open .details-backdrop { position: fixed; z-index: 105; bottom: calc(64px + env(safe-area-inset-bottom)); }
  .channels-view { height: 100%; padding: 20px 14px 35px; }
  .admin-view { height: 100%; padding: 20px 14px 35px; }
  .page-header { align-items: center; margin-bottom: 18px; }
  .page-header h1 { font-size: 25px; }
  .page-header p { display: none; }
  .page-header .primary-btn { width: 42px; min-height: 42px; padding: 0; font-size: 0; }
  .page-header .primary-btn svg { width: 19px; }
  .channel-stats { grid-template-columns: repeat(2,1fr); gap: 7px; }
  .stat-card { display: block; padding: 12px 9px; text-align: center; }
  .stat-icon { width: 32px; height: 32px; margin: 0 auto 6px; }
  .stat-card strong { font-size: 17px; }
  .stat-card small { font-size: 9px; }
  .channel-section { padding: 13px; }
  .section-heading p, .section-heading .secondary-btn { display: none; }
  .routing-team-section .section-heading .secondary-btn { min-height: 36px; display: inline-flex; padding: 0 10px; font-size: 9.5px; }
  .channel-card { grid-template-columns: 40px minmax(0,1fr); padding: 12px; }
  .channel-icon { width: 40px; height: 40px; }
  .channel-actions { grid-column: 1/-1; }
  .usage-grid,.ticket-summary,.report-grid { grid-template-columns: repeat(2,1fr); gap: 7px; }
  .report-page-header { display: block; }
  .report-toolbar { display: grid; grid-template-columns: 1fr 1fr; justify-content: stretch; margin-top: 16px; }
  .report-toolbar label:first-child { grid-column: 1/-1; }
  .report-toolbar input,.report-toolbar select { width: 100%; min-width: 0; }
  .report-toolbar .report-apply,.report-toolbar .report-export { width: 100%; min-height: 40px; padding: 0 10px; font-size: 10px; }
  .report-period { margin: -5px 0 12px; }
  .report-split,.report-visual-grid { grid-template-columns: 1fr; gap: 12px; margin: 12px 0; }
  .agent-chart { grid-template-columns: 1fr; }
  .donut-report { grid-template-columns: 120px minmax(0,1fr); gap: 16px; }
  .donut-ring { width: 120px; }
  .donut-ring::after { width: 68px; }
  .usage-card,.summary-card { padding: 12px; }
  .admin-section { padding: 13px; }
  .routing-team-list { grid-template-columns: 1fr; }
  .routing-team-card { align-items: flex-start; flex-direction: column; }
  .routing-team-actions { width: 100%; }
  .routing-team-actions .tiny-btn { flex: 1; justify-content: center; }
  .member-row { grid-template-columns: 38px minmax(0,1fr) auto; padding: 10px; }
  .member-row > select,.member-controls { grid-column: 2/-1; width: 100%; }
  .member-controls select { flex: 1; }
  .ticket-row { grid-template-columns: 1fr; gap: 9px; }
  .ticket-controls { justify-content: flex-start; }
  .knowledge-grid { grid-template-columns: 1fr; }
  .knowledge-intro { align-items: flex-start; }
  .knowledge-channel-picker { grid-template-columns: 1fr; }
  .knowledge-action-editor { grid-template-columns: 1fr 1fr 34px; }
  .knowledge-action-editor [data-action-value] { grid-column: 1 / -1; grid-row: 2; }
  .knowledge-action-editor .icon-btn { grid-column: 3; grid-row: 1; }
  .mobile-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; height: calc(64px + env(safe-area-inset-bottom)); display: flex; justify-content: center; padding: 5px 5px env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(255,255,255,.97); backdrop-filter: blur(12px); }
  .mobile-nav button { position: relative; z-index: 1; min-width: 0; max-width: 92px; flex: 0 1 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: transparent; color: #85918e; font-size: 9.5px; font-weight: 600; pointer-events: auto; touch-action: manipulation; }
  .mobile-nav button.is-active { color: var(--brand); }
  .mobile-nav svg { width: 20px; height: 20px; }
  .mobile-avatar { width: 21px; height: 21px; border: 0; background: #d9efb0; font-size: 9px; }
  .mobile-account-backdrop { position: fixed; inset: 0; z-index: 170; display: block; border: 0; background: rgba(8,32,27,.42); backdrop-filter: blur(2px); pointer-events: auto; }
  .mobile-account-sheet { position: fixed; left: 10px; right: 10px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 175; display: block; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 24px 70px rgba(8,35,29,.25); pointer-events: auto; }
  .mobile-account-head { display: grid; grid-template-columns: 46px minmax(0,1fr) 36px; gap: 11px; align-items: center; }
  .mobile-account-avatar { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: #d9efb0; color: #315048; font-weight: 800; }
  .mobile-account-head strong,.mobile-account-head span,.mobile-account-head small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-account-head strong { font-size: 13px; }
  .mobile-account-head span { margin-top: 2px; color: #4e5e59; font-size: 10.5px; }
  .mobile-account-head small { margin-top: 2px; color: var(--muted); font-size: 9.5px; }
  .mobile-presence { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; color: #40504c; font-size: 11px; font-weight: 700; }
  .mobile-presence select { min-width: 145px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: 10px; }
  .mobile-notification { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; color: #40504c; font-size: 11px; font-weight: 700; }
  .mobile-notification span { display: inline-flex; align-items: center; gap: 8px; }
  .mobile-notification-help { display: block; padding: 5px 4px 0; color: var(--muted); font-size: 9px; }
  .mobile-sound-control { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; color: #40504c; font-size: 10px; font-weight: 700; }
  .mobile-sound-control select { min-width: 125px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: 10px; }
  .mobile-logout { width: 100%; min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; border: 0; border-radius: 10px; background: #fff0f0; color: var(--danger); font-weight: 700; }
  #mobileServiceSettings { background: var(--surface-soft); color: var(--brand-dark); }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal-card { width: 100%; max-height: 90dvh; border-radius: 20px 20px 0 0; padding: 20px 17px calc(20px + env(safe-area-inset-bottom)); }
  .channel-access-head { grid-template-columns: minmax(0,1fr) 88px; }
  .channel-access-row { grid-template-columns: minmax(0,1fr) 40px 40px; }
  .toast-region { left: 12px; right: 12px; bottom: calc(75px + env(safe-area-inset-bottom)); }
  .toast { min-width: 0; max-width: none; }
}

@media (max-width: 370px) {
  .conversation-item { padding-left: 8px; padding-right: 8px; }
  .conversation-submeta { align-items: flex-start; flex-direction: column; gap: 2px; }
  .chat-actions .icon-btn { display: none; }
  .composer-tool span { display: none; }
  .location-grid { grid-template-columns: 1fr; }
  .channel-type-picker { grid-template-columns: 1fr; }
  .channel-type-picker label > span { min-height: 86px; }
}

@media (max-width: 480px) {
  .composer-tool span { display: none; }
  .composer-tool { min-width: 34px; flex: 0 1 46px; }
  .message-bubble { max-width: calc(100% - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
