:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17202a;
  background: #eef1f4;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 1180px; background: #eef1f4; }
button, input, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 64px; display: grid; grid-template-columns: 300px 1fr 300px; align-items: center;
  padding: 0 20px; background: #ffffff; border-bottom: 1px solid #dfe3e8;
}
.brand, .customer-heading, .name-row, .top-actions, .chat-actions, .composer-options { display: flex; align-items: center; }
.brand { gap: 11px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: #17202a; color: white; border-radius: 6px; font-weight: 800; }
.brand div { display: grid; gap: 2px; }
.brand strong { font-size: 14px; }
.brand span { color: #7a8490; font-size: 11px; }
.main-nav { display: flex; justify-content: center; align-self: stretch; gap: 4px; }
.nav-item { border: 0; border-bottom: 2px solid transparent; background: transparent; color: #69737f; padding: 0 18px; font-size: 13px; }
.nav-item.active { color: #17202a; border-bottom-color: #ef4b4b; font-weight: 700; }
.top-actions { justify-content: flex-end; gap: 18px; }
.live-status { color: #52606d; font-size: 12px; }
.live-status i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #1aa36f; margin-right: 7px; }
.operator { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #e7eef7; color: #28557f; font-weight: 700; }

.workspace { flex: 1; display: grid; grid-template-columns: 330px minmax(500px, 1fr) 340px; height: calc(100vh - 64px); }
.queue-panel, .chat-panel, .detail-panel { min-width: 0; background: #fff; }
.queue-panel { border-right: 1px solid #dfe3e8; overflow: hidden; display: flex; flex-direction: column; }
.detail-panel { border-left: 1px solid #dfe3e8; overflow-y: auto; }
.chat-panel { display: grid; grid-template-rows: 70px 38px minmax(220px, 1fr) auto; background: #f7f8fa; }

.panel-heading { height: 76px; padding: 16px 18px 12px; display: flex; align-items: center; justify-content: space-between; }
.eyebrow { margin: 0 0 3px; text-transform: uppercase; color: #ef4b4b; font-size: 10px; font-weight: 800; }
h1, h2, h3, p { letter-spacing: 0; }
h1 { margin: 0; font-size: 18px; }
.icon-button { width: 32px; height: 32px; border: 1px solid #dfe3e8; border-radius: 6px; background: #fff; color: #52606d; font-size: 18px; }
.queue-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid #edf0f2; border-bottom: 1px solid #edf0f2; }
.stat { height: 58px; display: grid; place-content: center; gap: 2px; border: 0; border-right: 1px solid #edf0f2; background: #fff; color: #7a8490; }
.stat:last-child { border-right: 0; }
.stat strong { font-size: 16px; color: #303a44; }
.stat span { font-size: 10px; }
.stat.active { box-shadow: inset 0 -2px #ef4b4b; background: #fffafa; }
.search { margin: 12px 14px 8px; position: relative; }
.search span { position: absolute; left: 11px; top: 9px; font-size: 11px; color: #8b949e; }
.search input { width: 100%; height: 34px; border: 1px solid #dfe3e8; border-radius: 6px; padding: 0 10px 0 56px; outline: none; }
.filters { display: flex; gap: 6px; padding: 0 14px 10px; }
.filter { border: 1px solid #dfe3e8; border-radius: 5px; background: #fff; color: #69737f; padding: 5px 9px; font-size: 10px; }
.filter.active { background: #27313b; border-color: #27313b; color: #fff; }
.conversation-list { overflow-y: auto; border-top: 1px solid #edf0f2; }
.conversation { width: 100%; min-height: 82px; padding: 12px 14px; display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; text-align: left; border: 0; border-bottom: 1px solid #edf0f2; background: #fff; }
.conversation:hover { background: #fafbfc; }
.conversation.active { background: #f1f6fb; box-shadow: inset 3px 0 #3278b7; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #dce9f5; color: #28557f; font-weight: 800; font-size: 12px; }
.conversation-copy { min-width: 0; }
.conversation-title { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.conversation-title strong { font-size: 12px; }
.conversation-title time { color: #8b949e; font-size: 9px; white-space: nowrap; }
.conversation-copy p { margin: 0; color: #69737f; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-copy small { display: block; margin-top: 7px; color: #8b949e; font-size: 9px; }
.unread { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: #ef4b4b; color: white; font-size: 9px; font-weight: 800; }

.chat-header { padding: 0 20px; display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid #dfe3e8; }
.customer-heading { gap: 11px; }
.customer-heading h2 { margin: 0; font-size: 15px; }
.customer-heading p { margin: 4px 0 0; color: #7a8490; font-size: 10px; }
.name-row { gap: 8px; }
.language { padding: 3px 6px; border-radius: 4px; background: #eaf5ef; color: #14724f; font-size: 9px; font-weight: 800; }
.chat-actions { gap: 8px; }
.primary, .secondary, .send-button, .full-width { border-radius: 5px; padding: 8px 13px; font-size: 11px; font-weight: 700; }
.primary, .send-button { border: 1px solid #17202a; background: #17202a; color: white; }
.secondary { border: 1px solid #d6dbe0; background: white; color: #52606d; }
.context-strip { display: flex; align-items: center; gap: 18px; padding: 0 20px; background: #fff; border-bottom: 1px solid #dfe3e8; color: #6c7680; font-size: 9px; }
.context-strip b { color: #303a44; margin-right: 5px; }
.context-strip .sla { margin-left: auto; color: #a5571a; }

.message-stream { overflow-y: auto; padding: 24px max(24px, 7%); }
.time-divider { text-align: center; color: #929ba5; font-size: 9px; margin-bottom: 18px; }
.message-row { display: flex; margin-bottom: 16px; }
.message-row.operator-message { justify-content: flex-end; }
.message-bubble { max-width: 68%; }
.message-bubble .original { margin: 0; padding: 10px 12px; border-radius: 6px; background: #fff; border: 1px solid #dfe3e8; font-size: 12px; line-height: 1.5; }
.operator-message .original { color: #fff; background: #28557f; border-color: #28557f; }
.translation { margin: 5px 0 0; padding-left: 8px; border-left: 2px solid #cbd3da; color: #69737f; font-size: 10px; line-height: 1.4; }
.message-meta { display: block; color: #8b949e; font-size: 8px; margin-top: 5px; }
.operator-message .message-meta { text-align: right; }

.composer { margin: 0 18px 18px; background: white; border: 1px solid #d7dde3; border-radius: 7px; box-shadow: 0 3px 12px rgba(35, 45, 55, .07); }
.suggestion-row { height: 37px; display: flex; align-items: center; gap: 7px; padding: 0 12px; border-bottom: 1px solid #edf0f2; }
.suggestion-row span { color: #7a8490; font-size: 9px; margin-right: 3px; }
.suggestion-row button { border: 1px solid #dfe3e8; border-radius: 4px; background: #f8fafb; color: #52606d; padding: 4px 7px; font-size: 9px; }
.translation-box { display: grid; grid-template-columns: 1fr 1px 1fr; min-height: 112px; }
.translation-divider { background: #edf0f2; }
.translation-column { padding: 10px 12px; }
.translation-column label { display: block; margin-bottom: 6px; color: #69737f; font-size: 9px; font-weight: 700; }
.translation-column textarea { width: 100%; min-height: 70px; resize: none; border: 0; outline: 0; padding: 0; color: #303a44; font-size: 11px; line-height: 1.5; }
.composer-footer { min-height: 44px; padding: 7px 9px 7px 12px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #edf0f2; }
.composer-options { gap: 10px; }
.composer-options button { border: 0; background: transparent; color: #52606d; padding: 0; font-size: 9px; }
.composer-options label { padding-left: 4px; border-left: 1px solid #dfe3e8; color: #52606d; font-size: 9px; }
.composer-options input { vertical-align: middle; }
.send-button { min-width: 92px; }

.detail-tabs { position: sticky; top: 0; z-index: 2; height: 48px; display: grid; grid-template-columns: repeat(3, 1fr); background: #fff; border-bottom: 1px solid #dfe3e8; }
.detail-tabs button { border: 0; border-bottom: 2px solid transparent; background: transparent; color: #7a8490; font-size: 11px; }
.detail-tabs button.active { color: #17202a; border-bottom-color: #ef4b4b; font-weight: 800; }
.detail-content { display: none; }
.detail-content.active { display: block; }
.detail-section { padding: 17px 18px; border-bottom: 1px solid #e6eaee; }
.detail-section h3 { margin: 0 0 13px; font-size: 12px; }
.section-title { display: flex; align-items: center; justify-content: space-between; }
.section-title span { padding: 3px 6px; border-radius: 4px; background: #eaf5ef; color: #14724f; font-size: 9px; font-weight: 800; }
.order-id { margin: -6px 0 13px; color: #7a8490; font-size: 9px; }
.product-line { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; }
.product-swatch { width: 44px; height: 44px; border-radius: 5px; background: repeating-linear-gradient(135deg, #ef4b4b 0 7px, #f4c44f 7px 14px, #2a8b78 14px 21px, #3976b8 21px 28px); }
.product-line div:nth-child(2) { display: grid; gap: 3px; min-width: 0; }
.product-line strong { font-size: 10px; }
.product-line span, .product-line small { color: #7a8490; font-size: 8px; }
.product-line b { font-size: 11px; }
.timeline { list-style: none; padding: 0; margin: 0 0 15px 7px; }
.timeline li { position: relative; padding: 0 0 16px 18px; border-left: 1px solid #d6dce2; display: grid; gap: 3px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -4px; top: 1px; width: 7px; height: 7px; border-radius: 50%; background: #c5ccd3; }
.timeline li.done::before { background: #1aa36f; }
.timeline li.current::before { background: #ef4b4b; box-shadow: 0 0 0 3px #fce2e2; }
.timeline b { font-size: 9px; }
.timeline span { color: #7a8490; font-size: 8px; }
.full-width { width: 100%; border: 1px solid #d6dbe0; background: #fff; color: #303a44; }
.compact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.compact-grid div { display: grid; gap: 4px; }
.compact-grid span { color: #7a8490; font-size: 8px; }
.compact-grid b { font-size: 9px; }
.low-risk { color: #14724f; }
.profile-list { margin: 0; }
.profile-list div { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #edf0f2; }
.profile-list dt, .profile-list dd { margin: 0; font-size: 10px; }
.profile-list dt { color: #7a8490; }
.empty-state { color: #7a8490; font-size: 10px; }

@media (max-height: 760px) {
  .workspace { height: calc(100vh - 58px); }
  .topbar { height: 58px; }
  .panel-heading { height: 68px; }
  .conversation { min-height: 72px; }
  .message-stream { padding-top: 16px; padding-bottom: 16px; }
  .translation-column textarea { min-height: 54px; }
  .translation-box { min-height: 94px; }
}
