:root {
  --blue: #3470ff;
  --action: #3470ff;
  --ink: #24324a;
  --muted: #71839c;
  --border: #dfe7f2;
  --canvas: #f1f5fb;
  --field-text: #24324a;
  --field-border: #8092ab;
  --field-placeholder: #65758b;
  --field-focus: #3470ff;
  --sidebar: 212px;
  --header: 76px;
  --list: 290px;
  --details: 360px;
  --composer-height: 190px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button, a { touch-action: manipulation; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; }
button:disabled { opacity: .45; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: #245add; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); }
[hidden] { display: none !important; }
input, select, textarea {
  min-width: 0;
  border: 1px solid var(--field-border);
  border-radius: 8px;
  background: #f8faff;
  color: var(--field-text);
  caret-color: var(--blue);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input, select { height: 40px; padding: 0 12px; }
textarea { padding: 11px 12px; resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: var(--field-placeholder); opacity: 1; }
input:autofill { -webkit-text-fill-color: var(--field-text); }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #3470ff1c; background: #fff; }
input:read-only:not([type="checkbox"]) { background: #edf2f8; color: #536780; }
input:disabled, select:disabled, textarea:disabled { background: #edf2f8; color: #65758b; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; padding: 0; accent-color: var(--blue); flex: none; }
button {
  min-height: 38px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
button:hover:not(:disabled) { background: #2860df; }
button.secondary, button.outline {
  border-color: var(--border);
  background: #fff;
  color: #536780;
}
button.secondary:hover:not(:disabled), button.outline:hover:not(:disabled) { background: #f1f5ff; border-color: #b8cafa; color: #2860df; }
button.outline { min-height: 30px; padding: 5px 10px; font-size: 12px; border-radius: 6px; }
button.link { min-height: 0; padding: 0; border: 0; background: transparent; color: var(--blue); font-weight: 500; }
button.link:hover:not(:disabled) { background: transparent; color: #245add; }
button.danger { background: #db4c67; }
button.danger:hover:not(:disabled) { background: #bf3653; }
button.square { min-height: 32px; padding: 6px; background: transparent; color: #71839c; display: inline-grid; place-items: center; }
button.square:hover:not(:disabled) { background: #edf3ff; }
button.square img { width: 18px; height: 18px; }
.muted { color: var(--muted); }
.error { color: #ca3d59; font-size: 12px; line-height: 1.6; }
.success, .paid { color: #16825f; }
.cancelled { color: #ca3d59; }
.pending { color: #a96a10; }
td .success, td .paid, td .cancelled, td .pending, .detail-field .paid, .detail-field .pending, .detail-field .cancelled {
  display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 6px; font-size: 12px; line-height: 1.4;
}
td .success, td .paid, .detail-field .paid { background: #eaf7f1; }
td .cancelled, .detail-field .cancelled { background: #fff0f3; }
td .pending, .detail-field .pending { background: #fff6e7; }
.empty { min-height: 180px; height: 100%; display: grid; place-content: center; text-align: center; gap: 10px; padding: 24px; color: var(--muted); line-height: 1.6; }
.empty p { margin: 0; font-size: 12px; color: #8796ac; }
.avatar { flex-shrink: 0; border-radius: 12px; object-fit: cover; }

/* Navigation and account header share the customer-service workbench palette. */
.workspace { height: 100dvh; overflow: hidden; display: grid; grid-template-columns: var(--sidebar) minmax(0,1fr); grid-template-rows: var(--header) minmax(0,1fr); }
.sidebar { grid-row: 1/3; position: relative; background: #fff; border-right: 1px solid var(--border); padding: 0 14px; }
.brand { height: var(--header); display: flex; align-items: center; gap: 12px; padding: 0 10px; white-space: nowrap; }
.brand > img { width: 30px; height: 30px; object-fit: contain; }
.brand strong { color: #24324a; font-size: 24px; letter-spacing: -.6px; font-weight: 750; }
.sidebar nav { display: grid; gap: 6px; padding-top: 24px; }
.sidebar nav a { min-height: 48px; padding: 12px 16px; display: flex; align-items: center; gap: 14px; border: 1px solid transparent; border-radius: 9px; color: #71839c; font-size: 14px; font-weight: 600; }
.sidebar nav .nav-icon { display: grid; flex: none; width: 21px; height: 21px; }
.sidebar nav .nav-icon img { grid-area: 1/1; width: 100%; height: 100%; object-fit: contain; }
.sidebar nav .nav-icon-active { opacity: 0; }
.sidebar nav a.active .nav-icon-default { opacity: 0; }
.sidebar nav a.active .nav-icon-active { opacity: 1; }
.sidebar nav a:hover { background: #f6f9ff; color: #536780; }
.sidebar nav a.active { color: var(--blue); background: #edf3ff; border-color: #e3ebff; }
.collapse { position: absolute; right: -10px; bottom: 28px; width: 22px; min-height: 32px; padding: 5px 2px; border: 1px solid var(--border); border-radius: 6px; background: #fff; z-index: 6; }
.collapse:hover:not(:disabled) { background: #edf3ff; }
.collapse img { display: block; width: 14px; margin: auto; }
.workspace.collapsed { --sidebar: 76px; }
.collapsed .sidebar { padding: 0 10px; }
.collapsed .brand { justify-content: center; padding: 0; }
.collapsed .brand strong, .collapsed nav span { display: none; }
.collapsed .sidebar nav a { padding: 12px; justify-content: center; gap: 0; }
.topbar { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 28px; background: #fff; border-bottom: 1px solid var(--border); z-index: 5; }
.workspace-heading { display: flex; align-items: center; gap: 12px; min-width: 0; white-space: nowrap; color: #8796ac; font-size: 13px; }
.workspace-heading strong { color: var(--ink); font-size: 15px; font-weight: 650; }
.heading-divider { color: #c6d2e3; }
.topbar-account { display: flex; align-items: center; gap: 24px; min-width: 0; }
.stock { display: flex; align-items: center; gap: 7px; padding: 9px 12px; border: 1px solid #e4ebf5; border-radius: 8px; background: #f8faff; font-size: 12px; color: #71839c; white-space: nowrap; }
.stock img { width: 16px; height: 16px; object-fit: contain; }
.stock b { color: #24324a; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.identity { position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; }
.presence { display: flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: #f8faff; color: #159263; }
.presence > span { width: 8px; height: 8px; flex: none; border-radius: 50%; background: currentColor; }
.presence > span img { display: none; }
.presence[data-presence="busy"] { color: #6b7280; }
.presence[data-presence="offline"] { color: #db4c67; }
.presence select { height: 36px; width: 56px; border: 0; border-radius: 0; padding: 0 16px 0 0; appearance: none; color: inherit; font-size: 12px; font-weight: 600; background: url("/assets/assets/f6bb6.svg") right center/10px auto no-repeat; box-shadow: none; }
.identity-line { height: 22px; border-right: 1px solid var(--border); }
.staff-avatar { width: 34px; height: 34px; display: grid; place-items: center; background: #edf3ff; border-radius: 10px; }
.staff-avatar > img { width: 28px; height: 28px; display: block; }
.profile-menu { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 180px; padding: 8px 0; background: transparent; color: var(--ink); font-size: 13px; }
.profile-menu:hover:not(:disabled) { background: transparent; color: var(--blue); }
.profile-menu #nickname { overflow: hidden; text-overflow: ellipsis; }
.profile-menu > img { width: 12px; }
.profile-dropdown { position: absolute; right: 0; top: calc(100% + 10px); min-width: 144px; padding: 5px; border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: 0 8px 28px #24324a18; }
.profile-dropdown > * { display: block; width: 100%; padding: 11px 12px; border: 0; border-radius: 6px; background: transparent; color: #536780; font-size: 12px; text-align: left; }
.profile-dropdown > *:hover, .profile-dropdown > button:hover:not(:disabled) { background: #f1f5fb; }
.profile-dropdown #logout { color: #ca3d59; }
.main { min-width: 0; min-height: 0; overflow: auto; background: var(--canvas); }
.connection { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 40; padding: 10px 16px; border: 1px solid #f1d8a3; border-radius: 9px; background: #fff7e6; color: #99600f; font-size: 12px; box-shadow: 0 4px 20px #24324a10; }
.toasts { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; pointer-events: none; }
.toast { max-width: 90vw; padding: 13px 20px; border-radius: 10px; background: #24324a; color: #fff; box-shadow: 0 6px 25px #24324a26; font-size: 13px; line-height: 1.6; }

/* A compact, readable login card replaces the scaled illustration layout. */
.login-screen { position: fixed; inset: 0; display: grid; place-items: center; overflow: auto; padding: 32px 20px; background: radial-gradient(ellipse at 15% 0%,#e6eeff 0,transparent 50%),var(--canvas); }
.login-art { width: min(100%,440px); }
.login-form { display: grid; gap: 20px; width: 100%; margin: auto; padding: 36px; border: 1px solid var(--border); border-radius: 20px; background: #fff; box-shadow: 0 20px 70px #2442720c; }
.login-logo { width: 52px; height: 52px; object-fit: contain; padding: 4px; border: 1px solid #e6edfa; border-radius: 14px; background: #f8faff; }
.login-heading { margin: 0 0 4px; }
.eyebrow { margin: 0 0 12px; color: #71839c; font-size: 11px; font-weight: 700; letter-spacing: 1.4px; }
.login-heading h2 { margin: 0 0 10px; color: var(--ink); font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.login-heading > p:last-child { margin: 0; color: #71839c; font-size: 12px; line-height: 1.7; }
.login-form > label:not(.remember) { display: grid; gap: 9px; color: #536780; font-size: 13px; }
.login-form input:not([type="checkbox"]) { width: 100%; height: 44px; font-size: 14px; }
.remember { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #536780; }
.remember input { margin: 0; }
.login-submit { height: 44px; width: 100%; margin-top: 0; font-size: 14px; }
.login-form .error { margin: 0; }
.login-form .error:empty { display: none; }

/* Conversation list, message panel and member information. */
.chat-layout { display: grid; grid-template-columns: var(--list) minmax(260px,1fr) var(--details); height: calc(100% - 48px); min-height: 0; margin: 24px; background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.conversation-list { min-height: 0; min-width: 0; background: #fcfdff; border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.conversation-tabs { display: flex; align-items: stretch; flex-shrink: 0; height: 64px; padding: 0 10px; border-bottom: 1px solid var(--border); background: #fff; }
.conversation-tabs button { flex: 1; min-width: 0; padding: 0 5px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; color: #6d809c; font-size: 12px; }
.conversation-tabs button:hover:not(:disabled) { background: #f8faff; color: var(--blue); }
.conversation-tabs button.active { color: var(--blue); border-bottom-color: var(--blue); }
.conversation-items { overflow: auto; flex: 1; }
.conversation-pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px; border-top: 1px solid var(--border); background: #fff; font-size: 11px; color: var(--muted); }
.conversation-pager:empty { display: none; }
.conversation-pager button { font-size: 11px; }
.conversation-item { position: relative; display: flex; align-items: center; gap: 11px; height: 92px; width: 100%; padding: 18px 16px; border: 0; border-bottom: 1px solid #edf1f7; border-radius: 0; background: transparent; color: var(--ink); text-align: left; font-weight: 400; }
.conversation-item:hover:not(:disabled) { background: #f5f8ff; }
.conversation-item.active { background: #edf3ff; box-shadow: inset 3px 0 var(--blue); }
.customer-avatar { width: 38px; height: 38px; display: grid; place-content: center; background: #eaf1ff; color: var(--blue); font-size: 16px; font-weight: 700; }
.conversation-item .words { min-width: 0; flex: 1; }
.conversation-item strong { display: block; padding-right: 35px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650; }
.conversation-item p { max-width: 100%; margin: 7px 0 0; padding-right: 36px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: #7f90a8; }
.conversation-item time { position: absolute; top: 19px; right: 13px; color: #8796ac; font-size: 10px; }
.conversation-item .queued { position: absolute; right: 13px; bottom: 18px; padding: 3px 6px; border-radius: 5px; background: #e8efff; color: var(--blue); font-size: 10px; }
.badge { position: absolute; right: 14px; bottom: 18px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 5px; border-radius: 10px; background: var(--blue); color: #fff; font-size: 10px; }
.badge > img { display: none; }
.chat-center { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #f8faff; }
.chat-head { height: 64px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--border); background: #fff; font-size: 13px; }
.chat-head strong { max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 650; }
.chat-head .duration { color: #8796ac; font-size: 11px; }
.chat-head button { font-size: 12px; }
.transcript { flex: 1; min-height: 120px; overflow: auto; padding: 24px; display: flex; flex-direction: column; gap: 22px; scroll-behavior: auto; overscroll-behavior: contain; }
.transcript > * { flex-shrink: 0; }
.system-message { color: #8796ac; font-size: 11px; text-align: center; line-height: 1.6; }
.message { display: flex; align-items: flex-start; gap: 10px; max-width: 90%; }
.message.mine { flex-direction: row-reverse; align-self: flex-end; }
.message .avatar { width: 34px; height: 34px; border-radius: 10px; }
.staff-message-avatar { display: grid; place-items: center; background: #edf3ff; color: var(--blue); font-weight: 700; overflow: hidden; }
.staff-message-avatar > img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.staff-message-avatar > [hidden], .customer-mark > [hidden] { display: none !important; }
.message-body { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.message.mine .message-body { align-items: flex-end; }
.message time { color: #8796ac; font-size: 10px; }
.bubble { padding: 11px 15px; border: 1px solid var(--border); border-radius: 2px 12px 12px 12px; background: #fff; color: #42536d; font-size: 14px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.mine .bubble { border-color: var(--blue); border-radius: 12px 2px 12px 12px; background: var(--blue); color: #fff; }
.message-image { display: block; max-width: min(260px,100%); max-height: 300px; object-fit: contain; border-radius: 8px; cursor: zoom-in; }
.message-image.error { width: 200px; height: 110px; background: #f1f5fb; }
.message.pending-send { opacity: .6; }
.message .image-error { color: #ca3d59; font-size: 11px; }
.history-button { align-self: center; font-size: 11px; }
.composer { position: relative; height: var(--composer-height); flex-shrink: 0; padding: 0 18px 54px; border-top: 1px solid var(--border); background: #fff; }
.toolbar { display: flex; align-items: center; gap: 5px; height: 44px; }
.toolbar .tool { display: grid; place-items: center; width: 32px; min-height: 32px; height: 32px; padding: 6px; border: 0; border-radius: 7px; background: transparent; color: #71839c; }
.toolbar .tool:hover:not(:disabled) { background: #edf3ff; color: var(--blue); }
.tool svg { width: 20px; height: 20px; }
.composer textarea { display: block; width: 100%; height: calc(var(--composer-height) - 100px); min-height: 44px; padding: 4px 0; border: 0; border-radius: 0; background: #fff; box-shadow: none; resize: none; font-size: 13px; }
.send-button { position: absolute; right: 18px; bottom: 14px; min-width: 96px; min-height: 36px; height: 36px; padding: 7px 14px; font-size: 12px; }
.composer .send-hint { position: absolute; left: 18px; bottom: 24px; color: #8796ac; font-size: 10px; }
.chat-details { min-width: 0; min-height: 0; border-left: 1px solid var(--border); overflow: auto; background: #fff; }
.detail-tabs { display: flex; height: 50px; align-items: stretch; gap: 20px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.detail-tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: 0; background: transparent; color: #71839c; font-size: 13px; }
.detail-tabs button.active { border-bottom-color: var(--blue); color: var(--blue); }
.detail-tabs button:hover:not(:disabled) { background: transparent; color: var(--blue); }
.detail-title { min-height: 42px; display: flex; align-items: center; gap: 9px; padding: 12px 16px 6px; color: var(--ink); font-size: 14px; font-weight: 650; }
.detail-title img { width: 12px; max-height: 16px; object-fit: contain; opacity: .6; }
.detail-body { padding: 12px 16px 16px; color: #42536d; font-size: 13px; }
.detail-body h3 { margin: 24px 0 12px; padding-top: 22px; border-top: 1px solid var(--border); font-size: 13px; }
.detail-field { min-height: 34px; display: grid; grid-template-columns: 78px minmax(0,1fr); align-items: center; gap: 8px; }
.detail-field > label { color: #71839c; font-size: 12px; white-space: nowrap; }
.detail-field input, .detail-field select { width: 100%; height: 32px; font-size: 12px; }
.detail-field .field-value { min-width: 0; overflow-wrap: anywhere; line-height: 1.7; }
.inline-control { min-width: 0; display: flex; align-items: center; gap: 8px; }
.inline-control button { flex: none; min-height: 32px; padding: 6px 9px; font-size: 11px; }
.detail-field .order-number { font-size: 11px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.copy { flex: none; min-height: 22px; height: auto; padding: 3px 6px; border: 1px solid #d6e2ff; border-radius: 5px; background: #edf3ff; color: var(--blue); font-size: 10px; line-height: 1.4; }
.copy:hover:not(:disabled) { background: #e1ebff; }
.detail-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.detail-actions button { min-height: 32px; padding: 6px 10px; font-size: 12px; }
.detail-actions button.link { min-height: 24px; padding: 3px 0; }
.detail-note { margin: 8px 0 0; color: #71839c; font-size: 11px; line-height: 1.6; }
.session-orders { margin-top: 14px; }
.session-orders > h3 { margin: 0 0 10px; padding-top: 12px; }
.session-order { padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: #f8faff; }
.session-order + .session-order { margin-top: 10px; }
.session-order-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.session-order-head .inline-control { flex: 1; align-items: flex-start; }
.session-order-head .order-number { font-size: 11px; line-height: 1.6; }
.session-order-status { flex: none; font-size: 11px; line-height: 1.6; }
.session-order .detail-field { min-height: 28px; grid-template-columns: 64px minmax(0,1fr); gap: 6px; }
.session-order .field-value { font-size: 12px; }
.session-order .inline-control { flex-wrap: wrap; }
.session-order .copy { min-height: 22px; padding: 3px 6px; }
.session-order-amount { color: var(--blue); font-size: 15px; font-variant-numeric: tabular-nums; }
.session-order .detail-actions { justify-content: flex-end; margin-top: 8px; }
.session-order .session-order-edit { flex-wrap: nowrap; }
.session-order-edit input { flex: 1; min-width: 0; }
.session-order-hint { margin: 0 0 6px; color: #8796ac; font-size: 10px; line-height: 1.5; }
.detail-create { padding: 22px; }
.detail-create form { display: grid; gap: 18px; }
.detail-create label { display: grid; gap: 9px; color: #536780; font-size: 12px; }

/* Payment cards keep the amount and choice of payment method easy to scan. */
.payment-card { width: 288px; max-width: 100%; padding: 18px 16px 14px; border: 1px solid var(--border); border-radius: 14px; background: #fff; color: #536780; font-size: 12px; text-align: center; box-shadow: 0 4px 14px #24427208; }
.payment-card > p { margin-bottom: 18px; line-height: 1.7; }
.payment-card .amount { display: block; margin-top: 7px; color: var(--blue); font-size: 24px; line-height: 1.5; font-weight: 750; font-variant-numeric: tabular-nums; }
.payment-methods { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.payment-methods button, .payment-methods .payment-method-option { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; min-width: 0; min-height: 82px; padding: 10px 4px; border: 1px solid #e7edf7; border-radius: 9px; background: #fafcff; color: #536780; font-size: 11px; font-weight: 500; }
.payment-methods button:hover:not(:disabled) { border-color: #a6bfff; background: #edf3ff; }
.payment-methods img { width: 32px; height: 32px; object-fit: contain; }
.payment-card footer { margin-top: 16px; color: #8796ac; font-size: 10px; }
.payment-card .pay-state { padding: 14px 0; color: #16825f; font-size: 14px; font-weight: 600; }
.pay-snapshot { display: grid; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.pay-snapshot img { max-width: 170px; max-height: 170px; margin: auto; object-fit: contain; border-radius: 8px; }
.pay-snapshot p { margin: 0; }
.popover { position: absolute; left: 18px; bottom: var(--composer-height); z-index: 12; width: min(420px,calc(100% - 36px)); max-height: 380px; overflow: auto; padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 12px 36px #24324a1c; }
.popover-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; font-size: 13px; font-weight: 600; }
.popover .quick-add { display: flex; gap: 8px; }
.popover .quick-add input { flex: 1; }
.quick-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid #edf1f7; }
.quick-row button:first-child { flex: 1; padding: 0; background: transparent; color: #536780; font-size: 12px; text-align: left; white-space: normal; line-height: 1.7; }
.emoji-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 6px; }
.emoji-grid button { min-width: 0; padding: 4px; border: 0; background: transparent; font-size: 24px; }
.emoji-grid button:hover:not(:disabled) { background: #edf3ff; }

/* Management, data tables and personal settings. */
.management { display: flex; flex-direction: column; gap: 20px; min-width: 0; padding: 26px; }
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 20px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.filters input { width: 190px; font-size: 12px; }
.filters select { width: 120px; font-size: 12px; }
.filters input[type="datetime-local"] { width: 208px; font-size: 12px; }
.filters .range { display: flex; align-items: center; gap: 9px; font-size: 12px; color: #8796ac; }
.filters .primary, .management > .primary { align-self: flex-start; font-size: 12px; }
.management > .primary { margin-bottom: -4px; }
.table-panel { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 320px; padding: 22px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.table-scroll { overflow: auto; flex: 1; }
table { width: 100%; border-collapse: separate; border-spacing: 0; color: #536780; font-size: 12px; white-space: nowrap; }
th, td { height: 54px; padding: 13px 16px; border: 0; border-bottom: 1px solid #eaf0f7; text-align: left; font-weight: 400; }
th { height: 46px; background: #f6f9fd; color: #71839c; font-size: 11px; font-weight: 600; }
th:first-child { border-radius: 8px 0 0 8px; }
th:last-child { border-radius: 0 8px 8px 0; }
tbody tr:hover { background: #fafcff; }
td .link { font-size: 12px; }
td.wrap { max-width: 360px; white-space: normal; overflow-wrap: anywhere; line-height: 1.7; }
td .actions { display: flex; align-items: center; gap: 8px; }
.table-panel .empty { min-height: 220px; }
.page-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 12px; }
.today-stats { display: flex; flex-wrap: wrap; gap: 8px; color: #536780; }
.today-stats > span { padding: 8px 11px; border-radius: 7px; background: #f6f9fd; font-size: 11px; }
.pagination { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-left: auto; font-size: 11px; color: #71839c; }
.pagination button { min-height: 30px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: #536780; font-size: 12px; }
.pagination button:hover:not(:disabled) { border-color: #a6bfff; background: #edf3ff; color: var(--blue); }
.pagination .page-number { display: grid; place-items: center; min-width: 30px; height: 30px; border-radius: 6px; background: var(--blue); color: #fff; }
.pagination input { width: 48px; height: 30px; padding: 0 6px; font-size: 11px; }
.pagination .jump { background: var(--blue); color: #fff; border-color: var(--blue); }
.profile-panel { max-width: 880px; margin: 26px; padding: 30px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.section-heading { padding-bottom: 22px; margin-bottom: 26px; border-bottom: 1px solid var(--border); }
.section-heading h2 { margin: 0 0 8px; font-size: 18px; font-weight: 650; }
.section-heading p { margin: 0; color: #71839c; font-size: 12px; }
.profile-form { display: grid; grid-template-columns: 112px minmax(0,360px); align-items: center; gap: 22px; max-width: 620px; font-size: 13px; }
.profile-form > label { color: #71839c; }
.profile-form input { width: 100%; }
.profile-form button { grid-column: 2; justify-self: start; }
.profile-form .bind { min-width: 110px; background: #fff; color: #536780; border: 1px solid var(--border); font-size: 12px; }
.profile-form .bind:hover:not(:disabled) { background: #edf3ff; color: var(--blue); }
.profile-form .save { min-width: 100px; margin-top: 8px; }
.profile-avatar-control .upload-preview { width:64px; height:64px; object-fit:cover; border-radius:50%; }
.profile-avatar-control .upload-control { display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
.profile-avatar-control .upload-control > div:empty { display:none; }
.profile-avatar-control .upload-control > small { order:3; flex-basis:100%; }
.profile-avatar-control .upload-control .upload-box { display:inline-flex; width:auto; height:36px; padding:0 14px; font-size:13px; }
.profile-avatar-control .upload-control:has(.upload-preview) .upload-box { display:inline-flex; }
.staff-avatar > .staff-avatar-image { width:34px; height:34px; object-fit:cover; border-radius:inherit; }

/* Dialogs and form controls. */
.dialog-backdrop { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; background: #23314a66; backdrop-filter: blur(3px); }
.dialog { display: flex; flex-direction: column; width: 540px; max-width: calc(100vw - 48px); max-height: calc(100dvh - 48px); border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: 0 24px 80px #24324a30; color: #536780; }
.dialog.large { width: 1040px; height: min(800px,85dvh); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 12px; min-height: 68px; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.dialog-header h2 { margin: 0; font-size: 16px; font-weight: 650; }
.dialog-header button { flex: none; }
.dialog-content { flex: 1; min-height: 0; overflow: auto; padding: 24px; font-size: 13px; }
.dialog-content > p { line-height: 1.8; }
.dialog-content > .error:empty { display: none; }
.dialog-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 18px 24px; border-top: 1px solid var(--border); }
.dialog-footer button { min-width: 80px; }
.dialog .form { display: grid; gap: 20px; }
.form-row { display: grid; grid-template-columns: 104px minmax(0,1fr); align-items: center; gap: 16px; min-height: 40px; }
.form-row > label { font-size: 12px; color: #71839c; }
.form-row input, .form-row select, .form-row textarea { width: 100%; }
.form-row textarea { min-height: 112px; }
.switch { display: inline-flex; align-items: center; gap: 10px; color: #71839c; font-size: 12px; }
.switch input { position: relative; appearance: none; flex-shrink: 0; width: 38px; height: 22px; min-height: 22px; padding: 0; border: 0; border-radius: 20px; background: #c7d2e2; cursor: pointer; }
.switch input::before { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked { background: var(--blue); }
.switch input:checked::before { transform: translateX(16px); }
.upload-control { display: grid; justify-items: start; gap: 12px; }
.upload-control input { display: none; }
.upload-preview { max-width: 130px; max-height: 130px; object-fit: contain; border-radius: 8px; }
.upload-box { display: grid; place-items: center; width: 112px; height: 96px; padding: 0; border: 1px dashed #b5c5dc; border-radius: 10px; background: #f8faff; color: var(--blue); font-size: 28px; }
.upload-box:hover:not(:disabled) { background: #edf3ff; }
.upload-control:has(.upload-preview) .upload-box { display: none; }
.dialog-list { display: flex; flex-direction: column; height: 100%; gap: 20px; }
.dialog-list > .primary { align-self: flex-start; }
.dialog-list .table-panel { padding: 0; border: 0; border-radius: 0; min-height: unset; }
.qr-binding { display: grid; justify-items: center; gap: 18px; text-align: center; font-size: 12px; }
.qr-binding img { width: 216px; height: 216px; }
.qr-binding input { width: min(260px,100%); text-align: center; letter-spacing: 7px; }
.qr-binding code { font-size: 12px; overflow-wrap: anywhere; }
.image-viewer { text-align: center; }
.image-viewer img { max-height: 70vh; max-width: 100%; object-fit: contain; border-radius: 8px; }
.date-field { position: relative; display: flex; align-items: center; min-width: 0; }
.date-field input { padding-left: 38px; }
.date-trigger { position: absolute; left: 3px; top: 3px; bottom: 3px; display: grid; place-items: center; width: 30px; min-height: 0; padding: 0; border: 0; border-radius: 5px; background: #edf2fa; }
.date-trigger:hover:not(:disabled) { background: #e0eaff; }
.date-trigger img { width: 16px; height: 16px; }
.date-field input::-webkit-calendar-picker-indicator { opacity: 0; width: 1px; padding: 0; }

/* Customer-facing chat uses the same visual system. */
.customer-page { background: linear-gradient(150deg,#edf3ff,#f8faff); }
.customer-shell { width: 100%; max-width: 760px; height: 100dvh; min-height: 400px; display: flex; flex-direction: column; margin: auto; background: #f8faff; box-shadow: 0 0 40px #2442720a; }
.customer-header { display: flex; align-items: center; gap: 16px; height: 72px; padding: 0 24px; border-bottom: 1px solid var(--border); background: #fff; flex-shrink: 0; }
.customer-header .brand { height: auto; padding: 0; gap: 9px; }
.customer-header .brand strong { font-size: 20px; }
.customer-header .brand img { width: 24px; height: 24px; }
.customer-header > span { font-size: 12px; color: #71839c; }
.customer-header > span:last-child { margin-left: auto; font-size: 11px; }
#customer-main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.customer-entry { display: grid; gap: 18px; width: min(100%,420px); margin: auto; padding: 28px; }
.customer-entry h1 { margin: 0; font-size: 22px; }
.customer-entry p { margin: 0; color: #71839c; font-size: 13px; line-height: 1.8; }
.customer-status { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--border); background: #f1f5ff; color: #536780; font-size: 12px; }
.customer-status button { min-height: 30px; margin-left: auto; padding: 5px 9px; font-size: 11px; }
.customer-page { --composer-height: 164px; }
.customer-page .chat-head { height: 58px; }
.customer-page .send-hint { display: none; }

@media (min-width:1800px) {
  :root { --list: 320px; --details: 380px; }
}
@media (max-width:1450px) {
  :root { --sidebar: 192px; --list: 260px; --details: 320px; }
  .topbar { padding: 0 24px; }
  .topbar-account { gap: 18px; }
  .chat-layout { margin: 20px; height: calc(100% - 40px); }
  .chat-head .duration { display: none; }
  .detail-tabs { padding: 0 18px; gap: 20px; }
  .detail-title { padding-left: 18px; padding-right: 18px; }
  .detail-body { padding-left: 18px; padding-right: 18px; }
  .detail-field { grid-template-columns: 78px minmax(0,1fr); }
  .management { padding: 24px; }
}
@media (max-width:1180px) {
  :root { --sidebar: 76px; --list: 240px; --details: 300px; }
  .sidebar { padding: 0 10px; }
  .brand { justify-content: center; padding: 0; }
  .sidebar .brand strong, .sidebar nav span { display: none; }
  .sidebar nav a { justify-content: center; padding: 12px; gap: 0; }
  .stock { padding: 8px 10px; }
  .workspace-heading { gap: 9px; }
  .chat-layout { margin: 16px; height: calc(100% - 32px); }
  .transcript { padding: 18px; }
  .message { max-width: 95%; }
  .detail-body { padding-left: 16px; padding-right: 16px; }
  .detail-field { gap: 8px; }
  .identity { gap: 9px; }
  .topbar-account { gap: 14px; }
}
@media (max-width:960px) {
  .workspace-heading > span { display: none; }
  .topbar { padding: 0 18px; }
  .stock img { display: none; }
  .chat-layout { grid-template-columns: 220px minmax(0,1fr); height: auto; min-height: calc(100% - 32px); }
  .chat-center { height: max(540px,calc(100dvh - 110px)); }
  .chat-details { grid-column: 1/-1; border-left: 0; border-top: 1px solid var(--border); }
  .chat-details .detail-body { max-width: 600px; }
  .chat-details .detail-field { grid-template-columns: 100px minmax(0,1fr); }
  .customer-page .chat-center { height: auto; flex: 1; }
  .filters .range { flex-wrap: wrap; }
  .management { padding: 18px; gap: 16px; }
  .table-panel { padding: 18px; }
  .profile-panel { margin: 18px; padding: 24px; }
  .today-stats { width: 100%; }
  .profile-menu { max-width: 120px; }
}
@media (max-width:620px) {
  :root { --sidebar: 56px; --header: 100px; --composer-height: 174px; }
  .workspace.collapsed { --sidebar: 56px; }
  .sidebar, .collapsed .sidebar { padding: 0 4px; }
  .sidebar .brand { height: 76px; }
  .sidebar .brand img { width: 27px; height: 27px; }
  .sidebar nav { padding-top: 10px; gap: 4px; }
  .sidebar nav a, .collapsed .sidebar nav a { min-height: 46px; padding: 10px; }
  .sidebar nav .nav-icon { width: 20px; height: 20px; }
  .collapse { display: none; }
  .topbar { display: flex; align-content: center; flex-wrap: wrap; justify-content: flex-start; gap: 10px; padding: 12px; }
  .workspace-heading { width: 100%; font-size: 12px; }
  .workspace-heading strong { font-size: 13px; }
  .topbar-account { justify-content: space-between; width: 100%; gap: 8px; }
  .stock { gap: 4px; padding: 6px 7px; font-size: 10px; }
  .stock b { font-size: 12px; }
  .stock > span { display: none; }
  .identity { gap: 8px; }
  .identity-line, .identity .avatar { display: none; }
  .presence { padding: 0 6px; gap: 5px; }
  .presence select { height: 30px; width: 46px; font-size: 11px; padding-right: 12px; }
  .presence > span { width: 6px; height: 6px; }
  .profile-menu { max-width: 90px; min-height: 30px; font-size: 11px; gap: 6px; padding: 5px 0; }
  .profile-menu > img { width: 9px; }
  .chat-layout { grid-template-columns: minmax(0,1fr); height: auto; margin: 10px; border-radius: 10px; }
  .conversation-list { max-height: 200px; border-right: 0; border-bottom: 1px solid var(--border); }
  .conversation-tabs { height: 46px; padding: 0 8px; }
  .conversation-tabs button { font-size: 11px; }
  .conversation-items { display: flex; overflow-x: auto; min-height: 82px; }
  .conversation-items > .empty { width: 100%; min-height: 82px; padding: 12px; }
  .conversation-item { flex: none; width: 234px; height: 82px; padding: 14px; border-right: 1px solid #edf1f7; border-bottom: 0; }
  .conversation-item time { top: 14px; }
  .conversation-item strong { font-size: 12px; }
  .conversation-pager { padding: 9px 12px; }
  .chat-center { height: max(430px,calc(100dvh - 270px)); }
  .chat-head { height: 56px; padding: 0 14px; gap: 8px; }
  .chat-head strong { max-width: 58%; font-size: 12px; }
  .chat-head button { font-size: 11px; }
  .transcript { padding: 16px 12px; gap: 18px; }
  .message { max-width: 100%; gap: 7px; }
  .message .avatar { width: 28px; height: 28px; border-radius: 8px; font-size: 12px; }
  .bubble { padding: 10px 12px; font-size: 13px; }
  .payment-card { width: 260px; max-width: 100%; padding: 16px 12px; }
  .payment-methods { gap: 7px; }
  .payment-methods button, .payment-methods .payment-method-option { min-height: 76px; font-size: 10px; }
  .payment-methods img { width: 28px; height: 28px; }
  .message-image { max-width: 100%; }
  .composer { padding-left: 12px; padding-right: 12px; }
  .composer textarea { font-size: 12px; }
  .composer .send-hint { left: 12px; bottom: 24px; font-size: 9px; }
  .send-button { right: 12px; min-width: 86px; font-size: 11px; }
  .detail-tabs { height: 52px; padding: 0 16px; }
  .detail-title { padding: 16px 16px 8px; }
  .detail-body { padding: 8px 16px 20px; }
  .chat-details .detail-field { grid-template-columns: 80px minmax(0,1fr); gap: 8px; }
  .detail-field > label { font-size: 11px; }
  .detail-body { font-size: 12px; }
  .management { padding: 12px; gap: 12px; }
  .filters { padding: 14px; gap: 10px; }
  .filters input, .filters select { width: 100%; }
  .filters > input, .filters > select { flex: 1 1 100%; }
  .filters .range { flex: 1 1 100%; flex-direction: column; align-items: stretch; gap: 7px; }
  .filters input[type="datetime-local"] { width: 100%; }
  .filters .date-field { width: 100%; }
  .filters > .primary { width: 100%; }
  .table-panel { padding: 12px; border-radius: 10px; }
  th, td { padding: 12px; }
  .page-footer { align-items: stretch; gap: 14px; }
  .today-stats { display: grid; gap: 6px; }
  .pagination { justify-content: flex-end; width: 100%; margin-left: 0; font-size: 10px; }
  .pagination button { padding: 5px 8px; }
  .profile-panel { margin: 12px; padding: 20px 16px; }
  .profile-form { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .profile-form > label:not(:first-child) { margin-top: 12px; }
  .profile-form button { grid-column: 1; }
  .profile-form .save { margin-top: 16px; width: 100%; }
  .section-heading { padding-bottom: 18px; margin-bottom: 20px; }
  .section-heading h2 { font-size: 16px; }
  .dialog-backdrop { padding: 12px; }
  .dialog { max-width: 100%; max-height: calc(100dvh - 24px); border-radius: 12px; }
  .dialog.large { height: 90dvh; }
  .dialog-header { min-height: 58px; padding: 14px 18px; }
  .dialog-header h2 { font-size: 15px; }
  .dialog-content { padding: 20px 18px; }
  .dialog-footer { padding: 14px 18px; }
  .form-row { grid-template-columns: minmax(0,1fr); gap: 9px; }
  .form-row textarea { min-height: 96px; }
  .dialog-list .table-panel { padding: 0; }
  .login-screen { padding: 24px 16px; }
  .login-form { padding: 28px 24px; border-radius: 16px; gap: 19px; }
  .login-heading h2 { font-size: 24px; }
  .customer-header { height: 64px; padding: 0 16px; gap: 12px; }
  .customer-header .brand strong { display: block; font-size: 18px; }
  .customer-header .brand img { width: 23px; height: 23px; }
  .customer-header > span { font-size: 11px; }
  .customer-header > span:last-child { font-size: 10px; }
  .customer-page { --composer-height: 152px; }
  .customer-page .chat-center { height: auto; flex: 1; }
  .customer-page .payment-card { width: min(280px,calc(100vw - 82px)); }
  .customer-page .message { max-width: 100%; }
  .customer-status { padding: 11px 16px; gap: 10px; font-size: 11px; }
  .customer-status button { white-space: nowrap; font-size: 10px; }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* Shared upload feedback for avatars, payment images and chat attachments. */
.upload-progress { display: grid; gap: 6px; width: 100%; max-width: 320px; color: var(--blue); font-size: 12px; }
.upload-progress[hidden] { display: none; }
.upload-progress-label { display: flex; align-items: center; gap: 7px; line-height: 1.5; }
.upload-spinner { width: 14px; height: 14px; flex: none; border: 2px solid #dce7ff; border-top-color: var(--blue); border-radius: 50%; animation: upload-spin .8s linear infinite; }
.upload-progress progress { display: block; width: 100%; height: 6px; border: 0; border-radius: 4px; overflow: hidden; accent-color: var(--blue); }
.upload-progress progress::-webkit-progress-bar { background: #e4ecfa; border-radius: 4px; }
.upload-progress progress::-webkit-progress-value { background: var(--blue); border-radius: 4px; }
.upload-progress progress::-moz-progress-bar { background: var(--blue); border-radius: 4px; }
@keyframes upload-spin { to { transform: rotate(360deg); } }
.profile-avatar-control .upload-progress { flex: 0 0 100%; order: 2; }
.composer > .upload-progress { position: absolute; left: 18px; right: 18px; top: 42px; z-index: 2; width: auto; max-width: none; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: #f8faff; box-shadow: 0 2px 8px #24324a0d; }
.customer-page .composer > .upload-progress { position: static; flex: 0 0 100%; order: -2; width: 100%; }

.notification-sound { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; min-height: 34px; padding: 6px; border: 1px solid var(--border); border-radius: 8px; color: #8796ac; background: #fff; }
.notification-sound svg { display: block; width: 20px; height: 20px; }
.notification-sound.is-active { color: #3470ff; background: #edf3ff; border-color: #cddcff; }
.notification-sound:hover { background: #f1f5ff; border-color: #b8ccff; }
.notification-sound.is-active:hover { background: #e3edff; }
