:root {
  --ink: #17211b;
  --muted: #6e766f;
  --line: #e5e9e5;
  --soft: #f5f7f4;
  --green: #0f6b4f;
  --green-dark: #0a533d;
  --green-soft: #eaf5ef;
  --coral: #ef745b;
  --amber: #e8a23b;
  --white: #fff;
  --shadow: 0 22px 70px rgba(13, 42, 30, .18);
  font-family: "DM Sans", "Noto Sans SC", sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #edf1ed; overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(15,107,79,.18); outline-offset: 2px; }

.app-shell { display: grid; grid-template-columns: 88px 340px minmax(440px, 1fr); grid-template-rows: minmax(0, 1fr); height: 100vh; height: 100dvh; background: var(--white); }
.sidebar { background: #123c30; color: #fff; display: flex; flex-direction: column; padding: 24px 14px 18px; }
.primary-nav { display: grid; gap: 8px; }
.nav-item { position: relative; border: 0; background: transparent; color: rgba(255,255,255,.68); min-height: 54px; border-radius: 7px; cursor: pointer; display: grid; place-items: center; gap: 3px; }
.nav-item svg { width: 21px; height: 21px; }
.nav-item span { font-size: 11px; }
.nav-item em { position: absolute; right: 9px; top: 7px; background: var(--coral); color: #fff; font-style: normal; font-size: 10px; line-height: 17px; min-width: 17px; border-radius: 10px; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.12); color: white; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 15px; position: relative; }
.user-card { width: 100%; border: 0; border-top: 1px solid rgba(255,255,255,.14); padding: 17px 0 0; display: grid; place-items: center; background: transparent; color: white; cursor: pointer; font: inherit; }
.user-card > div:not(.avatar), .user-card > .icon-button { display: none; }
.user-menu { display: none; position: absolute; z-index: 30; left: 76px; bottom: 0; width: 172px; padding: 7px; border-radius: 10px; background: #fff; box-shadow: 0 14px 36px rgba(12,42,33,.22); }
.user-menu.open { display: grid; }
.user-menu button { border: 0; border-radius: 7px; padding: 10px 11px; background: transparent; color: #24433a; text-align: left; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.user-menu button:hover { background: #edf5f1; }
.user-menu svg { width: 17px; height: 17px; }
.app-shell.no-conversation { grid-template-columns: 92px minmax(320px, 1fr); }
.app-shell.no-conversation .chat-panel { display: none; }
.avatar { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; position: relative; color: #24433a; background: #dcece4; }
.avatar-me { color: #5b3913; background: #f4dcb6; }
.avatar.has-image { background-size: cover; background-position: center; color: transparent; }
.profile-avatar-editor { display: flex; align-items: center; gap: 14px; margin: 4px 0 18px; padding: 12px; border-radius: 8px; background: #f5f8f6; }
.profile-avatar-editor .avatar { margin: 0; }
.profile-avatar-editor > div:last-of-type { display: grid; gap: 7px; justify-items: start; }
.profile-avatar-editor small { color: var(--muted); font-size: 9px; }
.avatar-sofia { background: #f0c9be; color: #71352a; }
.avatar-lucas { background: #cee0ee; color: #244b67; }
.avatar-emma { background: #e6d9f0; color: #513a63; }
.avatar-daniel { background: #eadfbf; color: #5c4b1e; }
.status-dot { position: absolute; right: -1px; bottom: 1px; width: 11px; height: 11px; border: 2px solid white; border-radius: 50%; background: #29a36a; }

.inbox-panel { min-width: 0; border-right: 1px solid var(--line); background: #fbfcfb; display: flex; flex-direction: column; }
.panel-header { padding: 28px 24px 18px; display: flex; justify-content: space-between; align-items: center; }
.eyebrow { margin: 0 0 5px; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: 1.6px; }
.panel-header h1 { margin: 0; font-size: 25px; letter-spacing: 0; }
.start-chat-button { min-height: 36px; padding: 0 11px; border: 1px solid var(--green); border-radius: 6px; background: var(--green); color: white; display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.start-chat-button:hover { background: var(--green-dark); }
.start-chat-button svg { width: 14px; }
.icon-button { width: 36px; height: 36px; border: 0; padding: 0; border-radius: 6px; background: transparent; display: inline-grid; place-items: center; cursor: pointer; }
.icon-button svg { width: 18px; height: 18px; }
.icon-button:hover { background: var(--soft); }
.icon-button.bordered { border: 1px solid var(--line); background: white; }
.search-box { margin: 0 20px 15px; height: 42px; padding: 0 12px; border: 1px solid var(--line); background: white; border-radius: 6px; display: flex; align-items: center; gap: 9px; color: #9ba19c; }
.search-box svg { width: 17px; }
.search-box input { border: 0; outline: 0; min-width: 0; width: 100%; color: var(--ink); background: transparent; }
kbd { border: 1px solid #dfe3df; border-bottom-width: 2px; padding: 1px 5px; border-radius: 4px; background: #fafbfa; color: #8c938d; font: 10px/1.4 "DM Sans", sans-serif; white-space: nowrap; }
.filter-row { display: flex; gap: 6px; padding: 0 20px 14px; border-bottom: 1px solid var(--line); }
.filter { border: 0; background: transparent; color: var(--muted); padding: 7px 10px; border-radius: 5px; cursor: pointer; font-size: 12px; font-weight: 600; }
.filter span { margin-left: 3px; }
.filter:hover, .filter.active { color: var(--green); background: var(--green-soft); }
.conversation-list { overflow: auto; padding: 8px; }
.conversation-item { width: 100%; display: grid; grid-template-columns: 45px 1fr auto; gap: 10px; text-align: left; border: 0; border-radius: 7px; background: transparent; padding: 13px 12px; cursor: pointer; }
.conversation-item:hover { background: #f3f6f3; }
.conversation-item.active { background: var(--green-soft); }
.conversation-section-label { padding: 10px 12px 6px; color: #969d97; font-size: 9px; font-weight: 700; letter-spacing: .8px; }
.user-search-result { grid-template-columns: 45px 1fr auto; }
.user-search-result .result-action { align-self: center; color: var(--green); font-size: 9px; font-weight: 600; }
.conversation-copy { min-width: 0; }
.conversation-copy strong { display: block; font-size: 13px; margin: 2px 0 5px; }
.conversation-copy p { margin: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-meta { text-align: right; }
.conversation-meta time { display: block; color: #959c96; font-size: 10px; margin: 3px 0 7px; }
.unread-count { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--green); color: white; font-size: 10px; font-weight: 700; }
.lang-code { font-size: 9px; border: 1px solid #dfe4df; border-radius: 4px; padding: 2px 4px; color: #7b837c; }

.chat-name-button { border: 0; background: transparent; padding: 0; font: inherit; color: inherit; text-align: inherit; }
.chat-name-button:not(:disabled) { cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 4px; }
.chat-panel { min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; background: #fff; }
.chat-header, .translation-strip { flex-shrink: 0; }
.chat-header { height: 82px; padding: 0 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.chat-title { min-width: 0; flex: 1; }
.chat-title > div { display: flex; align-items: center; gap: 8px; }
.chat-title h2 { margin: 0; font-size: 16px; }
.chat-title p { margin: 5px 0 0; font-size: 11px; color: var(--muted); }
.language-badge { padding: 3px 6px; color: var(--green); background: var(--green-soft); border-radius: 4px; font-size: 9px; font-weight: 700; }
.online-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #29a36a; margin-right: 5px; }
.header-actions { display: flex; gap: 6px; }
.mobile-back { display: none; }
.translation-strip { min-height: 42px; padding: 0 24px; background: #f4f8f5; border-bottom: 1px solid #e4eee8; display: flex; align-items: center; justify-content: space-between; }
.translation-state { display: flex; align-items: center; gap: 8px; font-size: 10px; color: var(--muted); }
.translation-state svg { width: 15px; color: var(--green); }
.translation-state strong { color: var(--green); font-size: 11px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { display: block; width: 34px; height: 19px; padding: 2px; border-radius: 12px; background: #ccd2cd; cursor: pointer; transition: .2s; }
.switch span::after { content: ""; display: block; width: 15px; height: 15px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(15px); }
.messages { flex: 1 1 0; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 24px clamp(20px, 4vw, 54px); background: linear-gradient(rgba(250,252,250,.94), rgba(250,252,250,.94)), repeating-linear-gradient(45deg, #eef2ee 0 1px, transparent 1px 12px); }
.date-divider { display: flex; align-items: center; gap: 10px; color: #9aa19b; font-size: 10px; margin: 6px 0 22px; }
.date-divider::before, .date-divider::after { content: ""; height: 1px; background: #e5e9e5; flex: 1; }
.message-row { display: flex; align-items: flex-end; gap: 8px; margin: 0 0 18px; }
.message-row.outgoing { justify-content: flex-end; }
.message-row .avatar { width: 29px; height: 29px; font-size: 9px; }
.message-stack { max-width: min(78%, 550px); }
.sender-identity { margin: 0 4px 5px; color: #657068; font-size: 9px; font-weight: 600; text-align: right; }
.sender-identity.incoming-identity { text-align: left; }
.message-bubble { padding: 11px 14px; border: 1px solid var(--line); border-radius: 7px 7px 7px 2px; background: white; font-size: 13px; line-height: 1.55; box-shadow: 0 2px 7px rgba(24,48,36,.035); }
.outgoing .message-bubble { color: white; background: var(--green); border-color: var(--green); border-radius: 7px 7px 2px 7px; }
.translated-copy { display: flex; align-items: flex-start; gap: 6px; padding: 7px 4px 0; color: #69716b; font-size: 11px; line-height: 1.45; }
.translated-copy svg { flex: 0 0 auto; width: 12px; margin-top: 2px; color: var(--green); }
.translation-text { user-select: text; -webkit-user-select: text; white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.copy-translation { flex: 0 0 auto; display: grid; place-items: center; width: 28px; height: 28px; padding: 4px; border: 1px solid #dce2dd; border-radius: 5px; background: #fff; cursor: pointer; }
.copy-translation:hover { background: var(--green-soft); }
.copy-translation svg { margin: 0; width: 15px; height: 15px; }
.message-attachment { display: flex; align-items: center; gap: 9px; margin-top: 7px; padding: 8px; border: 1px solid #d8e2dc; border-radius: 7px; background: #f8fbf9; color: #24433a; text-decoration: none; }
.message-attachment > svg { width: 22px; height: 22px; color: var(--green); }
.message-attachment img { width: 76px; max-height: 76px; border-radius: 5px; object-fit: cover; }
.message-attachment span:last-child { display: grid; gap: 2px; min-width: 0; }
.message-attachment strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.message-attachment small { color: #7b847d; font-size: 9px; }
.outgoing .translated-copy { justify-content: flex-end; }
.message-time { display: block; font-size: 9px; color: #a0a6a1; margin: 5px 3px 0; }
.outgoing .message-time { text-align: right; }
.composer-wrap { flex: 0 0 auto; padding: 10px 20px 18px; border-top: 1px solid var(--line); background: white; }
.reply-context { height: 27px; display: flex; align-items: center; gap: 6px; color: #7d847e; font-size: 10px; }
.reply-context svg { width: 13px; color: var(--green); }
.composer { position: relative; border: 1px solid #dbe0dc; border-radius: 7px; padding: 11px 12px 9px; background: #fff; box-shadow: 0 4px 16px rgba(20,55,40,.05); }
.composer:focus-within { border-color: #7fb09d; box-shadow: 0 0 0 3px rgba(15,107,79,.08); }
.composer textarea { display: block; width: 100%; resize: none; height: 64px; min-height: 64px; max-height: 64px; overflow-y: auto; border: 0; outline: 0; color: var(--ink); }
.composer textarea::placeholder { color: #a2a8a3; }
.composer-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 7px; }
.composer-actions .icon-button { width: 31px; height: 29px; color: #7a827b; }
.attachment-preview { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding: 7px 9px; border-radius: 6px; background: #eef6f2; color: #3d5c51; font-size: 10px; }
.attachment-preview button { border: 0; background: transparent; color: #78847d; cursor: pointer; font-size: 16px; }
.emoji-panel { display: none; position: absolute; z-index: 8; left: 42px; bottom: 45px; width: 190px; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 8px; border: 1px solid #dce5df; border-radius: 9px; background: white; box-shadow: 0 12px 30px rgba(20,55,40,.18); }
.emoji-panel.open { display: grid; }
.emoji-panel button { border: 0; border-radius: 5px; padding: 5px; background: transparent; cursor: pointer; font-size: 18px; }
.emoji-panel button:hover { background: #edf5f1; }
[dir="rtl"] .message-row.incoming { flex-direction: row-reverse; }
[dir="rtl"] .sender-identity.incoming-identity { text-align: right; }
[dir="rtl"] .user-menu button, [dir="rtl"] .account-table { text-align: right; }
.send-group { display: flex; align-items: center; gap: 10px; }
.send-group > span { color: #a1a7a2; font-size: 9px; }
.send-button { width: 36px; height: 33px; padding: 0; border: 0; border-radius: 6px; background: var(--green); color: white; display: grid; place-items: center; cursor: pointer; }
.send-button:hover, .login-button:hover { background: var(--green-dark); }
.send-button svg { width: 15px; }

.details-panel { border-left: 1px solid var(--line); background: #fcfdfc; overflow-y: auto; }
.details-panel > header { height: 65px; padding: 0 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.details-panel h2 { margin: 0; font-size: 14px; }
.customer-summary { text-align: center; padding: 25px 20px 21px; border-bottom: 1px solid var(--line); }
.avatar-large { width: 64px; height: 64px; margin: 0 auto 10px; font-size: 17px; }
.customer-summary h3 { margin: 0 0 5px; font-size: 15px; }
.customer-summary p { margin: 0 0 11px; color: var(--muted); font-size: 11px; }
.customer-tag { display: inline-block; padding: 4px 8px; border-radius: 4px; background: #fff1dd; color: #8f5d12; font-size: 9px; font-weight: 700; }
.detail-section { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.detail-section h4 { margin: 0 0 14px; font-size: 11px; }
.detail-section dl { margin: 0; display: grid; gap: 14px; }
.detail-section dl > div { display: grid; grid-template-columns: 25px 1fr; gap: 5px; align-items: start; }
.detail-section dt { color: #8a928b; }
.detail-section dt svg { width: 15px; }
.detail-section dd { margin: 0; min-width: 0; }
.detail-section dd span, .detail-section dd strong { display: block; }
.detail-section dd span { color: #969d97; font-size: 9px; margin-bottom: 2px; }
.detail-section dd strong { overflow: hidden; text-overflow: ellipsis; font-size: 10px; font-weight: 500; }
.section-title { display: flex; justify-content: space-between; }
.text-button { border: 0; color: var(--green); background: transparent; font-size: 10px; cursor: pointer; }
.note { margin: 0; color: #6b736c; font-size: 10px; line-height: 1.7; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tags span, .tags button { min-height: 24px; padding: 0 8px; border: 1px solid #dfe4df; border-radius: 4px; background: white; color: #606861; font-size: 9px; }
.tags button { cursor: pointer; font-size: 14px; }
.archive-button { width: calc(100% - 40px); height: 36px; margin: 18px 20px; border: 1px solid #dfe4df; border-radius: 6px; background: white; color: #6d756e; font-size: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px; }
.archive-button svg { width: 14px; }
.directory-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 20px; border: 1px solid #dfe9e2; border-radius: 8px; background: linear-gradient(135deg, #edf7f1, #fff); }
.directory-intro h3 { margin: 0 0 6px; font-size: 16px; }
.directory-intro p { margin: 0; color: var(--muted); font-size: 10px; }
.selection-count { align-self: center; padding: 0 8px; color: var(--green); font-size: 10px; font-weight: 600; }
.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.contact-card { position: relative; display: flex; align-items: center; gap: 11px; padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: white; cursor: pointer; transition: .18s; }
.contact-card:hover { border-color: #a6c8b9; transform: translateY(-1px); }
.contact-card.selected { border-color: var(--green); background: var(--green-soft); box-shadow: 0 0 0 2px rgba(15,107,79,.08); }
.contact-card input { position: absolute; right: 12px; top: 12px; accent-color: var(--green); }
.contact-card .avatar { width: 40px; height: 40px; }
.contact-card strong, .contact-card span, .contact-card small { display: block; }
.contact-card strong { margin-bottom: 4px; font-size: 11px; }
.contact-card span { color: var(--green); font-size: 9px; }
.contact-card small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.account-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.mini-button { min-height: 28px; padding: 0 8px; border: 1px solid #dce2dd; border-radius: 4px; background: white; color: #59625b; font-size: 9px; cursor: pointer; }
.mini-button:hover { background: var(--soft); }
.mini-button.danger { color: #b44737; }
.role-badge { display: inline-block; padding: 4px 7px; border-radius: 4px; color: #53635b; background: #eef1ef; font-size: 9px; }
.role-badge.admin { color: #76500c; background: #fff1d8; }
.group-member-preview { min-height: 52px; padding: 11px; border: 1px solid var(--line); border-radius: 5px; background: var(--soft); color: var(--muted); font-size: 10px; line-height: 1.6; }
.chat-launcher { width: min(520px, 100%); }
.launcher-search { height: 42px; padding: 0 11px; border: 1px solid #dce2dd; border-radius: 6px; display: flex !important; align-items: center; grid-template-columns: none !important; gap: 8px !important; }
.launcher-search svg { width: 16px; color: #889089; }
.launcher-search input { height: 38px !important; margin: 0 !important; padding: 0 !important; border: 0 !important; outline: 0; }
.launcher-list { max-height: 330px; overflow-y: auto; margin: 12px 0; border: 1px solid var(--line); border-radius: 6px; }
.launcher-person { display: grid; grid-template-columns: 36px 1fr 20px; gap: 10px; align-items: center; padding: 11px 12px; border-bottom: 1px solid #edf0ed; cursor: pointer; }
.launcher-person:last-child { border-bottom: 0; }
.launcher-person:hover, .launcher-person.selected { background: var(--green-soft); }
.launcher-person .avatar { width: 36px; height: 36px; font-size: 10px; }
.launcher-person strong, .launcher-person span { display: block; }
.launcher-person strong { margin-bottom: 3px; font-size: 11px; }
.launcher-person span { color: var(--muted); font-size: 9px; }
.launcher-person input { width: 15px !important; height: 15px !important; margin: 0 !important; accent-color: var(--green); }
.launcher-selected { margin-right: auto; align-self: center; color: var(--green); font-size: 10px; }

.workspace-panel { display: none; grid-column: 2 / -1; min-width: 0; overflow: auto; background: #f7f9f7; }
.app-shell.management-mode .inbox-panel, .app-shell.management-mode .chat-panel { display: none; }
.app-shell.management-mode .workspace-panel { display: block; }
.app-shell.details-closed { grid-template-columns: 88px 340px minmax(440px, 1fr); }
.app-shell.details-closed .details-panel { display: none; }
.workspace-header { min-height: 92px; padding: 22px 32px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: white; }
.workspace-header h1 { margin: 0; font-size: 24px; }
.workspace-actions, .settings-save { display: flex; align-items: center; gap: 8px; }
.primary-button, .secondary-button { min-height: 38px; padding: 0 14px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 11px; font-weight: 600; cursor: pointer; }
.primary-button { border: 1px solid var(--green); background: var(--green); color: white; }
.secondary-button { border: 1px solid #dce2dd; background: white; color: #566058; }
.primary-button:hover { background: var(--green-dark); }
.secondary-button:hover { background: var(--soft); }
.primary-button svg, .secondary-button svg { width: 15px; }
.workspace-content { padding: 24px 32px 36px; }
.hidden { display: none !important; }
.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stats-row article { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.stats-row article > span, .stats-row small { display: block; color: var(--muted); font-size: 10px; }
.stats-row strong { display: block; margin: 8px 0 6px; font-size: 25px; }
.positive { color: var(--green) !important; }
.warning { color: #b56c17 !important; }
.admin-toolbar { display: flex; gap: 9px; padding: 14px; border: 1px solid var(--line); border-bottom: 0; background: white; border-radius: 7px 7px 0 0; }
.admin-search { flex: 1; height: 38px; padding: 0 11px; border: 1px solid #dde3de; border-radius: 5px; display: flex; align-items: center; gap: 8px; color: #909790; }
.admin-search svg { width: 15px; }
.admin-search input { width: 100%; min-width: 0; border: 0; outline: 0; }
.admin-toolbar select, .settings-fields select, .settings-fields input { min-height: 38px; padding: 0 11px; border: 1px solid #dde3de; border-radius: 5px; color: var(--ink); background: white; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 0 0 7px 7px; background: white; }
.customer-table { width: 100%; min-width: 780px; border-collapse: collapse; font-size: 11px; }
.customer-table th { padding: 11px 16px; text-align: left; color: #8a928b; background: #fafbfa; font-size: 9px; font-weight: 600; }
.customer-table td { padding: 14px 16px; border-top: 1px solid #edf0ed; color: #59625b; }
.customer-cell { display: flex; align-items: center; gap: 10px; }
.customer-cell .avatar { width: 35px; height: 35px; font-size: 10px; }
.customer-cell strong, .customer-cell span { display: block; }
.customer-cell strong { margin-bottom: 3px; color: var(--ink); font-size: 11px; }
.customer-cell span { color: #8a928b; font-size: 9px; }
.status-pill { display: inline-block; padding: 4px 7px; border-radius: 4px; background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 600; }
.status-pill.disabled { background: #f1eeee; color: #78716f; }
.status-pill.lead { background: #fff1dd; color: #8f5d12; }
.table-action { border: 0; background: transparent; color: var(--green); font-size: 10px; cursor: pointer; }
.analytics-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .8fr); gap: 12px; }
.chart-panel { min-width: 0; min-height: 310px; padding: 19px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.panel-title { display: flex; align-items: flex-start; justify-content: space-between; }
.panel-title h3, .settings-section h3 { margin: 0 0 5px; font-size: 13px; }
.panel-title p, .settings-section p { margin: 0; color: var(--muted); font-size: 10px; }
.panel-title > span { color: #8c948d; font-size: 9px; }
.bar-chart { height: 220px; padding-top: 28px; display: flex; align-items: flex-end; justify-content: space-around; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0 54px, #edf0ed 55px); }
.bar-item { width: 9%; height: var(--h); min-height: 14px; position: relative; border-radius: 3px 3px 0 0; background: var(--green); }
.bar-item::after { content: attr(data-label); position: absolute; left: 50%; top: calc(100% + 9px); transform: translateX(-50%); color: #858d86; font-size: 9px; }
.bar-item:hover { background: var(--coral); }
.language-breakdown { min-height: 225px; display: flex; align-items: center; justify-content: space-evenly; gap: 22px; }
.donut { width: 130px; height: 130px; flex: 0 0 auto; border-radius: 50%; display: grid; place-content: center; text-align: center; background: radial-gradient(circle, white 0 50%, transparent 51%), conic-gradient(var(--green) 0 38%, var(--coral) 38% 62%, var(--amber) 62% 80%, #6f8fa5 80%); }
.donut strong { font-size: 23px; }
.donut span { color: var(--muted); font-size: 9px; }
.language-breakdown ul { min-width: 130px; padding: 0; margin: 0; list-style: none; display: grid; gap: 13px; }
.language-breakdown li { display: grid; grid-template-columns: 8px 1fr auto; gap: 7px; align-items: center; font-size: 10px; color: var(--muted); }
.language-breakdown i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.language-breakdown li strong { color: var(--ink); }
.performance-list { margin-top: 12px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.performance-list > div { display: grid; grid-template-columns: 1fr 120px 120px 100px; padding: 13px 18px; border-top: 1px solid #edf0ed; font-size: 10px; }
.performance-list > div:first-child { border-top: 0; color: #888f89; background: #fafbfa; }
.settings-view { max-width: 1020px; }
.settings-section { display: grid; grid-template-columns: minmax(190px, .65fr) minmax(360px, 1.35fr); gap: 48px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.settings-fields { display: grid; gap: 16px; }
.settings-fields > label:not(.setting-toggle) { display: grid; gap: 7px; color: #59625b; font-size: 10px; font-weight: 600; }
.setting-toggle { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.setting-toggle strong, .setting-toggle small { display: block; }
.setting-toggle strong { font-size: 11px; margin-bottom: 4px; }
.setting-toggle small { color: var(--muted); font-size: 9px; }
.inline-fields { grid-template-columns: 1fr 1fr; }
.settings-save { justify-content: flex-end; padding-top: 18px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgba(12,30,23,.5); opacity: 0; visibility: hidden; transition: .2s; }
.modal-backdrop.open { opacity: 1; visibility: visible; }
.action-modal { width: min(460px, 100%); padding: 22px; border-radius: 8px; background: white; box-shadow: var(--shadow); transform: translateY(12px); transition: .2s; }
.modal-backdrop.open .action-modal { transform: translateY(0); }
.action-modal header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 19px; }
.action-modal h2 { margin: 0; font-size: 20px; }
.action-modal > label { display: grid; gap: 6px; margin: 0 0 13px; color: #566058; font-size: 10px; font-weight: 600; }
.action-modal input, .action-modal select, .action-modal textarea { width: 100%; padding: 10px 11px; border: 1px solid #dce2dd; border-radius: 5px; color: var(--ink); background: white; resize: vertical; }
.action-modal footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.login-overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 28px; background: rgba(9,27,21,.62); backdrop-filter: blur(8px); transition: opacity .3s, visibility .3s; }
.login-overlay.hidden { opacity: 0; visibility: hidden; }
.login-dialog { width: min(920px, 100%); min-height: 550px; display: grid; grid-template-columns: .95fr 1.05fr; overflow: hidden; border-radius: 8px; background: white; box-shadow: var(--shadow); }
.login-visual { position: relative; padding: 36px; color: white; background: #143e32; overflow: hidden; }
.login-visual::before { content: ""; position: absolute; inset: 0; opacity: .18; background-image: linear-gradient(30deg, transparent 49%, #fff 50%, transparent 51%), linear-gradient(150deg, transparent 49%, #fff 50%, transparent 51%); background-size: 52px 90px; }
.conversation-preview { position: relative; margin: 60px 0 60px; display: flex; flex-direction: column; }
.preview-bubble { max-width: 83%; padding: 13px 15px; border-radius: 7px; font-size: 13px; line-height: 1.5; }
.preview-in { background: white; color: var(--ink); }
.preview-out { align-self: flex-end; margin-top: 25px; background: var(--coral); color: white; }
.translation-line { display: flex; gap: 6px; margin: 8px 6px 0; color: rgba(255,255,255,.67); font-size: 10px; }
.translation-line svg { width: 13px; }
.translation-line.align-right { align-self: flex-end; }
.preview-sender { align-self: flex-end; margin: 6px 5px -20px; color: rgba(255,255,255,.72); font-size: 9px; font-weight: 600; }
.login-visual blockquote { position: absolute; left: 36px; right: 36px; bottom: 32px; margin: 0; color: rgba(255,255,255,.72); font-size: 12px; line-height: 1.7; }
.login-form { padding: 62px 64px 45px; }
.login-form h2 { margin: 0 0 9px; font-size: 28px; }
.auth-mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin: 0 0 25px; padding: 3px; border-radius: 6px; background: #f0f3f0; }
.auth-mode-tabs button { height: 32px; border: 0; border-radius: 4px; background: transparent; color: #778078; font-size: 11px; font-weight: 600; cursor: pointer; }
.auth-mode-tabs button.active { color: var(--green); background: white; box-shadow: 0 1px 4px rgba(25,55,40,.09); }
.login-form > label:not(.remember) { display: block; margin: 0 0 16px; color: #4b554e; font-size: 11px; font-weight: 600; }
.login-form input:not([type="checkbox"]), .login-form select { width: 100%; height: 42px; margin-top: 7px; padding: 0 12px; border: 1px solid #dce2dd; border-radius: 5px; background: #fff; color: var(--ink); outline: none; }
.password-field { position: relative; }
.password-field input { padding-right: 42px !important; }
.password-field button { position: absolute; right: 4px; bottom: 3px; width: 36px; height: 36px; border: 0; background: transparent; color: #8c938d; cursor: pointer; }
.password-field svg { width: 16px; }
.remember { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 10px; margin: 4px 0 19px; }
.remember input { accent-color: var(--green); }
.remember a { margin-left: auto; color: var(--green); text-decoration: none; white-space: nowrap; }
.login-button { width: 100%; height: 44px; border: 0; border-radius: 5px; background: var(--green); color: white; font-weight: 600; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px; }
.login-button svg { width: 15px; }
.privacy { display: flex; justify-content: center; align-items: center; gap: 5px; margin: 19px 0 0; color: #929992; font-size: 9px; }
.privacy svg { width: 13px; color: var(--green); }
.mobile-logo { display: none; }
.toast { position: fixed; z-index: 30; left: 50%; bottom: 26px; transform: translate(-50%, 20px); display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 6px; background: #183e32; color: white; box-shadow: 0 9px 25px rgba(0,0,0,.17); opacity: 0; pointer-events: none; transition: .25s; font-size: 11px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 15px; color: #80d4ab; }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 76px 310px minmax(420px, 1fr); }
  .details-panel { display: none; }
  .workspace-panel { grid-column: 2 / -1; }
}
@media (max-width: 800px) {
  body { overflow: auto; }
  .app-shell { grid-template-columns: 1fr; min-height: 100vh; padding-bottom: 62px; }
  .app-shell.no-conversation { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; height: 62px; padding: 5px 10px; display: flex; flex-direction: row; background: #123c30; }
  .brand, .user-card { display: none; }
  .primary-nav { width: 50%; display: grid; grid-template-columns: repeat(2, 1fr); }
  .sidebar-bottom { width: 50%; margin: 0; display: grid; grid-template-columns: 1fr 1fr; }
  .nav-item { width: 100%; min-height: 52px; }
  .nav-item em { right: calc(50% - 23px); }
  .inbox-panel { min-height: calc(100vh - 62px); }
  .chat-panel { position: fixed; inset: 0 0 62px; z-index: 5; transform: translateX(100%); transition: transform .25s; }
  .chat-panel.mobile-open { transform: translateX(0); }
  .mobile-back { display: inline-grid; }
  .header-actions .icon-button:not(:last-child) { display: none; }
  .login-overlay { padding: 14px; }
  .login-dialog { min-height: 0; grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-form { padding: 38px 28px 30px; }
  .mobile-logo { display: flex; align-items: center; gap: 9px; margin-bottom: 38px; font-weight: 700; }
  .workspace-panel { grid-column: 1; min-height: calc(100vh - 62px); }
  .workspace-header { padding: 18px 16px; }
  .workspace-header h1 { font-size: 20px; }
  .workspace-actions .secondary-button { display: none; }
  .workspace-content { padding: 16px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stats-row article { padding: 14px; }
  .stats-row strong { font-size: 20px; }
  .analytics-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr 1fr; }
  .performance-list > div { grid-template-columns: 1fr 72px 82px; }
  .performance-list > div > *:nth-child(4) { display: none; }
  .settings-section { grid-template-columns: 1fr; gap: 18px; }
  .inline-fields { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .translation-state > span:last-child { display: none; }
  .chat-header { height: 72px; padding: 0 13px; }
  .messages { padding: 20px 14px; }
  .message-stack { max-width: 86%; }
  .send-group > span { display: none; }
  .composer-wrap { padding: 8px 10px 10px; }
  .contact-grid { grid-template-columns: 1fr; }
  .directory-intro { align-items: flex-start; }
  .directory-intro p { max-width: 210px; }
  .nav-item span { font-size: 9px; }
}
